Data Tables
IN THIS APPENDIX
Domains: First Parameter to
socket()
396
Types: Second Parameter to
socket()
404
Protocol Definitions 404
Standard Internet Port Assignments (First 100
Ports) 405
HTTP 1.1 Status Codes 407
Socket Options (
setsockopt()
) 408
Signal Definitions 414
ICMP Codes 415
IPv4 Multicast Allocation 417
Proposed IPv6 Address Allocation 417
ICMPv6 Codes 418
IPv6 Multicast Scope Field 419
IPv6 Multicast Flags Field 420
This appendix identifies and lists all the tables and data formats relevant to sockets programming.
Domains: First Parameter to socket()
Table A.1 lists the values for the first parameter of the
socket()
system call. You can use these
types as well in a
bind()
system call. While most programs use the AF style for both
socket()
and
bind()
, the correct form is to use the PF style for
socket()
and the AF style for
bind()
. If you are uncomfortable using the PF style, you can safely use the AF style because
the C header files define the AF style as the PF style. The structure definitions are located in
<bits/socket.h>
.
Types: Second Parameter to socket()
The second parameter ( ) selects the protocol layer. Some constants defined in Table A.2 are mere placeholders for when the kernel supports the protocol.
Protocol Definitions
Listing A.1 is an excerpt from the /etc/protocols file [RFC2292] on your distribution. It contains the common and standard protocol standards used in the network packet. Revising this file is not a good idea.
Standard Internet Port Assignments (First 100 Ports)
Listing A.2 shows the standard ports (up to port #100) defined in the /etc/services file. You can change many of these to suit your needs, but be sure to notify the clients if you do so.
HTTP 1.1 Status Codes
If you want to write your own Web server, you need to understand and use the standard status codes of HTTP 1.1 [RFC2616, RFC2817]. Table A.3 lists these codes.
Socket Options (setsockopt() )
Tables A.4 through A.7 list the various socket options and the required parameters. Not all options are size compatible between UNIX types. For example, IP_TTL in Linux allows a type int , but only fills the first byte. IBMs AIX restricts the same option to a char instead.
Signal Definitions
Table A.8 lists the standard signals and their meanings.
ICMP Codes
Table A.9 shows the different types of ICMP [RFC792] packets and what they mean.
IPv4 Multicast Allocation
Table A.10 defines the current multicast address allocation [RFC2365] in spectrum order.
Proposed IPv6 Address Allocation
Table A.11 lists the proposed IPv6 address allocation in bits.
ICMPv6 Codes
Table A.12 shows the new ICMPv6 [RFC2463] for IPv6.
IPv6 Multicast Scope Field
Table A.13 defines the different values for the scope field in the multicast IPv6 addresses.
IPv6 Multicast Flags Field
Table A.14 shows the currently defined flag fields for IPv6 multicast addresses.