7 This file is part of avahi.
9 avahi is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2.1 of the
12 License, or (at your option) any later version.
14 avahi is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
17 Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with avahi; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
27 #include <avahi-common/strlst.h>
28 #include <avahi-common/address.h>
31 AVAHI_DNS_TYPE_A = 0x01,
32 AVAHI_DNS_TYPE_NS = 0x02,
33 AVAHI_DNS_TYPE_CNAME = 0x05,
34 AVAHI_DNS_TYPE_SOA = 0x06,
35 AVAHI_DNS_TYPE_PTR = 0x0C,
36 AVAHI_DNS_TYPE_HINFO = 0x0D,
37 AVAHI_DNS_TYPE_MX = 0x0F,
38 AVAHI_DNS_TYPE_TXT = 0x10,
39 AVAHI_DNS_TYPE_AAAA = 0x1C,
40 AVAHI_DNS_TYPE_SRV = 0x21,
41 AVAHI_DNS_TYPE_ANY = 0xFF
45 AVAHI_DNS_CLASS_IN = 0x01,
46 AVAHI_DNS_CLASS_ANY = 0xFF,
47 AVAHI_DNS_CACHE_FLUSH = 0x8000,
48 AVAHI_DNS_UNICAST_RESPONSE = 0x8000
51 #define AVAHI_DEFAULT_TTL (120*60)
81 } ptr; /* and cname */
89 AvahiStringList *string_list;
93 AvahiIPv4Address address;
97 AvahiIPv6Address address;
104 AvahiKey *avahi_key_new(const gchar *name, guint16 class, guint16 type);
105 AvahiKey *avahi_key_ref(AvahiKey *k);
106 void avahi_key_unref(AvahiKey *k);
108 gboolean avahi_key_equal(const AvahiKey *a, const AvahiKey *b); /* Treat AVAHI_DNS_CLASS_ANY like any other type */
109 gboolean avahi_key_pattern_match(const AvahiKey *pattern, const AvahiKey *k); /* If pattern.type is AVAHI_DNS_CLASS_ANY, k.type is ignored */
111 gboolean avahi_key_is_pattern(const AvahiKey *k);
113 guint avahi_key_hash(const AvahiKey *k);
115 AvahiRecord *avahi_record_new(AvahiKey *k);
116 AvahiRecord *avahi_record_new_full(const gchar *name, guint16 class, guint16 type);
117 AvahiRecord *avahi_record_ref(AvahiRecord *r);
118 void avahi_record_unref(AvahiRecord *r);
120 const gchar *avahi_dns_class_to_string(guint16 class);
121 const gchar *avahi_dns_type_to_string(guint16 type);
123 gchar *avahi_key_to_string(const AvahiKey *k); /* g_free() the result! */
124 gchar *avahi_record_to_string(const AvahiRecord *r); /* g_free() the result! */
126 gboolean avahi_record_equal_no_ttl(const AvahiRecord *a, const AvahiRecord *b);
128 AvahiRecord *avahi_record_copy(AvahiRecord *r);
130 /* returns a maximum estimate for the space that is needed to store
131 * this key in a DNS packet */
132 guint avahi_key_get_estimate_size(AvahiKey *k);
135 guint avahi_record_get_estimate_size(AvahiRecord *r);
137 gint avahi_record_lexicographical_compare(AvahiRecord *a, AvahiRecord *b);
139 gboolean avahi_record_is_goodbye(AvahiRecord *r);