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: sd.c,v 1.
4
2005
/
10
/
22
03
:
22
:
06
bill Exp $
+
|| $Id: sd.c,v 1.
5
2008
/
07
/
18
15
:
17
:
03
bill Exp $
*/ /* Glue for DNS Service Discovery, which is built on top of e.g. Multicast
-
DNS (ZeroConf/Rendezvous). 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.
+
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/>.
-
The implementation requires either the dns_ds.h (found in Mac OS X
)
-
or howl.h (part of libhowl on Linux).
+
The implementation requires either the dns_ds.h (found in Mac OS X
+
and SunOS 5.11+)
or howl.h (part of libhowl on Linux).
*/ #include "global.h" #include "config.h" #include "pike_macros.h" #include "stralloc.h" #include "pike_error.h" #include "object.h" #include "constants.h"
pike.git/src/modules/_Protocols_DNS_SD/sd.c:142:
DNSServiceRef ref; /* Empty strings should be passed as NULL in order to get default values */ if (name && !strlen(name)) name = NULL; if (domain && !strlen(domain)) domain = NULL; if (txt && !txtlen) txt = NULL;
+
// port must be provided in network byte-order.
+
port = htons(port);
+
svc->service_ref = NULL; err = DNSServiceRegister(&ref, 0, 0, name, service, domain, NULL, port, txtlen, txt, start_service_callback, NULL); if (err == kDNSServiceErr_NoError) svc->service_ref = ref; err = DNSServiceProcessResult(ref); return err; }