• inetsw_array的定义中有四个元素IPPROTO_TCP,IPPROTO_UDP,IPPROTO_ICMP,IPPROTO_IP


    static struct inet_protosw inetsw_array[] =  
        {  
            {  
                .type =       SOCK_STREAM,  
                .protocol =   IPPROTO_TCP,  
                .prot =       &tcp_prot,  
                .ops =        &inet_stream_ops,  
                .no_check =   0,  
                .flags =      INET_PROTOSW_PERMANENT |  
                          INET_PROTOSW_ICSK,  
            },  
          
            {  
                .type =       SOCK_DGRAM,  
                .protocol =   IPPROTO_UDP,  
                .prot =       &udp_prot,  
                .ops =        &inet_dgram_ops,  
                .no_check =   UDP_CSUM_DEFAULT,  
                .flags =      INET_PROTOSW_PERMANENT,  
               },  
          
               {  
                .type =       SOCK_DGRAM,  
                .protocol =   IPPROTO_ICMP,  
                .prot =       &ping_prot,  
                .ops =        &inet_dgram_ops,  
                .no_check =   UDP_CSUM_DEFAULT,  
                .flags =      INET_PROTOSW_REUSE,  
               },  
          
               {  
                   .type =       SOCK_RAW,  
                   .protocol =   IPPROTO_IP,    /* wild card */  
                   .prot =       &raw_prot,  
                   .ops =        &inet_sockraw_ops,  
                   .no_check =   UDP_CSUM_DEFAULT,  
                   .flags =      INET_PROTOSW_REUSE,  
               }  
        };  
        

  • 相关阅读:
    看到一篇好文章 和大家分享《别让灵魂赶不上自己的脚步!》
    第二次结对编程作业
    css的用法
    MicrosoftWord2013基本用法
    使用winshark分析三次握手,四次挥手
    取石子(博弈游戏)
    java.lang.NullPointerException的可能原因及处理
    Git的用法
    C++ 各种基本类型间的转换
    Servlet技术(使用myeclipse)
  • 原文地址:https://www.cnblogs.com/mull/p/4477857.html
Copyright © 2020-2023  润新知