+/*
+ * Acess2 POSIX Sockets Emulation
+ * - By John Hodge (thePowersGang)
+ *
+ * netinet/in.h
+ * - ?Addressing?
+ */
#ifndef _LIBPSOCKET__NETINET__IN_H_
#define _LIBPSOCKET__NETINET__IN_H_
+#include <sys/socket.h> // sa_family_t
#include <stdint.h>
+typedef uint32_t in_addr_t;
+
struct in_addr
{
- unsigned long s_addr;
+ in_addr_t s_addr;
};
struct sockaddr_in
{
- uint16_t sin_family;
+ sa_family_t sin_family;
uint16_t sin_port;
struct in_addr sin_addr;
};
+#define INADDR_ANY 0x00000000
+#define INADDR_BROADCAST 0xFFFFFFFF
+
+// getsockopt/setsockopt(level)
+enum {
+ IPPROTO_IP = 1,
+ IPPROTO_ICMP,
+ IPPROTO_TCP,
+ IPPROTO_UDP
+};
+
struct in6_addr
{
unsigned char s6_addr[16];
struct sockaddr_in6
{
- uint16_t sin6_family;
+ sa_family_t sin6_family;
uint16_t sin6_port;
uint32_t sin6_flowinfo;
struct in6_addr sin6_addr;