|> | AF = address family. These constants go into the sin_family member of the
|> | socket address structure.
|> |
|> | PF = protocol family. These constants are the first argument to socket().
|>
|> There is a little more to it than that. Although I don't have the ancient
|> sources handy to check (and my memory of this particular aspect is fading),
|> I recall that the original socket code (4.1c/2.8/2.9BSD) employed a protocol
|> structure similar in concept to the sockaddr structure. The protocol
|> structure contained a family element and a family-specific protocol number.
|> The PF_ constants were used for the family element of the protocol structure.
|> A protocol structure (or, rather, the address of one) could be passed to the
|> socket() call to serve a purpose similar to that of the last (integer)
|> argument
|> of the current socket() call. (Keep in mind that the old socket() call did
|> not
|> take a family/domain argument at all, so interpretation of the protocol
|> number
|> would not have been possible without the PF_ cue.) Originally, then, the PF_
|> and AF_ constants had a much more parallel purpose as structure tags. When
|> socket() started requiring a family/domain argument, the protocol structure
|> was dropped.
|
| Well, actually your memory is a bit off.