pike.git
/
src
/
modules
/
_Protocols_DNS_SD
/
sd.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/_Protocols_DNS_SD/sd.c:1:
/* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id$
+
*/ /* Glue for DNS Service Discovery, which is built on top of e.g. Multicast DNS (ZeroConf/Rendezvous/Bonjour). Using this API a Pike program can register a service (e.g. a web server) and have other applications on the local network detect it without additional configuration. The specification can be found at <http://www.dns-sd.org/>.
pike.git/src/modules/_Protocols_DNS_SD/sd.c:112:
reason = "Bad interface index"; break; default: reason = "Unknown error"; break; } Pike_error("DNS_SD: %s Reason: %s (%d)\n", msg, reason, err); }
-
static void start_service_callback(DNSServiceRef ref,
-
DNSServiceFlags flags,
-
DNSServiceErrorType error,
-
const char *name,
-
const char *regtype,
-
const char *domain,
-
void *context)
+
static void start_service_callback(DNSServiceRef
UNUSED(
ref
)
,
+
DNSServiceFlags
UNUSED(
flags
)
,
+
DNSServiceErrorType
UNUSED(
error
)
,
+
const char *
UNUSED(
name
)
,
+
const char *
UNUSED(
regtype
)
,
+
const char *
UNUSED(
domain
)
,
+
void *
UNUSED(
context)
)
{ } static DNSServiceErrorType start_service(struct service *svc, char *name, char *service, char *domain, int port, char *txt,
pike.git/src/modules/_Protocols_DNS_SD/sd.c:284:
} static void * howl_thread(void *arg) { sw_discovery_run(service_session); return NULL; }
-
static void init_howl_module()
+
static void init_howl_module(
void
)
{ if (sw_discovery_init(&service_session) == SW_OKAY) { th_create_small(&service_thread, howl_thread, NULL); } }
-
static void exit_howl_module()
+
static void exit_howl_module(
void
)
{ /* Close active session */ if (service_session) sw_discovery_fina(service_session); /* Kill Howl thread if running */ if (service_thread) th_kill(service_thread, SIGCHLD); }
pike.git/src/modules/_Protocols_DNS_SD/sd.c:360:
/* Optional TXT record may theoretically contain NUL chars so we can't trust strlen. */ txt = (args == 5) ? sp[4 - args].u.string->str : NULL; txtlen = txt ? sp[4 - args].u.string->len : 0; /* Register new service */ err = start_service(THIS, name, service, domain, port, txt, txtlen); if (IS_ERR(err)) raise_error("Could not register service.", err);
-
pop_n_elems(args);
+
}
-
static void init_service_struct(struct object *o)
+
static void init_service_struct(struct object *
UNUSED(
o)
)
{ THIS->service_ref = 0; }
-
static void exit_service_struct(struct object *o)
+
static void exit_service_struct(struct object *
UNUSED(
o)
)
{ /* Stop an existing service */ stop_service(THIS); } PIKE_MODULE_INIT { start_new_program();