]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSCore/uDNS.h
52fc878f76e08aaea3fefe65e982c90b55c358fe
[apple/mdnsresponder.git] / mDNSCore / uDNS.h
1 /*
2 * Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24
25 Change History (most recent first):
26
27 $Log: uDNS.h,v $
28 Revision 1.11 2004/06/17 01:13:11 ksekar
29 <rdar://problem/3696616>: polling interval too short
30
31 Revision 1.10 2004/06/11 05:45:03 ksekar
32 <rdar://problem/3682397>: Change SRV names for LLQ/Update port lookups
33
34 Revision 1.9 2004/06/01 23:46:50 ksekar
35 <rdar://problem/3675149>: DynDNS: dynamically look up LLQ/Update ports
36
37 Revision 1.8 2004/05/28 23:42:37 ksekar
38 <rdar://problem/3258021>: Feature: DNS server->client notification on record changes (#7805)
39
40 Revision 1.7 2004/05/18 23:51:25 cheshire
41 Tidy up all checkin comments to use consistent "<rdar://problem/xxxxxxx>" format for bug numbers
42
43 Revision 1.6 2004/03/13 01:57:33 ksekar
44 <rdar://problem/3192546>: DynDNS: Dynamic update of service records
45
46 Revision 1.5 2004/02/21 08:56:58 bradley
47 Wrap prototypes with extern "C" for C++ builds.
48
49 Revision 1.4 2004/02/06 23:04:19 ksekar
50 Basic Dynamic Update support via mDNS_Register (dissabled via
51 UNICAST_REGISTRATION #define)
52
53 Revision 1.3 2004/01/24 03:38:27 cheshire
54 Fix minor syntactic error: Headers should use "extern" declarations, not "mDNSexport"
55
56 Revision 1.2 2004/01/23 23:23:15 ksekar
57 Added TCP support for truncated unicast messages.
58
59 Revision 1.1 2003/12/13 03:05:27 ksekar
60 <rdar://problem/3192548>: DynDNS: Unicast query of service records
61
62
63 */
64
65 #ifndef __UDNS_H_
66 #define __UDNS_H_
67
68 #include "mDNSClientAPI.h"
69 #include "DNSCommon.h"
70
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74
75 #define INIT_UCAST_POLL_INTERVAL (15 * mDNSPlatformOneSecond)
76 #define MAX_UCAST_POLL_INTERVAL (15 * 60 * mDNSPlatformOneSecond)
77 #define NO_GOODBYE // will we receive goodbye packets from the server?
78 #define UPDATE_PORT_NAME "_dns-update._udp."
79 #define LLQ_PORT_NAME "_dns-llq._udp"
80
81 // Entry points into unicast-specific routines
82
83 extern void uDNS_AdvertiseInterface(mDNS *const m, NetworkInterfaceInfo *set);
84 extern void uDNS_DeadvertiseInterface(mDNS *const m, NetworkInterfaceInfo *set);
85
86 extern mStatus uDNS_StartQuery(mDNS *const m, DNSQuestion *const question);
87 extern mDNSBool IsActiveUnicastQuery(DNSQuestion *const question, uDNS_GlobalInfo *u); // returns true if OK to call StopQuery
88 extern mStatus uDNS_StopQuery(mDNS *const m, DNSQuestion *const question);
89
90 // SuspendLLQs stops all LLQs, preserving known answers. RestartLLQs re-starts these suspended LLQs, generating appropriate add/removes
91 // Call SuspendLLQs prior to sleep, and on shutdown. Call RestartLLQs on wake from sleep.
92 extern void uDNS_SuspendLLQs(mDNS *m);
93 extern void uDNS_RestartLLQs(mDNS *m);
94
95 extern mStatus uDNS_RegisterRecord(mDNS *const m, AuthRecord *const rr);
96 extern mStatus uDNS_DeregisterRecord(mDNS *const m, AuthRecord *const rr);
97
98 extern mStatus uDNS_RegisterService(mDNS *const m, ServiceRecordSet *srs);
99 extern mStatus uDNS_DeregisterService(mDNS *const m, ServiceRecordSet *srs);
100 extern void uDNS_UpdateServiceTargets(mDNS *const m); // call following namechange
101
102 // integer fields of msg header must be in HOST byte order before calling this routine
103 extern void uDNS_ReceiveMsg(mDNS *const m, DNSMessage *const msg, const mDNSu8 *const end,
104 const mDNSAddr *const srcaddr, const mDNSIPPort srcport, const mDNSAddr *const dstaddr,
105 const mDNSIPPort dstport, const mDNSInterfaceID InterfaceID, mDNSu8 ttl);
106
107 // returns time of next scheduled event
108 extern void uDNS_Execute(mDNS *const m);
109
110 extern void uDNS_Init(mDNS *const m);
111
112 #ifdef __cplusplus
113 }
114 #endif
115
116 #endif // __UDNS_H_