From f081d098f67561bdcfedf5002335fa32d45e0442 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 5 May 2005 22:22:19 +0000 Subject: [PATCH] * add flx_server_add_service_strlst() * add flx_server_add_text_strlst() git-svn-id: file:///home/lennart/svn/public/avahi/trunk@42 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- flx.h | 21 +++++++++++++++++++++ server.c | 46 +++++++++++++++++++++++++++++++++++++++------- todo | 6 ++---- 3 files changed, 62 insertions(+), 11 deletions(-) diff --git a/flx.h b/flx.h index fd65784..0f7a024 100644 --- a/flx.h +++ b/flx.h @@ -82,6 +82,15 @@ void flx_server_add_text_va( const gchar *name, va_list va); +void flx_server_add_text_strlst( + flxServer *s, + flxEntryGroup *g, + gint interface, + guchar protocol, + flxEntryFlags flags, + const gchar *name, + flxStringList *strlst); + void flx_server_add_service( flxServer *s, flxEntryGroup *g, @@ -106,6 +115,18 @@ void flx_server_add_service_va( guint16 port, va_list va); +void flx_server_add_service_strlst( + flxServer *s, + flxEntryGroup *g, + gint interface, + guchar protocol, + const gchar *type, + const gchar *name, + const gchar *domain, + const gchar *host, + guint16 port, + flxStringList *strlst); + typedef enum { FLX_SUBSCRIPTION_NEW, FLX_SUBSCRIPTION_REMOVE, diff --git a/server.c b/server.c index a7c4f15..9e2b692 100644 --- a/server.c +++ b/server.c @@ -717,25 +717,39 @@ void flx_server_add_address( g_free(n); } -void flx_server_add_text_va( +void flx_server_add_text_strlst( flxServer *s, flxEntryGroup *g, gint interface, guchar protocol, flxEntryFlags flags, const gchar *name, - va_list va) { + flxStringList *strlst) { flxRecord *r; g_assert(s); r = flx_record_new_full(name ? name : s->hostname, FLX_DNS_CLASS_IN, FLX_DNS_TYPE_TXT); - r->data.txt.string_list = flx_string_list_new_va(va); + r->data.txt.string_list = strlst; flx_server_add(s, g, interface, protocol, flags, r); flx_record_unref(r); } +void flx_server_add_text_va( + flxServer *s, + flxEntryGroup *g, + gint interface, + guchar protocol, + flxEntryFlags flags, + const gchar *name, + va_list va) { + + g_assert(s); + + flx_server_add_text_strlst(s, g, interface, protocol, flags, name, flx_string_list_new_va(va)); +} + void flx_server_add_text( flxServer *s, flxEntryGroup *g, @@ -776,8 +790,7 @@ static void escape_service_name(gchar *d, guint size, const gchar *s) { *(d++) = 0; } - -void flx_server_add_service_va( +void flx_server_add_service_strlst( flxServer *s, flxEntryGroup *g, gint interface, @@ -787,7 +800,7 @@ void flx_server_add_service_va( const gchar *domain, const gchar *host, guint16 port, - va_list va) { + flxStringList *strlst) { gchar ptr_name[256], svc_name[256], ename[64], enum_ptr[256]; flxRecord *r; @@ -820,12 +833,31 @@ void flx_server_add_service_va( flx_server_add(s, g, interface, protocol, FLX_ENTRY_UNIQUE, r); flx_record_unref(r); - flx_server_add_text_va(s, g, interface, protocol, FLX_ENTRY_UNIQUE, svc_name, va); + flx_server_add_text_strlst(s, g, interface, protocol, FLX_ENTRY_UNIQUE, svc_name, strlst); snprintf(enum_ptr, sizeof(enum_ptr), "_services._dns-sd._udp.%s", domain); flx_server_add_ptr(s, g, interface, protocol, FLX_ENTRY_NULL, enum_ptr, ptr_name); } +void flx_server_add_service_va( + flxServer *s, + flxEntryGroup *g, + gint interface, + guchar protocol, + const gchar *type, + const gchar *name, + const gchar *domain, + const gchar *host, + guint16 port, + va_list va){ + + g_assert(s); + g_assert(type); + g_assert(name); + + flx_server_add_service(s, g, interface, protocol, type, name, domain, host, port, flx_string_list_new_va(va)); +} + void flx_server_add_service( flxServer *s, flxEntryGroup *g, diff --git a/todo b/todo index 82bf392..1ffc088 100644 --- a/todo +++ b/todo @@ -5,12 +5,8 @@ todo: * add SRV and TXT records referenced from PTR records automatically to packet * add A and AAAA records referenced from SRV records automatically to packet -* add flx_server_add_service_strlst() and friends - * change flx_* to avahi_* - * autoconf - * release! done: @@ -27,3 +23,5 @@ done: * remove expression "rrset" from source files * defend our entries on incoming goodbye * allow NULL bytes in TXT records +* add flx_server_add_service_strlst() and friends + -- 2.39.5