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