94655e143a23c05a4af667f9ee950530f76a454a
[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 struct in6_addr
43 {
44         unsigned char   s6_addr[16];
45 };
46
47 struct sockaddr_in6
48 {
49         sa_family_t     sin6_family;
50         uint16_t        sin6_port;
51         uint32_t        sin6_flowinfo;
52         struct in6_addr sin6_addr;
53         uint32_t        sin6_scope_id;
54 };
55
56 #endif
57

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