xref: /freebsd/include/arpa/inet.h (revision 0160f9c06507054e4c88985352b44693dbff4c71)
159deaec5SRodney W. Grimes /*
259deaec5SRodney W. Grimes  * Copyright (c) 1983, 1993
359deaec5SRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
459deaec5SRodney W. Grimes  *
559deaec5SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
659deaec5SRodney W. Grimes  * modification, are permitted provided that the following conditions
759deaec5SRodney W. Grimes  * are met:
859deaec5SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
959deaec5SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
1059deaec5SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
1159deaec5SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
1259deaec5SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
1359deaec5SRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
1459deaec5SRodney W. Grimes  *    must display the following acknowledgement:
1559deaec5SRodney W. Grimes  *	This product includes software developed by the University of
1659deaec5SRodney W. Grimes  *	California, Berkeley and its contributors.
1759deaec5SRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
1859deaec5SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
1959deaec5SRodney W. Grimes  *    without specific prior written permission.
2059deaec5SRodney W. Grimes  *
2159deaec5SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2259deaec5SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2359deaec5SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2459deaec5SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2559deaec5SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2659deaec5SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2759deaec5SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2859deaec5SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2959deaec5SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3059deaec5SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3159deaec5SRodney W. Grimes  * SUCH DAMAGE.
32f3f42e96SPeter Wemm  * -
33f3f42e96SPeter Wemm  * Portions Copyright (c) 1993 by Digital Equipment Corporation.
34f3f42e96SPeter Wemm  *
35f3f42e96SPeter Wemm  * Permission to use, copy, modify, and distribute this software for any
36f3f42e96SPeter Wemm  * purpose with or without fee is hereby granted, provided that the above
37f3f42e96SPeter Wemm  * copyright notice and this permission notice appear in all copies, and that
38f3f42e96SPeter Wemm  * the name of Digital Equipment Corporation not be used in advertising or
39f3f42e96SPeter Wemm  * publicity pertaining to distribution of the document or software without
40f3f42e96SPeter Wemm  * specific, written prior permission.
41f3f42e96SPeter Wemm  *
42f3f42e96SPeter Wemm  * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
43f3f42e96SPeter Wemm  * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
44f3f42e96SPeter Wemm  * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
45f3f42e96SPeter Wemm  * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
46f3f42e96SPeter Wemm  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
47f3f42e96SPeter Wemm  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
48f3f42e96SPeter Wemm  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
49f3f42e96SPeter Wemm  * SOFTWARE.
500160f9c0SPeter Wemm  */
510160f9c0SPeter Wemm 
520160f9c0SPeter Wemm /*
5359deaec5SRodney W. Grimes  *	@(#)inet.h	8.1 (Berkeley) 6/2/93
540160f9c0SPeter Wemm  *	From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
550160f9c0SPeter Wemm  *	$Id: inet.h,v 1.9 1997/05/07 20:00:19 eivind Exp $
5659deaec5SRodney W. Grimes  */
5759deaec5SRodney W. Grimes 
58385e380aSPaul Richards #ifndef _ARPA_INET_H_
59385e380aSPaul Richards #define	_ARPA_INET_H_
6059deaec5SRodney W. Grimes 
61ffd1512dSGarrett Wollman /* External definitions for functions in inet(3), addr2ascii(3) */
6259deaec5SRodney W. Grimes 
63f3f42e96SPeter Wemm #include <sys/types.h>
6459deaec5SRodney W. Grimes #include <sys/cdefs.h>
6559deaec5SRodney W. Grimes 
66f756433eSEivind Eklund struct in_addr;
67ffd1512dSGarrett Wollman 
680160f9c0SPeter Wemm /* XXX all new diversions!! argh!! */
690160f9c0SPeter Wemm #define	inet_addr	__inet_addr
700160f9c0SPeter Wemm #define	inet_aton	__inet_aton
710160f9c0SPeter Wemm #define	inet_lnaof	__inet_lnaof
720160f9c0SPeter Wemm #define	inet_makeaddr	__inet_makeaddr
730160f9c0SPeter Wemm #define	inet_neta	__inet_neta
740160f9c0SPeter Wemm #define	inet_netof	__inet_netof
750160f9c0SPeter Wemm #define	inet_network	__inet_network
760160f9c0SPeter Wemm #define	inet_net_ntop	__inet_net_ntop
770160f9c0SPeter Wemm #define	inet_net_pton	__inet_net_pton
780160f9c0SPeter Wemm #define	inet_ntoa	__inet_ntoa
790160f9c0SPeter Wemm #define	inet_pton	__inet_pton
800160f9c0SPeter Wemm #define	inet_ntop	__inet_ntop
810160f9c0SPeter Wemm #define	inet_nsap_addr	__inet_nsap_addr
820160f9c0SPeter Wemm #define	inet_nsap_ntoa	__inet_nsap_ntoa
830160f9c0SPeter Wemm 
8459deaec5SRodney W. Grimes __BEGIN_DECLS
85ffd1512dSGarrett Wollman int		 ascii2addr __P((int, const char *, void *));
86ffd1512dSGarrett Wollman char		*addr2ascii __P((int, const void *, int, char *));
8759deaec5SRodney W. Grimes unsigned long	 inet_addr __P((const char *));
8859deaec5SRodney W. Grimes int		 inet_aton __P((const char *, struct in_addr *));
8959deaec5SRodney W. Grimes unsigned long	 inet_lnaof __P((struct in_addr));
9059deaec5SRodney W. Grimes struct in_addr	 inet_makeaddr __P((u_long , u_long));
91f3f42e96SPeter Wemm char *		 inet_neta __P((u_long, char *, size_t));
9259deaec5SRodney W. Grimes unsigned long	 inet_netof __P((struct in_addr));
9359deaec5SRodney W. Grimes unsigned long	 inet_network __P((const char *));
94f3f42e96SPeter Wemm char		*inet_net_ntop __P((int, const void *, int, char *, size_t));
95f3f42e96SPeter Wemm int		 inet_net_pton __P((int, const char *, void *, size_t));
9659deaec5SRodney W. Grimes char		*inet_ntoa __P((struct in_addr));
97f3f42e96SPeter Wemm int              inet_pton __P((int, const char *, void *));
98f3f42e96SPeter Wemm const char	*inet_ntop __P((int, const void *, char *, size_t));
99f3f42e96SPeter Wemm u_int		 inet_nsap_addr __P((const char *, u_char *, int));
100f3f42e96SPeter Wemm char		*inet_nsap_ntoa __P((int, const u_char *, char *));
10159deaec5SRodney W. Grimes __END_DECLS
10259deaec5SRodney W. Grimes 
10359deaec5SRodney W. Grimes #endif /* !_INET_H_ */
104