diff options
author | Federico Lucifredi <flucifredi@acm.org> | 2007-12-26 23:37:28 +0000 |
---|---|---|
committer | Federico Lucifredi <flucifredi@acm.org> | 2007-12-26 23:37:28 +0000 |
commit | 45b07d32101ce6f7eca8fcdc68d080bb182332e0 (patch) | |
tree | e3fc498a1fbab83048605f6e4b8e85de377b6361 | |
parent | 85ceb5f661565e1f6e51f720fb345e372eb8adfa (diff) |
RR section names for Update packets
git-svn-id: file:///home/lennart/svn/public/avahi/branches/federico@1632 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
-rw-r--r-- | avahi-core/dns.h | 11 | ||||
-rw-r--r-- | avahi-core/wide-area.c | 5 |
2 files changed, 14 insertions, 2 deletions
diff --git a/avahi-core/dns.h b/avahi-core/dns.h index d810350..352b9cf 100644 --- a/avahi-core/dns.h +++ b/avahi-core/dns.h @@ -82,11 +82,22 @@ size_t avahi_dns_packet_space(AvahiDnsPacket *p); #define AVAHI_DNS_FIELD_ID 0 #define AVAHI_DNS_FIELD_FLAGS 1 + +/* DNS query/response packet field names */ + #define AVAHI_DNS_FIELD_QDCOUNT 2 #define AVAHI_DNS_FIELD_ANCOUNT 3 #define AVAHI_DNS_FIELD_NSCOUNT 4 #define AVAHI_DNS_FIELD_ARCOUNT 5 +/* DNS update packet field names */ + +#define AVAHI_DNS_FIELD_ZOCOUNT 2 +#define AVAHI_DNS_FIELD_PRCOUNT 3 +#define AVAHI_DNS_FIELD_UPCOUNT 4 +#define AVAHI_DNS_FIELD_ADCOUNT 5 + + #define AVAHI_DNS_FLAG_QR (1 << 15) #define AVAHI_DNS_FLAG_OPCODE (15 << 11) #define AVAHI_DNS_FLAG_RCODE (15) diff --git a/avahi-core/wide-area.c b/avahi-core/wide-area.c index 4889cc7..e523fff 100644 --- a/avahi-core/wide-area.c +++ b/avahi-core/wide-area.c @@ -802,7 +802,7 @@ void wide_area_publish(AvahiRecord *r, char *zone, uint16_t id) { avahi_dns_packet_append_key(p, k, 0); /* add zone record */ - avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_QDCOUNT, 1); /*increment record count for ZOCOUNT */ + avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_ZOCOUNT, 1); /*increment record count for ZOCOUNT */ if (!p) { /*OOM check */ avahi_log_error("appending of rdata failed."); @@ -810,8 +810,9 @@ void wide_area_publish(AvahiRecord *r, char *zone, uint16_t id) { } avahi_dns_packet_append_record(p, r, 0, 30); /* TODO: revisit max TTL from 30 */ + /* it may be useful to standardize TTLs independent of record for wide-area */ - avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_NSCOUNT, 1); /*increment record count for UPCOUNT */ + avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_UPCOUNT, 1); /*increment record count for UPCOUNT */ if (!p) { /*OOM check */ avahi_log_error("appending of rdata failed."); |