]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/helper.h
mDNSResponder-212.1.tar.gz
[apple/mdnsresponder.git] / mDNSMacOSX / helper.h
1 /* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2007 Apple Inc. All rights reserved.
4 *
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
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
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
15 * limitations under the License.
16
17 Change History (most recent first):
18
19 $Log: helper.h,v $
20 Revision 1.18 2009/04/20 20:40:14 cheshire
21 <rdar://problem/6786150> uDNS: Running location cycling caused configd and mDNSResponder to deadlock
22 Changed mDNSPreferencesSetName (and similar) routines from MIG "routine" to MIG "simpleroutine"
23 so we don't deadlock waiting for a result that we're just going to ignore anyway
24
25 Revision 1.17 2009/03/20 22:12:28 mcguire
26 <rdar://problem/6703952> Support CFUserNotificationDisplayNotice in mDNSResponderHelper
27 Make the call to the helper a simpleroutine: don't wait for an unused return value
28
29 Revision 1.16 2009/03/20 20:52:22 cheshire
30 <rdar://problem/6703952> Support CFUserNotificationDisplayNotice in mDNSResponderHelper
31
32 Revision 1.15 2009/03/14 01:42:56 mcguire
33 <rdar://problem/5457116> BTMM: Fix issues with multiple .Mac accounts on the same machine
34
35 Revision 1.14 2009/01/22 02:14:27 cheshire
36 <rdar://problem/6515626> Sleep Proxy: Set correct target MAC address, instead of all zeroes
37
38 Revision 1.13 2009/01/14 01:38:43 mcguire
39 <rdar://problem/6492710> Write out DynamicStore per-interface SleepProxyServer info
40
41 Revision 1.12 2009/01/12 22:26:13 mkrochma
42 Change DynamicStore location from BonjourSleepProxy/DiscoveredServers to SleepProxyServers
43
44 Revision 1.11 2008/12/05 02:35:24 mcguire
45 <rdar://problem/6107390> Write to the DynamicStore when a Sleep Proxy server is available on the network
46
47 Revision 1.10 2008/11/04 23:54:09 cheshire
48 Added routine mDNSSetARP(), used to replace an SPS client's entry in our ARP cache with
49 a dummy one, so that IP traffic to the SPS client initiated by the SPS machine can be
50 captured by our BPF filters, and used as a trigger to wake the sleeping machine.
51
52 Revision 1.9 2008/10/24 01:42:36 cheshire
53 Added mDNSPowerRequest helper routine to request a scheduled wakeup some time in the future
54
55 Revision 1.8 2008/10/20 22:01:28 cheshire
56 Made new Mach simpleroutine "mDNSRequestBPF"
57
58 Revision 1.7 2008/09/27 00:58:11 cheshire
59 Added mDNSRequestBPF declaration
60
61 Revision 1.6 2007/09/20 22:33:17 cheshire
62 Tidied up inconsistent and error-prone naming -- used to be mDNSResponderHelper in
63 some places and mDNSResponder.helper in others; now mDNSResponderHelper everywhere
64
65 Revision 1.5 2007/09/07 22:44:03 mcguire
66 <rdar://problem/5448420> Move CFUserNotification code to mDNSResponderHelper
67
68 Revision 1.4 2007/09/04 22:32:58 mcguire
69 <rdar://problem/5453633> BTMM: BTMM overwrites /etc/racoon/remote/anonymous.conf
70
71 Revision 1.3 2007/08/23 21:51:44 cheshire
72 Made code layout style consistent with existing project style; added $Log header
73
74 Revision 1.1 2007/08/08 22:34:58 mcguire
75 <rdar://problem/5197869> Security: Run mDNSResponder as user id mdnsresponder instead of root
76 */
77
78 #ifndef H_HELPER_H
79 #define H_HELPER_H
80
81 #define kmDNSHelperServiceName "com.apple.mDNSResponderHelper"
82
83 enum mDNSDynamicStoreSetConfigKey
84 {
85 kmDNSMulticastConfig = 1,
86 kmDNSDynamicConfig,
87 kmDNSPrivateConfig,
88 kmDNSBackToMyMacConfig,
89 kmDNSSleepProxyServersState
90 };
91
92 enum mDNSPreferencesSetNameKey
93 {
94 kmDNSComputerName = 1,
95 kmDNSLocalHostName
96 };
97
98 enum mDNSUpDown
99 {
100 kmDNSUp = 1,
101 kmDNSDown
102 };
103
104 enum mDNSAutoTunnelSetKeysReplaceDelete
105 {
106 kmDNSAutoTunnelSetKeysReplace = 1,
107 kmDNSAutoTunnelSetKeysDelete
108 };
109
110 #define ERROR(x, y) x,
111 enum mDNSHelperErrors
112 {
113 mDNSHelperErrorBase = 2300,
114 #include "helper-error.h"
115 mDNSHelperErrorEnd
116 };
117 #undef ERROR
118
119 #include "mDNSEmbeddedAPI.h"
120 #include "helpermsg-types.h"
121
122 extern const char *mDNSHelperError(int errornum);
123
124 extern void mDNSRequestBPF(void);
125 extern int mDNSPowerRequest(int key, int interval);
126 extern int mDNSSetARP(int ifindex, const v4addr_t ip, const ethaddr_t eth);
127 extern void mDNSNotify(const char *title, const char *msg); // Both strings are UTF-8 text
128 extern void mDNSDynamicStoreSetConfig(int key, const char *subkey, CFPropertyListRef value);
129 extern void mDNSPreferencesSetName(int key, domainlabel *old, domainlabel *new);
130 extern int mDNSKeychainGetSecrets(CFArrayRef *secrets);
131 extern void mDNSAutoTunnelInterfaceUpDown(int updown, v6addr_t addr);
132 extern void mDNSConfigureServer(int updown, const domainname *const fqdn);
133 extern int mDNSAutoTunnelSetKeys(int replacedelete, v6addr_t local_inner,
134 v4addr_t local_outer, short local_port, v6addr_t remote_inner,
135 v4addr_t remote_outer, short remote_port, const domainname *const fqdn);
136
137 #endif /* H_HELPER_H */