X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Frr.h;h=6bfe0ec2b4a608b4154dfd59bedef5d6cfd133a7;hb=5ed5452823a5da7d7a7b36d5a42d3edc09f2342f;hp=63dc18d202b1ba7ddbfa79b73a8449cb7a562cc0;hpb=943a6b93697fc0a7bcd0cc574744d7de609c189c;p=catta diff --git a/avahi-core/rr.h b/avahi-core/rr.h index 63dc18d..6bfe0ec 100644 --- a/avahi-core/rr.h +++ b/avahi-core/rr.h @@ -33,40 +33,28 @@ AVAHI_C_DECL_BEGIN -/** DNS record types, see RFC 1035 */ +/** DNS record types, see RFC 1035, in addition to those defined in defs.h */ enum { - AVAHI_DNS_TYPE_A = 0x01, - AVAHI_DNS_TYPE_NS = 0x02, - AVAHI_DNS_TYPE_CNAME = 0x05, - AVAHI_DNS_TYPE_SOA = 0x06, - AVAHI_DNS_TYPE_PTR = 0x0C, - AVAHI_DNS_TYPE_HINFO = 0x0D, - AVAHI_DNS_TYPE_MX = 0x0F, - AVAHI_DNS_TYPE_TXT = 0x10, - AVAHI_DNS_TYPE_AAAA = 0x1C, - AVAHI_DNS_TYPE_SRV = 0x21, - AVAHI_DNS_TYPE_ANY = 0xFF /**< Special query type for requesting all records */ + AVAHI_DNS_TYPE_ANY = 0xFF, /**< Special query type for requesting all records */ + AVAHI_DNS_TYPE_OPT = 41, /**< EDNS0 option */ + AVAHI_DNS_TYPE_TKEY = 249, + AVAHI_DNS_TYPE_TSIG = 250, + AVAHI_DNS_TYPE_IXFR = 251, + AVAHI_DNS_TYPE_AXFR = 252 }; -/** DNS record classes, see RFC 1035 */ +/** DNS record classes, see RFC 1035, in addition to those defined in defs.h */ enum { - AVAHI_DNS_CLASS_IN = 0x01, /**< Probably the only class we will ever use */ AVAHI_DNS_CLASS_ANY = 0xFF, /**< Special query type for requesting all records */ AVAHI_DNS_CACHE_FLUSH = 0x8000, /**< Not really a class but a bit which may be set in response packets, see mDNS spec for more information */ AVAHI_DNS_UNICAST_RESPONSE = 0x8000 /**< Not really a class but a bit which may be set in query packets, see mDNS spec for more information */ }; -/** The default TTL for RRs which contain a host name of some kind. */ -#define AVAHI_DEFAULT_TTL_HOST_NAME (120) - -/** The default TTL for all other records. */ -#define AVAHI_DEFAULT_TTL (75*60) - /** Encapsulates a DNS query key consisting of class, type and name. Use avahi_key_ref()/avahi_key_unref() for manipulating the reference counter. The structure is intended to be treated as "immutable", no changes should be imposed after creation */ -typedef struct { +typedef struct AvahiKey { int ref; /**< Reference counter */ char *name; /**< Record name */ uint16_t clazz; /**< Record class, one of the AVAHI_DNS_CLASS_xxx constants */ @@ -76,7 +64,7 @@ typedef struct { /** Encapsulates a DNS resource record. The structure is intended to * be treated as "immutable", no changes should be imposed after * creation. */ -typedef struct { +typedef struct AvahiRecord { int ref; /**< Reference counter */ AvahiKey *key; /**< Reference to the query key of this record */ @@ -98,7 +86,7 @@ typedef struct { struct { char *name; - } ptr; /**< Data for PTR an CNAME records */ + } ptr, ns, cname; /**< Data for PTR, NS and CNAME records */ struct { char *cpu; @@ -124,9 +112,6 @@ typedef struct { /** Create a new AvahiKey object. The reference counter will be set to 1. */ AvahiKey *avahi_key_new(const char *name, uint16_t clazz, uint16_t type); -/** Creaze new AvahiKey object based on an existing key but replaceing the type by CNAME */ -AvahiKey *avahi_key_new_cname(AvahiKey *key); - /** Increase the reference counter of an AvahiKey object by one */ AvahiKey *avahi_key_ref(AvahiKey *k); @@ -138,17 +123,6 @@ void avahi_key_unref(AvahiKey *k); * other class/type. */ int avahi_key_equal(const AvahiKey *a, const AvahiKey *b); -/** Match a key to a key pattern. The pattern has a type of -AVAHI_DNS_CLASS_ANY, the classes are taken to be equal. Same for the -type. If the pattern has neither class nor type with ANY constants, -this function is identical to avahi_key_equal(). In contrast to -avahi_equal() this function is not commutative. */ -int avahi_key_pattern_match(const AvahiKey *pattern, const AvahiKey *k); - -/** Check whether a key is a pattern key, i.e. the class/type has a - * value of AVAHI_DNS_CLASS_ANY/AVAHI_DNS_TYPE_ANY */ -int avahi_key_is_pattern(const AvahiKey *k); - /** Return a numeric hash value for a key for usage in hash tables. */ unsigned avahi_key_hash(const AvahiKey *k); @@ -183,25 +157,6 @@ char *avahi_record_to_string(const AvahiRecord *r); /** Check whether two records are equal (regardless of the TTL */ int avahi_record_equal_no_ttl(const AvahiRecord *a, const AvahiRecord *b); -/** Make a deep copy of an AvahiRecord object */ -AvahiRecord *avahi_record_copy(AvahiRecord *r); - -/** Returns a maximum estimate for the space that is needed to store - * this key in a DNS packet. */ -size_t avahi_key_get_estimate_size(AvahiKey *k); - -/** Returns a maximum estimate for the space that is needed to store - * the record in a DNS packet. */ -size_t avahi_record_get_estimate_size(AvahiRecord *r); - -/** Do a mDNS spec conforming lexicographical comparison of the two - * records. Return a negative value if a < b, a positive if a > b, - * zero if equal. */ -int avahi_record_lexicographical_compare(AvahiRecord *a, AvahiRecord *b); - -/** Return 1 if the specified record is an mDNS goodbye record. i.e. TTL is zero. */ -int avahi_record_is_goodbye(AvahiRecord *r); - /** Check whether the specified key is valid */ int avahi_key_is_valid(AvahiKey *k);