Usermode/libpsocket - Header wrapping, byte ordering functions
[tpg/acess2.git] / Usermode / Libraries / libpsocket.so_src / include_exp / netinet / in.h
1 /*
2  * Acess2 POSIX Sockets Emulation
3  * - By John Hodge (thePowersGang)
4  *
5  * netinet/in.h
6  * - ?Addressing?
7  */
8 #ifndef _LIBPSOCKET__NETINET__IN_H_
9 #define _LIBPSOCKET__NETINET__IN_H_
10
11 #include <sys/socket.h> // sa_family_t
12 #include <stdint.h>
13
14 typedef uint32_t        in_addr_t;
15
16 struct in_addr
17 {
18         in_addr_t s_addr;
19 };
20
21 struct sockaddr_in
22 {
23         sa_family_t     sin_family;
24         uint16_t        sin_port;
25         struct in_addr  sin_addr;
26 };
27
28 #define INADDR_ANY      0x00000000
29 #define INADDR_BROADCAST        0xFFFFFFFF
30
31 #define IPPORT_RESERVED 1024
32 #define IPPORT_UNRESERVED       0xC000
33
34 // getsockopt/setsockopt(level)
35 enum {
36         IPPROTO_IP = 1,
37         IPPROTO_ICMP,
38         IPPROTO_TCP,
39         IPPROTO_UDP
40 };
41
42 #define INET_ADDRSTRLEN         16
43 #define INET6_ADDRSTRLEN        48      // linux
44
45 struct in6_addr
46 {
47         unsigned char   s6_addr[16];
48 };
49
50 extern struct in6_addr  in6addr_any;
51
52 struct sockaddr_in6
53 {
54         sa_family_t     sin6_family;
55         uint16_t        sin6_port;
56         uint32_t        sin6_flowinfo;
57         struct in6_addr sin6_addr;
58         uint32_t        sin6_scope_id;
59 };
60
61 #include <arpa/inet.h>  // for hton*/ntoh* (bochs)
62
63 #endif
64

UCC git Repository :: git.ucc.asn.au