]>
Commit | Line | Data |
---|---|---|
67c8f8a1 A |
1 | /* -*- Mode: C; tab-width: 4 -*- |
2 | * | |
8e92c31c A |
3 | * Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved. |
4 | * | |
67c8f8a1 A |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
83fb1e36 | 8 | * |
67c8f8a1 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
83fb1e36 | 10 | * |
67c8f8a1 A |
11 | * Unless required by applicable law or agreed to in writing, software |
12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | * See the License for the specific language governing permissions and | |
8e92c31c | 15 | * limitations under the License. |
8e92c31c | 16 | |
83fb1e36 | 17 | File: uds_daemon.h |
8e92c31c | 18 | |
83fb1e36 | 19 | Contains: Interfaces necessary to talk to uds_daemon.c. |
8e92c31c | 20 | |
83fb1e36 | 21 | Version: 1.0 |
8e92c31c | 22 | |
263eeeab | 23 | */ |
8e92c31c | 24 | |
7f0064bd A |
25 | #include "mDNSEmbeddedAPI.h" |
26 | #include "dnssd_ipc.h" | |
8e92c31c | 27 | |
8e92c31c A |
28 | /* Client interface: */ |
29 | ||
30 | #define SRS_PORT(S) mDNSVal16((S)->RR_SRV.resrec.rdata->u.srv.port) | |
31 | ||
32bb7e43 | 32 | extern int udsserver_init(dnssd_sock_t skts[], mDNSu32 count); |
8e92c31c | 33 | extern mDNSs32 udsserver_idle(mDNSs32 nextevent); |
83fb1e36 | 34 | extern void udsserver_info(mDNS *const m); // print out info about current state |
67c8f8a1 | 35 | extern void udsserver_handle_configchange(mDNS *const m); |
83fb1e36 | 36 | extern int udsserver_exit(void); // should be called prior to app exit |
8e92c31c A |
37 | |
38 | /* Routines that uds_daemon expects to link against: */ | |
39 | ||
83fb1e36 | 40 | typedef void (*udsEventCallback)(int fd, short filter, void *context); |
263eeeab A |
41 | extern mStatus udsSupportAddFDToEventLoop(dnssd_sock_t fd, udsEventCallback callback, void *context, void **platform_data); |
42 | extern int udsSupportReadFD(dnssd_sock_t fd, char* buf, int len, int flags, void *platform_data); | |
43 | extern mStatus udsSupportRemoveFDFromEventLoop(dnssd_sock_t fd, void *platform_data); // Note: This also CLOSES the file descriptor as well | |
7f0064bd | 44 | |
7f0064bd A |
45 | extern void RecordUpdatedNiceLabel(mDNS *const m, mDNSs32 delay); |
46 | ||
47 | // Globals and functions defined in uds_daemon.c and also shared with the old "daemon.c" on OS X | |
67c8f8a1 | 48 | |
7f0064bd | 49 | extern mDNS mDNSStorage; |
67c8f8a1 A |
50 | extern DNameListElem *AutoRegistrationDomains; |
51 | extern DNameListElem *AutoBrowseDomains; | |
52 | ||
7f0064bd A |
53 | extern mDNSs32 ChopSubTypes(char *regtype); |
54 | extern AuthRecord *AllocateSubTypes(mDNSs32 NumSubTypes, char *p); | |
55 | extern int CountExistingRegistrations(domainname *srv, mDNSIPPort port); | |
56 | extern void FreeExtraRR(mDNS *const m, AuthRecord *const rr, mStatus result); | |
57 | extern int CountPeerRegistrations(mDNS *const m, ServiceRecordSet *const srs); | |
67c8f8a1 A |
58 | |
59 | #if APPLE_OSX_mDNSResponder | |
60 | extern void machserver_automatic_browse_domain_changed(const domainname *d, mDNSBool add); | |
61 | extern void machserver_automatic_registration_domain_changed(const domainname *d, mDNSBool add); | |
263eeeab | 62 | // External support |
83fb1e36 A |
63 | extern void external_start_browsing_for_service(mDNSInterfaceID InterfaceID, const domainname *const type, DNS_TypeValues qtype, DNSServiceFlags flags); |
64 | extern void external_stop_browsing_for_service(mDNSInterfaceID InterfaceID, const domainname *const type, DNS_TypeValues qtype, DNSServiceFlags flags); | |
65 | extern void external_start_advertising_service(const ResourceRecord *const resourceRecord, DNSServiceFlags flags); | |
66 | extern void external_stop_advertising_service(const ResourceRecord *const resourceRecord, DNSServiceFlags flags); | |
67 | extern void external_start_resolving_service(mDNSInterfaceID InterfaceID, const domainname *const fqdn, DNSServiceFlags flags); | |
68 | extern void external_stop_resolving_service(mDNSInterfaceID InterfaceID, const domainname *const fqdn, DNSServiceFlags flags); | |
263eeeab | 69 | #else |
83fb1e36 A |
70 | #define external_start_browsing_for_service(A,B,C,D) (void)(A) |
71 | #define external_stop_browsing_for_service(A,B,C,D) (void)(A) | |
72 | #define external_start_advertising_service(A,B) (void)(A) | |
73 | #define external_stop_advertising_service(A,B) (void)(A) | |
74 | #define external_start_resolving_service(A,B,C) (void)(A) | |
75 | #define external_stop_resolving_service(A,B,C) (void)(A) | |
263eeeab | 76 | #endif // APPLE_OSX_mDNSResponder |
67c8f8a1 A |
77 | |
78 | extern const char mDNSResponderVersionString_SCCS[]; | |
79 | #define mDNSResponderVersionString (mDNSResponderVersionString_SCCS+5) |