summaryrefslogtreecommitdiffstats
path: root/libc/include
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-14 01:09:00 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-14 01:09:01 +0000
commit17f8ef87b565d88c3b391d6d8de8818dec74c4d5 (patch)
treed8528e08179577e13de883c023b5139000d1ab05 /libc/include
parent5772237588a606cad2c7a26d24e9de3c0a62ce81 (diff)
parent6a41b0fb0e589c4afc4ecbcf7c425f0aa40eaea4 (diff)
downloadbionic-17f8ef87b565d88c3b391d6d8de8818dec74c4d5.zip
bionic-17f8ef87b565d88c3b391d6d8de8818dec74c4d5.tar.gz
bionic-17f8ef87b565d88c3b391d6d8de8818dec74c4d5.tar.bz2
Merge "Flesh out <arpa/inet.h>."
Diffstat (limited to 'libc/include')
-rw-r--r--libc/include/arpa/inet.h23
-rw-r--r--libc/include/sys/endian.h14
2 files changed, 22 insertions, 15 deletions
diff --git a/libc/include/arpa/inet.h b/libc/include/arpa/inet.h
index b008812..067be1f 100644
--- a/libc/include/arpa/inet.h
+++ b/libc/include/arpa/inet.h
@@ -36,19 +36,18 @@ __BEGIN_DECLS
typedef uint32_t in_addr_t;
-extern uint32_t inet_addr(const char *);
-
-extern int inet_aton(const char *, struct in_addr *);
-extern char* inet_ntoa(struct in_addr);
-
-extern int inet_pton(int, const char *, void *);
-extern const char* inet_ntop(int, const void *, char *, socklen_t);
-
-extern unsigned int inet_nsap_addr(const char *, unsigned char *, int);
-extern char* inet_nsap_ntoa(int, const unsigned char *, char *);
+in_addr_t inet_addr(const char*);
+int inet_aton(const char*, struct in_addr*);
+in_addr_t inet_lnaof(struct in_addr);
+struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
+in_addr_t inet_netof(struct in_addr);
+in_addr_t inet_network(const char*);
+char* inet_ntoa(struct in_addr);
+const char* inet_ntop(int, const void*, char*, socklen_t);
+unsigned int inet_nsap_addr(const char*, unsigned char*, int);
+char* inet_nsap_ntoa(int, const unsigned char*, char*);
+int inet_pton(int, const char*, void*);
__END_DECLS
#endif /* _ARPA_INET_H_ */
-
-
diff --git a/libc/include/sys/endian.h b/libc/include/sys/endian.h
index cbde121..1186540 100644
--- a/libc/include/sys/endian.h
+++ b/libc/include/sys/endian.h
@@ -186,14 +186,22 @@
#define letoh64(x) (x)
#endif /* __BSD_VISIBLE */
-#define htons(x) __swap16(x)
+/* glibc compatibility. */
+__BEGIN_DECLS
+uint32_t htonl(uint32_t) __pure2;
+uint16_t htons(uint16_t) __pure2;
+uint32_t ntohl(uint32_t) __pure2;
+uint16_t ntohs(uint16_t) __pure2;
+__END_DECLS
+
#define htonl(x) __swap32(x)
-#define ntohs(x) __swap16(x)
+#define htons(x) __swap16(x)
#define ntohl(x) __swap32(x)
+#define ntohs(x) __swap16(x)
/* Bionic additions */
-#define ntohq(x) __swap64(x)
#define htonq(x) __swap64(x)
+#define ntohq(x) __swap64(x)
#define __LITTLE_ENDIAN_BITFIELD