diff options
Diffstat (limited to 'system/include')
-rw-r--r-- | system/include/net/arpa/inet.h | 22 | ||||
-rw-r--r-- | system/include/net/netdb.h | 13 | ||||
-rw-r--r-- | system/include/net/netinet/in.h | 19 | ||||
-rw-r--r-- | system/include/sys/socket.h | 13 |
4 files changed, 64 insertions, 3 deletions
diff --git a/system/include/net/arpa/inet.h b/system/include/net/arpa/inet.h index af7845fd..06d44183 100644 --- a/system/include/net/arpa/inet.h +++ b/system/include/net/arpa/inet.h @@ -1,9 +1,27 @@ -/* */ + +#ifndef _NET_ARPA_INET_H +#define _NET_ARPA_INET_H + +#ifdef __cplusplus +extern "C" { +#endif #include <stdint.h> +uint32_t htonl(uint32_t hostlong); +uint16_t htons(uint16_t hostshort); uint32_t ntohl(uint32_t netlong); - uint16_t ntohs(uint16_t netshort); int inet_aton(const char *cp, struct in_addr *addr); +char *inet_ntoa(struct in_addr in); + +typedef long in_addr_t; +in_addr_t inet_addr(const char *cp); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/system/include/net/netdb.h b/system/include/net/netdb.h index ee33be5f..4151ccb5 100644 --- a/system/include/net/netdb.h +++ b/system/include/net/netdb.h @@ -1,4 +1,11 @@ +#ifndef _NET_NETDB_H +#define _NET_NETDB_H + +#ifdef __cplusplus +extern "C" { +#endif + struct addrinfo { int ai_flags; @@ -25,3 +32,9 @@ struct hostent char **h_addr_list; }; +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/system/include/net/netinet/in.h b/system/include/net/netinet/in.h index 7ac40c03..4547696b 100644 --- a/system/include/net/netinet/in.h +++ b/system/include/net/netinet/in.h @@ -1,4 +1,17 @@ +#ifndef _NET_NETINET_IN_H +#define _NET_NETINET_IN_H + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + IPPROTO_IP = 0, +#define IPPROTO_IP IPPROTO_IP + IPPROTO_MAX +}; + #define INET_ADDRSTRLEN 16 #define INADDR_ANY 0 @@ -26,3 +39,9 @@ struct sockaddr_in6 { int sin6_scope_id; }; +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/system/include/sys/socket.h b/system/include/sys/socket.h index 68e06509..2c23ddb7 100644 --- a/system/include/sys/socket.h +++ b/system/include/sys/socket.h @@ -1,4 +1,9 @@ -/* */ +#ifndef _SYS_SOCKET_H +#define _SYS_SOCKET_H + +#ifdef __cplusplus +extern "C" { +#endif #define SOMAXCONN 128 #define PF_INET 2 @@ -53,3 +58,9 @@ struct msghdr int msg_flags; }; +#ifdef __cplusplus +} +#endif + +#endif + |