1in.h(3HEAD) Headers in.h(3HEAD)
2
3
4
6 in.h, in - Internet Protocol family
7
9 #include <netinet/in.h>
10
11
13 The <netinet/in.h> header defines the following types through typedef:
14
15 in_port_t An unsigned integral type of exactly 16 bits.
16
17
18 in_addr_t An unsigned integral type of exactly 32 bits. The
19 <netinet/in.h> header defines the in_addr structure that
20 includes the following member:
21
22
23
24 The <netinet/in.h> header defines the in_addr structure that includes
25 the following member:
26
27 in_addr_t s_addr
28
29
30
31 The <netinet/in.h> header defines the type sa_family_t as described in
32 socket.h(3HEAD).
33
34
35 The <netinet/in.h> header defines the following macros for use as val‐
36 ues of the level argument of getsockopt() and setsockopt():
37
38 IPPROTO_IP Dummy for IP
39
40
41 IPPROTO_ICMP Control message protocol
42
43
44 IPPROTO_TCP TCP
45
46
47 IPPROTO_UDP User datagram protocol The <netinet/in.h> header
48 defines the following macros for use as destina‐
49 tion addresses for connect(), sendmsg(), and
50 sendto():
51
52
53 INADDR_ANY Local host address
54
55
56 INADDR_BROADCAST Broadcast address
57
58
59
60 The <netinet/in.h> header defines the sockaddr_in structure that is
61 used to store addresses for the Internet protocol family. Values of
62 this type must be cast to struct sockaddr for use with the socket
63 interfaces.
64
65 Default
66 For applications that do not require standard-conforming behavior
67 (those that use the socket interfaces described in section (3SOCKET) of
68 the reference manual; see Intro(3) and standards(5)), the
69 <netinet/in.h> header defines the sockaddr_in structure that includes
70 the following members:
71
72 sa_family_t sin_family
73 in_port_t sin_port
74 struct in_addr sin_addr
75 char sin_zero[8]
76
77
78 Standard conforming
79 For applications that require standard-conforming behavior (those that
80 use the socket interfaces described in section (3XNET) of the reference
81 manual; see Intro(3) and standards(5)), the <netinet/in.h> header
82 defines the sockaddr_in structure that includes the following members:
83
84 sa_family_t sin_family
85 in_port_t sin_port
86 struct in_addr sin_addr
87 unsigned char sin_zero[8]
88
89
91 See attributes(5) for descriptions of the following attributes:
92
93
94
95
96 ┌─────────────────────────────┬─────────────────────────────┐
97 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
98 ├─────────────────────────────┼─────────────────────────────┤
99 │Interface Stability │Standard │
100 └─────────────────────────────┴─────────────────────────────┘
101
103 Intro(3), connect(3SOCKET), connect(3XNET), getsockopt(3SOCKET), get‐
104 sockopt(3XNET), sendmsg(3SOCKET), sendmsg(3XNET), sendto(3SOCKET),
105 sendto(3XNET), setsockopt(3SOCKET), setsockopt(3XNET), socket.h(3HEAD),
106 attributes(5), standards(5)
107
108
109
110SunOS 5.11 30 Aug 2002 in.h(3HEAD)