]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/helper.h
mDNSResponder-544.tar.gz
[apple/mdnsresponder.git] / mDNSMacOSX / helper.h
1 /* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2007-2012 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 mDNSPreferencesSetNameKey
24 {
25 kmDNSComputerName = 1,
26 kmDNSLocalHostName
27 };
28
29 enum mDNSUpDown
30 {
31 kmDNSUp = 1,
32 kmDNSDown
33 };
34
35 enum mDNSAutoTunnelSetKeysReplaceDelete
36 {
37 kmDNSAutoTunnelSetKeysReplace = 1,
38 kmDNSAutoTunnelSetKeysDelete
39 };
40
41 // helper parses the system keychain and returns the information to mDNSResponder.
42 // It returns four attributes. Attributes are defined after how they show up in
43 // keychain access utility (the actual attribute name to retrieve these are different).
44 enum mDNSKeyChainAttributes
45 {
46 kmDNSKcWhere, // Where
47 kmDNSKcAccount, // Account
48 kmDNSKcKey, // Key
49 kmDNSKcName // Name
50 };
51
52 #define ERROR(x, y) x,
53 enum mDNSHelperErrors
54 {
55 mDNSHelperErrorBase = 2300,
56 #include "helper-error.h"
57 mDNSHelperErrorEnd
58 };
59 #undef ERROR
60
61 #include "mDNSEmbeddedAPI.h"
62 #include "helpermsg-types.h"
63
64 extern const char *mDNSHelperError(int errornum);
65
66 extern mStatus mDNSHelperInit(void);
67 extern void mDNSRequestBPF(void);
68 extern int mDNSPowerRequest(int key, int interval);
69 extern int mDNSSetLocalAddressCacheEntry(int ifindex, int family, const v6addr_t ip, const ethaddr_t eth);
70 extern void mDNSNotify(const char *title, const char *msg); // Both strings are UTF-8 text
71 extern void mDNSPreferencesSetName(int key, domainlabel *old, domainlabel *new);
72 extern int mDNSKeychainGetSecrets(CFArrayRef *secrets);
73 extern void mDNSConfigureServer(int updown, const char *const prefix, const domainname *const fqdn);
74 extern int mDNSAutoTunnelSetKeys(int replacedelete, v6addr_t local_inner,
75 v6addr_t local_outer, short local_port, v6addr_t remote_inner,
76 v6addr_t remote_outer, short remote_port, const char *const prefix, const domainname *const fqdn);
77 extern void mDNSSendWakeupPacket(unsigned ifid, char *eth_addr, char *ip_addr, int iteration);
78 extern void mDNSPacketFilterControl(uint32_t command, char * ifname, uint32_t count, pfArray_t portArray, pfArray_t protocolArray);
79 extern void mDNSSendKeepalive(v6addr_t sadd, v6addr_t dadd, uint16_t lport, uint16_t rport, unsigned seq, unsigned ack, uint16_t win);
80 extern int mDNSRetrieveTCPInfo(int family, v6addr_t laddr, uint16_t lport, v6addr_t raddr, uint16_t rport, uint32_t *seq, uint32_t *ack, uint16_t *win, int32_t *intfid);
81 extern void mDNSGetRemoteMAC(mDNS *const m, int family, v6addr_t raddr);
82 extern void mDNSStoreSPSMACAddress(int family, v6addr_t spsaddr, char *ifname);
83
84 #endif /* H_HELPER_H */