sl@0: /* sl@0: * Copyright (c) 1983, 1993 sl@0: * The Regents of the University of California. All rights reserved. sl@0: * sl@0: * Redistribution and use in source and binary forms, with or without sl@0: * modification, are permitted provided that the following conditions sl@0: * are met: sl@0: * 1. Redistributions of source code must retain the above copyright sl@0: * notice, this list of conditions and the following disclaimer. sl@0: * 2. Redistributions in binary form must reproduce the above copyright sl@0: * notice, this list of conditions and the following disclaimer in the sl@0: * documentation and/or other materials provided with the distribution. sl@0: * 4. Neither the name of the University nor the names of its contributors sl@0: * may be used to endorse or promote products derived from this software sl@0: * without specific prior written permission. sl@0: * sl@0: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND sl@0: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE sl@0: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE sl@0: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE sl@0: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL sl@0: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS sl@0: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) sl@0: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT sl@0: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY sl@0: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF sl@0: * SUCH DAMAGE. sl@0: * - sl@0: * Portions Copyright (c) 1993 by Digital Equipment Corporation. sl@0: * Permission to use, copy, modify, and distribute this software for any sl@0: * purpose with or without fee is hereby granted, provided that the above sl@0: * copyright notice and this permission notice appear in all copies, and that sl@0: * the name of Digital Equipment Corporation not be used in advertising or sl@0: * publicity pertaining to distribution of the document or software without sl@0: * specific, written prior permission. sl@0: * sl@0: * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL sl@0: * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES sl@0: * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT sl@0: * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL sl@0: * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR sl@0: * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS sl@0: * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS sl@0: * SOFTWARE. sl@0: * sl@0: * Portions Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. sl@0: * @(#)inet.h 8.1 (Berkeley) 6/2/93 sl@0: * From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $ sl@0: * $FreeBSD: src/include/arpa/inet.h,v 1.25 2002/08/21 16:19:56 mike Exp $ sl@0: */ sl@0: sl@0: #ifndef _ARPA_INET_H_ sl@0: #define _ARPA_INET_H_ sl@0: sl@0: /* External definitions for functions in inet(3), addr2ascii(3) */ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /* Required for byteorder(3) functions. */ sl@0: #include sl@0: sl@0: #ifdef __cplusplus sl@0: extern "C" { sl@0: #endif sl@0: #define INET_ADDRSTRLEN 16 sl@0: #define INET6_ADDRSTRLEN 46 sl@0: sl@0: #ifndef _UINT16_T_DECLARED sl@0: typedef __uint16_t uint16_t; sl@0: #define _UINT16_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _UINT32_T_DECLARED sl@0: typedef __uint32_t uint32_t; sl@0: #define _UINT32_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _IN_ADDR_T_DECLARED sl@0: typedef uint32_t in_addr_t; sl@0: #define _IN_ADDR_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _IN_PORT_T_DECLARED sl@0: typedef uint16_t in_port_t; sl@0: #define _IN_PORT_T_DECLARED sl@0: #endif sl@0: sl@0: #if __BSD_VISIBLE sl@0: #ifndef _SIZE_T_DECLARED sl@0: typedef __size_t size_t; sl@0: #define _SIZE_T_DECLARED sl@0: #endif sl@0: #endif sl@0: sl@0: /* sl@0: * XXX socklen_t is used by a POSIX.1-2001 interface, but not required by sl@0: * POSIX.1-2001. sl@0: */ sl@0: #ifndef _SOCKLEN_T_DECLARED sl@0: typedef __socklen_t socklen_t; sl@0: #define _SOCKLEN_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _STRUCT_IN_ADDR_DECLARED sl@0: struct in_addr { sl@0: in_addr_t s_addr; sl@0: }; sl@0: #define _STRUCT_IN_ADDR_DECLARED sl@0: #endif sl@0: #ifndef __DOXYGEN__ sl@0: /* XXX all new diversions!! argh!! */ sl@0: #if __BSD_VISIBLE sl@0: #define inet_addr __inet_addr sl@0: #define inet_aton __inet_aton sl@0: #define inet_lnaof __inet_lnaof sl@0: #define inet_makeaddr __inet_makeaddr sl@0: #define inet_neta __inet_neta sl@0: #define inet_netof __inet_netof sl@0: #define inet_network __inet_network sl@0: #define inet_net_ntop __inet_net_ntop sl@0: #define inet_net_pton __inet_net_pton sl@0: #define inet_ntoa __inet_ntoa sl@0: #define inet_pton __inet_pton sl@0: #define inet_ntop __inet_ntop sl@0: #define inet_nsap_addr __inet_nsap_addr sl@0: #define inet_nsap_ntoa __inet_nsap_ntoa sl@0: #endif /* __BSD_VISIBLE */ sl@0: #endif //__DOXYGEN__ sl@0: sl@0: __BEGIN_DECLS sl@0: #if !defined (_BYTEORDER_PROTOTYPED) ||defined(__SYMBIAN32__) sl@0: #define _BYTEORDER_PROTOTYPED sl@0: IMPORT_C uint32_t htonl(uint32_t); sl@0: IMPORT_C uint16_t htons(uint16_t); sl@0: #ifdef __SYMBIAN32__ sl@0: #define ntohl htonl sl@0: #define ntohs htons sl@0: #endif sl@0: #endif sl@0: sl@0: IMPORT_C in_addr_t inet_addr(const char *); sl@0: IMPORT_C char *inet_ntoa(struct in_addr); sl@0: IMPORT_C const char *inet_ntop(int, const void * __restrict, char * __restrict, sl@0: socklen_t); sl@0: IMPORT_C int inet_pton(int, const char * __restrict, void * __restrict); sl@0: sl@0: #if __BSD_VISIBLE sl@0: IMPORT_C int inet_aton(const char *, struct in_addr *); sl@0: sl@0: #endif /* __BSD_VISIBLE */ sl@0: __END_DECLS sl@0: sl@0: #ifndef _BYTEORDER_FUNC_DEFINED sl@0: #define _BYTEORDER_FUNC_DEFINED sl@0: #define htonl(x) __htonl(x) sl@0: #define htons(x) __htons(x) sl@0: #define ntohl(x) __ntohl(x) sl@0: #define ntohs(x) __ntohs(x) sl@0: #endif sl@0: #ifdef __cplusplus sl@0: } sl@0: #endif sl@0: sl@0: #endif /* !_ARPA_INET_H_ */