1

THIS is powering the internet:

"[...] was a protocol number, similar to the third argument to socket today. Specifying this structure was the only way to specify the protocol family. Therefore, in this early system the PF_ values were used as structure tags to specify the protocol family in the sockproto structure, and the AF values were used as structure tags to specify the address family in the socket address structures. The sockproto structure is still in 44BSD (pp. 626-627 of TCPv2) but is only used internally by the kernel. The original definition had the comment "protocol family" for the sp_family member, but this has been changed to "address family" in the 4.4BSD source code. To confuse this difference between the AF_ and PF_ constants even more, the Berkeley kernel data structure that contains the value that is compared to the first argument to socket (the dom family member of the domain structure, p. 187 of TCPv2) has the comment that it contains an AF_ value. But some of the domain structures within the kernel are initialized to the corresponding AF value (p. 192 of TCPv2) while others are initialized to the PF value." Richard Stevens 'Unix network programming'

Comments
Add Comment