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