]> git.saurik.com Git - apple/mdnsresponder.git/blame - mDNSShared/uds_daemon.h
mDNSResponder-108.6.tar.gz
[apple/mdnsresponder.git] / mDNSShared / uds_daemon.h
CommitLineData
c9d2d929 1/*
8e92c31c
A
2 * Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved.
3 *
c9d2d929 4 * @APPLE_LICENSE_HEADER_START@
8e92c31c 5 *
c9d2d929
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
8e92c31c 12 *
c9d2d929
A
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
8e92c31c 19 * limitations under the License.
c9d2d929
A
20 *
21 * @APPLE_LICENSE_HEADER_END@
8e92c31c
A
22
23 File: uds_daemon.h
24
25 Contains: Interfaces necessary to talk to uds_daemon.c.
26
27 Version: 1.0
28
29 Change History (most recent first):
30
31$Log: uds_daemon.h,v $
283ee3ff
A
32Revision 1.14 2005/01/27 17:48:39 cheshire
33Added comment about CFSocketInvalidate closing the underlying socket
34
7f0064bd
A
35Revision 1.13 2004/12/10 05:27:26 cheshire
36<rdar://problem/3909147> Guard against multiple autoname services of the same type on the same machine
37
38Revision 1.12 2004/12/10 04:28:28 cheshire
39<rdar://problem/3914406> User not notified of name changes for services using new UDS API
40
41Revision 1.11 2004/12/06 21:15:23 ksekar
42<rdar://problem/3884386> mDNSResponder crashed in CheckServiceRegistrations
43
44Revision 1.10 2004/10/26 04:31:44 cheshire
45Rename CountSubTypes() as ChopSubTypes()
46
47Revision 1.9 2004/09/30 00:25:00 ksekar
48<rdar://problem/3695802> Dynamically update default registration domains on config change
49
50Revision 1.8 2004/09/21 21:05:11 cheshire
51Move duplicate code out of mDNSMacOSX/daemon.c and mDNSPosix/PosixDaemon.c,
52into mDNSShared/uds_daemon.c
53
54Revision 1.7 2004/09/17 01:08:55 cheshire
55Renamed mDNSClientAPI.h to mDNSEmbeddedAPI.h
56 The name "mDNSClientAPI.h" is misleading to new developers looking at this code. The interfaces
57 declared in that file are ONLY appropriate to single-address-space embedded applications.
58 For clients on general-purpose computers, the interfaces defined in dns_sd.h should be used.
59
60Revision 1.6 2004/08/11 01:58:49 cheshire
61Remove "mDNS *globalInstance" parameter from udsserver_init()
62
63Revision 1.5 2004/06/18 04:44:58 rpantos
64Use platform layer for socket types
65
66Revision 1.4 2004/06/12 00:51:58 cheshire
67Changes for Windows compatibility
68
8e92c31c
A
69Revision 1.3 2004/01/25 00:03:21 cheshire
70Change to use mDNSVal16() instead of private PORT_AS_NUM() macro
71
72Revision 1.2 2004/01/24 08:46:26 bradley
73Added InterfaceID<->Index platform interfaces since they are now used by all platforms for the DNS-SD APIs.
74
75Revision 1.1 2003/12/08 21:11:42 rpantos;
76Changes necessary to support mDNSResponder on Linux.
77
78*/
79
7f0064bd
A
80#include "mDNSEmbeddedAPI.h"
81#include "dnssd_ipc.h"
8e92c31c
A
82
83
84/* Client interface: */
85
86#define SRS_PORT(S) mDNSVal16((S)->RR_SRV.resrec.rdata->u.srv.port)
87
7f0064bd 88extern int udsserver_init(void);
8e92c31c
A
89
90// takes the next scheduled event time, does idle work, and returns the updated nextevent time
91extern mDNSs32 udsserver_idle(mDNSs32 nextevent);
92
7f0064bd 93extern void udsserver_info(mDNS *const m); // print out info about current state
8e92c31c
A
94
95extern void udsserver_handle_configchange(void);
96
97extern int udsserver_exit(void); // should be called prior to app exit
98
7f0064bd
A
99extern void udsserver_default_reg_domain_changed(const domainname *d, mDNSBool add);
100extern void udsserver_default_browse_domain_changed(const domainname *d, mDNSBool add);
8e92c31c
A
101
102/* Routines that uds_daemon expects to link against: */
103
104typedef void (*udsEventCallback)(void *context);
105
7f0064bd 106extern mStatus udsSupportAddFDToEventLoop(dnssd_sock_t fd, udsEventCallback callback, void *context);
283ee3ff 107extern mStatus udsSupportRemoveFDFromEventLoop(dnssd_sock_t fd); // Note: This also CLOSES the file descriptor as well
7f0064bd
A
108
109// RecordUpdatedNiceLabel() can be a no-op on platforms that don't care about updating the machine's
110// global default service name (was OS X calls the "Computer Name") in response to name conflicts.
111extern void RecordUpdatedNiceLabel(mDNS *const m, mDNSs32 delay);
112
113// Globals and functions defined in uds_daemon.c and also shared with the old "daemon.c" on OS X
114extern mDNS mDNSStorage;
115extern mDNSs32 ChopSubTypes(char *regtype);
116extern AuthRecord *AllocateSubTypes(mDNSs32 NumSubTypes, char *p);
117extern int CountExistingRegistrations(domainname *srv, mDNSIPPort port);
118extern void FreeExtraRR(mDNS *const m, AuthRecord *const rr, mStatus result);
119extern int CountPeerRegistrations(mDNS *const m, ServiceRecordSet *const srs);