• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/arm-brcm-linux-uclibcgnueabi/sysroot/usr/include/arpa/
1/* Copyright (C) 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
2   This file is part of the GNU C Library.
3
4   The GNU C Library is free software; you can redistribute it and/or
5   modify it under the terms of the GNU Lesser General Public
6   License as published by the Free Software Foundation; either
7   version 2.1 of the License, or (at your option) any later version.
8
9   The GNU C Library is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12   Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public
15   License along with the GNU C Library; if not, write to the Free
16   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17   02111-1307 USA.  */
18
19#ifndef _ARPA_INET_H
20#define	_ARPA_INET_H	1
21
22#include <features.h>
23#include <netinet/in.h>		/* To define `struct in_addr'.  */
24
25/* Type for length arguments in socket calls.  */
26#ifndef __socklen_t_defined
27typedef __socklen_t socklen_t;
28# define __socklen_t_defined
29#endif
30
31__BEGIN_DECLS
32
33/* Convert Internet host address from numbers-and-dots notation in CP
34   into binary data in network byte order.  */
35extern in_addr_t inet_addr (__const char *__cp) __THROW;
36
37/* Return the local host address part of the Internet address in IN.  */
38extern in_addr_t inet_lnaof (struct in_addr __in) __THROW;
39
40/* Make Internet host address in network byte order by combining the
41   network number NET with the local address HOST.  */
42extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host)
43     __THROW;
44
45/* Return network number part of the Internet address IN.  */
46extern in_addr_t inet_netof (struct in_addr __in) __THROW;
47
48/* Extract the network number in network byte order from the address
49   in numbers-and-dots natation starting at CP.  */
50extern in_addr_t inet_network (__const char *__cp) __THROW;
51
52/* Convert Internet number in IN to ASCII representation.  The return value
53   is a pointer to an internal array containing the string.  */
54extern char *inet_ntoa (struct in_addr __in) __THROW;
55#ifdef __UCLIBC__
56/* Recursion-safe flavor */
57extern char *inet_ntoa_r (struct in_addr __in, char *__buf) __THROW;
58#endif
59
60/* Convert from presentation format of an Internet number in buffer
61   starting at CP to the binary network format and store result for
62   interface type AF in buffer starting at BUF.  */
63extern int inet_pton (int __af, __const char *__restrict __cp,
64		      void *__restrict __buf) __THROW;
65
66/* Convert a Internet address in binary network format for interface
67   type AF in buffer starting at CP to presentation form and place
68   result in buffer of length LEN astarting at BUF.  */
69extern __const char *inet_ntop (int __af, __const void *__restrict __cp,
70				char *__restrict __buf, socklen_t __len)
71     __THROW;
72
73
74/* The following functions are not part of XNS 5.2.  */
75#ifdef __USE_MISC
76/* Convert Internet host address from numbers-and-dots notation in CP
77   into binary data and store the result in the structure INP.  */
78extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW;
79
80#if 0
81/* Format a network number NET into presentation format and place result
82   in buffer starting at BUF with length of LEN bytes.  */
83extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW;
84
85/* Convert network number for interface type AF in buffer starting at
86   CP to presentation format.  The result will specifiy BITS bits of
87   the number.  */
88extern char *inet_net_ntop (int __af, __const void *__cp, int __bits,
89			    char *__buf, size_t __len) __THROW;
90
91/* Convert network number for interface type AF from presentation in
92   buffer starting at CP to network format and store result int
93   buffer starting at BUF of size LEN.  */
94extern int inet_net_pton (int __af, __const char *__cp,
95			  void *__buf, size_t __len) __THROW;
96
97/* Convert ASCII representation in hexadecimal form of the Internet
98   address to binary form and place result in buffer of length LEN
99   starting at BUF.  */
100extern unsigned int inet_nsap_addr (__const char *__cp,
101				    unsigned char *__buf, int __len) __THROW;
102
103/* Convert internet address in binary form in LEN bytes starting at CP
104   a presentation form and place result in BUF.  */
105extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp,
106			     char *__buf) __THROW;
107#endif
108#endif
109
110__END_DECLS
111
112#endif /* arpa/inet.h */
113