• sockaddr_in中的sin_family=PF_INET是什么意思?(转)


    sockaddr_in中的sin_family=PF_INET是什么意思?sin_family还有别的值吗?如果有都有什么?这些其他的值都是什么意思?

    你可以直接看定义所在的winsock.h啊   AF_INET是internet地址族,包括了tcp、udp什么的,
    IPX、pipe什么的就不用AF_INET这个值

    PF_INET与AF_INET究竟有什么不同?实际上,原来的想法是每个通信域(如PF_INET)可能对应多个协议(如AF_INET),而事 实上支持多个协议的通信域一直没有实现。因此,在linux内核中,AF_***与PF_***被定义为同一个常数,因此,在编程时可以不加区分地使用他 们。  
    #define AF_UNIX 1 /* local to host (pipes, portals) */
    #define AF_INET 2 /* internetwork: UDP, TCP, etc. */
    #define AF_IMPLINK 3 /* arpanet imp addresses */
    #define AF_PUP 4 /* pup protocols: e.g. BSP */
    #define AF_CHAOS 5 /* mit CHAOS protocols */
    #define AF_NS 6 /* XEROX NS protocols */
    #define AF_IPX AF_NS /* IPX protocols: IPX, SPX, etc. */
    #define AF_ISO 7 /* ISO protocols */
    #define AF_OSI AF_ISO /* OSI is ISO */
    #define AF_ECMA 8 /* european computer manufacturers */
    #define AF_DATAKIT 9 /* datakit protocols */
    #define AF_CCITT 10 /* CCITT protocols, X.25 etc */
    #define AF_SNA 11 /* IBM SNA */
    #define AF_DECnet 12 /* DECnet */
    #define AF_DLI 13 /* Direct data link interface */
    #define AF_LAT 14 /* LAT */
    #define AF_HYLINK 15 /* NSC Hyperchannel */
    #define AF_APPLETALK 16 /* AppleTalk */
    #define AF_NETBIOS 17 /* NetBios-style addresses */
    #define AF_VOICEVIEW 18 /* VoiceView */
    #define AF_FIREFOX 19 /* Protocols from Firefox */
    #define AF_UNKNOWN1 20 /* Somebody is using this! */
    #define AF_BAN 21 /* Banyan */
    #define AF_ATM 22 /* Native ATM Services */
    #define AF_INET6 23 /* Internetwork Version 6 */
    #define AF_CLUSTER 24 /* Microsoft Wolfpack */
    #define AF_12844 25 /* IEEE 1284.4 WG AF */

    转载:http://hi.baidu.com/jangill/blog/item/3b13dd529290cd020df3e3c7.html

  • 相关阅读:
    【软件工程】个人项目作业
    【软件工程】个人博客作业
    【软件工程】第一次作业-热身!
    OO第四单元总结
    OO第三单元总结
    OO第二单元总结
    OO第一单元总结
    提问回顾与个人总结
    [技术博客] Django中文件的保存与访问
    OO第三单元博客作业
  • 原文地址:https://www.cnblogs.com/doctorqbw/p/2266109.html
Copyright © 2020-2023  润新知