xref: /illumos-gate/usr/src/head/arpa/inet.h (revision 2a9459bd)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*2a9459bdSsangeeta  * Common Development and Distribution License (the "License").
6*2a9459bdSsangeeta  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*2a9459bdSsangeeta  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
277c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate /*
307c478bd9Sstevel@tonic-gate  * Portions of this source code were derived from Berkeley 4.3 BSD
317c478bd9Sstevel@tonic-gate  * under license from the Regents of the University of California.
327c478bd9Sstevel@tonic-gate  */
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #ifndef _ARPA_INET_H
357c478bd9Sstevel@tonic-gate #define	_ARPA_INET_H
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate #if !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__)
427c478bd9Sstevel@tonic-gate #include <sys/socket.h>
437c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */
447c478bd9Sstevel@tonic-gate 
457c478bd9Sstevel@tonic-gate #include <netinet/in.h>
467c478bd9Sstevel@tonic-gate #if defined(_XPG4_2) && !defined(__EXTENSIONS__)
477c478bd9Sstevel@tonic-gate #include <sys/byteorder.h>
487c478bd9Sstevel@tonic-gate #endif /* defined(_XPG4_2) && !defined(__EXTENSIONS__) */
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
517c478bd9Sstevel@tonic-gate extern "C" {
527c478bd9Sstevel@tonic-gate #endif
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate /*
557c478bd9Sstevel@tonic-gate  * External definitions for
567c478bd9Sstevel@tonic-gate  * functions in inet(3N)
577c478bd9Sstevel@tonic-gate  */
587c478bd9Sstevel@tonic-gate #ifdef __STDC__
597c478bd9Sstevel@tonic-gate #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
607c478bd9Sstevel@tonic-gate extern int inet_net_pton(int, const char *, void *, size_t);
617c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate #if !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__)
647c478bd9Sstevel@tonic-gate extern int inet_pton(int, const char *_RESTRICT_KYWD, void *_RESTRICT_KYWD);
657c478bd9Sstevel@tonic-gate extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,
667c478bd9Sstevel@tonic-gate 			char *_RESTRICT_KYWD, socklen_t);
677c478bd9Sstevel@tonic-gate #endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate extern in_addr_t inet_addr(const char *);
70*2a9459bdSsangeeta /*
71*2a9459bdSsangeeta  * With the introduction of CIDR the
72*2a9459bdSsangeeta  * following 4 routines are now considered to be Obsolete
73*2a9459bdSsangeeta  */
747c478bd9Sstevel@tonic-gate extern in_addr_t inet_lnaof(struct in_addr);
757c478bd9Sstevel@tonic-gate extern struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
767c478bd9Sstevel@tonic-gate extern in_addr_t inet_netof(struct in_addr);
777c478bd9Sstevel@tonic-gate extern in_addr_t inet_network(const char *);
78*2a9459bdSsangeeta 
797c478bd9Sstevel@tonic-gate extern char *inet_ntoa(struct in_addr);
807c478bd9Sstevel@tonic-gate extern int inet_aton(const char *, struct in_addr *);
817c478bd9Sstevel@tonic-gate #else
827c478bd9Sstevel@tonic-gate unsigned long inet_addr();
837c478bd9Sstevel@tonic-gate char	*inet_ntoa();
84*2a9459bdSsangeeta /*
85*2a9459bdSsangeeta  * With the introduction of CIDR the
86*2a9459bdSsangeeta  * following 4 routines are now considered to be Obsolete
87*2a9459bdSsangeeta  */
887c478bd9Sstevel@tonic-gate struct	in_addr inet_makeaddr();
897c478bd9Sstevel@tonic-gate unsigned long inet_network();
907c478bd9Sstevel@tonic-gate extern unsigned long inet_lnaof();
917c478bd9Sstevel@tonic-gate extern unsigned long inet_netof();
92*2a9459bdSsangeeta 
937c478bd9Sstevel@tonic-gate extern int inet_pton();
947c478bd9Sstevel@tonic-gate extern const char *inet_ntop();
957c478bd9Sstevel@tonic-gate extern int inet_aton();
967c478bd9Sstevel@tonic-gate #endif
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
997c478bd9Sstevel@tonic-gate }
1007c478bd9Sstevel@tonic-gate #endif
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate #endif	/* _ARPA_INET_H */
103