]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/helper.h
mDNSResponder-320.16.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
18 #ifndef H_HELPER_H
19 #define H_HELPER_H
20
21 #define kmDNSHelperServiceName "com.apple.mDNSResponderHelper"
22
23 enum mDNSDynamicStoreSetConfigKey
24 {
25 kmDNSMulticastConfig = 1,
26 kmDNSDynamicConfig,
27 kmDNSPrivateConfig,
28 kmDNSBackToMyMacConfig,
29 kmDNSSleepProxyServersState
30 };
31
32 enum mDNSPreferencesSetNameKey
33 {
34 kmDNSComputerName = 1,
35 kmDNSLocalHostName
36 };
37
38 enum mDNSUpDown
39 {
40 kmDNSUp = 1,
41 kmDNSDown
42 };
43
44 enum mDNSAutoTunnelSetKeysReplaceDelete
45 {
46 kmDNSAutoTunnelSetKeysReplace = 1,
47 kmDNSAutoTunnelSetKeysDelete
48 };
49
50 // helper parses the system keychain and returns the information to mDNSResponder.
51 // It returns four attributes. Attributes are defined after how they show up in
52 // keychain access utility (the actual attribute name to retrieve these are different).
53 enum mDNSKeyChainAttributes
54 {
55 kmDNSKcWhere, // Where
56 kmDNSKcAccount, // Account
57 kmDNSKcKey, // Key
58 kmDNSKcName // Name
59 };
60
61 #define ERROR(x, y) x,
62 enum mDNSHelperErrors
63 {
64 mDNSHelperErrorBase = 2300,
65 #include "helper-error.h"
66 mDNSHelperErrorEnd
67 };
68 #undef ERROR
69
70 #include "mDNSEmbeddedAPI.h"
71 #include "helpermsg-types.h"
72
73 extern const char *mDNSHelperError(int errornum);
74
75 extern void mDNSRequestBPF(void);
76 extern int mDNSPowerRequest(int key, int interval);
77 extern int mDNSSetLocalAddressCacheEntry(int ifindex, int family, const v6addr_t ip, const ethaddr_t eth);
78 extern void mDNSNotify(const char *title, const char *msg); // Both strings are UTF-8 text
79 extern void mDNSDynamicStoreSetConfig(int key, const char *subkey, CFPropertyListRef value);
80 extern void mDNSPreferencesSetName(int key, domainlabel *old, domainlabel *new);
81 extern int mDNSKeychainGetSecrets(CFArrayRef *secrets);
82 extern void mDNSAutoTunnelInterfaceUpDown(int updown, v6addr_t addr);
83 extern void mDNSConfigureServer(int updown, const char *const prefix, const domainname *const fqdn);
84 extern int mDNSAutoTunnelSetKeys(int replacedelete, v6addr_t local_inner,
85 v6addr_t local_outer, short local_port, v6addr_t remote_inner,
86 v6addr_t remote_outer, short remote_port, const char *const prefix, const domainname *const fqdn);
87 extern void mDNSSendWakeupPacket(unsigned ifid, char *eth_addr, char *ip_addr, int iteration);
88 extern void mDNSPacketFilterControl(uint32_t command, char * ifname, uint16_t servicePort, uint16_t protocol);
89
90 #endif /* H_HELPER_H */