]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSVxWorks/mDNSVxWorksIPv4Only.h
mDNSResponder-176.3.tar.gz
[apple/mdnsresponder.git] / mDNSVxWorks / mDNSVxWorksIPv4Only.h
1 /* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2002-2003 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 Contains: mDNS platform plugin for VxWorks.
18
19 Copyright: Copyright (C) 2002-2003 Apple Computer, Inc., All Rights Reserved.
20
21 Change History (most recent first):
22
23 $Log: mDNSVxWorksIPv4Only.h,v $
24 Revision 1.4 2006/08/14 23:25:18 cheshire
25 Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
26
27 Revision 1.3 2004/09/17 01:08:57 cheshire
28 Renamed mDNSClientAPI.h to mDNSEmbeddedAPI.h
29 The name "mDNSClientAPI.h" is misleading to new developers looking at this code. The interfaces
30 declared in that file are ONLY appropriate to single-address-space embedded applications.
31 For clients on general-purpose computers, the interfaces defined in dns_sd.h should be used.
32
33 Revision 1.2 2003/08/12 19:56:27 cheshire
34 Update to APSL 2.0
35
36 Revision 1.1 2003/08/02 10:06:49 bradley
37 mDNS platform plugin for VxWorks.
38
39 */
40
41 #ifndef __MDNS_VXWORKS__
42 #define __MDNS_VXWORKS__
43
44 #include "vxWorks.h"
45 #include "semLib.h"
46
47 #include "mDNSEmbeddedAPI.h"
48
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
53 // Forward Declarations
54
55 typedef struct MDNSInterfaceItem MDNSInterfaceItem;
56
57 //---------------------------------------------------------------------------------------------------------------------------
58 /*! @struct mDNS_PlatformSupport_struct
59
60 @abstract Structure containing platform-specific data.
61 */
62
63 struct mDNS_PlatformSupport_struct
64 {
65 SEM_ID lockID;
66 SEM_ID readyEvent;
67 mStatus taskInitErr;
68 SEM_ID quitEvent;
69 MDNSInterfaceItem * interfaceList;
70 int commandPipe;
71 int task;
72 mDNSBool quit;
73 long configID;
74 int rescheduled;
75 };
76
77 //---------------------------------------------------------------------------------------------------------------------------
78 /*! @function mDNSReconfigure
79
80 @abstract Tell mDNS that the configuration has changed. Call when IP address changes, link goes up after being down, etc.
81
82 @discussion
83
84 VxWorks does not provide a generic mechanism for getting notified when network interfaces change so this routines
85 provides a way for BSP-specific code to signal mDNS that something has changed and it should re-build its interfaces.
86 */
87
88 void mDNSReconfigure( void );
89
90 //---------------------------------------------------------------------------------------------------------------------------
91 /*! @struct ifaddrs
92
93 @abstract Interface information
94 */
95
96 struct ifaddrs
97 {
98 struct ifaddrs * ifa_next;
99 char * ifa_name;
100 u_int ifa_flags;
101 struct sockaddr * ifa_addr;
102 struct sockaddr * ifa_netmask;
103 struct sockaddr * ifa_dstaddr;
104 void * ifa_data;
105 };
106
107 //---------------------------------------------------------------------------------------------------------------------------
108 /*! @function getifaddrs
109
110 @abstract Builds a linked list of interfaces. Caller must free using freeifaddrs if successful.
111 */
112
113 int getifaddrs( struct ifaddrs **outAddrs );
114
115 //---------------------------------------------------------------------------------------------------------------------------
116 /*! @function freeifaddrs
117
118 @abstract Frees a linked list of interfaces built with getifaddrs.
119 */
120
121 void freeifaddrs( struct ifaddrs *inAddrs );
122
123 //---------------------------------------------------------------------------------------------------------------------------
124 /*! @function sock_pton
125
126 @abstract Converts a 'p'resentation address string into a 'n'umeric sockaddr structure.
127
128 @result 0 if successful or an error code on failure.
129 */
130
131 int sock_pton( const char *inString, int inFamily, void *outAddr, size_t inAddrSize, size_t *outAddrSize );
132
133 //---------------------------------------------------------------------------------------------------------------------------
134 /*! @function sock_ntop
135
136 @abstract Converts a 'n'umeric sockaddr structure into a 'p'resentation address string.
137
138 @result Ptr to 'p'resentation address string buffer if successful or NULL on failure.
139 */
140
141 char * sock_ntop( const void *inAddr, size_t inAddrSize, char *inBuffer, size_t inBufferSize );
142
143 #ifdef __cplusplus
144 }
145 #endif
146
147 #endif // __MDNS_VXWORKS__