os/ossrv/genericopenlibs/openenvcore/include/arpa/inet.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
 * Copyright (c) 1983, 1993
sl@0
     3
 *	The Regents of the University of California.  All rights reserved.
sl@0
     4
 *
sl@0
     5
 * Redistribution and use in source and binary forms, with or without
sl@0
     6
 * modification, are permitted provided that the following conditions
sl@0
     7
 * are met:
sl@0
     8
 * 1. Redistributions of source code must retain the above copyright
sl@0
     9
 *    notice, this list of conditions and the following disclaimer.
sl@0
    10
 * 2. Redistributions in binary form must reproduce the above copyright
sl@0
    11
 *    notice, this list of conditions and the following disclaimer in the
sl@0
    12
 *    documentation and/or other materials provided with the distribution.
sl@0
    13
 * 4. Neither the name of the University nor the names of its contributors
sl@0
    14
 *    may be used to endorse or promote products derived from this software
sl@0
    15
 *    without specific prior written permission.
sl@0
    16
 *
sl@0
    17
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
sl@0
    18
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
sl@0
    19
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
sl@0
    20
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
sl@0
    21
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
sl@0
    22
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
sl@0
    23
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
sl@0
    24
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
sl@0
    25
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
sl@0
    26
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
sl@0
    27
 * SUCH DAMAGE.
sl@0
    28
 * -
sl@0
    29
 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
sl@0
    30
 * Permission to use, copy, modify, and distribute this software for any
sl@0
    31
 * purpose with or without fee is hereby granted, provided that the above
sl@0
    32
 * copyright notice and this permission notice appear in all copies, and that
sl@0
    33
 * the name of Digital Equipment Corporation not be used in advertising or
sl@0
    34
 * publicity pertaining to distribution of the document or software without
sl@0
    35
 * specific, written prior permission.
sl@0
    36
 * 
sl@0
    37
 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
sl@0
    38
 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
sl@0
    39
 * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
sl@0
    40
 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
sl@0
    41
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
sl@0
    42
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
sl@0
    43
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
sl@0
    44
 * SOFTWARE.
sl@0
    45
 * 
sl@0
    46
 * Portions Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
sl@0
    47
 *	@(#)inet.h	8.1 (Berkeley) 6/2/93
sl@0
    48
 *	From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
sl@0
    49
 * $FreeBSD: src/include/arpa/inet.h,v 1.25 2002/08/21 16:19:56 mike Exp $
sl@0
    50
 */
sl@0
    51
sl@0
    52
#ifndef _ARPA_INET_H_
sl@0
    53
#define	_ARPA_INET_H_
sl@0
    54
sl@0
    55
/* External definitions for functions in inet(3), addr2ascii(3) */
sl@0
    56
sl@0
    57
#include <sys/cdefs.h>
sl@0
    58
#include <sys/_types.h>
sl@0
    59
sl@0
    60
/* Required for byteorder(3) functions. */
sl@0
    61
#include <stdapis/machine/endian.h>
sl@0
    62
sl@0
    63
#ifdef __cplusplus
sl@0
    64
extern "C" {
sl@0
    65
#endif
sl@0
    66
#define	INET_ADDRSTRLEN		16
sl@0
    67
#define	INET6_ADDRSTRLEN	46
sl@0
    68
sl@0
    69
#ifndef _UINT16_T_DECLARED
sl@0
    70
typedef	__uint16_t	uint16_t;
sl@0
    71
#define	_UINT16_T_DECLARED
sl@0
    72
#endif
sl@0
    73
sl@0
    74
#ifndef _UINT32_T_DECLARED
sl@0
    75
typedef	__uint32_t	uint32_t;
sl@0
    76
#define	_UINT32_T_DECLARED
sl@0
    77
#endif
sl@0
    78
sl@0
    79
#ifndef _IN_ADDR_T_DECLARED
sl@0
    80
typedef	uint32_t	in_addr_t;
sl@0
    81
#define	_IN_ADDR_T_DECLARED
sl@0
    82
#endif
sl@0
    83
sl@0
    84
#ifndef _IN_PORT_T_DECLARED
sl@0
    85
typedef	uint16_t	in_port_t;
sl@0
    86
#define	_IN_PORT_T_DECLARED
sl@0
    87
#endif
sl@0
    88
sl@0
    89
#if __BSD_VISIBLE
sl@0
    90
#ifndef _SIZE_T_DECLARED
sl@0
    91
typedef	__size_t	size_t;
sl@0
    92
#define	_SIZE_T_DECLARED
sl@0
    93
#endif
sl@0
    94
#endif
sl@0
    95
sl@0
    96
/*
sl@0
    97
 * XXX socklen_t is used by a POSIX.1-2001 interface, but not required by
sl@0
    98
 * POSIX.1-2001.
sl@0
    99
 */
sl@0
   100
#ifndef _SOCKLEN_T_DECLARED
sl@0
   101
typedef	__socklen_t	socklen_t;
sl@0
   102
#define	_SOCKLEN_T_DECLARED
sl@0
   103
#endif
sl@0
   104
sl@0
   105
#ifndef _STRUCT_IN_ADDR_DECLARED
sl@0
   106
struct in_addr {
sl@0
   107
	in_addr_t s_addr;
sl@0
   108
};
sl@0
   109
#define	_STRUCT_IN_ADDR_DECLARED
sl@0
   110
#endif
sl@0
   111
#ifndef __DOXYGEN__
sl@0
   112
/* XXX all new diversions!! argh!! */
sl@0
   113
#if __BSD_VISIBLE
sl@0
   114
#define	inet_addr	__inet_addr
sl@0
   115
#define	inet_aton	__inet_aton
sl@0
   116
#define	inet_lnaof	__inet_lnaof
sl@0
   117
#define	inet_makeaddr	__inet_makeaddr
sl@0
   118
#define	inet_neta	__inet_neta
sl@0
   119
#define	inet_netof	__inet_netof
sl@0
   120
#define	inet_network	__inet_network
sl@0
   121
#define	inet_net_ntop	__inet_net_ntop
sl@0
   122
#define	inet_net_pton	__inet_net_pton
sl@0
   123
#define	inet_ntoa	__inet_ntoa
sl@0
   124
#define	inet_pton	__inet_pton
sl@0
   125
#define	inet_ntop	__inet_ntop
sl@0
   126
#define	inet_nsap_addr	__inet_nsap_addr
sl@0
   127
#define	inet_nsap_ntoa	__inet_nsap_ntoa
sl@0
   128
#endif /* __BSD_VISIBLE */
sl@0
   129
#endif //__DOXYGEN__
sl@0
   130
sl@0
   131
__BEGIN_DECLS
sl@0
   132
#if  !defined (_BYTEORDER_PROTOTYPED) ||defined(__SYMBIAN32__)
sl@0
   133
#define	_BYTEORDER_PROTOTYPED
sl@0
   134
IMPORT_C uint32_t	        htonl(uint32_t);
sl@0
   135
IMPORT_C uint16_t	 htons(uint16_t);
sl@0
   136
#ifdef __SYMBIAN32__
sl@0
   137
#define ntohl htonl
sl@0
   138
#define ntohs htons
sl@0
   139
#endif
sl@0
   140
#endif
sl@0
   141
sl@0
   142
IMPORT_C in_addr_t	 inet_addr(const char *);
sl@0
   143
IMPORT_C char		*inet_ntoa(struct in_addr);
sl@0
   144
IMPORT_C const char	*inet_ntop(int, const void * __restrict, char * __restrict,
sl@0
   145
		    socklen_t);
sl@0
   146
IMPORT_C int inet_pton(int, const char * __restrict, void * __restrict);
sl@0
   147
sl@0
   148
#if __BSD_VISIBLE
sl@0
   149
IMPORT_C int	inet_aton(const char *, struct in_addr *);
sl@0
   150
sl@0
   151
#endif /* __BSD_VISIBLE */
sl@0
   152
__END_DECLS
sl@0
   153
sl@0
   154
#ifndef _BYTEORDER_FUNC_DEFINED
sl@0
   155
#define	_BYTEORDER_FUNC_DEFINED
sl@0
   156
#define	htonl(x)	__htonl(x)
sl@0
   157
#define	htons(x)	__htons(x)
sl@0
   158
#define	ntohl(x)	__ntohl(x)
sl@0
   159
#define	ntohs(x)	__ntohs(x)
sl@0
   160
#endif
sl@0
   161
#ifdef __cplusplus
sl@0
   162
}
sl@0
   163
#endif
sl@0
   164
sl@0
   165
#endif /* !_ARPA_INET_H_ */