]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSVxWorks/mDNSVxWorks.h
eb62b4877ece633877a74aa87f343383a280218c
[apple/mdnsresponder.git] / mDNSVxWorks / mDNSVxWorks.h
1 /* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2002-2005 Apple Computer, 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: mDNSVxWorks.h,v $
20 Revision 1.5 2006/08/14 23:25:18 cheshire
21 Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
22
23 Revision 1.4 2005/05/30 07:36:38 bradley
24 New implementation of the mDNS platform plugin for VxWorks 5.5 or later with IPv6 support.
25
26 */
27
28 #ifndef __MDNS_VXWORKS_H__
29 #define __MDNS_VXWORKS_H__
30
31 #include "vxWorks.h"
32 #include "config.h"
33
34 #include "semLib.h"
35
36 #include "CommonServices.h"
37 #include "DebugServices.h"
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 // Forward Declarations
44
45 typedef struct NetworkInterfaceInfoVxWorks NetworkInterfaceInfoVxWorks;
46
47 //---------------------------------------------------------------------------------------------------------------------------
48 /*! @struct SocketSet
49
50 @abstract Data for IPv4 and IPv6 sockets.
51 */
52
53 typedef struct SocketSet SocketSet;
54 struct SocketSet
55 {
56 NetworkInterfaceInfoVxWorks * info;
57 SocketRef sockV4;
58 SocketRef sockV6;
59 };
60
61 //---------------------------------------------------------------------------------------------------------------------------
62 /*! @struct NetworkInterfaceInfoVxWorks
63
64 @abstract Interface info for VxWorks.
65 */
66
67 struct NetworkInterfaceInfoVxWorks
68 {
69 NetworkInterfaceInfo ifinfo; // MUST be the first element in this structure.
70 NetworkInterfaceInfoVxWorks * next;
71 mDNSu32 exists; // 1 = currently exists in getifaddrs list; 0 = doesn't.
72 // 2 = exists, but McastTxRx state changed.
73 mDNSs32 lastSeen; // If exists == 0, last time this interface appeared in getifaddrs list.
74 mDNSu32 scopeID; // Interface index / IPv6 scope ID.
75 int family; // Socket address family of the primary socket.
76 mDNSBool multicast;
77 SocketSet ss;
78 };
79
80 //---------------------------------------------------------------------------------------------------------------------------
81 /*! @struct mDNS_PlatformSupport_struct
82
83 @abstract Data for mDNS platform plugin.
84 */
85
86 struct mDNS_PlatformSupport_struct
87 {
88 NetworkInterfaceInfoVxWorks * interfaceList;
89 SocketSet unicastSS;
90 domainlabel userNiceLabel;
91 domainlabel userHostLabel;
92
93 SEM_ID lock;
94 SEM_ID initEvent;
95 mStatus initErr;
96 SEM_ID quitEvent;
97 int commandPipe;
98 int taskID;
99 mDNSBool quit;
100 };
101
102 //---------------------------------------------------------------------------------------------------------------------------
103 /*! @function mDNSReconfigure
104
105 @abstract Tell mDNS that the configuration has changed. Call when IP address changes, link goes up after being down, etc.
106
107 @discussion
108
109 VxWorks does not provide a generic mechanism for getting notified when network interfaces change so this routines
110 provides a way for BSP-specific code to signal mDNS that something has changed and it should re-build its interfaces.
111 */
112
113 void mDNSReconfigure( void );
114
115 //---------------------------------------------------------------------------------------------------------------------------
116 /*! @function mDNSDeferIPv4
117
118 @abstract Tells mDNS whether to defer advertising of IPv4 interfaces.
119
120 @discussion
121
122 To workaround problems with clients getting a link-local IPv4 address before a DHCP address is acquired, this allows
123 external code to defer advertising of IPv4 addresses until a DHCP lease has been acquired (or it times out).
124 */
125
126 void mDNSDeferIPv4( mDNSBool inDefer );
127
128 #ifdef __cplusplus
129 }
130 #endif
131
132 #endif // __MDNS_VXWORKS_H__