aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-10-17 20:48:59 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-10-17 20:48:59 -0700
commitb5c11a1f4926369add9087d5f739bcd75e6bea46 (patch)
treec347318eec20581d60d327d188dbc977a545a433
parent291b5d29d568cc94a598df46011b80c8f0dc8d38 (diff)
various include/ additions
-rw-r--r--system/include/net/arpa/inet.h2
-rw-r--r--system/include/net/netdb.h9
-rw-r--r--system/include/net/netinet/in.h2
-rw-r--r--system/include/sys/socket.h15
4 files changed, 28 insertions, 0 deletions
diff --git a/system/include/net/arpa/inet.h b/system/include/net/arpa/inet.h
index 76ad8b5f..af7845fd 100644
--- a/system/include/net/arpa/inet.h
+++ b/system/include/net/arpa/inet.h
@@ -1,5 +1,7 @@
/* */
+#include <stdint.h>
+
uint32_t ntohl(uint32_t netlong);
uint16_t ntohs(uint16_t netshort);
diff --git a/system/include/net/netdb.h b/system/include/net/netdb.h
index 3b6f3389..ee33be5f 100644
--- a/system/include/net/netdb.h
+++ b/system/include/net/netdb.h
@@ -16,3 +16,12 @@ extern void freeaddrinfo(struct addrinfo *ai);
extern int getnameinfo (struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, unsigned int flags);
const char *gai_strerror(int ecode);
+struct hostent
+{
+ char *h_name;
+ char **h_aliases;
+ int h_addrtype;
+ int h_length;
+ char **h_addr_list;
+};
+
diff --git a/system/include/net/netinet/in.h b/system/include/net/netinet/in.h
index 0def3127..7ac40c03 100644
--- a/system/include/net/netinet/in.h
+++ b/system/include/net/netinet/in.h
@@ -1,6 +1,8 @@
#define INET_ADDRSTRLEN 16
+#define INADDR_ANY 0
+
struct in_addr {
unsigned long s_addr;
};
diff --git a/system/include/sys/socket.h b/system/include/sys/socket.h
index 95a0635a..68e06509 100644
--- a/system/include/sys/socket.h
+++ b/system/include/sys/socket.h
@@ -1,5 +1,9 @@
/* */
+#define SOMAXCONN 128
+#define PF_INET 2
+#define SO_BROADCAST 6
+
#define AF_UNSPEC 100
#define SOCK_STREAM 200
#define SOL_SOCKET 50
@@ -38,3 +42,14 @@ ssize_t send(int s, const void *buf, size_t len, int flags);
int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen);
ssize_t sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen);
+struct msghdr
+{
+ void *msg_name;
+ socklen_t msg_namelen;
+ struct iovec *msg_iov;
+ size_t msg_iovlen;
+ void * msg_control;
+ size_t msg_controllen;
+ int msg_flags;
+};
+