Example #1
0
int avahi_entry_group_add_service(
    AvahiEntryGroup *group,
    AvahiIfIndex interface,
    AvahiProtocol protocol,
    AvahiPublishFlags flags,
    const char *name,
    const char *type,
    const char *domain,
    const char *host,
    uint16_t port,
    ...) {

    va_list va;
    int r;
    AvahiStringList *txt;

    assert(group);

    va_start(va, port);
    txt = avahi_string_list_new_va(va);
    r = avahi_entry_group_add_service_strlst(group, interface, protocol, flags, name, type, domain, host, port, txt);
    avahi_string_list_free(txt);
    va_end(va);
    return r;
}
Example #2
0
static EpcService*
epc_service_new (EpcDispatcher *dispatcher,
                 AvahiProtocol  protocol,
                 const gchar   *type,
                 const gchar   *domain,
                 const gchar   *host,
                 guint16        port,
                 va_list        args)
{
  const gchar *service = epc_service_type_get_base (type);
  EpcService *self = g_slice_new0 (EpcService);

  self->dispatcher = dispatcher;
  self->details = avahi_string_list_new_va (args);
  self->type = g_strdup (service);
  self->protocol = protocol;
  self->port = port;

  if (domain)
    self->domain = g_strdup (domain);
  if (host)
    self->host = g_strdup (host);
  if (service > type)
    epc_service_add_subtype (self, type);

  return self;
}
Example #3
0
int avahi_entry_group_update_service_txt(
    AvahiEntryGroup *group,
    AvahiIfIndex interface,
    AvahiProtocol protocol,
    AvahiPublishFlags flags,
    const char *name,
    const char *type,
    const char *domain,
    ...) {

    va_list va;
    int r;
    AvahiStringList *txt;

    va_start(va, domain);
    txt = avahi_string_list_new_va(va);
    r = avahi_entry_group_update_service_txt_strlst(group, interface, protocol, flags, name, type, domain, txt);
    avahi_string_list_free(txt);
    va_end(va);
    return r;
}
/** Update the TXT record for a service with the NULL termonate list of strings */
int avahi_server_update_service_txt(
    AvahiServer *s,
    AvahiSEntryGroup *g,
    AvahiIfIndex interface,
    AvahiProtocol protocol,
    AvahiPublishFlags flags,
    const char *name,     
    const char *type,     
    const char *domain,   
    ...) {

    va_list va;
    int ret;
    
    va_start(va, domain);
    ret = server_update_service_txt_strlst_nocopy(s, g, interface, protocol, flags, name, type, domain, avahi_string_list_new_va(va));
    va_end(va);
    
    return ret;
}
int avahi_server_add_service(
    AvahiServer *s,
    AvahiSEntryGroup *g,
    AvahiIfIndex interface,
    AvahiProtocol protocol,
    AvahiPublishFlags flags,
    const char *name,
    const char *type,
    const char *domain,
    const char *host,
    uint16_t port,
    ... ){

    va_list va;
    int ret;
    
    va_start(va, port);
    ret = server_add_service_strlst_nocopy(s, g, interface, protocol, flags, name, type, domain, host, port, avahi_string_list_new_va(va));
    va_end(va);
    
    return ret;
}