diff options
Diffstat (limited to 'epan/dissectors/packet-ospf.c')
-rw-r--r-- | epan/dissectors/packet-ospf.c | 886 |
1 files changed, 447 insertions, 439 deletions
diff --git a/epan/dissectors/packet-ospf.c b/epan/dissectors/packet-ospf.c index 6d046198c8..77c1d3a25a 100644 --- a/epan/dissectors/packet-ospf.c +++ b/epan/dissectors/packet-ospf.c @@ -68,6 +68,9 @@ void proto_register_ospf(void); void proto_reg_handoff_ospf(void); +static dissector_handle_t ospf_handle; +static capture_dissector_handle_t ospf_cap_handle; + #define OSPF_VERSION_2 2 #define OSPF_VERSION_3 3 #define OSPF_AF_4 4 @@ -117,15 +120,15 @@ static const value_string auth_vals[] = { #define OSPF_V2_OPTIONS_DC 0x20 #define OSPF_V2_OPTIONS_O 0x40 #define OSPF_V2_OPTIONS_DN 0x80 -#define OSPF_V3_OPTIONS_V6 0x01 -#define OSPF_V3_OPTIONS_E 0x02 -#define OSPF_V3_OPTIONS_MC 0x04 -#define OSPF_V3_OPTIONS_N 0x08 -#define OSPF_V3_OPTIONS_R 0x10 -#define OSPF_V3_OPTIONS_DC 0x20 -#define OSPF_V3_OPTIONS_AF 0x0100 -#define OSPF_V3_OPTIONS_L 0x0200 -#define OSPF_V3_OPTIONS_AT 0x0400 +#define OSPF_V3_OPTIONS_V6 0x000001 +#define OSPF_V3_OPTIONS_E 0x000002 +#define OSPF_V3_OPTIONS_MC 0x000004 +#define OSPF_V3_OPTIONS_N 0x000008 +#define OSPF_V3_OPTIONS_R 0x000010 +#define OSPF_V3_OPTIONS_DC 0x000020 +#define OSPF_V3_OPTIONS_AF 0x000100 +#define OSPF_V3_OPTIONS_L 0x000200 +#define OSPF_V3_OPTIONS_AT 0x000400 /* Bitmask definitions for the informational capabilities bits. */ #define OSPF_RI_OPTIONS_GRC 0x80 @@ -258,6 +261,7 @@ static const value_string grace_tlv_type_vals[] = { #define OPAQUE_TLV_NAT 10 #define OPAQUE_TLV_SBD 11 #define OPAQUE_TLV_NODE_MSD 12 +#define OPAQUE_TLV_TUNN_ENCAPS 13 #define OPAQUE_TLV_SRLB 14 #define OPAQUE_TLV_SRMS_PREF 15 #define OPAQUE_TLV_FLEX_ALGO_DEF 16 @@ -276,6 +280,7 @@ static const value_string ri_tlv_type_vals[] = { {OPAQUE_TLV_NAT, "Node Admin Tag " }, {OPAQUE_TLV_SBD, "S-BFD Discriminator" }, {OPAQUE_TLV_NODE_MSD, "Node MSD" }, + {OPAQUE_TLV_TUNN_ENCAPS, "Tunnel Encapsulations" }, {OPAQUE_TLV_SRLB, "SR Local Block" }, {OPAQUE_TLV_SRMS_PREF, "SRMS Preference" }, {OPAQUE_TLV_FLEX_ALGO_DEF, "Flexible Algorithm Definition" }, @@ -350,7 +355,7 @@ static const value_string ls_type_vals[] = { static const value_string ls_opaque_type_vals[] = { {OSPF_LSA_MPLS_TE, "Traffic Engineering LSA" }, {OSPF_LSA_SYCAMORE, "Sycamore Optical Topology Descriptions" }, - {OSPF_LSA_GRACE, "grace-LSA" }, + {OSPF_LSA_GRACE, "Grace-LSA" }, {OSPF_LSA_OPAQUE_RI, "Router Information (RI)" }, {OSPF_LSA_L1VPN, "L1VPN LSA" }, {OSPF_LSA_IAS_TE_V2, "Inter-AS-TE-v2 LSA" }, @@ -469,6 +474,7 @@ static const true_false_string tfs_arbitrary_standard = { "Arbitrary", "Standard #define OSPF_V2_ROUTER_LSA_FLAG_V 0x04 #define OSPF_V2_ROUTER_LSA_FLAG_W 0x08 #define OSPF_V2_ROUTER_LSA_FLAG_N 0x10 +#define OSPF_V2_ROUTER_LSA_FLAG_S 0x20 #define OSPF_V2_ROUTER_LSA_FLAG_H 0x80 #define OSPF_V3_ROUTER_LSA_FLAG_B 0x01 #define OSPF_V3_ROUTER_LSA_FLAG_E 0x02 @@ -588,83 +594,83 @@ static const value_string ext_link_stlv_type_vals[] = { {0, NULL} }; -static int proto_ospf = -1; - -static gint ett_ospf = -1; -static gint ett_ospf_at = -1; -static gint ett_ospf_hdr = -1; -static gint ett_ospf_hello = -1; -static gint ett_ospf_desc = -1; -static gint ett_ospf_lsr = -1; -static gint ett_ospf_lsa = -1; -static gint ett_ospf_lsa_router_link = -1; -static gint ett_ospf_lsa_upd = -1; -static gint ett_ospf_v2_options = -1; -static gint ett_ospf_ri_options = -1; -static gint ett_ospf_v3_options = -1; -static gint ett_ospf_dbd = -1; -static gint ett_ospf_lls_data_block = -1; -static gint ett_ospf_lls_tlv = -1; -static gint ett_ospf_lls_ext_options = -1; -static gint ett_ospf_v3_lls_ext_options_tlv = -1; -static gint ett_ospf_v3_lls_ext_options = -1; -static gint ett_ospf_v3_lls_state_tlv = -1; -static gint ett_ospf_v3_lls_state_scs = -1; -static gint ett_ospf_v3_lls_state_options = -1; -static gint ett_ospf_v3_lls_drop_tlv = -1; -static gint ett_ospf_v3_lls_relay_tlv = -1; -static gint ett_ospf_v3_lls_relay_added = -1; -static gint ett_ospf_v3_lls_relay_options = -1; -static gint ett_ospf_v3_lls_willingness_tlv = -1; -static gint ett_ospf_v3_lls_willingness = -1; -static gint ett_ospf_v3_lls_rf_tlv = -1; -static gint ett_ospf_v3_lls_fsf_tlv = -1; -static gint ett_ospf_v2_router_lsa_flags = -1; -static gint ett_ospf_v3_router_lsa_flags = -1; -static gint ett_ospf_v3_as_external_flags = -1; -static gint ett_ospf_v3_prefix_options = -1; -static gint ett_ospf_v3_router_interface = -1; -static gint ett_ospf_v3_router_interface_entry = -1; -static gint ett_ospf_mpls_pri = -1; -static gint ett_ospf_mpls_bitmap = -1; +static int proto_ospf; + +static gint ett_ospf; +static gint ett_ospf_at; +static gint ett_ospf_hdr; +static gint ett_ospf_hello; +static gint ett_ospf_desc; +static gint ett_ospf_lsr; +static gint ett_ospf_lsa; +static gint ett_ospf_lsa_router_link; +static gint ett_ospf_lsa_upd; +static gint ett_ospf_v2_options; +static gint ett_ospf_ri_options; +static gint ett_ospf_v3_options; +static gint ett_ospf_dbd; +static gint ett_ospf_lls_data_block; +static gint ett_ospf_lls_tlv; +static gint ett_ospf_lls_ext_options; +static gint ett_ospf_v3_lls_ext_options_tlv; +static gint ett_ospf_v3_lls_ext_options; +static gint ett_ospf_v3_lls_state_tlv; +static gint ett_ospf_v3_lls_state_scs; +static gint ett_ospf_v3_lls_state_options; +static gint ett_ospf_v3_lls_drop_tlv; +static gint ett_ospf_v3_lls_relay_tlv; +static gint ett_ospf_v3_lls_relay_added; +static gint ett_ospf_v3_lls_relay_options; +static gint ett_ospf_v3_lls_willingness_tlv; +static gint ett_ospf_v3_lls_willingness; +static gint ett_ospf_v3_lls_rf_tlv; +static gint ett_ospf_v3_lls_fsf_tlv; +static gint ett_ospf_v2_router_lsa_flags; +static gint ett_ospf_v3_router_lsa_flags; +static gint ett_ospf_v3_as_external_flags; +static gint ett_ospf_v3_prefix_options; +static gint ett_ospf_v3_router_interface; +static gint ett_ospf_v3_router_interface_entry; +static gint ett_ospf_mpls_pri; +static gint ett_ospf_mpls_bitmap; /* Trees for opaque LSAs */ -static gint ett_ospf_lsa_mpls = -1; -static gint ett_ospf_lsa_mpls_bandwidth_sstlv = -1; -static gint ett_ospf_lsa_mpls_base_label = -1; -static gint ett_ospf_lsa_mpls_router = -1; -static gint ett_ospf_lsa_mpls_link = -1; -static gint ett_ospf_lsa_mpls_link_stlv = -1; -static gint ett_ospf_lsa_mpls_link_stlv_admingrp = -1; -static gint ett_ospf_lsa_oif_tna = -1; -static gint ett_ospf_lsa_oif_tna_stlv = -1; -static gint ett_ospf_lsa_grace_tlv = -1; -static gint ett_ospf_lsa_opaque_ri = -1; -static gint ett_ospf_lsa_ri_tlv = -1; -static gint ett_ospf_lsa_dh_tlv = -1; -static gint ett_ospf_lsa_sa_tlv = -1; -static gint ett_ospf_lsa_slr_tlv = -1; -static gint ett_ospf_lsa_slr_stlv = -1; -static gint ett_ospf_lsa_srms_tlv = -1; -static gint ett_ospf_lsa_node_msd_tlv = -1; -static gint ett_ospf_lsa_fad_tlv = -1; -static gint ett_ospf_lsa_fad_stlv = -1; -static gint ett_ospf_lsa_elink = -1; -static gint ett_ospf_lsa_epfx = -1; -static gint ett_ospf_lsa_elink_tlv = -1; -static gint ett_ospf_lsa_elink_stlv = -1; -static gint ett_ospf_lsa_epfx_tlv = -1; -static gint ett_ospf_lsa_epfx_flags = -1; -static gint ett_ospf_lsa_epfx_stlv = -1; -static gint ett_ospf_lsa_epfx_range_flags = -1; -static gint ett_ospf_lsa_pfxsid_flags = -1; -static gint ett_ospf_lsa_adjsid_flags = -1; -static gint ett_ospf_lsa_app_sabm_bits = -1; -static gint ett_ospf_lsa_app_link_attrs_stlv = -1; -static gint ett_ospf_lsa_unidir_link_flags = -1; -static gint ett_ospf_lsa_unknown_tlv = -1; - -static gint ett_ospf_lsa_type = -1; +static gint ett_ospf_lsa_mpls; +static gint ett_ospf_lsa_mpls_bandwidth_sstlv; +static gint ett_ospf_lsa_mpls_base_label; +static gint ett_ospf_lsa_mpls_router; +static gint ett_ospf_lsa_mpls_link; +static gint ett_ospf_lsa_mpls_link_stlv; +static gint ett_ospf_lsa_mpls_link_stlv_admingrp; +static gint ett_ospf_lsa_oif_tna; +static gint ett_ospf_lsa_oif_tna_stlv; +static gint ett_ospf_lsa_grace_tlv; +static gint ett_ospf_lsa_opaque_ri; +static gint ett_ospf_lsa_ri_tlv; +static gint ett_ospf_lsa_dh_tlv; +static gint ett_ospf_lsa_sa_tlv; +static gint ett_ospf_lsa_slr_tlv; +static gint ett_ospf_lsa_slr_stlv; +static gint ett_ospf_lsa_srms_tlv; +static gint ett_ospf_lsa_node_msd_tlv; +static gint ett_ospf_lsa_fad_tlv; +static gint ett_ospf_lsa_fad_stlv; +static gint ett_ospf_lsa_elink; +static gint ett_ospf_lsa_epfx; +static gint ett_ospf_lsa_elink_tlv; +static gint ett_ospf_lsa_elink_stlv; +static gint ett_ospf_lsa_epfx_tlv; +static gint ett_ospf_lsa_epfx_flags; +static gint ett_ospf_lsa_epfx_stlv; +static gint ett_ospf_lsa_epfx_range_flags; +static gint ett_ospf_lsa_pfxsid_flags; +static gint ett_ospf_lsa_adjsid_flags; +static gint ett_ospf_lsa_app_sabm_bits; +static gint ett_ospf_lsa_app_link_attrs_stlv; +static gint ett_ospf_lsa_unidir_link_flags; +static gint ett_ospf_lsa_unknown_tlv; + +static gint ett_ospf_lsa_type; /* The Options field in the first TLV of the Opaque RI LSA with type field set to "4" for OSPFv2 @@ -680,11 +686,11 @@ static const true_false_string tfs_v3_as_external_flags_e = { *-----------------------------------------------------------------------*/ /* OSPF MSG Type */ -static int hf_ospf_msg_hello = -1; -static int hf_ospf_msg_db_desc = -1; -static int hf_ospf_msg_ls_req = -1; -static int hf_ospf_msg_ls_upd = -1; -static int hf_ospf_msg_ls_ack = -1; +static int hf_ospf_msg_hello; +static int hf_ospf_msg_db_desc; +static int hf_ospf_msg_ls_req; +static int hf_ospf_msg_ls_upd; +static int hf_ospf_msg_ls_ack; static int *hf_ospf_msg_type_array[] = { &hf_ospf_msg_hello, @@ -694,37 +700,37 @@ static int *hf_ospf_msg_type_array[] = { &hf_ospf_msg_ls_ack, }; -static int hf_ospf_ls_type = -1; -static int hf_ospf_ls_age = -1; -static int hf_ospf_ls_donotage = -1; -static int hf_ospf_ls_id = -1; -static int hf_ospf_ls_seqnum = -1; -static int hf_ospf_ls_chksum = -1; -static int hf_ospf_ls_length = -1; -static int hf_ospf_ls_opaque_type = -1; -static int hf_ospf_ls_mpls_te_instance = -1; +static int hf_ospf_ls_type; +static int hf_ospf_ls_age; +static int hf_ospf_ls_donotage; +static int hf_ospf_ls_id; +static int hf_ospf_ls_seqnum; +static int hf_ospf_ls_chksum; +static int hf_ospf_ls_length; +static int hf_ospf_ls_opaque_type; +static int hf_ospf_ls_mpls_te_instance; /* OSPF V2 LSA Type */ -static int hf_ospf_ls_router = -1; -static int hf_ospf_ls_router_linktype = -1; -static int hf_ospf_ls_router_linkid = -1; -static int hf_ospf_ls_router_linkdata = -1; -static int hf_ospf_ls_router_nummetrics = -1; -static int hf_ospf_ls_router_metric0 = -1; -static int hf_ospf_ls_network = -1; -static int hf_ospf_ls_network_netmask = -1; -static int hf_ospf_ls_network_attachrtr = -1; -static int hf_ospf_ls_summary = -1; -static int hf_ospf_ls_asbr = -1; -static int hf_ospf_ls_asbr_netmask = -1; -static int hf_ospf_ls_asext = -1; -static int hf_ospf_ls_asext_netmask = -1; -static int hf_ospf_ls_asext_fwdaddr = -1; -static int hf_ospf_ls_asext_extrtrtag = -1; -static int hf_ospf_ls_grpmember = -1; -static int hf_ospf_ls_asext7 = -1; -static int hf_ospf_ls_extattr = -1; -static int hf_ospf_ls_opaque = -1; +static int hf_ospf_ls_router; +static int hf_ospf_ls_router_linktype; +static int hf_ospf_ls_router_linkid; +static int hf_ospf_ls_router_linkdata; +static int hf_ospf_ls_router_nummetrics; +static int hf_ospf_ls_router_metric0; +static int hf_ospf_ls_network; +static int hf_ospf_ls_network_netmask; +static int hf_ospf_ls_network_attachrtr; +static int hf_ospf_ls_summary; +static int hf_ospf_ls_asbr; +static int hf_ospf_ls_asbr_netmask; +static int hf_ospf_ls_asext; +static int hf_ospf_ls_asext_netmask; +static int hf_ospf_ls_asext_fwdaddr; +static int hf_ospf_ls_asext_extrtrtag; +static int hf_ospf_ls_grpmember; +static int hf_ospf_ls_asext7; +static int hf_ospf_ls_extattr; +static int hf_ospf_ls_opaque; static int *hf_ospf_ls_type_array[] = { &hf_ospf_ls_router, @@ -738,22 +744,22 @@ static int *hf_ospf_ls_type_array[] = { &hf_ospf_ls_opaque }; -static int hf_ospf_v3_ls_type = -1; -static int hf_ospf_v3_ls_type_u = -1; -static int hf_ospf_v3_ls_type_s12 = -1; -static int hf_ospf_v3_ls_type_fc = -1; +static int hf_ospf_v3_ls_type; +static int hf_ospf_v3_ls_type_u; +static int hf_ospf_v3_ls_type_s12; +static int hf_ospf_v3_ls_type_fc; /* OSPF V3 LSA Type */ -static int hf_ospf_v3_ls_router = -1; -static int hf_ospf_v3_ls_network = -1; -static int hf_ospf_v3_ls_inter_area_prefix = -1; -static int hf_ospf_v3_ls_inter_area_router = -1; -static int hf_ospf_v3_ls_as_external = -1; -static int hf_ospf_v3_ls_group_membership = -1; -static int hf_ospf_v3_ls_nssa = -1; -static int hf_ospf_v3_ls_link = -1; -static int hf_ospf_v3_ls_intra_area_prefix = -1; -static int hf_ospf_v3_ls_opaque_ri = -1; +static int hf_ospf_v3_ls_router; +static int hf_ospf_v3_ls_network; +static int hf_ospf_v3_ls_inter_area_prefix; +static int hf_ospf_v3_ls_inter_area_router; +static int hf_ospf_v3_ls_as_external; +static int hf_ospf_v3_ls_group_membership; +static int hf_ospf_v3_ls_nssa; +static int hf_ospf_v3_ls_link; +static int hf_ospf_v3_ls_intra_area_prefix; +static int hf_ospf_v3_ls_opaque_ri; static int *hf_ospf_v3_ls_type_array[] = { &hf_ospf_v3_ls_router, @@ -768,307 +774,308 @@ static int *hf_ospf_v3_ls_type_array[] = { &hf_ospf_v3_ls_opaque_ri }; -static int hf_ospf_adv_router = -1; -static int hf_ospf_ls_mpls = -1; -static int hf_ospf_ls_mpls_routerid = -1; -static int hf_ospf_ls_mpls_linktype = -1; -static int hf_ospf_ls_mpls_linkid = -1; -static int hf_ospf_ls_mpls_local_addr = -1; -static int hf_ospf_ls_mpls_remote_addr = -1; -static int hf_ospf_ls_mpls_local_ifid = -1; -static int hf_ospf_ls_mpls_remote_ifid = -1; -static int hf_ospf_ls_mpls_te_metric = -1; -static int hf_ospf_ls_mpls_linkcolor = -1; -static int hf_ospf_ls_mpls_group = -1; -static int hf_ospf_ls_mpls_link_max_bw = -1; -static int hf_ospf_ls_mpls_bc_model_id = -1; -static int hf_ospf_ls_oif_local_node_id = -1; -static int hf_ospf_ls_oif_remote_node_id = -1; -static int hf_ospf_v2_options = -1; -static int hf_ospf_v2_options_mt = -1; -static int hf_ospf_v2_options_e = -1; -static int hf_ospf_v2_options_mc = -1; -static int hf_ospf_v2_options_n = -1; -static int hf_ospf_v2_options_p = -1; -static int hf_ospf_v2_options_l = -1; -static int hf_ospf_v2_options_dc = -1; -static int hf_ospf_v2_options_o = -1; -static int hf_ospf_v2_options_dn = -1; - -static int hf_ospf_tlv_type_opaque = -1; - -static int hf_ospf_ri_options = -1; +static int hf_ospf_adv_router; +static int hf_ospf_ls_mpls; +static int hf_ospf_ls_mpls_routerid; +static int hf_ospf_ls_mpls_linktype; +static int hf_ospf_ls_mpls_linkid; +static int hf_ospf_ls_mpls_local_addr; +static int hf_ospf_ls_mpls_remote_addr; +static int hf_ospf_ls_mpls_local_ifid; +static int hf_ospf_ls_mpls_remote_ifid; +static int hf_ospf_ls_mpls_te_metric; +static int hf_ospf_ls_mpls_linkcolor; +static int hf_ospf_ls_mpls_group; +static int hf_ospf_ls_mpls_link_max_bw; +static int hf_ospf_ls_mpls_bc_model_id; +static int hf_ospf_ls_oif_local_node_id; +static int hf_ospf_ls_oif_remote_node_id; +static int hf_ospf_v2_options; +static int hf_ospf_v2_options_mt; +static int hf_ospf_v2_options_e; +static int hf_ospf_v2_options_mc; +static int hf_ospf_v2_options_n; +static int hf_ospf_v2_options_p; +static int hf_ospf_v2_options_l; +static int hf_ospf_v2_options_dc; +static int hf_ospf_v2_options_o; +static int hf_ospf_v2_options_dn; + +static int hf_ospf_tlv_type_opaque; + +static int hf_ospf_ri_options; /* OSPF Router Informational Capabilities Options */ -static int hf_ospf_ri_options_grc = -1; -static int hf_ospf_ri_options_grh = -1; -static int hf_ospf_ri_options_srs = -1; -static int hf_ospf_ri_options_tes = -1; -static int hf_ospf_ri_options_p2plan = -1; -static int hf_ospf_ri_options_ete = -1; -static int hf_ospf_ri_options_host = -1; +static int hf_ospf_ri_options_grc; +static int hf_ospf_ri_options_grh; +static int hf_ospf_ri_options_srs; +static int hf_ospf_ri_options_tes; +static int hf_ospf_ri_options_p2plan; +static int hf_ospf_ri_options_ete; +static int hf_ospf_ri_options_host; /* OSPF Extended Link Opaque LSA */ -static int hf_ospf_ls_elink_tlv = -1; -static int hf_ospf_ls_elink_stlv = -1; -static int hf_ospf_ls_elink_mt_id = -1; -static int hf_ospf_ls_elink_weight = -1; -static int hf_ospf_ls_elink_nbr = -1; -static int hf_ospf_ls_pfxsid_flags = -1; -static int hf_ospf_ls_pfxsid_flag_np = -1; -static int hf_ospf_ls_pfxsid_flag_m = -1; -static int hf_ospf_ls_pfxsid_flag_e = -1; -static int hf_ospf_ls_pfxsid_flag_v= -1; -static int hf_ospf_ls_pfxsid_flag_l= -1; -static int hf_ospf_ls_pfxsid_flag_unknown = -1; -static int hf_ospf_ls_adjsid_flags = -1; -static int hf_ospf_ls_adjsid_flag_b = -1; -static int hf_ospf_ls_adjsid_flag_v = -1; -static int hf_ospf_ls_adjsid_flag_l = -1; -static int hf_ospf_ls_adjsid_flag_g = -1; -static int hf_ospf_ls_adjsid_flag_p = -1; -static int hf_ospf_ls_adjsid_flag_unknown = -1; -static int hf_ospf_ls_app_sabm_length = -1; -static int hf_ospf_ls_app_udabm_length = -1; -static int hf_ospf_ls_app_sabm_bits = -1; -static int hf_ospf_ls_app_sabm_bits_r = -1; -static int hf_ospf_ls_app_sabm_bits_s = -1; -static int hf_ospf_ls_app_sabm_bits_f = -1; -static int hf_ospf_ls_app_sabm_bits_x = -1; -static int hf_ospf_ls_app_udabm_bits = -1; -static int hf_ospf_ls_app_link_attrs_stlv = -1; -static int hf_ospf_ls_admin_group = -1; -static int hf_ospf_ls_ext_admin_group = -1; -static int hf_ospf_ls_unidir_link_flags = -1; -static int hf_ospf_ls_unidir_link_flags_a = -1; -static int hf_ospf_ls_unidir_link_flags_reserved = -1; -static int hf_ospf_ls_unidir_link_delay = -1; -static int hf_ospf_ls_unidir_link_reserved = -1; -static int hf_ospf_ls_unidir_link_delay_min = -1; -static int hf_ospf_ls_unidir_link_delay_max = -1; -static int hf_ospf_ls_unidir_delay_variation = -1; +static int hf_ospf_ls_elink_tlv; +static int hf_ospf_ls_elink_stlv; +static int hf_ospf_ls_elink_mt_id; +static int hf_ospf_ls_elink_weight; +static int hf_ospf_ls_elink_nbr; +static int hf_ospf_ls_pfxsid_flags; +static int hf_ospf_ls_pfxsid_flag_np; +static int hf_ospf_ls_pfxsid_flag_m; +static int hf_ospf_ls_pfxsid_flag_e; +static int hf_ospf_ls_pfxsid_flag_v; +static int hf_ospf_ls_pfxsid_flag_l; +static int hf_ospf_ls_pfxsid_flag_unknown; +static int hf_ospf_ls_adjsid_flags; +static int hf_ospf_ls_adjsid_flag_b; +static int hf_ospf_ls_adjsid_flag_v; +static int hf_ospf_ls_adjsid_flag_l; +static int hf_ospf_ls_adjsid_flag_g; +static int hf_ospf_ls_adjsid_flag_p; +static int hf_ospf_ls_adjsid_flag_unknown; +static int hf_ospf_ls_app_sabm_length; +static int hf_ospf_ls_app_udabm_length; +static int hf_ospf_ls_app_sabm_bits; +static int hf_ospf_ls_app_sabm_bits_r; +static int hf_ospf_ls_app_sabm_bits_s; +static int hf_ospf_ls_app_sabm_bits_f; +static int hf_ospf_ls_app_sabm_bits_x; +static int hf_ospf_ls_app_udabm_bits; +static int hf_ospf_ls_app_link_attrs_stlv; +static int hf_ospf_ls_admin_group; +static int hf_ospf_ls_ext_admin_group; +static int hf_ospf_ls_unidir_link_flags; +static int hf_ospf_ls_unidir_link_flags_a; +static int hf_ospf_ls_unidir_link_flags_reserved; +static int hf_ospf_ls_unidir_link_delay; +static int hf_ospf_ls_unidir_link_reserved; +static int hf_ospf_ls_unidir_link_delay_min; +static int hf_ospf_ls_unidir_link_delay_max; +static int hf_ospf_ls_unidir_delay_variation; /* OSPF Extended Prefix Opaque LSA */ -static int hf_ospf_ls_epfx_tlv = -1; -static int hf_ospf_ls_epfx_stlv = -1; -static int hf_ospf_ls_epfx_route_type = -1; -static int hf_ospf_ls_epfx_af = -1; -static int hf_ospf_ls_epfx_flags = -1; -static int hf_ospf_ls_epfx_flag_a = -1; -static int hf_ospf_ls_epfx_flag_n = -1; -static int hf_ospf_ls_epfx_flag_unknown = -1; -static int hf_ospf_ls_epfx_range_flags = -1; -static int hf_ospf_ls_epfx_range_flag_ia = -1; -static int hf_ospf_ls_epfx_range_flag_unknown = -1; +static int hf_ospf_ls_epfx_tlv; +static int hf_ospf_ls_epfx_stlv; +static int hf_ospf_ls_epfx_route_type; +static int hf_ospf_ls_epfx_af; +static int hf_ospf_ls_epfx_flags; +static int hf_ospf_ls_epfx_flag_a; +static int hf_ospf_ls_epfx_flag_n; +static int hf_ospf_ls_epfx_flag_unknown; +static int hf_ospf_ls_epfx_range_flags; +static int hf_ospf_ls_epfx_range_flag_ia; +static int hf_ospf_ls_epfx_range_flag_unknown; /* OSPF Dynamic Hostname support (RFC5642) */ -static int hf_ospf_v3_options = -1; -static int hf_ospf_v3_options_v6 = -1; -static int hf_ospf_v3_options_e = -1; -static int hf_ospf_v3_options_mc = -1; -static int hf_ospf_v3_options_n = -1; -static int hf_ospf_v3_options_r = -1; -static int hf_ospf_v3_options_dc = -1; -static int hf_ospf_v3_options_af = -1; -static int hf_ospf_v3_options_l = -1; -static int hf_ospf_v3_options_at = -1; -static int hf_ospf_dbd = -1; -static int hf_ospf_dbd_r = -1; -static int hf_ospf_dbd_i = -1; -static int hf_ospf_dbd_m = -1; -static int hf_ospf_dbd_ms = -1; -static int hf_ospf_lls_ext_options = -1; -static int hf_ospf_lls_ext_options_lr = -1; -static int hf_ospf_lls_ext_options_rs = -1; -static int hf_ospf_v2_router_lsa_flag = -1; -static int hf_ospf_v2_router_lsa_flag_b = -1; -static int hf_ospf_v2_router_lsa_flag_e = -1; -static int hf_ospf_v2_router_lsa_flag_v = -1; -static int hf_ospf_v2_router_lsa_flag_w = -1; -static int hf_ospf_v2_router_lsa_flag_n = -1; -static int hf_ospf_v2_router_lsa_flag_h = -1; -static int hf_ospf_v3_router_lsa_flag = -1; -static int hf_ospf_v3_router_lsa_flag_b = -1; -static int hf_ospf_v3_router_lsa_flag_e = -1; -static int hf_ospf_v3_router_lsa_flag_v = -1; -static int hf_ospf_v3_router_lsa_flag_w = -1; -static int hf_ospf_v3_as_external_flag = -1; -static int hf_ospf_v3_as_external_flag_t = -1; -static int hf_ospf_v3_as_external_flag_f = -1; -static int hf_ospf_v3_as_external_flag_e = -1; -static int hf_ospf_v3_prefix_option = -1; -static int hf_ospf_v3_prefix_option_nu = -1; -static int hf_ospf_v3_prefix_option_la = -1; -static int hf_ospf_v3_prefix_option_mc = -1; -static int hf_ospf_v3_prefix_option_p = -1; -static int hf_ospf_dyn_hostname = -1; -static int hf_ospf_lsa_sa = -1; -static int hf_ospf_ls_slr_stlv = -1; -static int hf_ospf_ls_range_size = -1; -static int hf_ospf_ls_sid_label = -1; -static int hf_ospf_ls_preference = -1; -static int hf_ospf_ls_igp_msd_type = -1; -static int hf_ospf_ls_igp_msd_value = -1; -static int hf_ospf_ls_remote_ipv4_addr = -1; -static int hf_ospf_ls_local_interface_id = -1; -static int hf_ospf_ls_remote_interface_id = -1; -static int hf_ospf_ls_fad_flex_algorithm = -1; -static int hf_ospf_ls_fad_metric_type = -1; -static int hf_ospf_ls_fad_calc_type = -1; -static int hf_ospf_ls_fad_priority = -1; -static int hf_ospf_ls_fad_stlv = -1; -static int hf_ospf_unknown_tlv = -1; -static int hf_ospf_v2_grace_tlv = -1; -static int hf_ospf_v2_grace_period = -1; -static int hf_ospf_v2_grace_reason = -1; -static int hf_ospf_v2_grace_ip = -1; -static int hf_ospf_v3_lls_ext_options_tlv = -1; -static int hf_ospf_v3_lls_ext_options = -1; -static int hf_ospf_v3_lls_ext_options_lr = -1; -static int hf_ospf_v3_lls_ext_options_rs = -1; -static int hf_ospf_v3_lls_state_tlv = -1; -static int hf_ospf_v3_lls_state_scs = -1; -static int hf_ospf_v3_lls_state_options = -1; -static int hf_ospf_v3_lls_state_options_r = -1; -static int hf_ospf_v3_lls_state_options_a = -1; -static int hf_ospf_v3_lls_state_options_n = -1; -static int hf_ospf_v3_lls_drop_tlv = -1; -static int hf_ospf_v3_lls_relay_tlv = -1; -static int hf_ospf_v3_lls_relay_added = -1; -static int hf_ospf_v3_lls_relay_options = -1; -static int hf_ospf_v3_lls_relay_options_a = -1; -static int hf_ospf_v3_lls_relay_options_n = -1; -static int hf_ospf_v3_lls_willingness_tlv = -1; -static int hf_ospf_v3_lls_willingness = -1; -static int hf_ospf_v3_lls_rf_tlv = -1; -static int hf_ospf_v3_lls_fsf_tlv = -1; - -static int hf_ospf_header = -1; -static int hf_ospf_header_version = -1; -static int hf_ospf_header_msg_type = -1; -static int hf_ospf_header_packet_length = -1; -static int hf_ospf_header_src_router = -1; -static int hf_ospf_header_area_id = -1; -static int hf_ospf_header_checksum = -1; -static int hf_ospf_tlv_type = -1; -static int hf_ospf_tlv_length = -1; +static int hf_ospf_v3_options; +static int hf_ospf_v3_options_v6; +static int hf_ospf_v3_options_e; +static int hf_ospf_v3_options_mc; +static int hf_ospf_v3_options_n; +static int hf_ospf_v3_options_r; +static int hf_ospf_v3_options_dc; +static int hf_ospf_v3_options_af; +static int hf_ospf_v3_options_l; +static int hf_ospf_v3_options_at; +static int hf_ospf_dbd; +static int hf_ospf_dbd_r; +static int hf_ospf_dbd_i; +static int hf_ospf_dbd_m; +static int hf_ospf_dbd_ms; +static int hf_ospf_lls_ext_options; +static int hf_ospf_lls_ext_options_lr; +static int hf_ospf_lls_ext_options_rs; +static int hf_ospf_v2_router_lsa_flag; +static int hf_ospf_v2_router_lsa_flag_b; +static int hf_ospf_v2_router_lsa_flag_e; +static int hf_ospf_v2_router_lsa_flag_v; +static int hf_ospf_v2_router_lsa_flag_w; +static int hf_ospf_v2_router_lsa_flag_n; +static int hf_ospf_v2_router_lsa_flag_s; +static int hf_ospf_v2_router_lsa_flag_h; +static int hf_ospf_v3_router_lsa_flag; +static int hf_ospf_v3_router_lsa_flag_b; +static int hf_ospf_v3_router_lsa_flag_e; +static int hf_ospf_v3_router_lsa_flag_v; +static int hf_ospf_v3_router_lsa_flag_w; +static int hf_ospf_v3_as_external_flag; +static int hf_ospf_v3_as_external_flag_t; +static int hf_ospf_v3_as_external_flag_f; +static int hf_ospf_v3_as_external_flag_e; +static int hf_ospf_v3_prefix_option; +static int hf_ospf_v3_prefix_option_nu; +static int hf_ospf_v3_prefix_option_la; +static int hf_ospf_v3_prefix_option_mc; +static int hf_ospf_v3_prefix_option_p; +static int hf_ospf_dyn_hostname; +static int hf_ospf_lsa_sa; +static int hf_ospf_ls_slr_stlv; +static int hf_ospf_ls_range_size; +static int hf_ospf_ls_sid_label; +static int hf_ospf_ls_preference; +static int hf_ospf_ls_igp_msd_type; +static int hf_ospf_ls_igp_msd_value; +static int hf_ospf_ls_remote_ipv4_addr; +static int hf_ospf_ls_local_interface_id; +static int hf_ospf_ls_remote_interface_id; +static int hf_ospf_ls_fad_flex_algorithm; +static int hf_ospf_ls_fad_metric_type; +static int hf_ospf_ls_fad_calc_type; +static int hf_ospf_ls_fad_priority; +static int hf_ospf_ls_fad_stlv; +static int hf_ospf_unknown_tlv; +static int hf_ospf_v2_grace_tlv; +static int hf_ospf_v2_grace_period; +static int hf_ospf_v2_grace_reason; +static int hf_ospf_v2_grace_ip; +static int hf_ospf_v3_lls_ext_options_tlv; +static int hf_ospf_v3_lls_ext_options; +static int hf_ospf_v3_lls_ext_options_lr; +static int hf_ospf_v3_lls_ext_options_rs; +static int hf_ospf_v3_lls_state_tlv; +static int hf_ospf_v3_lls_state_scs; +static int hf_ospf_v3_lls_state_options; +static int hf_ospf_v3_lls_state_options_r; +static int hf_ospf_v3_lls_state_options_a; +static int hf_ospf_v3_lls_state_options_n; +static int hf_ospf_v3_lls_drop_tlv; +static int hf_ospf_v3_lls_relay_tlv; +static int hf_ospf_v3_lls_relay_added; +static int hf_ospf_v3_lls_relay_options; +static int hf_ospf_v3_lls_relay_options_a; +static int hf_ospf_v3_lls_relay_options_n; +static int hf_ospf_v3_lls_willingness_tlv; +static int hf_ospf_v3_lls_willingness; +static int hf_ospf_v3_lls_rf_tlv; +static int hf_ospf_v3_lls_fsf_tlv; + +static int hf_ospf_header; +static int hf_ospf_header_version; +static int hf_ospf_header_msg_type; +static int hf_ospf_header_packet_length; +static int hf_ospf_header_src_router; +static int hf_ospf_header_area_id; +static int hf_ospf_header_checksum; +static int hf_ospf_tlv_type; +static int hf_ospf_tlv_length; /* Header OSPF v2 auth */ -static int hf_ospf_header_auth_type = -1; -static int hf_ospf_header_auth_data_none = -1; -static int hf_ospf_header_auth_data_simple = -1; -static int hf_ospf_header_auth_crypt_key_id = -1; -static int hf_ospf_header_auth_crypt_data_length = -1; -static int hf_ospf_header_auth_crypt_seq_nbr = -1; -static int hf_ospf_header_auth_crypt_data = -1; -static int hf_ospf_header_auth_data_unknown = -1; +static int hf_ospf_header_auth_type; +static int hf_ospf_header_auth_data_none; +static int hf_ospf_header_auth_data_simple; +static int hf_ospf_header_auth_crypt_key_id; +static int hf_ospf_header_auth_crypt_data_length; +static int hf_ospf_header_auth_crypt_seq_nbr; +static int hf_ospf_header_auth_crypt_data; +static int hf_ospf_header_auth_data_unknown; /* Header OSPF v3 */ -static int hf_ospf_header_instance_id = -1; -static int hf_ospf_header_reserved = -1; +static int hf_ospf_header_instance_id; +static int hf_ospf_header_reserved; /* Hello */ -static int hf_ospf_hello = -1; -static int hf_ospf_hello_network_mask = -1; -static int hf_ospf_hello_interface_id = -1; -static int hf_ospf_hello_hello_interval = -1; -static int hf_ospf_hello_router_priority = -1; -static int hf_ospf_hello_router_dead_interval = -1; -static int hf_ospf_hello_designated_router = -1; -static int hf_ospf_hello_backup_designated_router = -1; -static int hf_ospf_hello_active_neighbor = -1; +static int hf_ospf_hello; +static int hf_ospf_hello_network_mask; +static int hf_ospf_hello_interface_id; +static int hf_ospf_hello_hello_interval; +static int hf_ospf_hello_router_priority; +static int hf_ospf_hello_router_dead_interval; +static int hf_ospf_hello_designated_router; +static int hf_ospf_hello_backup_designated_router; +static int hf_ospf_hello_active_neighbor; /* Authentication Trailer RFC6506 */ -static int hf_ospf_at = -1; -static int hf_ospf_at_auth_type = -1; -static int hf_ospf_at_auth_data_len = -1; -static int hf_ospf_at_reserved = -1; -static int hf_ospf_at_sa_id = -1; -static int hf_ospf_at_crypto_seq_nbr = -1; -static int hf_ospf_at_auth_data = -1; +static int hf_ospf_at; +static int hf_ospf_at_auth_type; +static int hf_ospf_at_auth_data_len; +static int hf_ospf_at_reserved; +static int hf_ospf_at_sa_id; +static int hf_ospf_at_crypto_seq_nbr; +static int hf_ospf_at_auth_data; /* Generated from convert_proto_tree_add_text.pl */ -static int hf_ospf_referenced_advertising_router = -1; -static int hf_ospf_v3_lsa_referenced_link_state_id = -1; -static int hf_ospf_mpls_protection_capability = -1; -static int hf_ospf_oif_encoding = -1; -static int hf_ospf_ls_id_te_lsa_reserved = -1; -static int hf_ospf_db_interface_mtu = -1; -static int hf_ospf_v3_lls_full_state_for = -1; -static int hf_ospf_v3_lsa_interface_id = -1; -static int hf_ospf_v3_lsa_router_priority = -1; -static int hf_ospf_v3_lsa_forwarding_address_ipv6 = -1; -static int hf_ospf_v3_lls_dropped_neighbor = -1; -static int hf_ospf_v3_lsa_external_route_tag = -1; -static int hf_ospf_tna_addr = -1; -static int hf_ospf_v3_lsa_neighbor_router_id = -1; -static int hf_ospf_mpls_switching_type = -1; -static int hf_ospf_oif_tna_addr_length = -1; -static int hf_ospf_oif_tna_addr_ipv4 = -1; -static int hf_ospf_link_state_id = -1; -static int hf_ospf_ls_id_opaque_id = -1; -static int hf_ospf_v2_lls_sequence_number = -1; -static int hf_ospf_v3_lsa_do_not_age = -1; -static int hf_ospf_lls_data_length = -1; -static int hf_ospf_mpls_shared_risk_link_group = -1; -static int hf_ospf_db_dd_sequence = -1; -static int hf_ospf_v3_lsa_destination_router_id = -1; -static int hf_ospf_tna_addr_ipv6 = -1; -static int hf_ospf_v3_lsa_link_local_interface_address = -1; -static int hf_ospf_mpls_interface_mtu = -1; -static int hf_ospf_v3_lsa_neighbor_interface_id = -1; -static int hf_ospf_lsa_number_of_links = -1; -static int hf_ospf_v2_lls_auth_data = -1; -static int hf_ospf_v2_lls_li_id = -1; -static int hf_ospf_oif_switching_cap = -1; -static int hf_ospf_ls_number_of_lsas = -1; -static int hf_ospf_v3_lls_neighbor = -1; -static int hf_ospf_v3_lls_request_from = -1; -static int hf_ospf_lls_checksum = -1; -static int hf_ospf_v3_lsa_attached_router = -1; -static int hf_ospf_v3_lsa_referenced_ls_type = -1; -static int hf_ospf_mpls_encoding = -1; -static int hf_ospf_mpls_num_labels = -1; -static int hf_ospf_lsa_external_type = -1; -static int hf_ospf_lsa_tos = -1; -static int hf_ospf_lsa_external_tos = -1; -static int hf_ospf_v3_lsa_type = -1; -static int hf_ospf_metric = -1; -static int hf_ospf_prefix_length = -1; -static int hf_ospf_ls_mpls_pri = -1; -static int hf_ospf_ls_mpls_bc = -1; -static int hf_ospf_mpls_action = -1; -static int hf_ospf_mpls_bandwidth_type = -1; -static int hf_ospf_mpls_bitmap = -1; -static int hf_ospf_mpls_grid = -1; -static int hf_ospf_mpls_cs2 = -1; -static int hf_ospf_mpls_n = -1; -static int hf_ospf_mpls_cs = -1; -static int hf_ospf_mpls_length = -1; -static int hf_ospf_mpls_minimum_lsp_bandwidth = -1; -static int hf_ospf_mpls_pri = -1; -static int hf_ospf_mpls_sonet_sdh = -1; -static int hf_ospf_mpls_starting = -1; -static int hf_ospf_mpls_no_effective_bits = -1; -static int hf_ospf_mpls_type = -1; -static int hf_ospf_oif_signal_type = -1; -static int hf_ospf_tlv_value = -1; -static int hf_ospf_oif_node_id = -1; -static int hf_ospf_pad_bytes = -1; -static int hf_ospf_ls_metric = -1; -static int hf_ospf_v3_lsa_forwarding_address_ipv4 = -1; -static int hf_ospf_link_local_interface_address_ipv4 = -1; -static int hf_ospf_v3_lsa_num_prefixes = -1; -static int hf_ospf_v3_address_prefix_ipv6 = -1; -static int hf_ospf_v3_address_prefix_ipv4 = -1; - -static expert_field ei_ospf_header_reserved = EI_INIT; -static expert_field ei_ospf_lsa_bad_length = EI_INIT; -static expert_field ei_ospf_lsa_constraint_missing = EI_INIT; -static expert_field ei_ospf_lsa_bc_error = EI_INIT; -static expert_field ei_ospf_lsa_unknown_type = EI_INIT; -static expert_field ei_ospf_unknown_link_subtype = EI_INIT; -static expert_field ei_ospf_stlv_length_invalid = EI_INIT; +static int hf_ospf_referenced_advertising_router; +static int hf_ospf_v3_lsa_referenced_link_state_id; +static int hf_ospf_mpls_protection_capability; +static int hf_ospf_oif_encoding; +static int hf_ospf_ls_id_te_lsa_reserved; +static int hf_ospf_db_interface_mtu; +static int hf_ospf_v3_lls_full_state_for; +static int hf_ospf_v3_lsa_interface_id; +static int hf_ospf_v3_lsa_router_priority; +static int hf_ospf_v3_lsa_forwarding_address_ipv6; +static int hf_ospf_v3_lls_dropped_neighbor; +static int hf_ospf_v3_lsa_external_route_tag; +static int hf_ospf_tna_addr; +static int hf_ospf_v3_lsa_neighbor_router_id; +static int hf_ospf_mpls_switching_type; +static int hf_ospf_oif_tna_addr_length; +static int hf_ospf_oif_tna_addr_ipv4; +static int hf_ospf_link_state_id; +static int hf_ospf_ls_id_opaque_id; +static int hf_ospf_v2_lls_sequence_number; +static int hf_ospf_v3_lsa_do_not_age; +static int hf_ospf_lls_data_length; +static int hf_ospf_mpls_shared_risk_link_group; +static int hf_ospf_db_dd_sequence; +static int hf_ospf_v3_lsa_destination_router_id; +static int hf_ospf_tna_addr_ipv6; +static int hf_ospf_v3_lsa_link_local_interface_address; +static int hf_ospf_mpls_interface_mtu; +static int hf_ospf_v3_lsa_neighbor_interface_id; +static int hf_ospf_lsa_number_of_links; +static int hf_ospf_v2_lls_auth_data; +static int hf_ospf_v2_lls_li_id; +static int hf_ospf_oif_switching_cap; +static int hf_ospf_ls_number_of_lsas; +static int hf_ospf_v3_lls_neighbor; +static int hf_ospf_v3_lls_request_from; +static int hf_ospf_lls_checksum; +static int hf_ospf_v3_lsa_attached_router; +static int hf_ospf_v3_lsa_referenced_ls_type; +static int hf_ospf_mpls_encoding; +static int hf_ospf_mpls_num_labels; +static int hf_ospf_lsa_external_type; +static int hf_ospf_lsa_tos; +static int hf_ospf_lsa_external_tos; +static int hf_ospf_v3_lsa_type; +static int hf_ospf_metric; +static int hf_ospf_prefix_length; +static int hf_ospf_ls_mpls_pri; +static int hf_ospf_ls_mpls_bc; +static int hf_ospf_mpls_action; +static int hf_ospf_mpls_bandwidth_type; +static int hf_ospf_mpls_bitmap; +static int hf_ospf_mpls_grid; +static int hf_ospf_mpls_cs2; +static int hf_ospf_mpls_n; +static int hf_ospf_mpls_cs; +static int hf_ospf_mpls_length; +static int hf_ospf_mpls_minimum_lsp_bandwidth; +static int hf_ospf_mpls_pri; +static int hf_ospf_mpls_sonet_sdh; +static int hf_ospf_mpls_starting; +static int hf_ospf_mpls_no_effective_bits; +static int hf_ospf_mpls_type; +static int hf_ospf_oif_signal_type; +static int hf_ospf_tlv_value; +static int hf_ospf_oif_node_id; +static int hf_ospf_pad_bytes; +static int hf_ospf_ls_metric; +static int hf_ospf_v3_lsa_forwarding_address_ipv4; +static int hf_ospf_link_local_interface_address_ipv4; +static int hf_ospf_v3_lsa_num_prefixes; +static int hf_ospf_v3_address_prefix_ipv6; +static int hf_ospf_v3_address_prefix_ipv4; + +static expert_field ei_ospf_header_reserved; +static expert_field ei_ospf_lsa_bad_length; +static expert_field ei_ospf_lsa_constraint_missing; +static expert_field ei_ospf_lsa_bc_error; +static expert_field ei_ospf_lsa_unknown_type; +static expert_field ei_ospf_unknown_link_subtype; +static expert_field ei_ospf_stlv_length_invalid; static gint ospf_msg_type_to_filter (guint8 msg_type) { @@ -1135,6 +1142,7 @@ static int * const bf_v3_lls_relay_options[] = { }; static int * const bf_v2_router_lsa_flags[] = { &hf_ospf_v2_router_lsa_flag_h, + &hf_ospf_v2_router_lsa_flag_s, &hf_ospf_v2_router_lsa_flag_n, &hf_ospf_v2_router_lsa_flag_w, &hf_ospf_v2_router_lsa_flag_v, @@ -1511,7 +1519,7 @@ dissect_ospf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ break; case OSPF_AUTH_SIMPLE: - proto_tree_add_item(ospf_header_tree, hf_ospf_header_auth_data_simple, tvb, 16, 8, ENC_ASCII|ENC_NA); + proto_tree_add_item(ospf_header_tree, hf_ospf_header_auth_data_simple, tvb, 16, 8, ENC_ASCII); break; case OSPF_AUTH_CRYPT: @@ -2724,10 +2732,10 @@ dissect_ospf_lsa_mpls(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree default: stlv_tree = proto_tree_add_subtree_format(tlv_tree, tvb, stlv_offset, stlv_len+4, ett_ospf_lsa_mpls_link_stlv, NULL, "Unknown Link sub-TLV: %u %s", stlv_type, - rval_to_str(stlv_type, mpls_te_sub_tlv_rvals, "Unknown")); + rval_to_str_const(stlv_type, mpls_te_sub_tlv_rvals, "Unknown")); proto_tree_add_uint_format_value(stlv_tree, hf_ospf_tlv_type, tvb, stlv_offset, 2, stlv_type, "%u: %s %s", stlv_type, stlv_name, - rval_to_str(stlv_type, mpls_te_sub_tlv_rvals, "Unknown")); + rval_to_str_const(stlv_type, mpls_te_sub_tlv_rvals, "Unknown")); proto_tree_add_item(stlv_tree, hf_ospf_tlv_length, tvb, stlv_offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(stlv_tree, hf_ospf_tlv_value, tvb, stlv_offset+4, stlv_len, ENC_NA); break; @@ -2813,9 +2821,9 @@ dissect_ospf_lsa_mpls(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree default: tlv_tree = proto_tree_add_subtree_format(mpls_tree, tvb, offset, tlv_length+4, ett_ospf_lsa_mpls_link, NULL, "Unknown LSA: %u %s", tlv_type, - rval_to_str(tlv_type, mpls_te_tlv_rvals, "Unknown")); + rval_to_str_const(tlv_type, mpls_te_tlv_rvals, "Unknown")); proto_tree_add_uint_format_value(tlv_tree, hf_ospf_tlv_type, tvb, offset, 2, tlv_type, "%u - Unknown %s", - tlv_type, rval_to_str(tlv_type, mpls_te_tlv_rvals, "Unknown")); + tlv_type, rval_to_str_const(tlv_type, mpls_te_tlv_rvals, "Unknown")); proto_tree_add_item(tlv_tree, hf_ospf_tlv_length, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_tree, hf_ospf_tlv_value, tvb, offset+4, tlv_length, ENC_NA); break; @@ -2954,7 +2962,7 @@ dissect_ospf_lsa_opaque_ri(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_ proto_tree_add_item(tlv_tree, hf_ospf_tlv_length, tvb, offset+2, 2, ENC_BIG_ENDIAN); - proto_tree_add_item(tlv_tree, hf_ospf_dyn_hostname, tvb, offset+4, tlv_length, ENC_ASCII|ENC_NA); + proto_tree_add_item(tlv_tree, hf_ospf_dyn_hostname, tvb, offset+4, tlv_length, ENC_ASCII); break; case OPAQUE_TLV_SA:{ @@ -3658,7 +3666,7 @@ dissect_ospf_v2_lsa(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *t guint8 ls_type; guint16 ls_length; int end_offset; - guint16 nr_links; + guint32 nr_links; guint16 nr_metric; /* router LSA */ @@ -3766,9 +3774,8 @@ dissect_ospf_v2_lsa(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *t case OSPF_LSTYPE_ROUTER: /* flags field in an router-lsa */ proto_tree_add_bitmask(ospf_lsa_tree, tvb, offset, hf_ospf_v2_router_lsa_flag, ett_ospf_v2_router_lsa_flags, bf_v2_router_lsa_flags, ENC_BIG_ENDIAN); - - nr_links = tvb_get_ntohs(tvb, offset + 2); - proto_tree_add_item(ospf_lsa_tree, hf_ospf_lsa_number_of_links, tvb, offset + 2, 2, ENC_BIG_ENDIAN); + /* TODO: flags are only 1 byte, so there is an apparently unused byte here */ + proto_tree_add_item_ret_uint(ospf_lsa_tree, hf_ospf_lsa_number_of_links, tvb, offset + 2, 2, ENC_BIG_ENDIAN, &nr_links); offset += 4; @@ -4248,6 +4255,7 @@ dissect_ospf_v3_lsa(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *t case OSPF_V3_LSTYPE_OPAQUE_RI: dissect_ospf_lsa_opaque_ri(tvb, pinfo, offset, ospf_lsa_tree, ls_length); + offset += ls_length; break; default: @@ -4434,7 +4442,7 @@ proto_register_ospf(void) /* LS Types */ {&hf_ospf_ls_type, - { "LS Type", "ospf.lsa", FT_UINT8, BASE_DEC, + { "LS Type", "ospf.lsa", FT_UINT32, BASE_DEC, VALS(ls_type_vals), 0x0, NULL, HFILL }}, {&hf_ospf_ls_age, {"LS Age (seconds)", "ospf.lsa.age", FT_UINT16, @@ -4655,7 +4663,7 @@ proto_register_ospf(void) { "(DC) Demand Circuits", "ospf.v2.options.dc", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), OSPF_V2_OPTIONS_DC, NULL, HFILL }}, {&hf_ospf_v2_options_o, - { "O", "ospf.v2.options.o", FT_BOOLEAN, 8, + { "(O) Opaque", "ospf.v2.options.o", FT_BOOLEAN, 8, TFS(&tfs_set_notset), OSPF_V2_OPTIONS_O, NULL, HFILL }}, {&hf_ospf_v2_options_dn, { "DN", "ospf.v2.options.dn", FT_BOOLEAN, 8, @@ -4760,10 +4768,13 @@ proto_register_ospf(void) { "(W) Wild-card multicast receiver", "ospf.v2.router.lsa.flags.w", FT_BOOLEAN, 8, TFS(&tfs_yes_no), OSPF_V2_ROUTER_LSA_FLAG_W, NULL, HFILL }}, {&hf_ospf_v2_router_lsa_flag_n, - { "(N) flag", "ospf.v2.router.lsa.flags.n", FT_BOOLEAN, 8, + { "(N) NSSA translation", "ospf.v2.router.lsa.flags.n", FT_BOOLEAN, 8, TFS(&tfs_yes_no), OSPF_V2_ROUTER_LSA_FLAG_N, NULL, HFILL }}, + {&hf_ospf_v2_router_lsa_flag_s, + { "(S) Shortcut-capable ABR", "ospf.v2.router.lsa.flags.s", FT_BOOLEAN, 8, + TFS(&tfs_yes_no), OSPF_V2_ROUTER_LSA_FLAG_S, NULL, HFILL }}, {&hf_ospf_v2_router_lsa_flag_h, - { "(H) flag", "ospf.v2.router.lsa.flags.h", FT_BOOLEAN, 8, + { "(H) Host", "ospf.v2.router.lsa.flags.h", FT_BOOLEAN, 8, TFS(&tfs_yes_no), OSPF_V2_ROUTER_LSA_FLAG_H, NULL, HFILL }}, {&hf_ospf_v3_router_lsa_flag, { "Flags", "ospf.v3.router.lsa.flags", FT_UINT8, BASE_HEX, @@ -4864,7 +4875,7 @@ proto_register_ospf(void) {&hf_ospf_ls_epfx_stlv, { "TLV Type", "ospf.tlv.extpfx.subtlv_type", FT_UINT16, BASE_DEC, VALS(ext_pfx_stlv_type_vals), 0x0, NULL, HFILL }}, {&hf_ospf_ls_epfx_route_type, - { "Route Type", "ospf.tlv.extpfx.rotuetype", FT_UINT16, BASE_DEC, VALS(ext_pfx_tlv_route_vals), 0x0, NULL, HFILL }}, + { "Route Type", "ospf.tlv.extpfx.routetype", FT_UINT16, BASE_DEC, VALS(ext_pfx_tlv_route_vals), 0x0, NULL, HFILL }}, {&hf_ospf_ls_epfx_af, { "Address Family", "ospf.tlv.extpfx.af", FT_UINT8, BASE_DEC, VALS(ext_pfx_tlv_af_vals), 0x0, NULL, HFILL }}, @@ -4931,7 +4942,7 @@ proto_register_ospf(void) { "(V) Value/Index Flag", "ospf.tlv.adjsid.flags.v", FT_BOOLEAN, 8, TFS(&tfs_set_notset), SR_STLV_ADJSID_FLAG_V, NULL, HFILL }}, {&hf_ospf_ls_adjsid_flag_l, - { "(L) Local/Global Flag", "ospf.tlv.adjsid.flags.b", FT_BOOLEAN, 8, + { "(L) Local/Global Flag", "ospf.tlv.adjsid.flags.l", FT_BOOLEAN, 8, TFS(&tfs_set_notset), SR_STLV_ADJSID_FLAG_L, NULL, HFILL }}, {&hf_ospf_ls_adjsid_flag_g, { "(G) Group Flag", "ospf.tlv.adjsid.flags.g", FT_BOOLEAN, 8, @@ -5131,7 +5142,7 @@ proto_register_ospf(void) { &hf_ospf_ls_id_te_lsa_reserved, { "Link State ID TE-LSA Reserved", "ospf.lsid_te_lsa.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ospf_ls_id_opaque_id, { "Link State ID Opaque ID", "ospf.lsid.opaque_id", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ospf_lsa_number_of_links, { "Number of Links", "ospf.lsa.number_of_links", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_ospf_v3_lsa_do_not_age, { "Do Not Age", "ospf.v3.lsa.do_not_age", FT_BOOLEAN, 16, TFS(&tfs_true_false), OSPF_DNA_LSA, NULL, HFILL }}, + { &hf_ospf_v3_lsa_do_not_age, { "Do Not Age", "ospf.v3.lsa.do_not_age", FT_BOOLEAN, 16, NULL, OSPF_DNA_LSA, NULL, HFILL }}, { &hf_ospf_v3_lsa_interface_id, { "Interface ID", "ospf.v3.lsa.interface_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ospf_v3_lsa_neighbor_interface_id, { "Neighbor Interface ID", "ospf.v3.lsa.neighbor_interface_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ospf_v3_lsa_neighbor_router_id, { "Neighbor Router ID", "ospf.v3.lsa.neighbor_router_id", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, @@ -5153,7 +5164,7 @@ proto_register_ospf(void) { &hf_ospf_ls_mpls_pri, { "Pri (or TE-Class)", "ospf.mpls.pri", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ospf_ls_mpls_bc, { "BC", "ospf.mpls.bc", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ospf_mpls_minimum_lsp_bandwidth, { "Minimum LSP bandwidth", "ospf.mpls.minimum_lsp_bandwidth", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_ospf_mpls_sonet_sdh, { "SONET/SDH", "ospf.mpls.sonet.sdh", FT_BOOLEAN, 8, TFS(&tfs_arbitrary_standard), 0x0, NULL, HFILL }}, + { &hf_ospf_mpls_sonet_sdh, { "SONET/SDH", "ospf.mpls.sonet.sdh", FT_BOOLEAN, BASE_NONE, TFS(&tfs_arbitrary_standard), 0x0, NULL, HFILL }}, { &hf_ospf_oif_signal_type, { "Signal Type", "ospf.oif.signal_type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, VALS_EXT_PTR(&gmpls_sonet_signal_type_str_ext), 0x0, NULL, HFILL }}, { &hf_ospf_tlv_value, { "TLV Value", "ospf.tlv_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ospf_oif_node_id, { "Node ID", "ospf.oif.node_id", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, @@ -5255,6 +5266,8 @@ proto_register_ospf(void) proto_ospf = proto_register_protocol("Open Shortest Path First", "OSPF", "ospf"); + ospf_handle = register_dissector("ospf", dissect_ospf, proto_ospf); + ospf_cap_handle = register_capture_dissector("ospf", capture_ospf, proto_ospf); proto_register_field_array(proto_ospf, ospff_info, array_length(ospff_info)); proto_register_subtree_array(ett, array_length(ett)); expert_ospf = expert_register_protocol(proto_ospf); @@ -5264,12 +5277,7 @@ proto_register_ospf(void) void proto_reg_handoff_ospf(void) { - dissector_handle_t ospf_handle; - capture_dissector_handle_t ospf_cap_handle; - - ospf_handle = create_dissector_handle(dissect_ospf, proto_ospf); dissector_add_uint("ip.proto", IP_PROTO_OSPF, ospf_handle); - ospf_cap_handle = create_capture_dissector_handle(capture_ospf, proto_ospf); capture_dissector_add_uint("ip.proto", IP_PROTO_OSPF, ospf_cap_handle); } |