]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSVxWorks/mDNSVxWorks.h
mDNSResponder-107.5.tar.gz
[apple/mdnsresponder.git] / mDNSVxWorks / mDNSVxWorks.h
1 /*
2 * Copyright (c) 2002-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22
23 Change History (most recent first):
24
25 $Log: mDNSVxWorks.h,v $
26 Revision 1.4 2005/05/30 07:36:38 bradley
27 New implementation of the mDNS platform plugin for VxWorks 5.5 or later with IPv6 support.
28
29 */
30
31 #ifndef __MDNS_VXWORKS_H__
32 #define __MDNS_VXWORKS_H__
33
34 #include "vxWorks.h"
35 #include "config.h"
36
37 #include "semLib.h"
38
39 #include "CommonServices.h"
40 #include "DebugServices.h"
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 // Forward Declarations
47
48 typedef struct NetworkInterfaceInfoVxWorks NetworkInterfaceInfoVxWorks;
49
50 //---------------------------------------------------------------------------------------------------------------------------
51 /*! @struct SocketSet
52
53 @abstract Data for IPv4 and IPv6 sockets.
54 */
55
56 typedef struct SocketSet SocketSet;
57 struct SocketSet
58 {
59 NetworkInterfaceInfoVxWorks * info;
60 SocketRef sockV4;
61 SocketRef sockV6;
62 };
63
64 //---------------------------------------------------------------------------------------------------------------------------
65 /*! @struct NetworkInterfaceInfoVxWorks
66
67 @abstract Interface info for VxWorks.
68 */
69
70 struct NetworkInterfaceInfoVxWorks
71 {
72 NetworkInterfaceInfo ifinfo; // MUST be the first element in this structure.
73 NetworkInterfaceInfoVxWorks * next;
74 mDNSu32 exists; // 1 = currently exists in getifaddrs list; 0 = doesn't.
75 // 2 = exists, but McastTxRx state changed.
76 mDNSs32 lastSeen; // If exists == 0, last time this interface appeared in getifaddrs list.
77 mDNSu32 scopeID; // Interface index / IPv6 scope ID.
78 int family; // Socket address family of the primary socket.
79 mDNSBool multicast;
80 SocketSet ss;
81 };
82
83 //---------------------------------------------------------------------------------------------------------------------------
84 /*! @struct mDNS_PlatformSupport_struct
85
86 @abstract Data for mDNS platform plugin.
87 */
88
89 struct mDNS_PlatformSupport_struct
90 {
91 NetworkInterfaceInfoVxWorks * interfaceList;
92 SocketSet unicastSS;
93 domainlabel userNiceLabel;
94 domainlabel userHostLabel;
95
96 SEM_ID lock;
97 SEM_ID initEvent;
98 mStatus initErr;
99 SEM_ID quitEvent;
100 int commandPipe;
101 int taskID;
102 mDNSBool quit;
103 };
104
105 //---------------------------------------------------------------------------------------------------------------------------
106 /*! @function mDNSReconfigure
107
108 @abstract Tell mDNS that the configuration has changed. Call when IP address changes, link goes up after being down, etc.
109
110 @discussion
111
112 VxWorks does not provide a generic mechanism for getting notified when network interfaces change so this routines
113 provides a way for BSP-specific code to signal mDNS that something has changed and it should re-build its interfaces.
114 */
115
116 void mDNSReconfigure( void );
117
118 //---------------------------------------------------------------------------------------------------------------------------
119 /*! @function mDNSDeferIPv4
120
121 @abstract Tells mDNS whether to defer advertising of IPv4 interfaces.
122
123 @discussion
124
125 To workaround problems with clients getting a link-local IPv4 address before a DHCP address is acquired, this allows
126 external code to defer advertising of IPv4 addresses until a DHCP lease has been acquired (or it times out).
127 */
128
129 void mDNSDeferIPv4( mDNSBool inDefer );
130
131 #ifdef __cplusplus
132 }
133 #endif
134
135 #endif // __MDNS_VXWORKS_H__