- avahi_server_add_ptr(s, g, interface, protocol, AVAHI_ENTRY_NULL, ptr_name, svc_name);
-
- r = avahi_record_new_full(svc_name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_SRV);
- r->data.srv.priority = 0;
- r->data.srv.weight = 0;
- r->data.srv.port = port;
- r->data.srv.name = avahi_normalize_name(host);
- avahi_server_add(s, g, interface, protocol, AVAHI_ENTRY_UNIQUE, r);
- avahi_record_unref(r);
-
- avahi_server_add_text_strlst(s, g, interface, protocol, AVAHI_ENTRY_UNIQUE, svc_name, strlst);
-
- snprintf(enum_ptr, sizeof(enum_ptr), "_services._dns-sd._udp.%s", domain);
- avahi_server_add_ptr(s, g, interface, protocol, AVAHI_ENTRY_NULL, enum_ptr, ptr_name);
-
- return 0;
-}
-
-gint avahi_server_add_service_va(
- AvahiServer *s,
- AvahiEntryGroup *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);
-
- avahi_server_add_service_strlst(s, g, interface, protocol, type, name, domain, host, port, avahi_string_list_new_va(va));
- return 0;
-}
-
-gint avahi_server_add_service(
- AvahiServer *s,
- AvahiEntryGroup *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);
-
- va_start(va, port);
- avahi_server_add_service_va(s, g, interface, protocol, type, name, domain, host, port, va);
- va_end(va);
- return 0;
-}
-
-static void post_query_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, gpointer userdata) {
- AvahiKey *k = userdata;
-
- g_assert(m);
- g_assert(i);
- g_assert(k);
-
- avahi_interface_post_query(i, k, FALSE);