Looking at examples about socket programming, we can see that some people use AF_INET
while others use PF_INET
. In addition, sometimes both of them are
I think the Wikipedia notes on this sum it up pretty well:
The original design concept of the socket interface distinguished between protocol types (families) and the specific address types that each may use. It was envisioned that a protocol family may have several address types. Address types were defined by additional symbolic constants, using the prefix
AF_
instead ofPF_
. TheAF_
-identifiers are intended for all data structures that specifically deal with the address type and not the protocol family. However, this concept of separation of protocol and address type has not found implementation support and theAF_
-constants were simply defined by the corresponding protocol identifier, rendering the distinction betweenAF_
versusPF_
constants a technical argument of no significant practical consequence. Indeed, much confusion exists in the proper usage of both forms.
Even if someone came up with a reason to have a difference today, they'd have to come up with new identifiers or so much stuff would break...