Mercurial > pidgin.yaz
annotate libpurple/protocols/bonjour/dns_sd_proxy.c @ 32827:4a34689eeb33 default tip
merged from im.pidgin.pidgin
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sat, 19 Nov 2011 14:42:54 +0900 |
parents | 014a58e994da |
children |
rev | line source |
---|---|
31017
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
1 /* |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
2 * |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
3 * Purple is the legal property of its developers, whose names are too numerous |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
4 * to list here. Please refer to the COPYRIGHT file distributed with this |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
5 * source distribution. |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
6 * |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
10 * (at your option) any later version. |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
11 * |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
15 * GNU Library General Public License for more details. |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
16 * |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
17 * You should have received a copy of the GNU General Public License |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
18 * along with this program; if not, write to the Free Software |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA. |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
20 */ |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
21 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
22 #include "win32dep.h" |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
23 #include "dns_sd_proxy.h" |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
24 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
25 #ifndef LINK_DNS_SD_DIRECTLY |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
26 static DNSServiceErrorType (DNSSD_API* _DNSServiceAddRecord)(DNSServiceRef sdRef, DNSRecordRef *RecordRef, DNSServiceFlags flags, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
27 uint16_t rrtype, uint16_t rdlen, const void *rdata, uint32_t ttl); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
28 static DNSServiceErrorType (DNSSD_API* _DNSServiceBrowse)(DNSServiceRef *sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
29 const char *regtype, const char *domain, DNSServiceBrowseReply callBack, void *context); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
30 static int (DNSSD_API* _DNSServiceConstructFullName)(char *fullName, const char *service, const char *regtype, const char *domain); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
31 static DNSServiceErrorType (DNSSD_API* _DNSServiceGetAddrInfo)(DNSServiceRef *sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
32 DNSServiceProtocol protocol, const char *hostname, DNSServiceGetAddrInfoReply callBack, void *context); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
33 static DNSServiceErrorType (DNSSD_API* _DNSServiceProcessResult)(DNSServiceRef sdRef); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
34 static DNSServiceErrorType (DNSSD_API* _DNSServiceQueryRecord)(DNSServiceRef *sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
35 const char *fullname, uint16_t rrtype, uint16_t rrclass, DNSServiceQueryRecordReply callBack, void *context); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
36 static void (DNSSD_API* _DNSServiceRefDeallocate)(DNSServiceRef sdRef); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
37 static int (DNSSD_API* _DNSServiceRefSockFD)(DNSServiceRef sdRef); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
38 static DNSServiceErrorType (DNSSD_API* _DNSServiceRegister)(DNSServiceRef *sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
39 const char *name, const char *regtype, const char *domain, const char *host, uint16_t port, uint16_t txtLen, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
40 const void *txtRecord, DNSServiceRegisterReply callBack, void *context); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
41 static DNSServiceErrorType (DNSSD_API* _DNSServiceResolve)(DNSServiceRef *sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *name, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
42 const char *regtype, const char *domain, DNSServiceResolveReply callBack, void *context); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
43 static DNSServiceErrorType (DNSSD_API* _DNSServiceRemoveRecord)(DNSServiceRef sdRef, DNSRecordRef RecordRef, DNSServiceFlags flags); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
44 static DNSServiceErrorType (DNSSD_API* _DNSServiceUpdateRecord)(DNSServiceRef sdRef, DNSRecordRef RecordRef, DNSServiceFlags flags, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
45 uint16_t rdlen, const void *rdata, uint32_t ttl); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
46 static void (DNSSD_API* _TXTRecordCreate)(TXTRecordRef *txtRecord, uint16_t bufferLen, void *buffer); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
47 static void (DNSSD_API* _TXTRecordDeallocate)(TXTRecordRef *txtRecord); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
48 static const void * (DNSSD_API* _TXTRecordGetBytesPtr)(const TXTRecordRef *txtRecord); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
49 static int16_t (DNSSD_API* _TXTRecordGetLength)(const TXTRecordRef *txtRecord); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
50 static const void * (DNSSD_API* _TXTRecordGetValuePtr)(uint16_t txtLen, const void *txtRecord, const char *key, uint8_t *valueLen); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
51 static DNSServiceErrorType (DNSSD_API* _TXTRecordSetValue)(TXTRecordRef *txtRecord, const char *key, uint8_t valueSize, const void *value); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
52 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
53 #endif |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
54 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
55 gboolean dns_sd_available(void) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
56 #ifndef LINK_DNS_SD_DIRECTLY |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
57 static gboolean initialized = FALSE; |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
58 static gboolean loaded = FALSE; |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
59 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
60 if (!initialized) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
61 initialized = TRUE; |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
62 if ((_DNSServiceAddRecord = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceAddRecord")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
63 && (_DNSServiceBrowse = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceBrowse")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
64 && (_DNSServiceConstructFullName = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceConstructFullName")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
65 && (_DNSServiceGetAddrInfo = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceGetAddrInfo")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
66 && (_DNSServiceProcessResult = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceProcessResult")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
67 && (_DNSServiceQueryRecord = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceQueryRecord")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
68 && (_DNSServiceRefDeallocate = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRefDeallocate")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
69 && (_DNSServiceRefSockFD = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRefSockFD")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
70 && (_DNSServiceRegister = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRegister")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
71 && (_DNSServiceResolve = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceResolve")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
72 && (_DNSServiceRemoveRecord = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRemoveRecord")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
73 && (_DNSServiceUpdateRecord = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceUpdateRecord")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
74 && (_TXTRecordCreate = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordCreate")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
75 && (_TXTRecordDeallocate = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordDeallocate")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
76 && (_TXTRecordGetBytesPtr = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordGetBytesPtr")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
77 && (_TXTRecordGetLength = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordGetLength")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
78 && (_TXTRecordGetValuePtr = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordGetValuePtr")) |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
79 && (_TXTRecordSetValue = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordSetValue"))) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
80 loaded = TRUE; |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
81 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
82 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
83 return loaded; |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
84 #else |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
85 return TRUE; |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
86 #endif |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
87 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
88 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
89 #ifndef LINK_DNS_SD_DIRECTLY |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
90 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
91 DNSServiceErrorType _wpurple_DNSServiceAddRecord(DNSServiceRef sdRef, DNSRecordRef *RecordRef, DNSServiceFlags flags, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
92 uint16_t rrtype, uint16_t rdlen, const void *rdata, uint32_t ttl) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
93 g_return_val_if_fail(_DNSServiceAddRecord != NULL, kDNSServiceErr_Unknown); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
94 return (_DNSServiceAddRecord)(sdRef, RecordRef, flags, rrtype, rdlen, rdata, ttl); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
95 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
96 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
97 DNSServiceErrorType _wpurple_DNSServiceBrowse(DNSServiceRef *sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
98 const char *regtype, const char *domain, DNSServiceBrowseReply callBack, void *context) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
99 g_return_val_if_fail(_DNSServiceBrowse != NULL, kDNSServiceErr_Unknown); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
100 return (_DNSServiceBrowse)(sdRef, flags, interfaceIndex, regtype, domain, callBack, context); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
101 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
102 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
103 int _wpurple_DNSServiceConstructFullName(char *fullName, const char *service, const char *regtype, const char *domain) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
104 g_return_val_if_fail(_DNSServiceConstructFullName != NULL, 0); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
105 return (_DNSServiceConstructFullName)(fullName, service, regtype, domain); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
106 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
107 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
108 DNSServiceErrorType _wpurple_DNSServiceGetAddrInfo(DNSServiceRef *sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
109 DNSServiceProtocol protocol, const char *hostname, DNSServiceGetAddrInfoReply callBack, void *context) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
110 g_return_val_if_fail(_DNSServiceGetAddrInfo != NULL, 0); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
111 return (_DNSServiceGetAddrInfo)(sdRef, flags, interfaceIndex, protocol, hostname, callBack, context); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
112 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
113 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
114 DNSServiceErrorType _wpurple_DNSServiceProcessResult(DNSServiceRef sdRef) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
115 g_return_val_if_fail(_DNSServiceProcessResult != NULL, kDNSServiceErr_Unknown); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
116 return (_DNSServiceProcessResult)(sdRef); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
117 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
118 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
119 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
120 DNSServiceErrorType _wpurple_DNSServiceQueryRecord(DNSServiceRef *sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
121 const char *fullname, uint16_t rrtype, uint16_t rrclass, DNSServiceQueryRecordReply callBack, void *context) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
122 g_return_val_if_fail(_DNSServiceQueryRecord != NULL, kDNSServiceErr_Unknown); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
123 return (_DNSServiceQueryRecord)(sdRef, flags, interfaceIndex, fullname, rrtype, rrclass, callBack, context); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
124 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
125 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
126 void _wpurple_DNSServiceRefDeallocate(DNSServiceRef sdRef) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
127 g_return_if_fail(_DNSServiceRefDeallocate != NULL); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
128 (_DNSServiceRefDeallocate)(sdRef); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
129 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
130 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
131 int _wpurple_DNSServiceRefSockFD(DNSServiceRef sdRef) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
132 g_return_val_if_fail(_DNSServiceRefSockFD != NULL, -1); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
133 return (_DNSServiceRefSockFD)(sdRef); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
134 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
135 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
136 DNSServiceErrorType _wpurple_DNSServiceRegister(DNSServiceRef *sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
137 const char *name, const char *regtype, const char *domain, const char *host, uint16_t port, uint16_t txtLen, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
138 const void *txtRecord, DNSServiceRegisterReply callBack, void *context) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
139 g_return_val_if_fail(_DNSServiceRegister != NULL, kDNSServiceErr_Unknown); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
140 return (_DNSServiceRegister)(sdRef, flags, interfaceIndex, name, regtype, domain, host, port, txtLen, txtRecord, callBack, context); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
141 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
142 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
143 DNSServiceErrorType _wpurple_DNSServiceResolve(DNSServiceRef *sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *name, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
144 const char *regtype, const char *domain, DNSServiceResolveReply callBack, void *context) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
145 g_return_val_if_fail(_DNSServiceResolve != NULL, kDNSServiceErr_Unknown); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
146 return (_DNSServiceResolve)(sdRef, flags, interfaceIndex, name, regtype, domain, callBack, context); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
147 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
148 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
149 DNSServiceErrorType _wpurple_DNSServiceRemoveRecord(DNSServiceRef sdRef, DNSRecordRef RecordRef, DNSServiceFlags flags) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
150 g_return_val_if_fail(_DNSServiceRemoveRecord != NULL, kDNSServiceErr_Unknown); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
151 return (_DNSServiceRemoveRecord)(sdRef, RecordRef, flags); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
152 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
153 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
154 DNSServiceErrorType _wpurple_DNSServiceUpdateRecord(DNSServiceRef sdRef, DNSRecordRef RecordRef, DNSServiceFlags flags, |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
155 uint16_t rdlen, const void *rdata, uint32_t ttl) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
156 g_return_val_if_fail(_DNSServiceUpdateRecord != NULL, kDNSServiceErr_Unknown); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
157 return (_DNSServiceUpdateRecord)(sdRef, RecordRef, flags, rdlen, rdata, ttl); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
158 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
159 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
160 void _wpurple_TXTRecordCreate(TXTRecordRef *txtRecord, uint16_t bufferLen, void *buffer) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
161 g_return_if_fail(_TXTRecordCreate != NULL); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
162 (_TXTRecordCreate)(txtRecord, bufferLen, buffer); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
163 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
164 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
165 void _wpurple_TXTRecordDeallocate(TXTRecordRef *txtRecord) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
166 g_return_if_fail(_TXTRecordDeallocate != NULL); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
167 (_TXTRecordDeallocate)(txtRecord); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
168 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
169 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
170 const void * _wpurple_TXTRecordGetBytesPtr(const TXTRecordRef *txtRecord) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
171 g_return_val_if_fail(_TXTRecordGetBytesPtr != NULL, NULL); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
172 return (_TXTRecordGetBytesPtr)(txtRecord); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
173 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
174 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
175 uint16_t _wpurple_TXTRecordGetLength(const TXTRecordRef *txtRecord) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
176 g_return_val_if_fail(_TXTRecordGetLength != NULL, 0); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
177 return (_TXTRecordGetLength)(txtRecord); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
178 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
179 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
180 const void * _wpurple_TXTRecordGetValuePtr(uint16_t txtLen, const void *txtRecord, const char *key, uint8_t *valueLen) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
181 g_return_val_if_fail(_TXTRecordGetValuePtr != NULL, NULL); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
182 return (_TXTRecordGetValuePtr)(txtLen, txtRecord, key, valueLen); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
183 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
184 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
185 DNSServiceErrorType _wpurple_TXTRecordSetValue(TXTRecordRef *txtRecord, const char *key, uint8_t valueSize, const void *value) { |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
186 g_return_val_if_fail(_TXTRecordSetValue != NULL, kDNSServiceErr_Unknown); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
187 return (_TXTRecordSetValue)(txtRecord, key, valueSize, value); |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
188 } |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
189 |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
190 #endif /*LINK_DNS_SD_DIRECTLY*/ |
014a58e994da
Use DNSServiceGetAddrInfo() from dns_sd.h to resolve the IP for remote bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20765
diff
changeset
|
191 |