Lines Matching +full:iso +full:- +full:8 +full:x8

24  * complete IS-IS & CLNP support.
27 /* \summary: ISO CLNS, ESIS, and ISIS printer */
32 * CLNP: ISO 8473 (respective ITU version is at https://www.itu.int/rec/T-REC-X.233/en/)
33 * ES-IS: ISO 9542
34 * IS-IS: ISO 10589
39 #include "netdissect-stdinc.h"
53 * IS-IS is defined in ISO 10589. Look there for protocol definitions.
98 * list taken from rfc3359 plus some memory from veterans ;-)
108 #define ISIS_TLV_PADDING 8 /* iso10589 */
128 #define ISIS_TLV_SHARED_RISK_GROUP 138 /* draft-ietf-isis-gmpls-extensions */
136 #define ISIS_TLV_MT_IS_REACH 222 /* draft-ietf-isis-wg-multi-topology-05 */
137 #define ISIS_TLV_MT_SUPPORTED 229 /* draft-ietf-isis-wg-multi-topology-05 */
138 #define ISIS_TLV_IP6ADDR 232 /* draft-ietf-isis-ipv6-02 */
139 #define ISIS_TLV_MT_IP_REACH 235 /* draft-ietf-isis-wg-multi-topology-05 */
140 #define ISIS_TLV_IP6_REACH 236 /* draft-ietf-isis-ipv6-02 */
141 #define ISIS_TLV_MT_IP6_REACH 237 /* draft-ietf-isis-wg-multi-topology-05 */
143 #define ISIS_TLV_IIH_SEQNR 241 /* draft-shen-isis-iih-sequence-00 */
145 #define ISIS_TLV_VENDOR_PRIVATE 250 /* draft-ietf-isis-experimental-tlv-01 */
169 { ISIS_TLV_IDRP_INFO, "Inter-Domain Information Type"},
175 { ISIS_TLV_MT_PORT_CAP, "Multi-Topology-Aware Port Capability"},
176 { ISIS_TLV_MT_CAPABILITY, "Multi-Topology Capability"},
184 { ISIS_TLV_MT_IP_REACH, "Multi-Topology IPv4 Reachability"},
186 { ISIS_TLV_MT_IP6_REACH, "Multi-Topology IP6 Reachability"},
187 { ISIS_TLV_PTP_ADJ, "Point-to-point Adjacency State"},
189 { ISIS_TLV_ROUTER_CAPABILITY, "IS-IS Router Capability"},
234 { 0x8, "Address"},
288 /* array of 16 error-classes */
352 { ISIS_SUBTLV_ROUTER_CAP_SR, "SR-Capabilities"},
366 #define ISIS_SUBTLV_EXT_IS_REACH_IPV4_NEIGHBOR_ADDR 8 /* rfc5305 */
370 #define ISIS_SUBTLV_EXT_IS_REACH_BW_CONSTRAINTS_OLD 12 /* draft-ietf-tewg-diff-te-proto-06 */
372 #define ISIS_SUBTLV_EXT_IS_REACH_LINK_ATTRIBUTE 19 /* draft-ietf-isis-link-attr-01 */
406 #define ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG32 1 /* draft-ietf-isis-admin-tags-01 */
407 #define ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG64 2 /* draft-ietf-isis-admin-tags-01 */
409 #define ISIS_SUBTLV_EXTD_IP_REACH_MGMT_PREFIX_COLOR 117 /* draft-ietf-isis-wg-multi-topology-05 */
412 { ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG32, "32-Bit Administrative tag" },
413 { ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG64, "64-Bit Administrative tag" },
429 { ISIS_PREFIX_SID_FLAG_P, "No-PHP"},
440 { 1, "strict-SPF"},
469 { ISIS_SUBTLV_AUTH_GENERIC, "Generic Crypto key-id"},
470 { ISIS_SUBTLV_AUTH_MD5, "HMAC-MD5 password"},
481 { ISIS_SUBTLV_IDRP_LOCAL, "Routing-Domain Specific"},
498 #define ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN 8
526 nd_byte cist_root_id[8];
551 #define ISIS_MASK_LSP_ATT_DEFAULT_BIT(x) (GET_U_1(x)&0x8)
577 { 1, "In-Band Management"},
735 ndo->ndo_protocol = "isoclns"; in isoclns_print()
737 if (ndo->ndo_eflag) in isoclns_print()
759 ND_PRINT("%slength: %u", ndo->ndo_eflag ? "" : ", ", length); in isoclns_print()
763 q933_print(ndo, p + 1, length - 1); in isoclns_print()
767 ip_print(ndo, p + 1, length - 1); in isoclns_print()
771 ip6_print(ndo, p + 1, length - 1); in isoclns_print()
775 ppp_print(ndo, p + 1, length - 1); in isoclns_print()
779 if (!ndo->ndo_eflag) in isoclns_print()
781 ND_PRINT("%slength: %u", ndo->ndo_eflag ? "" : ", ", length); in isoclns_print()
834 ndo->ndo_protocol = "clnp"; in clnp_print()
838 li = GET_U_1(clnp_header->length_indicator); in clnp_print()
842 if (!ndo->ndo_eflag) in clnp_print()
849 if (GET_U_1(clnp_header->version) != CLNP_VERSION) { in clnp_print()
851 GET_U_1(clnp_header->version)); in clnp_print()
862 while (pptr < ndo->ndo_snapend) { in clnp_print()
871 clnp_pdu_type = GET_U_1(clnp_header->type) & CLNP_PDU_TYPE_MASK; in clnp_print()
872 clnp_flags = GET_U_1(clnp_header->type) & CLNP_FLAG_MASK; in clnp_print()
875 li_remaining -= sizeof(struct clnp_header_t); in clnp_print()
883 li_remaining -= 1; in clnp_print()
891 li_remaining -= dest_address_length; in clnp_print()
899 li_remaining -= 1; in clnp_print()
907 li_remaining -= source_address_length; in clnp_print()
909 if (ndo->ndo_vflag < 1) { in clnp_print()
911 ndo->ndo_eflag ? "" : ", ", in clnp_print()
918 ND_PRINT("%slength %u", ndo->ndo_eflag ? "" : ", ", length); in clnp_print()
922 GET_U_1(clnp_header->length_indicator), in clnp_print()
923 GET_U_1(clnp_header->version), in clnp_print()
924 GET_U_1(clnp_header->lifetime)/2, in clnp_print()
925 (GET_U_1(clnp_header->lifetime)%2)*5, in clnp_print()
926 GET_BE_U_2(clnp_header->segment_length), in clnp_print()
927 GET_BE_U_2(clnp_header->cksum)); in clnp_print()
929 osi_print_cksum(ndo, optr, GET_BE_U_2(clnp_header->cksum), 7, in clnp_print()
930 GET_U_1(clnp_header->length_indicator)); in clnp_print()
949 GET_BE_U_2(clnp_segment_header->data_unit_id), in clnp_print()
950 GET_BE_U_2(clnp_segment_header->segment_offset), in clnp_print()
951 GET_BE_U_2(clnp_segment_header->total_length)); in clnp_print()
953 li_remaining-=sizeof(struct clnp_segment_header_t); in clnp_print()
968 li_remaining -= 2; in clnp_print()
974 li_remaining -= opli; in clnp_print()
1008 nsap_offset-=1; /* offset to nsap list */ in clnp_print()
1014 tlen-=nsap_offset; in clnp_print()
1027 tlen-=source_address_length+1; in clnp_print()
1059 ND_PRINT("\n\t Format Code: %s, Security-Level %u", in clnp_print()
1085 * you are welcome to contribute code ;-) in clnp_print()
1092 if (ndo->ndo_vflag > 1) in clnp_print()
1102 ND_PRINT("\n\t-----original packet-----\n\t"); in clnp_print()
1104 clnp_print(ndo, pptr, length - li); in clnp_print()
1111 * ISO/IEC 8473-1:1998(E). It is not clear why in this code the same in clnp_print()
1113 * the contents -- could be a proprietary extension or a bug. In either in clnp_print()
1116 * contents as-is. in clnp_print()
1127 ND_PRINT("\n\t undecoded non-header data, length %u", length-li); in clnp_print()
1129 length - ND_BYTES_BETWEEN(optr, pptr)); in clnp_print()
1171 ndo->ndo_protocol = "esis"; in esis_print()
1172 if (!ndo->ndo_eflag) in esis_print()
1173 ND_PRINT("ES-IS"); in esis_print()
1176 ND_PRINT(ndo->ndo_qflag ? "bad pkt!" : "no header at all!"); in esis_print()
1182 li = GET_U_1(esis_header->length_indicator); in esis_print()
1189 if (GET_U_1(esis_header->nlpid) != NLPID_ESIS) { in esis_print()
1191 GET_U_1(esis_header->nlpid)); in esis_print()
1195 version = GET_U_1(esis_header->version); in esis_print()
1208 while (pptr < ndo->ndo_snapend) { in esis_print()
1215 esis_pdu_type = GET_U_1(esis_header->type) & ESIS_PDU_TYPE_MASK; in esis_print()
1217 if (ndo->ndo_vflag < 1) { in esis_print()
1219 ndo->ndo_eflag ? "" : ", ", in esis_print()
1225 ndo->ndo_eflag ? "" : ", ", in esis_print()
1231 ND_PRINT(", checksum: 0x%04x", GET_BE_U_2(esis_header->cksum)); in esis_print()
1233 osi_print_cksum(ndo, pptr, GET_BE_U_2(esis_header->cksum), 7, in esis_print()
1237 GET_BE_U_2(esis_header->holdtime), li); in esis_print()
1239 if (ndo->ndo_vflag > 1) in esis_print()
1243 li -= sizeof(struct esis_header_t); in esis_print()
1257 li--; in esis_print()
1265 li -= dstl; in esis_print()
1275 li--; in esis_print()
1283 li -= snpal; in esis_print()
1298 li -= netal; in esis_print()
1323 li--; in esis_print()
1335 li--; in esis_print()
1346 li -= source_address_length; in esis_print()
1347 source_address_number--; in esis_print()
1360 li--; in esis_print()
1368 li -= source_address_length; in esis_print()
1373 if (ndo->ndo_vflag <= 1) { in esis_print()
1396 li -= 2; in esis_print()
1401 li -= opli; in esis_print()
1426 if (opli>1) /* further NPLIDs ? - put comma */ in esis_print()
1429 opli--; in esis_print()
1435 * you are welcome to contribute code ;-) in esis_print()
1448 if (ndo->ndo_vflag > 1) in esis_print()
1465 ND_PRINT("ID: %u, Name: ", GET_U_1(mcid->format_id)); in isis_print_mcid()
1467 nd_printjnp(ndo, mcid->name, sizeof(mcid->name)); in isis_print_mcid()
1469 ND_PRINT("\n\t Lvl: %u", GET_BE_U_2(mcid->revision_lvl)); in isis_print_mcid()
1474 ND_PRINT("%.2x ", mcid->digest[i]); in isis_print_mcid()
1500 /*len -= TLV_TYPE_LEN_OFFSET;*/ in isis_print_mt_port_cap_subtlv()
1501 len -= 2; in isis_print_mt_port_cap_subtlv()
1518 isis_print_mcid(ndo, &(subtlv_spb_mcid->mcid)); in isis_print_mt_port_cap_subtlv()
1521 len -= SPB_MCID_MIN_LEN; */ in isis_print_mt_port_cap_subtlv()
1523 ND_PRINT("\n\t AUX-MCID: "); in isis_print_mt_port_cap_subtlv()
1524 isis_print_mcid(ndo, &(subtlv_spb_mcid->aux_mcid)); in isis_print_mt_port_cap_subtlv()
1527 len -= SPB_MCID_MIN_LEN; */ in isis_print_mt_port_cap_subtlv()
1529 len -= ISIS_SUBTLV_SPB_MCID_MIN_LEN; in isis_print_mt_port_cap_subtlv()
1530 stlv_len -= ISIS_SUBTLV_SPB_MCID_MIN_LEN; in isis_print_mt_port_cap_subtlv()
1550 for(i=1;i<=8; i++) { in isis_print_mt_port_cap_subtlv()
1552 if (i%4 == 0 && i != 8) in isis_print_mt_port_cap_subtlv()
1557 len -= ISIS_SUBTLV_SPB_DIGEST_MIN_LEN; in isis_print_mt_port_cap_subtlv()
1558 stlv_len -= ISIS_SUBTLV_SPB_DIGEST_MIN_LEN; in isis_print_mt_port_cap_subtlv()
1572 len -= 4; in isis_print_mt_port_cap_subtlv()
1573 stlv_len -= 4; in isis_print_mt_port_cap_subtlv()
1583 len -= 2; in isis_print_mt_port_cap_subtlv()
1584 stlv_len -= 2; in isis_print_mt_port_cap_subtlv()
1594 len -= stlv_len; in isis_print_mt_port_cap_subtlv()
1621 len -= 2; in isis_print_mt_capability_subtlv()
1640 ND_PRINT("\n\t CIST Root-ID: %08x", GET_BE_U_4(tptr)); in isis_print_mt_capability_subtlv()
1652 ND_PRINT(", SPSource-ID: %u", in isis_print_mt_capability_subtlv()
1660 len -= ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN; in isis_print_mt_capability_subtlv()
1661 stlv_len -= ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN; in isis_print_mt_capability_subtlv()
1684 len -= ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN; in isis_print_mt_capability_subtlv()
1685 stlv_len -= ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN; in isis_print_mt_capability_subtlv()
1686 treecount--; in isis_print_mt_capability_subtlv()
1692 if (stlv_len < 8) in isis_print_mt_capability_subtlv()
1704 len -= 8; in isis_print_mt_capability_subtlv()
1705 stlv_len -= 8; in isis_print_mt_capability_subtlv()
1715 len -= 4; in isis_print_mt_capability_subtlv()
1716 stlv_len -= 4; in isis_print_mt_capability_subtlv()
1725 len -= stlv_len; in isis_print_mt_capability_subtlv()
1742 /* shared routine for printing system, node and lsp-ids */
1747 static char id[sizeof("xxxx.xxxx.xxxx.yy-zz")]; in isis_print_id()
1755 snprintf(pos, sizeof(id) - (pos - id), "%02x", GET_U_1(cp)); in isis_print_id()
1762 snprintf(pos, sizeof(id) - (pos - id), ".%02x", GET_U_1(cp)); in isis_print_id()
1767 snprintf(pos, sizeof(id) - (pos - id), "-%02x", GET_U_1(cp)); in isis_print_id()
1771 /* print the 4-byte metric block which is common found in the old-style TLVs */
1777 ISIS_LSP_TLV_METRIC_VALUE(isis_metric_block->metric_default), in isis_print_metric_block()
1778 ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_default) ? "External" : "Internal"); in isis_print_metric_block()
1779 if (!ISIS_LSP_TLV_METRIC_SUPPORTED(isis_metric_block->metric_delay)) in isis_print_metric_block()
1781 ISIS_LSP_TLV_METRIC_VALUE(isis_metric_block->metric_delay), in isis_print_metric_block()
1782 ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_delay) ? "External" : "Internal"); in isis_print_metric_block()
1783 if (!ISIS_LSP_TLV_METRIC_SUPPORTED(isis_metric_block->metric_expense)) in isis_print_metric_block()
1785 ISIS_LSP_TLV_METRIC_VALUE(isis_metric_block->metric_expense), in isis_print_metric_block()
1786 ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_expense) ? "External" : "Internal"); in isis_print_metric_block()
1787 if (!ISIS_LSP_TLV_METRIC_SUPPORTED(isis_metric_block->metric_error)) in isis_print_metric_block()
1789 ISIS_LSP_TLV_METRIC_VALUE(isis_metric_block->metric_error), in isis_print_metric_block()
1790 ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_error) ? "External" : "Internal"); in isis_print_metric_block()
1814 prefix_len = mask2plen(GET_IPV4_TO_HOST_ORDER(tlv_ip_reach->mask)); in isis_print_tlv_ip_reach()
1816 if (prefix_len == -1) in isis_print_tlv_ip_reach()
1819 GET_IPADDR_STRING(tlv_ip_reach->prefix), in isis_print_tlv_ip_reach()
1820 GET_IPADDR_STRING(tlv_ip_reach->mask)); in isis_print_tlv_ip_reach()
1824 GET_IPADDR_STRING(tlv_ip_reach->prefix), in isis_print_tlv_ip_reach()
1828 … ISIS_LSP_TLV_METRIC_UPDOWN(tlv_ip_reach->isis_metric_block.metric_default) ? "down" : "up", in isis_print_tlv_ip_reach()
1829 ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_default), in isis_print_tlv_ip_reach()
1830 … ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_default) ? "External" : "Internal"); in isis_print_tlv_ip_reach()
1832 if (!ISIS_LSP_TLV_METRIC_SUPPORTED(tlv_ip_reach->isis_metric_block.metric_delay)) in isis_print_tlv_ip_reach()
1835 ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_delay), in isis_print_tlv_ip_reach()
1836 … ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_delay) ? "External" : "Internal"); in isis_print_tlv_ip_reach()
1838 if (!ISIS_LSP_TLV_METRIC_SUPPORTED(tlv_ip_reach->isis_metric_block.metric_expense)) in isis_print_tlv_ip_reach()
1841 … ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_expense), in isis_print_tlv_ip_reach()
1842 … ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_expense) ? "External" : "Internal"); in isis_print_tlv_ip_reach()
1844 if (!ISIS_LSP_TLV_METRIC_SUPPORTED(tlv_ip_reach->isis_metric_block.metric_error)) in isis_print_tlv_ip_reach()
1847 ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_error), in isis_print_tlv_ip_reach()
1848 … ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_error) ? "External" : "Internal"); in isis_print_tlv_ip_reach()
1850 length -= sizeof(struct isis_tlv_ip_reach); in isis_print_tlv_ip_reach()
1859 * this is the common IP-REACH subTLV decoder it is called
1860 * from various EXTD-IP REACH TLVs (135,235,236,237)
1883 subl-=4; in isis_print_ip_reach_subtlv()
1887 while (subl >= 8) { in isis_print_ip_reach_subtlv()
1891 tptr+=8; in isis_print_ip_reach_subtlv()
1892 subl-=8; in isis_print_ip_reach_subtlv()
1908 subl-=5; in isis_print_ip_reach_subtlv()
1914 subl-=6; in isis_print_ip_reach_subtlv()
1937 * this is the common IS-REACH decoder it is called
1938 * from various EXTD-IS REACH style TLVs (22,24,222)
1961 tlv_remaining-=NODE_ID_LEN; in isis_print_ext_is_reach()
1970 tlv_remaining-=3; in isis_print_ext_is_reach()
1979 tlv_remaining--; in isis_print_ext_is_reach()
1981 ND_PRINT(", %ssub-TLVs present",subtlv_sum_len ? "" : "no "); in isis_print_ext_is_reach()
2002 tlv_remaining -= 2; in isis_print_ext_is_reach()
2003 subtlv_sum_len -= 2; in isis_print_ext_is_reach()
2029 if (subtlv_len == 8) /* rfc4205 */ in isis_print_ext_is_reach()
2042 ND_PRINT(", %.3f Mbps", bw.f * 8 / 1000000); in isis_print_ext_is_reach()
2047 for (te_class = 0; te_class < 8; te_class++) { in isis_print_ext_is_reach()
2049 ND_PRINT("%s TE-Class %u: %.3f Mbps", in isis_print_ext_is_reach()
2052 bw.f * 8 / 1000000); in isis_print_ext_is_reach()
2054 subtlv_len -= 4; in isis_print_ext_is_reach()
2055 subtlv_sum_len -= 4; in isis_print_ext_is_reach()
2069 subtlv_len--; in isis_print_ext_is_reach()
2070 subtlv_sum_len--; in isis_print_ext_is_reach()
2080 bw.f * 8 / 1000000); in isis_print_ext_is_reach()
2082 subtlv_len -= 4; in isis_print_ext_is_reach()
2083 subtlv_sum_len -= 4; in isis_print_ext_is_reach()
2111 subtlv_len -= 3; in isis_print_ext_is_reach()
2112 subtlv_sum_len -= 3; in isis_print_ext_is_reach()
2116 subtlv_len--; in isis_print_ext_is_reach()
2117 subtlv_sum_len--; in isis_print_ext_is_reach()
2119 ND_PRINT(", P-ID: %u", GET_BE_U_2(tptr)); in isis_print_ext_is_reach()
2131 subtlv_len -= 4; in isis_print_ext_is_reach()
2132 subtlv_sum_len -= 4; in isis_print_ext_is_reach()
2135 for (priority_level = 0; priority_level < 8; priority_level++) { in isis_print_ext_is_reach()
2140 bw.f * 8 / 1000000); in isis_print_ext_is_reach()
2142 subtlv_len -= 4; in isis_print_ext_is_reach()
2143 subtlv_sum_len -= 4; in isis_print_ext_is_reach()
2154 ND_PRINT("%s Min LSP Bandwidth: %.3f Mbps", ident, bw.f * 8 / 1000000); in isis_print_ext_is_reach()
2159 if (subtlv_len < 8) in isis_print_ext_is_reach()
2162 ND_PRINT("%s Min LSP Bandwidth: %.3f Mbps", ident, bw.f * 8 / 1000000); in isis_print_ext_is_reach()
2177 if (subtlv_len >= 8) { in isis_print_ext_is_reach()
2185 subtlv_len--; in isis_print_ext_is_reach()
2186 subtlv_sum_len--; in isis_print_ext_is_reach()
2190 subtlv_len--; in isis_print_ext_is_reach()
2191 subtlv_sum_len--; in isis_print_ext_is_reach()
2195 ND_PRINT("%s Neighbor System-ID: %s", ident, in isis_print_ext_is_reach()
2199 /* if V-flag is set to 1 and L-flag is set to 1 ==> 3 octet label */ in isis_print_ext_is_reach()
2200 /* if V-flag is set to 0 and L-flag is set to 0 ==> 4 octet index */ in isis_print_ext_is_reach()
2218 tlv_remaining -= subtlv_len; in isis_print_ext_is_reach()
2219 subtlv_sum_len -= subtlv_len; in isis_print_ext_is_reach()
2231 * it is called from various MT-TLVs (222,229,235,237)
2300 byte_length = (bit_length + 7) / 8; /* prefix has variable length encoding */ in isis_print_extd_ip_reach()
2323 ND_PRINT(", sub-TLVs present"); in isis_print_extd_ip_reach()
2327 ISIS_MASK_TLV_EXTD_IP6_SUBTLV(status_byte) ? ", sub-TLVs present" : ""); in isis_print_extd_ip_reach()
2333 than one subTLV - therefore the first byte must reflect in isis_print_extd_ip_reach()
2350 sublen-=(subtlvlen+2); in isis_print_extd_ip_reach()
2364 tlen -= 2; in isis_print_router_cap_subtlv()
2393 sid_tlen = subl - 4; in isis_print_router_cap_subtlv()
2398 sid_tlen -= 2; in isis_print_router_cap_subtlv()
2423 sid_tlen -= sid_len; in isis_print_router_cap_subtlv()
2432 tlen -= subl; in isis_print_router_cap_subtlv()
2447 header_lsp->checksum[0] = 0; in isis_clear_checksum_lifetime()
2448 header_lsp->checksum[1] = 0; in isis_clear_checksum_lifetime()
2449 header_lsp->remaining_lifetime[0] = 0; in isis_clear_checksum_lifetime()
2450 header_lsp->remaining_lifetime[1] = 0; in isis_clear_checksum_lifetime()
2455 * Decode IS-IS packets. Return 0 on error.
2464 length -= (decr);
2496 ndo->ndo_protocol = "isis"; in isis_print()
2498 optr = p; /* initialize the _o_riginal pointer to the packet start - in isis_print()
2512 if (!ndo->ndo_eflag) in isis_print()
2513 ND_PRINT("IS-IS"); in isis_print()
2519 version = GET_U_1(isis_header->version); in isis_print()
2525 pdu_id_length = GET_U_1(isis_header->id_length); in isis_print()
2532 pdu_version = GET_U_1(isis_header->pdu_version); in isis_print()
2538 fixed_len = GET_U_1(isis_header->fixed_len); in isis_print()
2549 pdu_max_area = GET_U_1(isis_header->max_area); in isis_print()
2555 ND_PRINT("bad packet -- 255 areas"); in isis_print()
2566 case 1: /* 1-8 are valid sys-ID lengths */ in isis_print()
2573 case 8: in isis_print()
2584 /* toss any non 6-byte sys-ID len PDUs */ in isis_print()
2586 ND_PRINT("bad packet -- illegal sys-ID length (%u)", id_length); in isis_print()
2590 pdu_type = GET_U_1(isis_header->pdu_type); in isis_print()
2592 /* in non-verbose mode print the basic PDU Type plus PDU specific brief information*/ in isis_print()
2593 if (ndo->ndo_vflag == 0) { in isis_print()
2595 ndo->ndo_eflag ? "" : ", ", in isis_print()
2596 tok2str(isis_pdu_values, "unknown PDU-Type %u", pdu_type)); in isis_print()
2598 /* ok they seem to want to know everything - lets fully decode it */ in isis_print()
2599 ND_PRINT("%slength %u", ndo->ndo_eflag ? "" : ", ", length); in isis_print()
2601 ND_PRINT("\n\t%s, hlen: %u, v: %u, pdu-v: %u, sys-id-len: %u (%u), max-area: %u (%u)", in isis_print()
2613 if (ndo->ndo_vflag > 1) { in isis_print()
2614 if (!print_unknown_data(ndo, optr, "\n\t", 8)) /* provide the _o_riginal pointer */ in isis_print()
2631 if (ndo->ndo_vflag == 0) { in isis_print()
2632 ND_PRINT(", src-id %s", in isis_print()
2633 isis_print_id(ndo, header_iih_lan->source_id, SYSTEM_ID_LEN)); in isis_print()
2634 ND_PRINT(", lan-id %s, prio %u", in isis_print()
2635 isis_print_id(ndo, header_iih_lan->lan_id,NODE_ID_LEN), in isis_print()
2636 GET_U_1(header_iih_lan->priority)); in isis_print()
2640 pdu_len=GET_BE_U_2(header_iih_lan->pdu_len); in isis_print()
2646 ND_PRINT("\n\t source-id: %s, holding time: %us, Flags: [%s]", in isis_print()
2647 isis_print_id(ndo, header_iih_lan->source_id,SYSTEM_ID_LEN), in isis_print()
2648 GET_BE_U_2(header_iih_lan->holding_time), in isis_print()
2651 GET_U_1(header_iih_lan->circuit_type))); in isis_print()
2653 ND_PRINT("\n\t lan-id: %s, Priority: %u, PDU length: %u", in isis_print()
2654 isis_print_id(ndo, header_iih_lan->lan_id, NODE_ID_LEN), in isis_print()
2655 GET_U_1(header_iih_lan->priority) & ISIS_LAN_PRIORITY_MASK, in isis_print()
2658 if (ndo->ndo_vflag > 1) { in isis_print()
2676 if (ndo->ndo_vflag == 0) { in isis_print()
2677 ND_PRINT(", src-id %s", isis_print_id(ndo, header_iih_ptp->source_id, SYSTEM_ID_LEN)); in isis_print()
2681 pdu_len=GET_BE_U_2(header_iih_ptp->pdu_len); in isis_print()
2687 ND_PRINT("\n\t source-id: %s, holding time: %us, Flags: [%s]", in isis_print()
2688 isis_print_id(ndo, header_iih_ptp->source_id,SYSTEM_ID_LEN), in isis_print()
2689 GET_BE_U_2(header_iih_ptp->holding_time), in isis_print()
2692 GET_U_1(header_iih_ptp->circuit_type))); in isis_print()
2694 ND_PRINT("\n\t circuit-id: 0x%02x, PDU length: %u", in isis_print()
2695 GET_U_1(header_iih_ptp->circuit_id), in isis_print()
2698 if (ndo->ndo_vflag > 1) { in isis_print()
2716 if (ndo->ndo_vflag == 0) { in isis_print()
2717 ND_PRINT(", lsp-id %s, seq 0x%08x, lifetime %5us", in isis_print()
2718 isis_print_id(ndo, header_lsp->lsp_id, LSP_ID_LEN), in isis_print()
2719 GET_BE_U_4(header_lsp->sequence_number), in isis_print()
2720 GET_BE_U_2(header_lsp->remaining_lifetime)); in isis_print()
2724 pdu_len=GET_BE_U_2(header_lsp->pdu_len); in isis_print()
2730 ND_PRINT("\n\t lsp-id: %s, seq: 0x%08x, lifetime: %5us\n\t chksum: 0x%04x", in isis_print()
2731 isis_print_id(ndo, header_lsp->lsp_id, LSP_ID_LEN), in isis_print()
2732 GET_BE_U_4(header_lsp->sequence_number), in isis_print()
2733 GET_BE_U_2(header_lsp->remaining_lifetime), in isis_print()
2734 GET_BE_U_2(header_lsp->checksum)); in isis_print()
2736 osi_print_cksum(ndo, (const uint8_t *)header_lsp->lsp_id, in isis_print()
2737 GET_BE_U_2(header_lsp->checksum), in isis_print()
2738 12, length-12); in isis_print()
2742 ISIS_MASK_LSP_OL_BIT(header_lsp->typeblock) ? "Overload bit set, " : ""); in isis_print()
2744 if (ISIS_MASK_LSP_ATT_BITS(header_lsp->typeblock)) { in isis_print()
2745 ND_PRINT("%s", ISIS_MASK_LSP_ATT_DEFAULT_BIT(header_lsp->typeblock) ? "default " : ""); in isis_print()
2746 ND_PRINT("%s", ISIS_MASK_LSP_ATT_DELAY_BIT(header_lsp->typeblock) ? "delay " : ""); in isis_print()
2747 ND_PRINT("%s", ISIS_MASK_LSP_ATT_EXPENSE_BIT(header_lsp->typeblock) ? "expense " : ""); in isis_print()
2748 ND_PRINT("%s", ISIS_MASK_LSP_ATT_ERROR_BIT(header_lsp->typeblock) ? "error " : ""); in isis_print()
2751 ND_PRINT("%s", ISIS_MASK_LSP_PARTITION_BIT(header_lsp->typeblock) ? "P bit set, " : ""); in isis_print()
2753 ISIS_MASK_LSP_ISTYPE_BITS(header_lsp->typeblock))); in isis_print()
2755 if (ndo->ndo_vflag > 1) { in isis_print()
2774 if (ndo->ndo_vflag == 0) { in isis_print()
2775 ND_PRINT(", src-id %s", isis_print_id(ndo, header_csnp->source_id, NODE_ID_LEN)); in isis_print()
2779 pdu_len=GET_BE_U_2(header_csnp->pdu_len); in isis_print()
2785 ND_PRINT("\n\t source-id: %s, PDU length: %u", in isis_print()
2786 isis_print_id(ndo, header_csnp->source_id, NODE_ID_LEN), in isis_print()
2788 ND_PRINT("\n\t start lsp-id: %s", in isis_print()
2789 isis_print_id(ndo, header_csnp->start_lsp_id, LSP_ID_LEN)); in isis_print()
2790 ND_PRINT("\n\t end lsp-id: %s", in isis_print()
2791 isis_print_id(ndo, header_csnp->end_lsp_id, LSP_ID_LEN)); in isis_print()
2793 if (ndo->ndo_vflag > 1) { in isis_print()
2805 ND_PRINT("- bogus fixed header length %u should be %zu", in isis_print()
2812 if (ndo->ndo_vflag == 0) { in isis_print()
2813 ND_PRINT(", src-id %s", isis_print_id(ndo, header_psnp->source_id, NODE_ID_LEN)); in isis_print()
2817 pdu_len=GET_BE_U_2(header_psnp->pdu_len); in isis_print()
2823 ND_PRINT("\n\t source-id: %s, PDU length: %u", in isis_print()
2824 isis_print_id(ndo, header_psnp->source_id, NODE_ID_LEN), in isis_print()
2827 if (ndo->ndo_vflag > 1) { in isis_print()
2837 if (ndo->ndo_vflag == 0) { in isis_print()
2856 packet_len -= 2; in isis_print()
2877 tlen--; in isis_print()
2884 tlen -= alen; in isis_print()
2893 tlen -= MAC_ADDR_LEN; in isis_print()
2901 num_vals = (tlen-2)/2; in isis_print()
2906 tlen -= 2; in isis_print()
2909 if (i < (num_vals - 1)) { in isis_print()
2913 tlen -= 2; in isis_print()
2925 tlen-=mt_len; in isis_print()
2935 tlen-=(uint8_t)ext_is_len; in isis_print()
2950 tlen-=(uint8_t)ext_is_len; in isis_print()
2965 tlen-=(uint8_t)ext_is_len; in isis_print()
2977 tlen--; in isis_print()
2984 isis_print_id(ndo, tlv_is_reach->neighbor_nodeid, NODE_ID_LEN)); in isis_print()
2985 isis_print_metric_block(ndo, &tlv_is_reach->isis_metric_block); in isis_print()
2986 tlen -= sizeof(struct isis_tlv_is_reach); in isis_print()
2998 isis_print_id(ndo, tlv_es_reach->neighbor_sysid, SYSTEM_ID_LEN)); in isis_print()
2999 isis_print_metric_block(ndo, &tlv_es_reach->isis_metric_block); in isis_print()
3000 tlen -= sizeof(struct isis_tlv_es_reach); in isis_print()
3022 tlen-=(uint8_t)ext_ip_len; in isis_print()
3033 tlen-=mt_len; in isis_print()
3044 tlen-=(uint8_t)ext_ip_len; in isis_print()
3059 tlen-=(uint8_t)ext_ip_len; in isis_print()
3070 tlen-=mt_len; in isis_print()
3081 tlen-=(uint8_t)ext_ip_len; in isis_print()
3094 tlen -= sizeof(nd_ipv6); in isis_print()
3102 tlen--; in isis_print()
3132 tlen -= 2; in isis_print()
3151 tlen--; in isis_print()
3153 if(tlen>sizeof(tlv_ptp_adj->extd_local_circuit_id)) { in isis_print()
3154 ND_PRINT("\n\t Extended Local circuit-ID: 0x%08x", in isis_print()
3155 GET_BE_U_4(tlv_ptp_adj->extd_local_circuit_id)); in isis_print()
3156 tlen-=sizeof(tlv_ptp_adj->extd_local_circuit_id); in isis_print()
3159 ND_TCHECK_LEN(tlv_ptp_adj->neighbor_sysid, SYSTEM_ID_LEN); in isis_print()
3160 ND_PRINT("\n\t Neighbor System-ID: %s", in isis_print()
3161 isis_print_id(ndo, tlv_ptp_adj->neighbor_sysid, SYSTEM_ID_LEN)); in isis_print()
3162 tlen-=SYSTEM_ID_LEN; in isis_print()
3164 if(tlen>=sizeof(tlv_ptp_adj->neighbor_extd_local_circuit_id)) { in isis_print()
3165 ND_PRINT("\n\t Neighbor Extended Local circuit-ID: 0x%08x", in isis_print()
3166 GET_BE_U_4(tlv_ptp_adj->neighbor_extd_local_circuit_id)); in isis_print()
3178 if (tlen>1) /* further NPLIDs ? - put comma */ in isis_print()
3181 tlen--; in isis_print()
3195 tlen -= 2; in isis_print()
3213 tlen -= 2; in isis_print()
3232 tlen -= sizeof(nd_ipv4); in isis_print()
3247 tlen-=NODE_ID_LEN; in isis_print()
3254 tlen--; in isis_print()
3260 tlen-=sizeof(nd_ipv4); in isis_print()
3266 tlen-=sizeof(nd_ipv4); in isis_print()
3271 ND_PRINT("\n\t Link-ID: 0x%08x", GET_BE_U_4(tptr)); in isis_print()
3273 tlen-=4; in isis_print()
3282 ND_TCHECK_1(tlv_lsp->lsp_id + LSP_ID_LEN - 1); in isis_print()
3283 ND_PRINT("\n\t lsp-id: %s", in isis_print()
3284 isis_print_id(ndo, tlv_lsp->lsp_id, LSP_ID_LEN)); in isis_print()
3286 GET_BE_U_4(tlv_lsp->sequence_number)); in isis_print()
3288 GET_BE_U_2(tlv_lsp->remaining_lifetime)); in isis_print()
3289 ND_PRINT(", chksum: 0x%04x", GET_BE_U_2(tlv_lsp->checksum)); in isis_print()
3290 tlen-=sizeof(struct isis_tlv_lsp); in isis_print()
3301 * most likely a HMAC-MD5 TLV is also present and in isis_print()
3305 osi_print_cksum(ndo, optr, GET_BE_U_2(tptr), (int)(tptr-optr), in isis_print()
3314 tlen--; in isis_print()
3322 ND_PRINT("\n\t Purge Originator System-ID: %s", in isis_print()
3325 tlen -= SYSTEM_ID_LEN; in isis_print()
3332 ND_PRINT("\n\t Received from System-ID: %s", in isis_print()
3341 something broken -> so decode down until length is 1 */ in isis_print()
3347 tlen-=mt_len; in isis_print()
3349 ND_PRINT("\n\t invalid MT-ID"); in isis_print()
3363 tlen-=ISIS_TLV_RESTART_SIGNALING_FLAGLEN; in isis_print()
3375 tlen-=ISIS_TLV_RESTART_SIGNALING_HOLDTIMELEN; in isis_print()
3388 ND_PRINT("\n\t Inter-Domain Information Type: %s", in isis_print()
3393 tlen--; in isis_print()
3422 tlen-=SYSTEM_ID_LEN; in isis_print()
3433 tlen-=sizeof(struct isis_metric_block); in isis_print()
3438 tlen--; in isis_print()
3448 tlen-=prefix_len/2; in isis_print()
3464 ND_PRINT("\n\t Router-ID %s", GET_IPADDR_STRING(tptr)); in isis_print()
3468 /* Optional set of sub-TLV */ in isis_print()
3470 isis_print_router_cap_subtlv(ndo, tptr+5, tlen-5); in isis_print()
3482 tlen-=3; in isis_print()
3489 * you are welcome to contribute code ;-) in isis_print()
3499 if (ndo->ndo_vflag <= 1) { in isis_print()
3507 if (ndo->ndo_vflag> 1) { in isis_print()
3513 packet_len -= tlv_len; in isis_print()