inet.h revision 03b59f7842b50eda32f941744a5d94a55e47ba26
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt/*
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * CDDL HEADER START
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt *
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * The contents of this file are subject to the terms of the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Common Development and Distribution License (the "License").
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * You may not use this file except in compliance with the License.
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt *
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * or http://www.opensolaris.org/os/licensing.
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * See the License for the specific language governing permissions
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * and limitations under the License.
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont *
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * When distributing Covered Code, include this CDDL HEADER in each
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * If applicable, add the following below this CDDL HEADER, with the
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * fields enclosed by brackets "[]" replaced with your own identifying
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * information: Portions Copyright [yyyy] [name of copyright owner]
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont *
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * CDDL HEADER END
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont *
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * Copyright 2014 Garrett D'Amore <garrett@damore.org>
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont *
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * Use is subject to license terms.
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont *
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont */
50f64cf0e58073f61bea3e1e4a9ad258bca80961Francis Dupont
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
* under license from the Regents of the University of California.
*/
#ifndef _ARPA_INET_H
#define _ARPA_INET_H
#include <sys/feature_tests.h>
#if !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__)
#include <sys/socket.h>
#endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */
#include <netinet/in.h>
#if defined(_XPG4_2) && !defined(__EXTENSIONS__)
#include <sys/byteorder.h>
#endif /* defined(_XPG4_2) && !defined(__EXTENSIONS__) */
#ifdef __cplusplus
extern "C" {
#endif
/*
* External definitions for
* functions in inet(3N)
*/
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
extern int inet_net_pton(int, const char *, void *, size_t);
extern int inet_matchaddr(const void *, const char *);
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
#if !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__)
extern int inet_pton(int, const char *_RESTRICT_KYWD, void *_RESTRICT_KYWD);
extern const char *inet_ntop(int, const void *_RESTRICT_KYWD,
char *_RESTRICT_KYWD, socklen_t);
#endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */
extern in_addr_t inet_addr(const char *);
/*
* With the introduction of CIDR the
* following 4 routines are now considered to be Obsolete
*/
extern in_addr_t inet_lnaof(struct in_addr);
extern struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
extern in_addr_t inet_netof(struct in_addr);
extern in_addr_t inet_network(const char *);
extern char *inet_neta(ulong_t, char *, size_t);
extern char *inet_net_ntop(int, const void *, int, char *, size_t);
extern char *inet_cidr_ntop(int, const void *, int, char *, size_t);
extern int inet_cidr_pton(int, const char *, void *, int *);
extern char *inet_ntoa(struct in_addr);
extern int inet_aton(const char *, struct in_addr *);
extern uint_t inet_nsap_addr(const char *, uchar_t *, int);
extern char *inet_nsap_ntoa(int, const uchar_t *, char *);
#ifdef __cplusplus
}
#endif
#endif /* _ARPA_INET_H */