xref: /haiku/headers/posix/arpa/inet.h (revision 1acbe440b8dd798953bec31d18ee589aa3f71b73)
1 /*
2  * Copyright 2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 /*
7  * Copyright (c) 1983, 1993
8  *    The Regents of the University of California.  All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. All advertising materials mentioning features or use of this software
19  *    must display the following acknowledgement:
20  * 	This product includes software developed by the University of
21  * 	California, Berkeley and its contributors.
22  * 4. Neither the name of the University nor the names of its contributors
23  *    may be used to endorse or promote products derived from this software
24  *    without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36  * SUCH DAMAGE.
37  * -
38  * Portions Copyright (c) 1993 by Digital Equipment Corporation.
39  *
40  * Permission to use, copy, modify, and distribute this software for any
41  * purpose with or without fee is hereby granted, provided that the above
42  * copyright notice and this permission notice appear in all copies, and that
43  * the name of Digital Equipment Corporation not be used in advertising or
44  * publicity pertaining to distribution of the document or software without
45  * specific, written prior permission.
46  *
47  * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
48  * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
49  * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
50  * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
51  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
52  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
53  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
54  * SOFTWARE.
55  */
56 #ifndef _INET_H_
57 #define	_INET_H_
58 
59 
60 #include <netinet/in.h>
61 #include <sys/param.h>
62 #include <sys/types.h>
63 #include <sys/cdefs.h>
64 
65 
66 #define	inet_addr		__inet_addr
67 #define	inet_aton		__inet_aton
68 #define	inet_lnaof		__inet_lnaof
69 #define	inet_makeaddr	__inet_makeaddr
70 #define	inet_neta		__inet_neta
71 #define	inet_netof		__inet_netof
72 #define	inet_network	__inet_network
73 #define	inet_net_ntop	__inet_net_ntop
74 #define	inet_net_pton	__inet_net_pton
75 #define	inet_cidr_ntop	__inet_cidr_ntop
76 #define	inet_cidr_pton	__inet_cidr_pton
77 #define	inet_ntoa		__inet_ntoa
78 #define	inet_pton		__inet_pton
79 #define	inet_ntop		__inet_ntop
80 #define	inet_nsap_addr	__inet_nsap_addr
81 #define	inet_nsap_ntoa	__inet_nsap_ntoa
82 
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
86 
87 in_addr_t		inet_addr(const char *);
88 int				inet_aton(const char *, struct in_addr *);
89 unsigned long	inet_lnaof(struct in_addr);
90 struct in_addr	inet_makeaddr(u_long , u_long);
91 char			*inet_neta(u_long, char *, size_t);
92 unsigned long	inet_netof(struct in_addr);
93 unsigned long	inet_network(const char *);
94 char			*inet_net_ntop(int, const void *, int, char *, size_t);
95 int				inet_net_pton(int, const char *, void *, size_t);
96 char			*inet_cidr_ntop(int, const void *, int, char *, size_t);
97 int				inet_cidr_pton(int, const char *, void *, int *);
98 char			*inet_ntoa(struct in_addr);
99 int				inet_pton(int, const char *, void *);
100 const char		*inet_ntop(int, const void *, char *, socklen_t);
101 u_int			inet_nsap_addr(const char *, u_char *, int);
102 char			*inet_nsap_ntoa(int, const u_char *, char *);
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 #endif	/* _INET_H_ */
109