1 /* -*- Mode: C; tab-width: 4 -*-
3 * Copyright (c) 2002-2003 Apple Computer, 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.
17 Contains: mDNS platform plugin for VxWorks.
19 Copyright: Copyright (C) 2002-2003 Apple Computer, Inc., All Rights Reserved.
23 #ifndef __MDNS_VXWORKS__
24 #define __MDNS_VXWORKS__
29 #include "mDNSEmbeddedAPI.h"
35 // Forward Declarations
37 typedef struct MDNSInterfaceItem MDNSInterfaceItem
;
39 //---------------------------------------------------------------------------------------------------------------------------
40 /*! @struct mDNS_PlatformSupport_struct
42 @abstract Structure containing platform-specific data.
45 struct mDNS_PlatformSupport_struct
51 MDNSInterfaceItem
* interfaceList
;
59 //---------------------------------------------------------------------------------------------------------------------------
60 /*! @function mDNSReconfigure
62 @abstract Tell mDNS that the configuration has changed. Call when IP address changes, link goes up after being down, etc.
66 VxWorks does not provide a generic mechanism for getting notified when network interfaces change so this routines
67 provides a way for BSP-specific code to signal mDNS that something has changed and it should re-build its interfaces.
70 void mDNSReconfigure( void );
72 //---------------------------------------------------------------------------------------------------------------------------
75 @abstract Interface information
80 struct ifaddrs
* ifa_next
;
83 struct sockaddr
* ifa_addr
;
84 struct sockaddr
* ifa_netmask
;
85 struct sockaddr
* ifa_dstaddr
;
89 //---------------------------------------------------------------------------------------------------------------------------
90 /*! @function getifaddrs
92 @abstract Builds a linked list of interfaces. Caller must free using freeifaddrs if successful.
95 int getifaddrs( struct ifaddrs
**outAddrs
);
97 //---------------------------------------------------------------------------------------------------------------------------
98 /*! @function freeifaddrs
100 @abstract Frees a linked list of interfaces built with getifaddrs.
103 void freeifaddrs( struct ifaddrs
*inAddrs
);
105 //---------------------------------------------------------------------------------------------------------------------------
106 /*! @function sock_pton
108 @abstract Converts a 'p'resentation address string into a 'n'umeric sockaddr structure.
110 @result 0 if successful or an error code on failure.
113 int sock_pton( const char *inString
, int inFamily
, void *outAddr
, size_t inAddrSize
, size_t *outAddrSize
);
115 //---------------------------------------------------------------------------------------------------------------------------
116 /*! @function sock_ntop
118 @abstract Converts a 'n'umeric sockaddr structure into a 'p'resentation address string.
120 @result Ptr to 'p'resentation address string buffer if successful or NULL on failure.
123 char * sock_ntop( const void *inAddr
, size_t inAddrSize
, char *inBuffer
, size_t inBufferSize
);
129 #endif // __MDNS_VXWORKS__