aboutsummaryrefslogtreecommitdiff
path: root/inet/arpa/inet.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-04-02 03:09:41 +0000
committerUlrich Drepper <drepper@redhat.com>2000-04-02 03:09:41 +0000
commitad483238a1ef7bce6d8534a84ba548c455d1631e (patch)
treecb89ea9fdeba2be20d846869bcf726d9dca43f25 /inet/arpa/inet.h
parent9b48fa9b416094acd0f25a605c768f6cf3798f71 (diff)
downloadglibc-ad483238a1ef7bce6d8534a84ba548c455d1631e.zip
glibc-ad483238a1ef7bce6d8534a84ba548c455d1631e.tar.gz
glibc-ad483238a1ef7bce6d8534a84ba548c455d1631e.tar.bz2
Update.
* inet/arpa/inet.h (inet_addr): Change return type to in_addr_t. (inet_lnaof): Likewise. (inet_netof): Likewise. (inet_network): Likewise. (inet_aton): Likewise. (inet_makeaddr): Change parameter types to in_addr_t. (inet_neta): Likewise. (inet_ntop): Change type of last parameter to socklen_t. (inet_aton): Only make available if __USE_MISC. (inet_neta): Likewise. (inet_net_ntop): Likewise. (inet_net_pton): Likewise. (inet_nsap_ntoa): Likewise. * inet/in.h: Define in_port_t type. Define in_addr_t type. (struct in_addr): Use in_addr_t in definition. (IN_CLASSA): Use cast to in_addr_t. (IN_CLASSB): Likewise. (IN_CLASSC): Likewise. (IN_CLASSD): Likewise. (IN_EXPERIMENTAL): Likewise. (IN_BADCLASS): Likewise. (INADDR_ANY): Likewise. (INADDR_BROADCAST): Likewise. (INADDR_NONE): Likewise. (INADDR_LOOPBACK): Likewise. (INADDR_UNSPEC_GROUP): Likewise. (INADDR_ALLHOSTS_GROUP): Likewise. (INADDR_ALLRTRS_GROUP): Likewise. (INADDR_MAX_LOCAL_GROUP): Likewise. (struct sockaddr_in): Use in_port_t for sin_port element. (struct sockaddr_in6): Use in_port_t for sin6_port element. Use uint8_t instead of u_int8_t. * resolv/inet_addr.c (inet_addr): Change return type to in_addr_t. Call __inet_aton instead of inet_aton. (__inet_aton): Renamed from inet_aton. Add weak alias under old name. * resolv/netdb.h (gethostbyname2): Define only is __USE_MISC. (innetgr): Likewise. (struct addrinfo): Use socklen_t for ai_addrlen element. * sysdeps/unix/sysv/linux/bits/in.h (IPV6_MTU_DISCOVER, IPV6_MTU, IPV6_RECVERR): New defines.
Diffstat (limited to 'inet/arpa/inet.h')
-rw-r--r--inet/arpa/inet.h60
1 files changed, 32 insertions, 28 deletions
diff --git a/inet/arpa/inet.h b/inet/arpa/inet.h
index 7e0a40f..72a90ba 100644
--- a/inet/arpa/inet.h
+++ b/inet/arpa/inet.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,6 @@
#define _ARPA_INET_H 1
#include <features.h>
-
#include <sys/types.h>
#include <netinet/in.h> /* To define `struct in_addr'. */
@@ -28,41 +27,22 @@ __BEGIN_DECLS
/* Convert Internet host address from numbers-and-dots notation in CP
into binary data in network byte order. */
-extern u_int32_t inet_addr (__const char *__cp) __THROW;
-
-/* Convert Internet host address from numbers-and-dots notation in CP
- into binary data and store the result in the structure INP. */
-extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW;
+extern in_addr_t inet_addr (__const char *__cp) __THROW;
/* Return the local host address part of the Internet address in IN. */
-extern u_int32_t inet_lnaof (struct in_addr __in) __THROW;
+extern in_addr_t inet_lnaof (struct in_addr __in) __THROW;
/* Make Internet host address in network byte order by combining the
network number NET with the local address HOST. */
-extern struct in_addr inet_makeaddr (u_int32_t __net, u_int32_t __host) __THROW;
-
-/* Format a network number NET into presentation format and place result
- in buffer starting at BUF with length of LEN bytes. */
-extern char *inet_neta (u_int32_t __net, char *__buf, size_t __len) __THROW;
+extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host)
+ __THROW;
/* Return network number part of the Internet address IN. */
-extern u_int32_t inet_netof (struct in_addr __in) __THROW;
+extern in_addr_t inet_netof (struct in_addr __in) __THROW;
/* Extract the network number in network byte order from the address
in numbers-and-dots natation starting at CP. */
-extern u_int32_t inet_network (__const char *__cp) __THROW;
-
-/* Convert network number for interface type AF in buffer starting at
- CP to presentation format. The result will specifiy BITS bits of
- the number. */
-extern char *inet_net_ntop (int __af, __const void *__cp, int __bits,
- char *__buf, size_t __len) __THROW;
-
-/* Convert network number for interface type AF from presentation in
- buffer starting at CP to network format and store result int
- buffer starting at BUF of size LEN. */
-extern int inet_net_pton (int __af, __const char *__cp,
- void *__buf, size_t __len) __THROW;
+extern in_addr_t inet_network (__const char *__cp) __THROW;
/* Convert Internet number in IN to ASCII representation. The return value
is a pointer to an internal array containing the string. */
@@ -77,7 +57,30 @@ extern int inet_pton (int __af, __const char *__cp, void *__buf) __THROW;
type AF in buffer starting at CP to presentation form and place
result in buffer of length LEN astarting at BUF. */
extern __const char *inet_ntop (int __af, __const void *__cp,
- char *__buf, size_t __len) __THROW;
+ char *__buf, socklen_t __len) __THROW;
+
+
+/* The following functions are not part of XNS 5.2. */
+#ifdef __USE_MISC
+/* Convert Internet host address from numbers-and-dots notation in CP
+ into binary data and store the result in the structure INP. */
+extern in_addr_t inet_aton (__const char *__cp, struct in_addr *__inp) __THROW;
+
+/* Format a network number NET into presentation format and place result
+ in buffer starting at BUF with length of LEN bytes. */
+extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW;
+
+/* Convert network number for interface type AF in buffer starting at
+ CP to presentation format. The result will specifiy BITS bits of
+ the number. */
+extern char *inet_net_ntop (int __af, __const void *__cp, int __bits,
+ char *__buf, size_t __len) __THROW;
+
+/* Convert network number for interface type AF from presentation in
+ buffer starting at CP to network format and store result int
+ buffer starting at BUF of size LEN. */
+extern int inet_net_pton (int __af, __const char *__cp,
+ void *__buf, size_t __len) __THROW;
/* Convert ASCII representation in hexadecimal form of the Internet
address to binary form and place result in buffer of length LEN
@@ -89,6 +92,7 @@ extern unsigned int inet_nsap_addr (__const char *__cp,
a presentation form and place result in BUF. */
extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp,
char *__buf) __THROW;
+#endif
__END_DECLS