开发者

What is Address Family?

When I read about socket programming, I get to know that AF_ stands for Address Family. But literally, a family should have many members. So, what are the members of, say, AF_INET address family?

In my opinion, I think it would be more appropriate to say Address Type than Addresss Family. Also this applies to PF (Protocol Family).

开发者_高级运维

Thanks.


Members of AF_INET address family are IPv4 addresses.

Members of AF_INET6 address family are IPv6 addresses.

Members of AF_UNIX address family are names of Unix domain sockets (/var/run/mysqld/mysqld.sock is an example).

Members of AF_IPX address family are IPX addresses, and so on. I don't think you really need to distinguish between family and type here. They are merely synonyms, except that family looks like more specialized, well-suited for this purpose, whilst type is a too much general word.


  Name                   Purpose                 
   AF_UNIX, AF_LOCAL      Local communication              
   AF_INET                IPv4 Internet protocols        
   AF_INET6               IPv6 Internet protocols
   AF_IPX                 IPX - Novell protocols
   AF_NETLINK             Kernel user interface device    
   AF_X25                 ITU-T X.25 / ISO-8208 protocol 
   AF_AX25                Amateur radio AX.25 protocol
   AF_ATMPVC              Access to raw ATM PVCs
   AF_APPLETALK           Appletalk                      
   AF_PACKET              Low level packet interface   
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜