Print this page
dccp: options and features

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_pf.c
          +++ new/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_pf.c
↓ open down ↓ 145 lines elided ↑ open up ↑
 146  146          {IPPROTO_OSPF, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 147  147          {IPPROTO_SCTP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 148  148          {IPPROTO_SCTP, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 149  149          {IPPROTO_ICMP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 150  150          {IPPROTO_ICMPV6, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 151  151          {IPPROTO_ENCAP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 152  152          {IPPROTO_ESP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 153  153          {IPPROTO_ESP, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 154  154          {IPPROTO_AH, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 155  155          {IPPROTO_AH, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
      156 +        {IPPROTO_DCCP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
      157 +        {IPPROTO_DCCP, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 156  158          {-1, 0, 0}      /* must be the final entry */
 157  159  };
 158  160  
 159  161  static transport_table_t ipnet_transport_mapping_table[] = {
 160  162          {IPPROTO_TCP, (DL_IPNETINFO_VERSION << 8 | AF_INET),
 161  163              IPV4_TYPE_HEADER_OFFSET},
 162  164          {IPPROTO_TCP, (DL_IPNETINFO_VERSION << 8 | AF_INET6),
 163  165              IPV6_TYPE_HEADER_OFFSET},
 164  166          {IPPROTO_UDP, (DL_IPNETINFO_VERSION << 8 | AF_INET),
 165  167              IPV4_TYPE_HEADER_OFFSET},
↓ open down ↓ 14 lines elided ↑ open up ↑
 180  182          {IPPROTO_ENCAP, (DL_IPNETINFO_VERSION << 8 | AF_INET),
 181  183              IPV4_TYPE_HEADER_OFFSET},
 182  184          {IPPROTO_ESP, (DL_IPNETINFO_VERSION << 8 | AF_INET),
 183  185              IPV4_TYPE_HEADER_OFFSET},
 184  186          {IPPROTO_ESP, (DL_IPNETINFO_VERSION << 8 | AF_INET6),
 185  187              IPV6_TYPE_HEADER_OFFSET},
 186  188          {IPPROTO_AH, (DL_IPNETINFO_VERSION << 8 | AF_INET),
 187  189              IPV4_TYPE_HEADER_OFFSET},
 188  190          {IPPROTO_AH, (DL_IPNETINFO_VERSION << 8 | AF_INET6),
 189  191              IPV6_TYPE_HEADER_OFFSET},
      192 +        {IPPROTO_DCCP, (DL_IPNETINFO_VERSION << 8 | AF_INET),
      193 +            IPV4_TYPE_HEADER_OFFSET},
      194 +        {IPPROTO_DCCP, (DL_IPNETINFO_VERSION << 8 | AF_INET6),
      195 +            IPV6_TYPE_HEADER_OFFSET},
 190  196          {-1, 0, 0}      /* must be the final entry */
 191  197  };
 192  198  
 193  199  static transport_table_t ib_transport_mapping_table[] = {
 194  200          {IPPROTO_TCP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 195  201          {IPPROTO_TCP, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 196  202          {IPPROTO_UDP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 197  203          {IPPROTO_UDP, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 198  204          {IPPROTO_OSPF, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 199  205          {IPPROTO_OSPF, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 200  206          {IPPROTO_SCTP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 201  207          {IPPROTO_SCTP, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 202  208          {IPPROTO_ICMP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 203  209          {IPPROTO_ICMPV6, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 204  210          {IPPROTO_ENCAP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 205  211          {IPPROTO_ESP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 206  212          {IPPROTO_ESP, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 207  213          {IPPROTO_AH, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
 208  214          {IPPROTO_AH, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
      215 +        {IPPROTO_DCCP, ETHERTYPE_IP,   IPV4_TYPE_HEADER_OFFSET},
      216 +        {IPPROTO_DCCP, ETHERTYPE_IPV6, IPV6_TYPE_HEADER_OFFSET},
 209  217          {-1, 0, 0}      /* must be the final entry */
 210  218  };
 211  219  
 212  220  typedef struct datalink {
 213  221          uint_t                  dl_type;
 214  222          void                    (*dl_match_fn)(uint_t datatype);
 215  223          transport_table_t       *dl_trans_map_tbl;
 216  224          network_table_t         *dl_net_map_tbl;
 217  225          int                     dl_link_header_len;
 218  226          int                     dl_link_type_offset;
↓ open down ↓ 1102 lines elided ↑ open up ↑
1321 1329                          break;
1322 1330                  }
1323 1331  
1324 1332                  if (EQ("ah")) {
1325 1333                          pf_check_transport_protocol(IPPROTO_AH);
1326 1334                          opstack++;
1327 1335                          next();
1328 1336                          break;
1329 1337                  }
1330 1338  
     1339 +                if (EQ("dccp")) {
     1340 +                        pf_check_transport_protocol(IPPROTO_DCCP);
     1341 +                        opstack++;
     1342 +                        next();
     1343 +                        break;
     1344 +                }
     1345 +
1331 1346                  if (EQ("(")) {
1332 1347                          inBrace++;
1333 1348                          next();
1334 1349                          pf_expression();
1335 1350                          if (EQ(")")) {
1336 1351                                  if (inBrace)
1337 1352                                          inBraceOR--;
1338 1353                                  inBrace--;
1339 1354                                  next();
1340 1355                          }
↓ open down ↓ 322 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX