X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Frr.h;h=794b83fb1f4aa7f242f2c9bca09c2104c2ce0e76;hb=9c0f9c65093cfa53d45f9b68782321eb8063a032;hp=a2d430a2a90e29c2b970029c8e9333a54f9601b2;hpb=6efe2615e04c6ef664fa9d49b013e261ba1e6e66;p=catta diff --git a/avahi-core/rr.h b/avahi-core/rr.h index a2d430a..794b83f 100644 --- a/avahi-core/rr.h +++ b/avahi-core/rr.h @@ -1,21 +1,19 @@ #ifndef foorrhfoo #define foorrhfoo -/* $Id$ */ - /*** This file is part of avahi. - + avahi is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + avahi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with avahi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 @@ -33,35 +31,23 @@ 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 @@ -79,16 +65,16 @@ typedef struct AvahiKey { typedef struct AvahiRecord { int ref; /**< Reference counter */ AvahiKey *key; /**< Reference to the query key of this record */ - + uint32_t ttl; /**< DNS TTL of this record */ union { - + struct { void* data; uint16_t size; } generic; /**< Generic record data for unknown types */ - + struct { uint16_t priority; uint16_t weight; @@ -118,7 +104,7 @@ typedef struct AvahiRecord { } aaaa; /**< Data for AAAA records */ } data; /**< Record data */ - + } AvahiRecord; /** Create a new AvahiKey object. The reference counter will be set to 1. */ @@ -133,7 +119,7 @@ void avahi_key_unref(AvahiKey *k); /** Check whether two AvahiKey object contain the same * data. AVAHI_DNS_CLASS_ANY/AVAHI_DNS_TYPE_ANY are treated like any * other class/type. */ -int avahi_key_equal(const AvahiKey *a, const AvahiKey *b); +int avahi_key_equal(const AvahiKey *a, const AvahiKey *b); /** Return a numeric hash value for a key for usage in hash tables. */ unsigned avahi_key_hash(const AvahiKey *k); @@ -164,7 +150,7 @@ char *avahi_key_to_string(const AvahiKey *k); /** Create a textual representation of the specified record, similar * in style to BIND zone file data. avahi_free() the result! */ -char *avahi_record_to_string(const AvahiRecord *r); +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); @@ -181,6 +167,9 @@ int avahi_rdata_parse(AvahiRecord *record, const void* rdata, size_t size); /** Serialize an AvahiRecord object into binary rdata. This function is actually implemented in dns.c */ size_t avahi_rdata_serialize(AvahiRecord *record, void *rdata, size_t max_size); +/** Return TRUE if the AvahiRecord object is a link-local A or AAAA address */ +int avahi_record_is_link_local_address(const AvahiRecord *r); + AVAHI_C_DECL_END #endif