summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--avahi-common/defs.h3
-rw-r--r--avahi-core/wide-area.c13
-rw-r--r--avahi-core/wide-area.h1
3 files changed, 16 insertions, 1 deletions
diff --git a/avahi-common/defs.h b/avahi-common/defs.h
index 4efa5ad..bbdcb64 100644
--- a/avahi-common/defs.h
+++ b/avahi-common/defs.h
@@ -277,7 +277,7 @@ typedef enum {
/** In invalid cookie as special value */
#define AVAHI_SERVICE_COOKIE_INVALID (0)
-/** DNS record types, see RFC 1035 */
+/** DNS record types, see RFC 1035 and succeeding updates and extensions */
enum {
AVAHI_DNS_TYPE_A = 0x01,
AVAHI_DNS_TYPE_NS = 0x02,
@@ -289,6 +289,7 @@ enum {
AVAHI_DNS_TYPE_TXT = 0x10,
AVAHI_DNS_TYPE_AAAA = 0x1C,
AVAHI_DNS_TYPE_SRV = 0x21,
+ AVAHI_DNS_TYPE_TSIG = 0xFA,
};
/** DNS record classes, see RFC 1035 */
diff --git a/avahi-core/wide-area.c b/avahi-core/wide-area.c
index bf3f60d..2811408 100644
--- a/avahi-core/wide-area.c
+++ b/avahi-core/wide-area.c
@@ -721,5 +721,18 @@ int avahi_wide_area_has_servers(AvahiWideAreaLookupEngine *e) {
return e->n_dns_servers > 0;
}
+/* TODO: should this be located in this file? */
+AvahiRecord* tsig_sign_packet(AvahiDnsPacket *p, unsigned a) {
+ AvahiRecord *r;
+
+ r = avahi_record_new_full("TSIG", AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_TSIG, 0);
+
+ if (!r) {
+ avahi_log_error("avahi_record_new_full() failed.");
+ return NULL;
+ }
+
+ return r;
+}
diff --git a/avahi-core/wide-area.h b/avahi-core/wide-area.h
index 1af613b..9b1f9da 100644
--- a/avahi-core/wide-area.h
+++ b/avahi-core/wide-area.h
@@ -44,6 +44,7 @@ void avahi_wide_area_set_servers(AvahiWideAreaLookupEngine *e, const AvahiAddres
void avahi_wide_area_clear_cache(AvahiWideAreaLookupEngine *e);
void avahi_wide_area_cleanup(AvahiWideAreaLookupEngine *e);
int avahi_wide_area_has_servers(AvahiWideAreaLookupEngine *e);
+AvahiRecord* tsig_sign_packet(AvahiDnsPacket *p, unsigned a);
AvahiWideAreaLookup *avahi_wide_area_lookup_new(AvahiWideAreaLookupEngine *e, AvahiKey *key, AvahiWideAreaLookupCallback callback, void *userdata);
void avahi_wide_area_lookup_free(AvahiWideAreaLookup *q);