Blame inet/arpa/inet.h

Packit 6c4009
/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _ARPA_INET_H
Packit 6c4009
#define	_ARPA_INET_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
#include <netinet/in.h>		/* To define `struct in_addr'.  */
Packit 6c4009
Packit 6c4009
/* Type for length arguments in socket calls.  */
Packit 6c4009
#ifndef __socklen_t_defined
Packit 6c4009
typedef __socklen_t socklen_t;
Packit 6c4009
# define __socklen_t_defined
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* Convert Internet host address from numbers-and-dots notation in CP
Packit 6c4009
   into binary data in network byte order.  */
Packit 6c4009
extern in_addr_t inet_addr (const char *__cp) __THROW;
Packit 6c4009
Packit 6c4009
/* Return the local host address part of the Internet address in IN.  */
Packit 6c4009
extern in_addr_t inet_lnaof (struct in_addr __in) __THROW;
Packit 6c4009
Packit 6c4009
/* Make Internet host address in network byte order by combining the
Packit 6c4009
   network number NET with the local address HOST.  */
Packit 6c4009
extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host)
Packit 6c4009
     __THROW;
Packit 6c4009
Packit 6c4009
/* Return network number part of the Internet address IN.  */
Packit 6c4009
extern in_addr_t inet_netof (struct in_addr __in) __THROW;
Packit 6c4009
Packit 6c4009
/* Extract the network number in network byte order from the address
Packit 6c4009
   in numbers-and-dots natation starting at CP.  */
Packit 6c4009
extern in_addr_t inet_network (const char *__cp) __THROW;
Packit 6c4009
Packit 6c4009
/* Convert Internet number in IN to ASCII representation.  The return value
Packit 6c4009
   is a pointer to an internal array containing the string.  */
Packit 6c4009
extern char *inet_ntoa (struct in_addr __in) __THROW;
Packit 6c4009
Packit 6c4009
/* Convert from presentation format of an Internet number in buffer
Packit 6c4009
   starting at CP to the binary network format and store result for
Packit 6c4009
   interface type AF in buffer starting at BUF.  */
Packit 6c4009
extern int inet_pton (int __af, const char *__restrict __cp,
Packit 6c4009
		      void *__restrict __buf) __THROW;
Packit 6c4009
Packit 6c4009
/* Convert a Internet address in binary network format for interface
Packit 6c4009
   type AF in buffer starting at CP to presentation form and place
Packit 6c4009
   result in buffer of length LEN astarting at BUF.  */
Packit 6c4009
extern const char *inet_ntop (int __af, const void *__restrict __cp,
Packit 6c4009
			      char *__restrict __buf, socklen_t __len)
Packit 6c4009
     __THROW;
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* The following functions are not part of XNS 5.2.  */
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
/* Convert Internet host address from numbers-and-dots notation in CP
Packit 6c4009
   into binary data and store the result in the structure INP.  */
Packit 6c4009
extern int inet_aton (const char *__cp, struct in_addr *__inp) __THROW;
Packit 6c4009
Packit 6c4009
/* Format a network number NET into presentation format and place result
Packit 6c4009
   in buffer starting at BUF with length of LEN bytes.  */
Packit 6c4009
extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW;
Packit 6c4009
Packit 6c4009
/* Convert network number for interface type AF in buffer starting at
Packit 6c4009
   CP to presentation format.  The result will specifiy BITS bits of
Packit 6c4009
   the number.  */
Packit 6c4009
extern char *inet_net_ntop (int __af, const void *__cp, int __bits,
Packit 6c4009
			    char *__buf, size_t __len) __THROW;
Packit 6c4009
Packit 6c4009
/* Convert network number for interface type AF from presentation in
Packit 6c4009
   buffer starting at CP to network format and store result int
Packit 6c4009
   buffer starting at BUF of size LEN.  */
Packit 6c4009
extern int inet_net_pton (int __af, const char *__cp,
Packit 6c4009
			  void *__buf, size_t __len) __THROW;
Packit 6c4009
Packit 6c4009
/* Convert ASCII representation in hexadecimal form of the Internet
Packit 6c4009
   address to binary form and place result in buffer of length LEN
Packit 6c4009
   starting at BUF.  */
Packit 6c4009
extern unsigned int inet_nsap_addr (const char *__cp,
Packit 6c4009
				    unsigned char *__buf, int __len) __THROW;
Packit 6c4009
Packit 6c4009
/* Convert internet address in binary form in LEN bytes starting at CP
Packit 6c4009
   a presentation form and place result in BUF.  */
Packit 6c4009
extern char *inet_nsap_ntoa (int __len, const unsigned char *__cp,
Packit 6c4009
			     char *__buf) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* arpa/inet.h */