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-core/strlst.h>
28 #include <avahi-core/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_CACHE_FLUSH = 0x8000,
47 AVAHI_DNS_UNICAST_RESPONSE = 0x8000
50 #define AVAHI_DEFAULT_TTL (120*60)
80 } ptr; /* and cname */
88 AvahiStringList *string_list;
92 AvahiIPv4Address address;
96 AvahiIPv6Address address;
103 AvahiKey *avahi_key_new(const gchar *name, guint16 class, guint16 type);
104 AvahiKey *avahi_key_ref(AvahiKey *k);
105 void avahi_key_unref(AvahiKey *k);
107 gboolean avahi_key_equal(const AvahiKey *a, const AvahiKey *b); /* Treat AVAHI_DNS_CLASS_ANY like any other type */
108 gboolean avahi_key_pattern_match(const AvahiKey *pattern, const AvahiKey *k); /* If pattern.type is AVAHI_DNS_CLASS_ANY, k.type is ignored */
110 gboolean avahi_key_is_pattern(const AvahiKey *k);
112 guint avahi_key_hash(const AvahiKey *k);
114 AvahiRecord *avahi_record_new(AvahiKey *k);
115 AvahiRecord *avahi_record_new_full(const gchar *name, guint16 class, guint16 type);
116 AvahiRecord *avahi_record_ref(AvahiRecord *r);
117 void avahi_record_unref(AvahiRecord *r);
119 const gchar *avahi_dns_class_to_string(guint16 class);
120 const gchar *avahi_dns_type_to_string(guint16 type);
122 gchar *avahi_key_to_string(const AvahiKey *k); /* g_free() the result! */
123 gchar *avahi_record_to_string(const AvahiRecord *r); /* g_free() the result! */
125 gboolean avahi_record_equal_no_ttl(const AvahiRecord *a, const AvahiRecord *b);
127 AvahiRecord *avahi_record_copy(AvahiRecord *r);
129 /* returns a maximum estimate for the space that is needed to store
130 * this key in a DNS packet */
131 guint avahi_key_get_estimate_size(AvahiKey *k);
134 guint avahi_record_get_estimate_size(AvahiRecord *r);
136 gint avahi_record_lexicographical_compare(AvahiRecord *a, AvahiRecord *b);