1 /*
2 netinet/in.h
3 */
4
5 #ifndef _NETINET__IN_H
6 #define _NETINET__IN_H
7
8 /* Can we include <stdint.h> here or do we need an additional header that is
9 * safe to include?
10 */
11 #include <stdint.h>
12
13 /* Open Group Base Specifications Issue 6 (not complete) */
14 #define INADDR_ANY (uint32_t)0x00000000
15 #define INADDR_BROADCAST (uint32_t)0xFFFFFFFF
16
17 typedef uint16_t in_port_t;
18
19 #ifndef _IN_ADDR_T
20 #define _IN_ADDR_T
21 typedef uint32_t in_addr_t;
22 #endif /* _IN_ADDR_T */
23
24 #ifndef _SA_FAMILY_T
25 #define _SA_FAMILY_T
26 /* Should match corresponding typedef in <sys/socket.h> */
27 typedef uint8_t sa_family_t;
28 #endif /* _SA_FAMILY_T */
29
30 /* Protocols */
31 #define IPPROTO_IP 0 /* Dummy protocol */
32 #define IPPROTO_TCP 6 /* TCP */
33 #define IPPROTO_UDP 17 /* UDP */
34
35 /* setsockopt options at IP level */
36 #define IP_ADD_MEMBERSHIP 12
37 #define IP_DROP_MEMBERSHIP 13
38
39 #ifndef _STRUCT_IN_ADDR
40 #define _STRUCT_IN_ADDR
41 struct in_addr
42 {
43 in_addr_t s_addr;
44 };
45 #endif
46
47 struct sockaddr_in
48 {
49 sa_family_t sin_family;
50 in_port_t sin_port;
51 struct in_addr sin_addr;
52 };
53
54 struct ip_mreq
55 {
56 struct in_addr imr_multiaddr;
57 struct in_addr imr_interface;
58 };
59
60 #endif /* _NETINET__IN_H */
Cache object: a3bc9b18bc57ca838e832b04ff3fd5f2
|