25 #ifndef __TCP_HEADER_DEFINITIONS_H__ 26 #define __TCP_HEADER_DEFINITIONS_H__ 37 #define TYPE_IP 0x0800 38 #define TYPE_IP_V6 0x86DD 39 #define TYPE_ARP 0x0806 40 #define TYPE_RARP 0x8035 41 #define TYPE_MPLS 0x8847 42 #define TYPE_CDP 0x2000 43 #define TYPE_CGMP 0x2001 44 #define TYPE_LACP 0x8808 45 #define TYPE_CLNS 0xFEFE 47 #define TYPE_PPPOE_SESSION 0x8864 48 #define TYPE_PPPOE_DISCOVERY 0x8863 53 #define IN_ATM_ARP_BIT 0x0008 70 #define HDLC_ADDR_CMD 0x0F00 71 #define HDLC_HDR_LEN 4 72 #define HDLC_BROADCAST_BIT 31 73 #define TYPE_KEEP 0x8035 75 #define HDLC_CLNS (HDLC_ADDR_CMD<<16|TYPE_CLNS) 76 #define HDLC_CDP (HDLC_ADDR_CMD<<16|TYPE_CDP) 77 #define HDLC_MPLS (HDLC_ADDR_CMD<<16|TYPE_MPLS) 78 #define HDLC_IP (HDLC_ADDR_CMD<<16|TYPE_IP) 79 #define HDLC_IP_V6 (HDLC_ADDR_CMD<<16|TYPE_IP_V6) 80 #define HDLC_KEEPALIVE_CMD (HDLC_ADDR_CMD<<16|TYPE_KEEP) 94 #define PPP_STATION 0xFF03 95 #define PPP_STATION_LEN 0x2 96 #define PPP_ENDPROTO 0x01 97 #define PPP_NOT_ENDPROTO 0xfffffffe 98 #define PPP_CONTROL_PROTOCOL_MASK 0x8000 99 #define PPP_CONTROL_PROTOCOL_BIT 15 100 #define PPP_CSCO_LEN 4 101 #define PPP_RFC1661_LEN 2 102 #define PPP_RFC1661_COMP_LEN 1 104 #define TYPE_PPP_IP 0x0021 105 #define TYPE_PPP_IP_V6 0x0057 106 #define TYPE_PPP_MPLS_UNICAST 0x0281 107 #define TYPE_PPP_MPLS_CONTROL 0x8281 108 #define TYPE_PPP_CLNS 0x0023 109 #define TYPE_PPP_CDP 0x0207 111 #define TYPE_PPP_IPCP 0x8021 112 #define TYPE_PPP_LCP 0xC021 113 #define TYPE_PPP_PAP 0xC023 114 #define TYPE_PPP_LQR 0xC025 115 #define TYPE_PPP_CHAP 0xC223 118 #define TYPE_PPP_LCP_ECHO_REQUEST 0x09 123 #define MLPPP_FLAGS_FIELD_LEN 4 124 #define MLPPP_BEGIN_MASK 0x80000000 125 #define MLPPP_END_MASK 0x40000000 126 #define MLPPP_BEGIN_END_MASK (MLPPP_BEGIN_MASK|MLPPP_END_MASK) 127 #define MLPPP_BEGIN_END_SHIFT 30 128 #define MLPPP_SEQUENCE_NUM_MASK 0x00FFFFFF 129 #define MLPPP_MC_CLASS_ID_MASK 0x3C000000 130 #define MLPPP_MC_CLASS_SHIFT 26 132 #define TYPE_PPP_MULTILINK 0x003D 135 #define TYPE_PPP_FULL_IP_4 0xff030021 136 #define TYPE_PPP_FULL_IP_3 0xff0321 137 #define TYPE_PPP_FULL_IP_2 0x0021 138 #define TYPE_PPP_FULL_IP_1 0x21 140 #define MLPPP_BEGIN_END_MASK_BYTE 0xC0 141 #define MLPPP_BEGIN_BIT 7 142 #define MLPPP_END_BIT 6 143 #define MLPPP_MC_CLASS_ID_MASK_BYTE 0x3C 144 #define MLPPP_MC_CLASS_ID_SHIFT_BYTE 2 146 #define MLPOA_BEGIN_END_SHIFT 24 183 #define MIN_ETHERNET_PKT_LEN 60 184 #define MAX_ETHERNET_PKT_LEN 1500 185 #define ETHERNET_ARPA_HDR_LEN 14 186 #define ETHERNET_TYPE_FIELD_SIZE 2 245 #define ETH_BPDU_DSAP 0x42 246 #define ETH_BPDU_SSAP 0x42 247 #define ETH_BPDU_CONTROL 0x03 248 #define ETH_BPDU_MATCH 0x424203 309 #define ETH_PPPOE_ARPA_HDR_LEN sizeof(ethernet_pppoe_arpa_hdr_type) 310 #define ETH_PPPOE_VLAN_HDR_LEN sizeof(ethernet_pppoe_vlan_hdr_type) 311 #define ETH_PPPOE_QINQ_HDR_LEN sizeof(ethernet_pppoe_qinq_hdr_type) 312 #define PPPOE_HDR_LEN 6 318 #define TYPE_DOT1Q 0x8100 319 #define DOT1Q_HDR_LEN 18 320 #define DOT1Q_VLAN_ID_MASK 0x0FFF 321 #define DOT1Q_VLAN_ID_RES_0 0x0000 322 #define DOT1Q_VLAN_ID_RES_4095 0x0FFF 323 #define DOT1Q_ARPA_INDEX DOT1Q_VLAN_ID_RES_0 325 #define TYPE_QINQ_91 0x9100 326 #define TYPE_QINQ_92 0x9200 327 #define TYPE_QINQ_88A8 0x88A8 328 #define QINQ_HDR_LEN 22 333 #define DOT1P_VLAN_COS_MASK 0xE000 334 #define DOT1P_VLAN_COS_SHIFT 13 335 #define DOT1P_MAX_COS_VALUE 7 366 #define FR_ADDR_LEN 2 367 #define FR_CTL_NLPID_LEN 2 368 #define FR_HDR_LEN (FR_ADDR_LEN+FR_CTL_NLPID_LEN) 378 #define FR_ARP_CONTROL 0x03 379 #define FR_ARP_PAD 0x00 380 #define FR_ARP_NLPID 0x80 381 #define FR_ARP_OUI_0 0x00 382 #define FR_ARP_OUI_1 0x00 383 #define FR_ARP_OUI_2 0x00 387 #define FR_NLPID_OUI_LEN 4 388 #define FR_ARP_CONTROL_PAD 0x0300 389 #define FR_ARP_NLPID_OUI 0x80000000 392 #define FR_DLCI_UPPER_MASK 0xFC00 393 #define FR_DLCI_UPPER_SHIFT 6 394 #define FR_DLCI_LOWER_MASK 0x00F0 395 #define FR_DLCI_LOWER_SHIFT 4 424 #define FR_DLCI_TO_HDR_UPPER_MASK 0x3f0 425 #define FR_DLCI_TO_HDR_UPPER_SHIFT (10-4) 426 #define FR_DLCI_TO_HDR_LOWER_MASK 0xf 427 #define FR_DLCI_TO_HDR_LOWER_SHIFT 4 429 #define TYPE_FR_IETF_IP 0x03CC 430 #define TYPE_FR_IETF_IP_V6 0x038E 431 #define TYPE_FR_CISCO_IP 0x0800 432 #define TYPE_FR_CISCO_IP_V6 0x86DD 433 #define TYPE_FR_ISIS 0x0383 434 #define TYPE_FR_SNAP0PAD 0x0380 435 #define TYPE_FR_SNAP1PAD 0x0300 436 #define TYPE_FR_FRF12 0x03B1 437 #define TYPE_FR_MLP 0x03CF 438 #define TYPE_FR_EEK 0x8037 440 #define FR_LMI_DLCI_CISCO 1023 441 #define FR_LMI_DLCI_IETF 0 443 #define FR_NOT_NOT_NOT 0 444 #define FR_NOT_NOT_DE 1 445 #define FR_NOT_BECN_NOT 2 446 #define FR_NOT_BECN_DE 3 447 #define FR_FECN_NOT_NOT 4 448 #define FR_FECN_NOT_DE 5 449 #define FR_FECN_BECN_NOT 6 450 #define FR_FECN_BECN_DE 7 452 #define FR_FECN_BECN_DE_MASK 0x000E 453 #define FR_FECN_BECN_DE_SHIFT 1 456 #define FR_EA1_MASK 0x0001 457 #define FR_EA1_MASK_BIT 0 464 #define FR_DLCI_LS_BIT 4 487 #define MLFR_LIP_FRAME 0xE100 488 #define MLFR_LIP_MASK 0xE000 489 #define MLFR_FRAG_HDR_LEN 2 491 #define MLFR_BEGIN_MASK 0x8000 492 #define MLFR_END_MASK 0x4000 493 #define MLFR_BEGIN_END_MASK (MLFR_BEGIN_MASK|MLFR_END_MASK) 494 #define MLFR_BEGIN_END_SHIFT 14 496 #define MLFR_SEQ_NUM_HI_MASK 0x1E00 497 #define MLFR_SEQ_NUM_HI_SHIFT 1 498 #define MLFR_SEQ_NUM_LO_MASK 0x00FF 503 #define MLFR_BEGIN_END_MASK_BYTE 0xC0 516 #define FRF12_FRAG_HDR_LEN sizeof(frf12_hdr_type) 518 #define FRF12_BEGIN_MASK 0x8000 519 #define FRF12_END_MASK 0x4000 520 #define FRF12_BEGIN_END_MASK (FRF12_BEGIN_MASK|FRF12_END_MASK) 521 #define FRF12_BEGIN_END_SHIFT 8 523 #define FRF12_SEQ_NUM_HI_MASK 0x1E00 524 #define FRF12_SEQ_NUM_HI_SHIFT 1 525 #define FRF12_SEQ_NUM_LO_MASK 0x00FF 526 #define FRF12_BEGIN_END_MASK_BYTE 0xC0 667 #define APOLLO_ATM_OAM_F4_HDR_PT_MASK 0xE 668 #define APOLLO_ATM_OAM_F4_HDR_PT_SHIFT 1 676 #define APOLLO_IRONBUS_EXT_LESS_PROTO 0xFFFF0FFF 677 #define APOLLO_CHANNEL_HANDLE_MASK 0xFFFF 678 #define APOLLO_PKT_TYPE_MASK 0x0038 679 #define APOLLO_PKT_TYPE_SHIFT 3 680 #define APOLLO_FLAG_CLP_MASK 0x0001 681 #define APOLLO_FLAG_CLP_BIT 0 683 #define APOLLO_CHANNEL_HANDLE_RES_0 0x0000 687 #define APOLLO_F4_RX_CELL_SIZE 52 688 #define APOLLO_F5_RX_CELL_SIZE 52 690 #define APOLLO_ATM_PACKET_TYPE_AAL5 0 691 #define APOLLO_ATM_PACKET_TYPE_F4 1 692 #define APOLLO_ATM_PACKET_TYPE_F5_SEG 2 693 #define APOLLO_ATM_PACKET_TYPE_F5_E_TO_E 3 694 #define APOLLO_ATM_PACKET_TYPE_4 4 695 #define APOLLO_ATM_PACKET_TYPE_5 5 696 #define APOLLO_ATM_PACKET_TYPE_6 6 697 #define APOLLO_ATM_PACKET_RESERVED 7 699 #define APOLLO_AAL5_MUX_IP_HDR_LEN 4 700 #define APOLLO_AAL5_SNAP_HDR_LEN 12 702 #define APOLLO_RCV_IRON_BUS_EXT_LEN 4 703 #define APOLLO_TX_IRON_BUS_EXT_LEN 8 708 #define MLPOA_CISCO_HDR 0xFF03 709 #define MLPOA_SNAP_HDR_LEN 4 710 #define MLPOA_CISCO_HDR_LEN 2 792 #define PPPOA_SNAPLLC_HDR_LEN sizeof(apollo_atm_aal5_llcsnap_pppoa_hdr_type) 793 #define PPPOA_MUX_HDR_LEN sizeof(apollo_atm_aal5_mux_pppoa_hdr_type) 794 #define PPPOE_SNAPLLC_HDR_LEN sizeof(apollo_atm_aal5_llcsnap_pppoe_hdr_type) 795 #define RBE_SNAPLLC_HDR_LEN sizeof(apollo_atm_aal5_llcsnap_rbe_hdr_type) 800 #define LLCSNAP_PID_DOT3_NOFCS 0x0007 811 #define LLC_SNAP_HDR_DSAP 0xAA 812 #define LLC_SNAP_HDR_SSAP 0xAA 813 #define LLC_SNAP_HDR_CONTROL 0x03 814 #define LLC_SNAP_HDR_OUI_0 0x00 815 #define LLC_SNAP_HDR_OUI_1 0x00 816 #define LLC_SNAP_HDR_OUI_2 0x00 817 #define LLC_SNAP_HDR_OUI_2_CDP 0x0C 819 #define LLC_SNAP_HDR_DSAP_SSAP 0xAAAA 820 #define LLC_SNAP_HDR_DSAP_SSAP_CTRL_OUI0 0xAAAA0300 821 #define LLC_SNAP_HDR_CONTROL_OUI 0x03000000 822 #define LLC_SNAP_HDR_OUI1_OUI2_CDP 0x000C2000 844 #define SRP_HDR_LEN 16 846 #define SRP_IB_CHANNEL_CONTROL 0x0000 847 #define SRP_IB_CHANNEL_DATA_HI 0x0001 848 #define SRP_IB_CHANNEL_DATA_LO 0x0002 850 #define SRP_RING_ID_MASK 0x0080 851 #define SRP_RING_ID_BIT 7 853 #define SRP_MODE_BITS_MASK 0x0070 854 #define SRP_MODE_BITS_SHIFT 4 855 #define SRP_MODE_CONTROL_TOPOLOGY 4 856 #define SRP_MODE_CONTROL_IPS 5 857 #define SRP_MODE_DATA 7 859 #define SRP_PRIORITY_BITS_MASK 0x000E 860 #define SRP_PRIORITY_BITS_SHIFT 1 861 #define SRP_PRIORITY_HIGH 7 862 #define SRP_PRIORITY_PAK_PRIORITY 6 865 #define SRP_INV_PRIORITY_BITS_MASK 0xFFF1 867 #define SRP_PROT_CONTROL_TOPOLOGY 0x2007 868 #define SRP_PROT_CONTROL_IPS 0x2007 877 #define MPLS_EOS_BIT 0x00000100 878 #define MPLS_EOS_SHIFT 8 879 #define MPLS_LABEL_SIZE 4 880 #define MAX_MPLS_LABEL_STACK 6 881 #define MPLS_LABEL_MASK 0xfffff000 882 #define MPLS_LABEL_SHIFT 12 883 #define MPLS_TTL_MASK 0x000000ff 884 #define MPLS_EXP_MASK 0x00000e00 885 #define MPLS_EXP_SHIFT 9 886 #define MPLS_EXP_TTL_MASK 0x00000eff 890 typedef union _layer2 {
956 #define ATM_OAM_FAULT_MGMT 0x1 957 #define ATM_OAM_PRFRM_MGMT 0x2 958 #define ATM_OAM_ACT_DEACT 0x8 960 #define ATM_OAM_SYSTEM_MGMT 0xF 962 #define ATM_OAM_AIS_FUNC 0x0 963 #define ATM_OAM_RDI_FUNC 0x1 964 #define ATM_OAM_CC_FUNC 0x4 965 #define ATM_OAM_LOOP_FUNC 0x8 967 #define ATM_OAM_F5_SEGMENT 0x4 968 #define ATM_OAM_F5_ENDTOEND 0x5 969 #define ATM_OAM_F4_SEGMENT 0x3 970 #define ATM_OAM_F4_ENDTOEND 0x4 971 #define ATM_OAM_F4_PTI_ZERO 0x0 976 unsigned oam_vci_ms:4;
978 unsigned oam_vci_ls:12;
1035 #define LOOSE_SOURCE_ROUTE 131 1036 #define STRICT_SOURCE_ROUTE 137 1037 #define IPV4_NO_OPTIONS_HDR_LEN (sizeof(ipv4_header)) 1038 #define IPV4_VERSION 4 1039 #define IPV4_HEADER_LENGTH_WORDS 5 1040 #define IPV4_VERSION_HDR_LEN_FIELD ((u8) 0x45) 1041 #define IPV4_HEADER_LENGTH_WORDS 5 1042 #define IPV4_MIN_HEADER_LENGTH_BYTES 20 1043 #define IP_HDR_LEN sizeof(ipv4_header) 1044 #define IPV4_VERSION_VALUE_SHIFT 4 1046 #define IPV4_FRAG_OFFSET_MASK (0x1fff) 1047 #define IPV4_FRAG_MF_MASK (0x2000) 1048 #define IPV4_FRAG_MF_SHIFT (13) 1051 #define IP_BOOTP_SOURCE_ADDRESS 0 1053 #define IP_LIMITED_BROADCAST_ADDRESS 0xFFFFFFFF 1058 #define IP_VER_LEN 0x45 1060 #define IP_MIN_LEN 0x5 1061 #define IP_VER_MASK 0xf0 1062 #define IP_LEN_MASK 0x0f 1067 #define PS_IP_TOS_MASK 0xff 1068 #define IP_PRECEDENCE_SHIFT 5 1069 #define IP_DSCP_SHIFT 2 1071 #define IP_TOS_PRECEDENCE 0xe0 1072 #define IP_TOS_NO_PRECEDENCE 0x1f 1073 #define IP_TOS_LOW_DELAY 8 1074 #define IP_TOS_HIGH_TPUT 4 1075 #define IP_TOS_HIGH_RELY 2 1076 #define IP_TOS_LOW_COST 1 1077 #define IP_TOS_NORMAL 0 1078 #define IP_TOS_MASK 0x1e 1079 #define IP_TOS_MBZ_MASK 0x01 1080 #define IP_TOS_DSCP 0xfc 1081 #define IP_TOS_NO_DSCP 0x03 1083 #define IP_TOS_METRIC_TYPES 8 1084 #define IP_TOS_SHIFT 1 1086 #define IP_TOS_PRECEDENCE_MASK (IP_TOS_PRECEDENCE | IP_TOS_MASK) 1091 #define TOS_PREC_NET_CONTROL 0xe0 1092 #define TOS_PREC_INET_CONTROL 0xc0 1093 #define TOS_PREC_CRIT_ECP 0xa0 1094 #define TOS_PREC_FLASH_OVER 0x80 1095 #define TOS_PREC_FLASH 0x60 1096 #define TOS_PREC_IMMEDIATE 0x40 1097 #define TOS_PREC_PRIORITY 0x20 1098 #define TOS_PREC_ROUTINE 0x00 1099 #define TOS_PREC_ILLEGAL 0xff 1101 #define TOS_PREC_NET_CONTROL_NUM 7 1102 #define TOS_PREC_INET_CONTROL_NUM 6 1103 #define TOS_PREC_CRIT_ECP_NUM 5 1104 #define TOS_PREC_FLASH_OVER_NUM 4 1105 #define TOS_PREC_FLASH_NUM 3 1106 #define TOS_PREC_IMMEDIATE_NUM 2 1107 #define TOS_PREC_PRIORITY_NUM 1 1108 #define TOS_PREC_ROUTINE_NUM 0 1115 #define IP_FRAG_OFFSET_MASK 0x1fff 1118 #define IP_FRAG_MORE_MASK 0x2000 1119 #define IP_FRAG_DF_MASK 0x4000 1120 #define IP_FRAG_UNDEF_MASK 0x8000 1121 #define IP_FRAG_NO_DF_SET 0x0000 1124 #define IP_FRAG_MORE_BIT 13 1125 #define IP_FRAG_DF_BIT 14 1126 #define IP_FRAG_UNDEF_BIT 15 1131 #define TTL_DEFAULT 255 1176 #define IPINIP_PROT 4 1183 #define IPV6_INIP_PROT 41 1184 #define RSVP_PROT 46 1188 #define SDNS0_PROT 53 1189 #define NHRP_PROT 54 1190 #define SDNS1_PROT 55 1191 #define HELLO_PROT 63 1193 #define EONIP_PROT 80 1194 #define VINES_PROT 83 1195 #define NEWIGRP_PROT 88 1196 #define OSPF_PROT 89 1197 #define FST_RSRB_PROT 90 1198 #define FST_DLSW_PROT 91 1199 #define NOSIP_PROT 94 1200 #define PIM_PROT 103 1201 #define PCP_PROT 108 1202 #define PGM_PROT 113 1203 #define MAX_PROT 113 1223 #define TCP_FLAG_FIN 0x01 1224 #define TCP_FLAG_SYN 0x02 1225 #define TCP_FLAG_RST 0x04 1226 #define TCP_FLAG_PUSH 0x08 1227 #define TCP_FLAG_ACK 0x10 1228 #define TCP_FLAG_URG 0x20 1229 #define TCP_FLAG_ECE 0x40 1230 #define TCP_FLAG_CWR 0x80 1241 #define TCP_END_OPTIONS_LIST 0 1242 #define TCP_OPTION_NOP 1 1243 #define TCP_OPTION_MSS 2 1244 #define TCP_OPTION_WINDOW_SCALE 3 1245 #define TCP_OPTION_SACK_PERMITTED 4 1246 #define TCP_OPTION_SACK_DATA 5 1247 #define TCP_OPTION_ECHO 6 1248 #define TCP_OPTION_ECHO_REPLY 7 1249 #define TCP_OPTION_TSOPT 8 1262 #define TCP_OPTION_MD5_SIGNATURE 19 1272 #define TCP_OPTION_QUICK_START 27 1274 #define TCP_OPTION_NUM_MAX 27 1277 #define tcp_printf(format_str, params...) //printf(format_str, ## params) 1279 #define tcp_printf(format_str, params...) printf(format_str, ## params) 1289 #define TYPE_IPV6 0x86dd 1290 #define TYPE_IPV4 0x0800 1312 #define IPV6_HDR_LEN 40 1313 #define IPV6_HDR_LEN_WORDS 10 1314 #define IPV6_FLABLE_MASK 0x000FFFFF 1315 #define IPV6_MIN_PATH_MTU (1280) 1317 #define IPV6_GET_IP_VER(ih) ((clib_net_to_host_u32((ih) \ 1318 ->version_trafficclass_flowlabel) >> 28) & 0xf) 1319 #define IPV6_GET_TOS(ih) ((clib_net_to_host_u32((ih) \ 1320 ->version_trafficclass_flowlabel) >> 20) & 0xff) 1321 #define IPV6_GET_FLOW_LABEL(ih) ((clib_net_to_host_u32((ih) \ 1322 ->version_trafficclass_flowlabel)) & 0xfffff) 1324 #define IPV6_VERSION_VALUE (6) 1325 #define IPV6_VERSION_VALUE_SHIFT (28) 1326 #define IPV6_TRAFFIC_CLASS_VALUE_SHIFT (20) 1327 #define IPV6_TRAFFIC_CLASS_VALUE_MASK (0xff) 1329 #define IPV6_PROTO_HOPOPTS 0 1330 #define IPV6_PROTO_TCP 6 1331 #define IPV6_PROTO_UDP 17 1332 #define IPV6_PROTO_IPV6 41 1333 #define IPV6_PROTO_ROUTING 43 1334 #define IPV6_PROTO_FRAGMENT 44 1335 #define IPV6_PROTO_DESTOPTS 60 1336 #define IPV6_PROTO_ESP 50 1337 #define IPV6_PROTO_AH 51 1338 #define IPV6_PROTO_ICMPV6 58 1339 #define IPV6_PROTO_NONE 59 1353 #define IPV6_FRAG_HDR_LEN (sizeof(ipv6_frag_header_t)) 1355 #define IPV6_FRAG_OFFSET_MASK (0xFFF8) 1356 #define IPV6_FRAG_OFFSET_SHIFT (3) 1357 #define IPV6_FRAG_MORE_FRAG_MASK (0x0001) 1359 #define IPV6_TOS_SHIFT 20 1360 #define IPV6_TOS_SHIFT_HLF_WD 4 1361 #define IPV6_NEXT_HDR_SHIFT 8 1370 #define IPV6_ROUTING_HDR_LEN (sizeof(ipv6_routing_header_t)) 1377 #define IPV6_HOP_LEN (sizeof(ipv6_hop_header_t)) 1384 #define IPV6_DESTOPT_LEN (sizeof(ipv6_dest_opt_header_t)) 1396 #define ICMPV4_HDR_SIZE (sizeof(icmp_v4_t)) 1397 #define ICMPV4_ECHOREPLY 0 1398 #define ICMPV4_ECHO 8 1400 #define ICMPV4_UNREACHABLE 3 1401 #define ICMPV4_UNRNET 0 1402 #define ICMPV4_UNRHOST 1 1403 #define ICMPV4_UNRPROT 2 1404 #define ICMPV4_UNRPORT 3 1405 #define ICMPV4_UNRFRAG 4 1406 #define ICMPV4_UNRADMIN 13 1407 #define ICMPV4_SOURCEROUTE_FAILED 5 1409 #define ICMPV4_SRC_ROUTE_FAIL 5 1410 #define ICMPV4_NO_ROUTE_DESTN_8 8 1411 #define ICMPV4_NO_ROUTE_DESTN_11 11 1412 #define ICMPV4_NO_ROUTE_DESTN_12 12 1414 #define ICMPV4_ADMIN_PROH_9 9 1415 #define ICMPV4_ADMIN_PROH_10 10 1416 #define ICMPV4_PREC_CUTOFF 15 1419 #define ICMPV4_TIMEEXCEEDED 11 1420 #define ICMPV4_TIMTTL 0 1422 #define ICMPV4_PARAMETER_PROBLEM 12 1423 #define ICMPV4_PARAM_ERROR 0 1424 #define ICMPV4_MISSING_OPTION_CODE 1 1425 #define ICMPV4_PARAM_BAD_LEN 2 1427 #define ICMPV4_CONVERSION_ERROR 31 1428 #define ICMPV4_SOURCE_QUENCH 4 1429 #define ICMPV4_REDIRECT 5 1430 #define ICMPV4_TIMESTAMP 13 1431 #define ICMPV4_TIMESTAMP_REPLY 14 1432 #define ICMPV4_INFO_REQUEST 15 1433 #define ICMPV4_INFO_REPLY 16 1434 #define ICMPV4_ADDR_MASK_REQUEST 17 1435 #define ICMPV4_ADDR_MASK_REPLY 18 1454 #define ICMPV6_ECHO 128 1455 #define ICMPV6_ECHO_REPLY 129 1456 #define ICMPV6_PKT_TOO_BIG 2 1457 #define ICMPV6_TIMEEXCEEDED 3 1458 #define ICMPV6_TIMTTL 0 1459 #define ICMPV6_PARAMETER_PROBLEM 4 1460 #define ICMPV6_UNREACHABLE 1 1461 #define ICMPV6_NEIGHBOR_SOLICITAION 135 1462 #define ICMPV6_NEIGHBOR_ADVT 136 1464 #define ICMPV6_ERR_SIZE 48 1465 #define ICMPV6_HDR_SIZE (sizeof(icmp_v6_t) +sizeof(u32)) 1468 #define ICMPV6_UNRDESTN 0 1469 #define ICMPV6_ADM_PROH 1 1470 #define ICMPV6_SRC_ADD_SCOPE 2 1471 #define ICMPV6_UNRHOST 3 1472 #define ICMPV6_UNRPORT 4 1474 #define ICMPV6_UNRPROT 1 1476 #define ICMPV6_PTB_CODE 0 1477 #define ICMPV6_PARAM_CODE 0 1478 #define ICMPV6_UNREC_HDR 1 1479 #define ICMPV6_SRC_ADD_FAIL 5 1480 #define ICMP_ECHO_REPLY_CODE 0 1481 #define DEFAULT_TTL_HOPLIMIT_VAL 64 1524 #define MAXTCPOPTIONBYTES 40 1525 #define MINTCPOPTIONLENGTH 2 1559 u16 *ipv4_word_ptr = (
u16 *) ipv4;
1564 crc32 = (
u32)clib_net_to_host_u16(*ipv4_word_ptr) +
1565 (
u32)clib_net_to_host_u16(*(ipv4_word_ptr + 1)) +
1566 (
u32)clib_net_to_host_u16(*(ipv4_word_ptr + 2)) +
1567 (
u32)clib_net_to_host_u16(*(ipv4_word_ptr + 3)) +
1568 (
u32)clib_net_to_host_u16(*(ipv4_word_ptr + 4)) +
1569 (
u32)clib_net_to_host_u16(*(ipv4_word_ptr + 6)) +
1570 (
u32)clib_net_to_host_u16(*(ipv4_word_ptr + 7)) +
1571 (
u32)clib_net_to_host_u16(*(ipv4_word_ptr + 8)) +
1572 (
u32)clib_net_to_host_u16(*(ipv4_word_ptr + 9));
1575 crc32 = (crc32 & 0xFFFF) + (crc32 >> 16);
1577 crc32 = (crc32 & 0xFFFF) + (crc32 >> 16);
extension_802p3_type extension
extension_802p3_type extension