1 /* -*- Mode: C; tab-width: 4 -*-
3 * Copyright (c) 2007-2012 Apple Inc. All rights reserved.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #define kmDNSHelperServiceName "com.apple.mDNSResponderHelper"
23 enum mDNSPreferencesSetNameKey
25 kmDNSComputerName
= 1,
35 enum mDNSAutoTunnelSetKeysReplaceDelete
37 kmDNSAutoTunnelSetKeysReplace
= 1,
38 kmDNSAutoTunnelSetKeysDelete
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
46 kmDNSKcWhere
, // Where
47 kmDNSKcAccount
, // Account
52 #define ERROR(x, y) x,
55 mDNSHelperErrorBase
= 2300,
56 #include "helper-error.h"
61 #include "mDNSEmbeddedAPI.h"
62 #include "helpermsg-types.h"
64 extern const char *mDNSHelperError(int errornum
);
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
);
84 #endif /* H_HELPER_H */