os/ossrv/genericopenlibs/openenvcore/include/arpa/inet.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/include/arpa/inet.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,165 @@
     1.4 +/*
     1.5 + * Copyright (c) 1983, 1993
     1.6 + *	The Regents of the University of California.  All rights reserved.
     1.7 + *
     1.8 + * Redistribution and use in source and binary forms, with or without
     1.9 + * modification, are permitted provided that the following conditions
    1.10 + * are met:
    1.11 + * 1. Redistributions of source code must retain the above copyright
    1.12 + *    notice, this list of conditions and the following disclaimer.
    1.13 + * 2. Redistributions in binary form must reproduce the above copyright
    1.14 + *    notice, this list of conditions and the following disclaimer in the
    1.15 + *    documentation and/or other materials provided with the distribution.
    1.16 + * 4. Neither the name of the University nor the names of its contributors
    1.17 + *    may be used to endorse or promote products derived from this software
    1.18 + *    without specific prior written permission.
    1.19 + *
    1.20 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
    1.21 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.22 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    1.23 + * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
    1.24 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    1.25 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    1.26 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    1.27 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    1.28 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    1.29 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.30 + * SUCH DAMAGE.
    1.31 + * -
    1.32 + * Portions Copyright (c) 1993 by Digital Equipment Corporation.
    1.33 + * Permission to use, copy, modify, and distribute this software for any
    1.34 + * purpose with or without fee is hereby granted, provided that the above
    1.35 + * copyright notice and this permission notice appear in all copies, and that
    1.36 + * the name of Digital Equipment Corporation not be used in advertising or
    1.37 + * publicity pertaining to distribution of the document or software without
    1.38 + * specific, written prior permission.
    1.39 + * 
    1.40 + * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
    1.41 + * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
    1.42 + * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
    1.43 + * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
    1.44 + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
    1.45 + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
    1.46 + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
    1.47 + * SOFTWARE.
    1.48 + * 
    1.49 + * Portions Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
    1.50 + *	@(#)inet.h	8.1 (Berkeley) 6/2/93
    1.51 + *	From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
    1.52 + * $FreeBSD: src/include/arpa/inet.h,v 1.25 2002/08/21 16:19:56 mike Exp $
    1.53 + */
    1.54 +
    1.55 +#ifndef _ARPA_INET_H_
    1.56 +#define	_ARPA_INET_H_
    1.57 +
    1.58 +/* External definitions for functions in inet(3), addr2ascii(3) */
    1.59 +
    1.60 +#include <sys/cdefs.h>
    1.61 +#include <sys/_types.h>
    1.62 +
    1.63 +/* Required for byteorder(3) functions. */
    1.64 +#include <stdapis/machine/endian.h>
    1.65 +
    1.66 +#ifdef __cplusplus
    1.67 +extern "C" {
    1.68 +#endif
    1.69 +#define	INET_ADDRSTRLEN		16
    1.70 +#define	INET6_ADDRSTRLEN	46
    1.71 +
    1.72 +#ifndef _UINT16_T_DECLARED
    1.73 +typedef	__uint16_t	uint16_t;
    1.74 +#define	_UINT16_T_DECLARED
    1.75 +#endif
    1.76 +
    1.77 +#ifndef _UINT32_T_DECLARED
    1.78 +typedef	__uint32_t	uint32_t;
    1.79 +#define	_UINT32_T_DECLARED
    1.80 +#endif
    1.81 +
    1.82 +#ifndef _IN_ADDR_T_DECLARED
    1.83 +typedef	uint32_t	in_addr_t;
    1.84 +#define	_IN_ADDR_T_DECLARED
    1.85 +#endif
    1.86 +
    1.87 +#ifndef _IN_PORT_T_DECLARED
    1.88 +typedef	uint16_t	in_port_t;
    1.89 +#define	_IN_PORT_T_DECLARED
    1.90 +#endif
    1.91 +
    1.92 +#if __BSD_VISIBLE
    1.93 +#ifndef _SIZE_T_DECLARED
    1.94 +typedef	__size_t	size_t;
    1.95 +#define	_SIZE_T_DECLARED
    1.96 +#endif
    1.97 +#endif
    1.98 +
    1.99 +/*
   1.100 + * XXX socklen_t is used by a POSIX.1-2001 interface, but not required by
   1.101 + * POSIX.1-2001.
   1.102 + */
   1.103 +#ifndef _SOCKLEN_T_DECLARED
   1.104 +typedef	__socklen_t	socklen_t;
   1.105 +#define	_SOCKLEN_T_DECLARED
   1.106 +#endif
   1.107 +
   1.108 +#ifndef _STRUCT_IN_ADDR_DECLARED
   1.109 +struct in_addr {
   1.110 +	in_addr_t s_addr;
   1.111 +};
   1.112 +#define	_STRUCT_IN_ADDR_DECLARED
   1.113 +#endif
   1.114 +#ifndef __DOXYGEN__
   1.115 +/* XXX all new diversions!! argh!! */
   1.116 +#if __BSD_VISIBLE
   1.117 +#define	inet_addr	__inet_addr
   1.118 +#define	inet_aton	__inet_aton
   1.119 +#define	inet_lnaof	__inet_lnaof
   1.120 +#define	inet_makeaddr	__inet_makeaddr
   1.121 +#define	inet_neta	__inet_neta
   1.122 +#define	inet_netof	__inet_netof
   1.123 +#define	inet_network	__inet_network
   1.124 +#define	inet_net_ntop	__inet_net_ntop
   1.125 +#define	inet_net_pton	__inet_net_pton
   1.126 +#define	inet_ntoa	__inet_ntoa
   1.127 +#define	inet_pton	__inet_pton
   1.128 +#define	inet_ntop	__inet_ntop
   1.129 +#define	inet_nsap_addr	__inet_nsap_addr
   1.130 +#define	inet_nsap_ntoa	__inet_nsap_ntoa
   1.131 +#endif /* __BSD_VISIBLE */
   1.132 +#endif //__DOXYGEN__
   1.133 +
   1.134 +__BEGIN_DECLS
   1.135 +#if  !defined (_BYTEORDER_PROTOTYPED) ||defined(__SYMBIAN32__)
   1.136 +#define	_BYTEORDER_PROTOTYPED
   1.137 +IMPORT_C uint32_t	        htonl(uint32_t);
   1.138 +IMPORT_C uint16_t	 htons(uint16_t);
   1.139 +#ifdef __SYMBIAN32__
   1.140 +#define ntohl htonl
   1.141 +#define ntohs htons
   1.142 +#endif
   1.143 +#endif
   1.144 +
   1.145 +IMPORT_C in_addr_t	 inet_addr(const char *);
   1.146 +IMPORT_C char		*inet_ntoa(struct in_addr);
   1.147 +IMPORT_C const char	*inet_ntop(int, const void * __restrict, char * __restrict,
   1.148 +		    socklen_t);
   1.149 +IMPORT_C int inet_pton(int, const char * __restrict, void * __restrict);
   1.150 +
   1.151 +#if __BSD_VISIBLE
   1.152 +IMPORT_C int	inet_aton(const char *, struct in_addr *);
   1.153 +
   1.154 +#endif /* __BSD_VISIBLE */
   1.155 +__END_DECLS
   1.156 +
   1.157 +#ifndef _BYTEORDER_FUNC_DEFINED
   1.158 +#define	_BYTEORDER_FUNC_DEFINED
   1.159 +#define	htonl(x)	__htonl(x)
   1.160 +#define	htons(x)	__htons(x)
   1.161 +#define	ntohl(x)	__ntohl(x)
   1.162 +#define	ntohs(x)	__ntohs(x)
   1.163 +#endif
   1.164 +#ifdef __cplusplus
   1.165 +}
   1.166 +#endif
   1.167 +
   1.168 +#endif /* !_ARPA_INET_H_ */