diff options
-rw-r--r-- | epan/dissectors/packet-isis-clv.c | 121 | ||||
-rw-r--r-- | epan/dissectors/packet-isis-clv.h | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-isis-hello.c | 143 | ||||
-rw-r--r-- | epan/dissectors/packet-isis-lsp.c | 71 | ||||
-rw-r--r-- | epan/dissectors/packet-isis-snp.c | 37 | ||||
-rw-r--r-- | epan/dissectors/packet-mpls.c | 28 | ||||
-rw-r--r-- | epan/dissectors/packet-netflow.c | 81 | ||||
-rw-r--r-- | epan/dissectors/packet-nsip.c | 23 | ||||
-rw-r--r-- | epan/dissectors/packet-radius_packetcable.c | 158 | ||||
-rw-r--r-- | epan/dissectors/packet-rmi.c | 49 | ||||
-rw-r--r-- | epan/dissectors/packet-rtsp.c | 11 |
11 files changed, 406 insertions, 328 deletions
diff --git a/epan/dissectors/packet-isis-clv.c b/epan/dissectors/packet-isis-clv.c index cac9d3826c..ab2eb43e11 100644 --- a/epan/dissectors/packet-isis-clv.c +++ b/epan/dissectors/packet-isis-clv.c @@ -50,7 +50,7 @@ */ void isis_dissect_area_address_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, - expert_field* expert, int offset, int length) + expert_field* expert, int hf_area, int offset, int length) { int arealen,area_idx; @@ -72,14 +72,8 @@ isis_dissect_area_address_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tv if ( tree ) { proto_item *ti; - /* - * Throw an exception rather than putting in a - * partial address. - */ - tvb_ensure_bytes_exist ( tvb, offset, arealen + 1 ); - - ti = proto_tree_add_text ( tree, tvb, offset, arealen + 1, - "Area address (%d): ", arealen ); + ti = proto_tree_add_bytes_format( tree, hf_area, tvb, offset, arealen + 1, + NULL, "Area address (%d): ", arealen ); /* * Lets turn the area address into "standard" @@ -124,11 +118,10 @@ isis_dissect_area_address_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tv */ void isis_dissect_authentication_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, - expert_field* auth_expert, int offset, int length) + int hf_auth_bytes, expert_field* auth_expert, int offset, int length) { guchar pw_type; int auth_unsupported; - proto_item *ti; if ( length <= 0 ) { return; @@ -141,78 +134,36 @@ isis_dissect_authentication_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t * switch (pw_type) { case 1: - ti = proto_tree_add_text ( tree, tvb, offset - 1, length + 1, - "clear text (1), password (length %d) = ", length); if ( length > 0 ) { - proto_item_append_text(ti, "%s", - tvb_format_text(tvb, offset, length)); - } else { - proto_item_append_text(ti, "no clear-text password found!!!"); + proto_tree_add_bytes_format( tree, hf_auth_bytes, tvb, offset, length, + NULL, "clear text (1), password (length %d) = %s", length, tvb_format_text(tvb, offset, length)); + } else { + proto_tree_add_bytes_format( tree, hf_auth_bytes, tvb, offset, length, + NULL, "clear text (1), no clear-text password found!!!"); } break; case 54: - ti = proto_tree_add_text ( tree, tvb, offset - 1, length + 1, - "hmac-md5 (54), password (length %d) = ", length); - if ( length == 16 ) { - proto_item_append_text(ti, "0x%02x", tvb_get_guint8(tvb, offset)); - offset += 1; - length--; - while (length > 0) { - proto_item_append_text(ti, "%02x", tvb_get_guint8(tvb, offset)); - offset += 1; - length--; - } + proto_tree_add_bytes_format( tree, hf_auth_bytes, tvb, offset, length, + NULL, "hmac-md5 (54), password (length %d) = %s", length, tvb_bytes_to_ep_str(tvb, offset, length)); } else { - proto_item_append_text(ti, - "illegal hmac-md5 digest format (must be 16 bytes)"); + proto_tree_add_bytes_format( tree, hf_auth_bytes, tvb, offset, length, + NULL, "hmac-md5 (54), illegal hmac-md5 digest format (must be 16 bytes)"); } break; default: - proto_tree_add_text ( tree, tvb, offset - 1, length + 1, - "type 0x%02x (0x%02x): ", pw_type, length ); + proto_tree_add_bytes_format( tree, hf_auth_bytes, tvb, offset, length, + NULL, "type 0x%02x (0x%02x)", pw_type, length); auth_unsupported=TRUE; break; } - if ( auth_unsupported ) { - proto_tree_add_expert(tree, pinfo, auth_expert, tvb, offset, -1); + if ( auth_unsupported ) { + proto_tree_add_expert(tree, pinfo, auth_expert, tvb, offset, -1); } } /* - * Name: isis_ip_authentication_clv() - * - * Description: - * dump the IP authentication information found in TLV 133 - * the CLV is standardized in rf1195, however all major - * implementations use TLV #10 - * Input: - * tvbuff_t * : tvbuffer for packet data - * proto_tree * : protocol display tree to fill out. May be NULL - * int : offset into packet data where we are. - * int : length of clv we are decoding - * - * Output: - * void, but we will add to proto tree if !NULL. - */ - - -void -isis_dissect_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree, int offset, - int length) -{ - if ( !tree ) return; /* nothing to do! */ - - if ( length != 0 ) { - proto_tree_add_text ( tree, tvb, offset, length, - "IP Authentication: %.*s", length, - tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII)); - } -} - - -/* * Name: isis_dissect_hostname_clv() * * Description: @@ -235,25 +186,18 @@ void isis_dissect_hostname_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length, int tree_id) { - if ( !tree ) return; /* nothing to do! */ - - if ( length == 0 ) { - proto_tree_add_text ( tree, tvb, offset, length, - "Hostname: --none--" ); - } else { - const char* value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII); - proto_tree_add_string_format ( tree, tree_id, - tvb, offset, length, - value, "Hostname: %.*s", length, value); - } + proto_item* ti = proto_tree_add_item( tree, tree_id, tvb, offset, length, ENC_ASCII|ENC_NA); + if ( length == 0 ) { + proto_item_append_text(ti, "--none--" ); + } } void -isis_dissect_mt_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length, - int tree_id) +isis_dissect_mt_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, int length, + int tree_id, expert_field* mtid_expert) { guint16 mt_block; const char *mt_desc; @@ -294,8 +238,7 @@ isis_dissect_mt_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length, (mt_block&0x8000) ? "" : "no ", (mt_block&0x4000) ? ", ATT bit set" : "" ); } else { - proto_tree_add_text ( tree, tvb, offset, 1, - "malformed MT-ID"); + proto_tree_add_expert( tree, pinfo, mtid_expert, tvb, offset, 1); break; } length -= 2; @@ -443,29 +386,19 @@ isis_dissect_te_router_id_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tv * Output: * void, but we will add to proto tree if !NULL. */ - -#define TRUNCATED_TEXT " [truncated]" void -isis_dissect_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length) +isis_dissect_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, int hf_nlpid, int offset, int length) { gboolean first; proto_item *ti; if ( !tree ) return; /* nothing to do! */ - /* - * Throw an exception rather than putting in a - * partial address. - */ - tvb_ensure_bytes_exist ( tvb, offset, length ); - if (length <= 0) { - proto_tree_add_text (tree, tvb, offset, length, - "NLPID(s): --none--"); + proto_tree_add_bytes_format_value(tree, hf_nlpid, tvb, offset, length, NULL, "--none--"); } else { first = TRUE; - ti = proto_tree_add_text (tree, tvb, offset, length, - "NLPID(s): "); + ti = proto_tree_add_bytes_format(tree, hf_nlpid, tvb, offset, length, NULL, "NLPID(s): "); while (length-- > 0 ) { if (!first) { proto_item_append_text(ti, ", "); diff --git a/epan/dissectors/packet-isis-clv.h b/epan/dissectors/packet-isis-clv.h index a3efb87a76..fb08ea70ef 100644 --- a/epan/dissectors/packet-isis-clv.h +++ b/epan/dissectors/packet-isis-clv.h @@ -96,23 +96,21 @@ extern void isis_dissect_clvs(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tre int unknown_tree_id, int tree_type, int tree_length); extern void isis_dissect_nlpid_clv(tvbuff_t *tvb, proto_tree *tree, - int offset, int length); + int hf_nlpid, int offset, int length); extern void isis_dissect_te_router_id_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, expert_field* expert, int offset, int length, int tree_id); extern void isis_dissect_ipv6_int_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, expert_field* expert, int offset, int length, int tree_id); extern void isis_dissect_ip_int_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, expert_field* expert, int offset, int length, int tree_id); -extern void isis_dissect_mt_clv(tvbuff_t *tvb, proto_tree *tree, - int offset, int length, int tree_id); +extern void isis_dissect_mt_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, + int offset, int length, int tree_id, expert_field* mtid_expert); extern void isis_dissect_hostname_clv(tvbuff_t *tvb, proto_tree *tree, int offset, int length, int tree_id); extern void isis_dissect_authentication_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, - expert_field* auth_expert, int offset, int length); -extern void isis_dissect_ip_authentication_clv(tvbuff_t *tvb, proto_tree *tree, - int offset, int length); + int hf_auth_bytes, expert_field* auth_expert, int offset, int length); extern void isis_dissect_area_address_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, - expert_field* expert, int offset, int length); + expert_field* expert, int hf_area, int offset, int length); extern void isis_dissect_metric(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 value, char *pstr, int force_supported); diff --git a/epan/dissectors/packet-isis-hello.c b/epan/dissectors/packet-isis-hello.c index d4ef6bfee6..f1082c93ba 100644 --- a/epan/dissectors/packet-isis-hello.c +++ b/epan/dissectors/packet-isis-hello.c @@ -100,6 +100,18 @@ static int hf_isis_hello_extended_local_circuit_id = -1; static int hf_isis_hello_adjacency_state = -1; static int hf_isis_hello_neighbor_systemid = -1; static int hf_isis_hello_digest = -1; +static int hf_isis_hello_digest_v = -1; +static int hf_isis_hello_digest_a = -1; +static int hf_isis_hello_digest_d = -1; +static int hf_isis_hello_ect = -1; +static int hf_isis_hello_bvid = -1; +static int hf_isis_hello_bvid_u = -1; +static int hf_isis_hello_bvid_m = -1; +static int hf_isis_hello_area_address = -1; +static int hf_isis_hello_clv_nlpid = -1; +static int hf_isis_hello_clv_ip_authentication = -1; +static int hf_isis_hello_authentication = -1; + static int hf_isis_hello_aux_mcid = -1; static int hf_isis_hello_mcid = -1; static int hf_isis_hello_is_neighbor = -1; @@ -163,8 +175,10 @@ static gint ett_isis_hello_clv_checksum = -1; static expert_field ei_isis_hello_short_packet = EI_INIT; static expert_field ei_isis_hello_long_packet = EI_INIT; -static expert_field ei_isis_hello_subtlv = EI_INIT; static expert_field ei_isis_hello_authentication = EI_INIT; +static expert_field ei_isis_hello_subtlv = EI_INIT; +static expert_field ei_isis_hello_clv_mt = EI_INIT; + static const value_string isis_hello_circuit_type_vals[] = { { ISIS_HELLO_TYPE_RESERVED, "Reserved 0 (discard PDU)"}, @@ -215,16 +229,13 @@ dissect_hello_mt_port_cap_spb_digest_clv(tvbuff_t *tvb, packet_info* pinfo, } else { proto_tree *subtree; - const guint8 vad = tvb_get_guint8(tvb, offset); subtree = proto_tree_add_subtree_format( tree, tvb, offset-2, sublen+2, ett_isis_hello_clv_mt_port_cap_spb_digest, NULL, "SPB Digest: Type: 0x%02x, Length: %d", subtype, sublen); - proto_tree_add_text( subtree, tvb, offset, 1, - "V: %d, A: %d, D: %d", - (vad >> 4) & 0x1, - (vad >> 2) & 0x3, - (vad >> 0) & 0x3); + proto_tree_add_item( subtree, hf_isis_hello_digest_v, tvb, offset, 1, ENC_NA); + proto_tree_add_item( subtree, hf_isis_hello_digest_a, tvb, offset, 1, ENC_NA); + proto_tree_add_item( subtree, hf_isis_hello_digest_d, tvb, offset, 1, ENC_NA); ++offset; /* Digest: */ @@ -250,21 +261,11 @@ dissect_hello_mt_port_cap_spb_bvid_tuples_clv(tvbuff_t *tvb, packet_info* pinfo, return; } else { - const guint8 *ect_tlv = tvb_get_ptr(tvb, subofs, 6); - guint16 word = (ect_tlv[4] << 8) | ect_tlv[5]; - guint16 bvid = (word >> 4) & 0xfff; - int u_bit = (ect_tlv[5] & 8) ? 1 : 0; - int m_bit = (ect_tlv[5] & 4) ? 1 : 0; - proto_tree_add_text( subtree, tvb, subofs, 6, - "ECT: %02x-%02x-%02x-%02x, BVID: 0x%03x (%d),%s U: %d, M: %d", - ect_tlv[0], ect_tlv[1], ect_tlv[2], ect_tlv[3], - bvid, bvid, - ( bvid < 10 ? " " - : bvid < 100 ? " " - : bvid < 1000 ? " " - : ""), - u_bit, - m_bit); + proto_tree_add_bytes_format_value(subtree, hf_isis_hello_ect, tvb, subofs, 4, NULL, + "%s", tvb_bytes_to_ep_str_punct(tvb, subofs, 4, '-')); + proto_tree_add_item( subtree, hf_isis_hello_bvid, tvb, subofs+4, 2, ENC_BIG_ENDIAN); + proto_tree_add_item( subtree, hf_isis_hello_bvid_u, tvb, subofs+4, 2, ENC_BIG_ENDIAN); + proto_tree_add_item( subtree, hf_isis_hello_bvid_m, tvb, subofs+4, 2, ENC_BIG_ENDIAN); } sublen -= 6; subofs += 6; @@ -586,7 +587,7 @@ static void dissect_hello_nlpid_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_nlpid_clv(tvb, tree, offset, length); + isis_dissect_nlpid_clv(tvb, tree, hf_isis_hello_clv_nlpid, offset, length); } /* @@ -608,11 +609,11 @@ dissect_hello_nlpid_clv(tvbuff_t *tvb, packet_info* pinfo _U_, */ static void -dissect_hello_mt_clv(tvbuff_t *tvb, packet_info* pinfo _U_, +dissect_hello_mt_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_mt_clv(tvb, tree, offset, length, - hf_isis_hello_clv_mt ); + isis_dissect_mt_clv(tvb, pinfo, tree, offset, length, + hf_isis_hello_clv_mt, &ei_isis_hello_clv_mt); } /* @@ -686,7 +687,7 @@ static void dissect_hello_authentication_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_authentication_clv(tree, pinfo, tvb, &ei_isis_hello_authentication, offset, length); + isis_dissect_authentication_clv(tree, pinfo, tvb, hf_isis_hello_authentication, &ei_isis_hello_authentication, offset, length); } /* @@ -710,7 +711,9 @@ static void dissect_hello_ip_authentication_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_ip_authentication_clv(tvb, tree, offset, length); + if ( length != 0 ) { + proto_tree_add_item( tree, hf_isis_hello_clv_ip_authentication, tvb, offset, length, ENC_ASCII|ENC_NA); + } } /* @@ -774,45 +777,43 @@ dissect_hello_checksum_clv(tvbuff_t *tvb, packet_info* pinfo, guint16 pdu_length,checksum, cacl_checksum=0; - if (tree) { - if ( length != 2 ) { - proto_tree_add_text ( tree, tvb, offset, length, - "incorrect checksum length (%u), should be (2)", length ); - return; - } + if ( length != 2 ) { + proto_tree_add_expert_format(tree, pinfo, &ei_isis_hello_short_packet, tvb, offset, length, + "incorrect checksum length (%u), should be (2)", length ); + return; + } - checksum = tvb_get_ntohs(tvb, offset); + checksum = tvb_get_ntohs(tvb, offset); - /* the check_and_get_checksum() function needs to know how big - * the packet is. we can either pass through the pdu-len through several layers - * of dissectors and wrappers or extract the PDU length field from the PDU specific header - * which is offseted 17 bytes in IIHs (relative to the beginning of the IS-IS packet) */ - pdu_length = tvb_get_ntohs(tvb, 17); + /* the check_and_get_checksum() function needs to know how big + * the packet is. we can either pass through the pdu-len through several layers + * of dissectors and wrappers or extract the PDU length field from the PDU specific header + * which is offseted 17 bytes in IIHs (relative to the beginning of the IS-IS packet) */ + pdu_length = tvb_get_ntohs(tvb, 17); - /* unlike the LSP checksum verification which starts at an offset of 12 we start at offset 0*/ - switch (check_and_get_checksum(tvb, 0, pdu_length, checksum, offset, &cacl_checksum)) - { - case NO_CKSUM : - proto_tree_add_uint_format_value( tree, hf_isis_hello_checksum, tvb, offset, length, checksum, - "0x%04x [unused]", checksum); - break; - case DATA_MISSING : - proto_tree_add_expert_format(tree, pinfo, &ei_isis_hello_long_packet, tvb, offset, -1, - "Packet length %d went beyond packet", tvb_length(tvb) ); - break; - case CKSUM_NOT_OK : - proto_tree_add_uint_format_value( tree, hf_isis_hello_checksum, tvb, offset, length, checksum, - "0x%04x [incorrect, should be 0x%04x]", - checksum, - cacl_checksum); - break; - case CKSUM_OK : - proto_tree_add_uint_format_value( tree, hf_isis_hello_checksum, tvb, offset, length, checksum, - "0x%04x [correct]", checksum); - break; - default : - g_message("'check_and_get_checksum' returned an invalid value"); - } + /* unlike the LSP checksum verification which starts at an offset of 12 we start at offset 0*/ + switch (check_and_get_checksum(tvb, 0, pdu_length, checksum, offset, &cacl_checksum)) + { + case NO_CKSUM : + proto_tree_add_uint_format_value( tree, hf_isis_hello_checksum, tvb, offset, length, checksum, + "0x%04x [unused]", checksum); + break; + case DATA_MISSING : + proto_tree_add_expert_format(tree, pinfo, &ei_isis_hello_long_packet, tvb, offset, -1, + "Packet length %d went beyond packet", tvb_length(tvb) ); + break; + case CKSUM_NOT_OK : + proto_tree_add_uint_format_value( tree, hf_isis_hello_checksum, tvb, offset, length, checksum, + "0x%04x [incorrect, should be 0x%04x]", + checksum, + cacl_checksum); + break; + case CKSUM_OK : + proto_tree_add_uint_format_value( tree, hf_isis_hello_checksum, tvb, offset, length, checksum, + "0x%04x [correct]", checksum); + break; + default : + g_message("'check_and_get_checksum' returned an invalid value"); } } @@ -839,7 +840,7 @@ static void dissect_hello_area_address_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_area_address_clv(tree, pinfo, tvb, &ei_isis_hello_short_packet, offset, length); + isis_dissect_area_address_clv(tree, pinfo, tvb, &ei_isis_hello_short_packet, hf_isis_hello_area_address, offset, length); } static const value_string adj_state_vals[] = { @@ -1389,6 +1390,17 @@ proto_register_isis_hello(void) { &hf_isis_hello_mcid, { "MCID", "isis.hello.mcid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_isis_hello_aux_mcid, { "Aux MCID", "isis.hello.aux_mcid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_isis_hello_digest, { "Digest", "isis.hello.digest", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_hello_digest_v, { "V", "isis.hello.digest.v", FT_UINT8, BASE_DEC, NULL, 0x10, NULL, HFILL }}, + { &hf_isis_hello_digest_a, { "A", "isis.hello.digest.a", FT_UINT8, BASE_DEC, NULL, 0x0c, NULL, HFILL }}, + { &hf_isis_hello_digest_d, { "D", "isis.hello.digest.d", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL }}, + { &hf_isis_hello_ect, { "ECT", "isis.hello.ect", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_hello_bvid, { "BVID", "isis.hello.bvid", FT_UINT16, BASE_HEX_DEC, NULL, 0x0FFF, NULL, HFILL }}, + { &hf_isis_hello_bvid_u, { "U", "isis.hello.bvid.u", FT_UINT16, BASE_HEX_DEC, NULL, 0x0008, NULL, HFILL }}, + { &hf_isis_hello_bvid_m, { "M", "isis.hello.bvid.m", FT_UINT16, BASE_HEX_DEC, NULL, 0x0004, NULL, HFILL }}, + { &hf_isis_hello_area_address, { "Srea address", "isis.hello.area_address", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_hello_clv_nlpid, { "NLPID", "isis.hello.clv_nlpid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_hello_clv_ip_authentication, { "NLPID", "isis.hello.clv_ip_authentication", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_hello_authentication, { "Authentication", "isis.hello.clv_authentication", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_isis_hello_mtid, { "Topology ID", "isis.hello.mtid", FT_UINT16, BASE_DEC|BASE_RANGE_STRING, RVALS(mtid_strings), 0xfff, NULL, HFILL }}, { &hf_isis_hello_trill_neighbor_sf, { "Smallest flag", "isis.hello.trill_neighbor.sf", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, NULL, HFILL }}, { &hf_isis_hello_trill_neighbor_lf, { "Largest flag", "isis.hello.trill_neighbor.lf", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40, NULL, HFILL }}, @@ -1459,6 +1471,7 @@ proto_register_isis_hello(void) { &ei_isis_hello_long_packet, { "isis.hello.long_packet", PI_MALFORMED, PI_ERROR, "Long packet", EXPFILL }}, { &ei_isis_hello_subtlv, { "isis.hello.subtlv.unknown", PI_PROTOCOL, PI_WARN, "Unknown Sub-TLV", EXPFILL }}, { &ei_isis_hello_authentication, { "isis.hello.authentication.unknown", PI_PROTOCOL, PI_WARN, "Unknown authentication type", EXPFILL }}, + { &ei_isis_hello_clv_mt, { "isis.hello.clv_mt.malformed", PI_MALFORMED, PI_ERROR, "malformed MT-ID", EXPFILL }}, }; expert_module_t* expert_isis_hello; diff --git a/epan/dissectors/packet-isis-lsp.c b/epan/dissectors/packet-isis-lsp.c index bd6f39f67e..1d7917baac 100644 --- a/epan/dissectors/packet-isis-lsp.c +++ b/epan/dissectors/packet-isis-lsp.c @@ -261,11 +261,15 @@ static int hf_isis_lsp_ip_reachability_expense_metric_ie = -1; static int hf_isis_lsp_rt_capable_router_id =-1; static int hf_isis_lsp_rt_capable_flag_s =-1; static int hf_isis_lsp_rt_capable_flag_d =-1; -static int isis_lsp_clv_te_node_cap_b_bit = -1; -static int isis_lsp_clv_te_node_cap_e_bit = -1; -static int isis_lsp_clv_te_node_cap_m_bit = -1; -static int isis_lsp_clv_te_node_cap_g_bit = -1; -static int isis_lsp_clv_te_node_cap_p_bit = -1; +static int hf_isis_lsp_clv_te_node_cap_b_bit = -1; +static int hf_isis_lsp_clv_te_node_cap_e_bit = -1; +static int hf_isis_lsp_clv_te_node_cap_m_bit = -1; +static int hf_isis_lsp_clv_te_node_cap_g_bit = -1; +static int hf_isis_lsp_clv_te_node_cap_p_bit = -1; +static int hf_isis_lsp_area_address = -1; +static int hf_isis_lsp_clv_nlpid = -1; +static int hf_isis_lsp_ip_authentication = -1; +static int hf_isis_lsp_authentication = -1; static gint ett_isis_lsp = -1; static gint ett_isis_lsp_info = -1; @@ -323,6 +327,8 @@ static expert_field ei_isis_lsp_short_packet = EI_INIT; static expert_field ei_isis_lsp_long_packet = EI_INIT; static expert_field ei_isis_lsp_subtlv = EI_INIT; static expert_field ei_isis_lsp_authentication = EI_INIT; +static expert_field ei_isis_lsp_clv_mt = EI_INIT; + static const value_string isis_lsp_istype_vals[] = { { ISIS_LSP_TYPE_UNUSED0, "Unused 0x0 (invalid)"}, @@ -891,11 +897,11 @@ dissect_isis_trill_clv(tvbuff_t *tvb, packet_info* pinfo _U_, * 5-7 Unassigned [RFC5073] */ - proto_tree_add_item(cap_tree, isis_lsp_clv_te_node_cap_b_bit, tvb, offset, 1, ENC_NA); - proto_tree_add_item(cap_tree, isis_lsp_clv_te_node_cap_e_bit, tvb, offset, 1, ENC_NA); - proto_tree_add_item(cap_tree, isis_lsp_clv_te_node_cap_m_bit, tvb, offset, 1, ENC_NA); - proto_tree_add_item(cap_tree, isis_lsp_clv_te_node_cap_g_bit, tvb, offset, 1, ENC_NA); - proto_tree_add_item(cap_tree, isis_lsp_clv_te_node_cap_p_bit, tvb, offset, 1, ENC_NA); + proto_tree_add_item(cap_tree, hf_isis_lsp_clv_te_node_cap_b_bit, tvb, offset, 1, ENC_NA); + proto_tree_add_item(cap_tree, hf_isis_lsp_clv_te_node_cap_e_bit, tvb, offset, 1, ENC_NA); + proto_tree_add_item(cap_tree, hf_isis_lsp_clv_te_node_cap_m_bit, tvb, offset, 1, ENC_NA); + proto_tree_add_item(cap_tree, hf_isis_lsp_clv_te_node_cap_g_bit, tvb, offset, 1, ENC_NA); + proto_tree_add_item(cap_tree, hf_isis_lsp_clv_te_node_cap_p_bit, tvb, offset, 1, ENC_NA); return(0); case TRILL_VERSION: rt_tree = proto_tree_add_subtree_format(tree, tvb, offset-2, sublen+2, @@ -1198,7 +1204,7 @@ static void dissect_lsp_nlpid_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_nlpid_clv(tvb, tree, offset, length); + isis_dissect_nlpid_clv(tvb, tree, hf_isis_lsp_clv_nlpid, offset, length); } /* @@ -1219,10 +1225,10 @@ dissect_lsp_nlpid_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, i * void, will modify proto_tree if not null. */ static void -dissect_lsp_mt_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset, +dissect_lsp_mt_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_mt_clv(tvb, tree, offset, length, hf_isis_lsp_clv_mt ); + isis_dissect_mt_clv(tvb, pinfo, tree, offset, length, hf_isis_lsp_clv_mt, &ei_isis_lsp_clv_mt ); } /* @@ -1630,7 +1636,7 @@ static void dissect_lsp_authentication_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_authentication_clv(tree, pinfo, tvb, &ei_isis_lsp_authentication, offset, length); + isis_dissect_authentication_clv(tree, pinfo, tvb, hf_isis_lsp_authentication, &ei_isis_lsp_authentication, offset, length); } /* @@ -1654,7 +1660,9 @@ static void dissect_lsp_ip_authentication_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_ip_authentication_clv(tvb, tree, offset, length); + if ( length != 0 ) { + proto_tree_add_item(tree, hf_isis_lsp_ip_authentication, tvb, offset, length, ENC_ASCII|ENC_NA); + } } /* @@ -1678,7 +1686,7 @@ static void dissect_lsp_area_address_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_area_address_clv(tree, pinfo, tvb, &ei_isis_lsp_short_packet, offset, length); + isis_dissect_area_address_clv(tree, pinfo, tvb, &ei_isis_lsp_short_packet, hf_isis_lsp_area_address, offset, length); } /* @@ -3530,31 +3538,51 @@ proto_register_isis_lsp(void) FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, - { &isis_lsp_clv_te_node_cap_b_bit, + { &hf_isis_lsp_clv_te_node_cap_b_bit, { "B bit: P2MP Branch LSR capability", "isis.lsp.te_node_cap.b_bit", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, - { &isis_lsp_clv_te_node_cap_e_bit, + { &hf_isis_lsp_clv_te_node_cap_e_bit, { "E bit: P2MP Bud LSR capability", "isis.lsp.te_node_cap.e_bit", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, - { &isis_lsp_clv_te_node_cap_m_bit, + { &hf_isis_lsp_clv_te_node_cap_m_bit, { "M bit: MPLS-TE support", "isis.lsp.te_node_cap.m_bit", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, - { &isis_lsp_clv_te_node_cap_g_bit, + { &hf_isis_lsp_clv_te_node_cap_g_bit, { "G bit: GMPLS support", "isis.lsp.te_node_cap.g_bit", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, - { &isis_lsp_clv_te_node_cap_p_bit, + { &hf_isis_lsp_clv_te_node_cap_p_bit, { "P bit: P2MP RSVP-TE support", "isis.lsp.te_node_cap.p_bit", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, + { &hf_isis_lsp_area_address, + { "Area address", "isis.lsp.area_address", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_isis_lsp_clv_nlpid, + { "NLPID", "isis.lsp.clv_nlpid", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_isis_lsp_ip_authentication, + { "IP Authentication", "isis.lsp.ip_authentication", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_isis_lsp_authentication, + { "Authentication", "isis.lsp.authentication", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, }; static gint *ett[] = { &ett_isis_lsp, @@ -3615,6 +3643,7 @@ proto_register_isis_lsp(void) { &ei_isis_lsp_long_packet, { "isis.lsp.long_packet", PI_MALFORMED, PI_ERROR, "Long packet", EXPFILL }}, { &ei_isis_lsp_subtlv, { "isis.lsp.subtlv.unknown", PI_PROTOCOL, PI_WARN, "Unknown SubTLV", EXPFILL }}, { &ei_isis_lsp_authentication, { "isis.lsp.authentication.unknown", PI_PROTOCOL, PI_WARN, "Unknown authentication type", EXPFILL }}, + { &ei_isis_lsp_clv_mt, { "isis.lsp.clv_mt.malformed", PI_MALFORMED, PI_ERROR, "malformed MT-ID", EXPFILL }}, }; expert_module_t* expert_isis_lsp; diff --git a/epan/dissectors/packet-isis-snp.c b/epan/dissectors/packet-isis-snp.c index f68866caa5..648316065e 100644 --- a/epan/dissectors/packet-isis-snp.c +++ b/epan/dissectors/packet-isis-snp.c @@ -55,6 +55,8 @@ static int hf_isis_csnp_lsp_checksum = -1; static int hf_isis_csnp_checksum = -1; static int hf_isis_csnp_clv_type = -1; static int hf_isis_csnp_clv_length = -1; +static int hf_isis_csnp_ip_authentication = -1; +static int hf_isis_csnp_authentication = -1; static gint ett_isis_csnp = -1; static gint ett_isis_csnp_clv_lsp_entries = -1; static gint ett_isis_csnp_lsp_entry = -1; @@ -72,6 +74,7 @@ static int hf_isis_psnp_pdu_length = -1; static int hf_isis_psnp_source_id = -1; static int hf_isis_psnp_clv_type = -1; static int hf_isis_psnp_clv_length = -1; +static int hf_isis_psnp_ip_authentication = -1; static gint ett_isis_psnp = -1; static gint ett_isis_psnp_clv_lsp_entries = -1; static gint ett_isis_psnp_lsp_entry = -1; @@ -87,14 +90,25 @@ static void dissect_snp_authentication_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_authentication_clv(tree, pinfo, tvb, &ei_isis_csnp_authentication, offset, length); + isis_dissect_authentication_clv(tree, pinfo, tvb, hf_isis_csnp_authentication, &ei_isis_csnp_authentication, offset, length); } static void -dissect_snp_ip_authentication_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset, +dissect_csnp_ip_authentication_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset, int id_length _U_, int length) { - isis_dissect_ip_authentication_clv(tvb, tree, offset, length); + if ( length != 0 ) { + proto_tree_add_item(tree, hf_isis_csnp_ip_authentication, tvb, offset, length, ENC_ASCII|ENC_NA); + } +} + +static void +dissect_psnp_ip_authentication_clv(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, int offset, + int id_length _U_, int length) +{ + if ( length != 0 ) { + proto_tree_add_item(tree, hf_isis_psnp_ip_authentication, tvb, offset, length, ENC_ASCII|ENC_NA); + } } /* @@ -202,7 +216,7 @@ static const isis_clv_handle_t clv_l1_csnp_opts[] = { ISIS_CLV_IP_AUTHENTICATION, "IP Authentication", &ett_isis_csnp_clv_ip_authentication, - dissect_snp_ip_authentication_clv + dissect_csnp_ip_authentication_clv }, { ISIS_CLV_CHECKSUM, @@ -232,7 +246,7 @@ static const isis_clv_handle_t clv_l2_csnp_opts[] = { ISIS_CLV_IP_AUTHENTICATION, "IP Authentication", &ett_isis_csnp_clv_ip_authentication, - dissect_snp_ip_authentication_clv + dissect_csnp_ip_authentication_clv }, { ISIS_CLV_CHECKSUM, @@ -262,7 +276,7 @@ static const isis_clv_handle_t clv_l1_psnp_opts[] = { ISIS_CLV_IP_AUTHENTICATION, "IP Authentication", &ett_isis_psnp_clv_ip_authentication, - dissect_snp_ip_authentication_clv + dissect_psnp_ip_authentication_clv }, { ISIS_CLV_CHECKSUM, @@ -292,7 +306,7 @@ static const isis_clv_handle_t clv_l2_psnp_opts[] = { ISIS_CLV_IP_AUTHENTICATION, "IP Authentication", &ett_isis_psnp_clv_ip_authentication, - dissect_snp_ip_authentication_clv + dissect_psnp_ip_authentication_clv }, { ISIS_CLV_CHECKSUM, @@ -458,6 +472,12 @@ proto_register_isis_csnp(void) { &hf_isis_csnp_clv_length, { "Length", "isis.csnp.clv.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_csnp_ip_authentication, + { "IP Authentication", "isis.csnp.ip_authentication", FT_STRING, + BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_csnp_authentication, + { "Authentication", "isis.csnp.authentication", FT_BYTES, + BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { @@ -509,6 +529,9 @@ proto_register_isis_psnp(void) { &hf_isis_psnp_clv_length, { "Length", "isis.psnp.clv.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_psnp_ip_authentication, + { "IP Authentication", "isis.csnp.ip_authentication", FT_STRING, + BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c index a2c182b982..d55c1c3a8a 100644 --- a/epan/dissectors/packet-mpls.c +++ b/epan/dissectors/packet-mpls.c @@ -51,6 +51,7 @@ #include "config.h" #include <epan/packet.h> +#include <epan/expert.h> #include <epan/ppptypes.h> #include <epan/etypes.h> @@ -227,6 +228,11 @@ static int hf_mpls_pw_mcw_flags = -1; static int hf_mpls_pw_mcw_length = -1; static int hf_mpls_pw_mcw_sequence_number = -1; +static expert_field ei_mpls_pw_ach_error_processing_message = EI_INIT; +static expert_field ei_mpls_pw_ach_res = EI_INIT; +static expert_field ei_mpls_pw_mcw_error_processing_message = EI_INIT; +static expert_field ei_mpls_invalid_label = EI_INIT; + #if 0 /*not used yet*/ /* * MPLS PW types @@ -360,7 +366,7 @@ dissect_pw_ach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint channel_type; if (tvb_reported_length_remaining(tvb, 0) < 4) { - proto_tree_add_text(tree, tvb, 0, -1, "Error processing Message"); + proto_tree_add_expert(tree, pinfo, &ei_mpls_pw_ach_error_processing_message, tvb, 0, -1); return; } @@ -382,10 +388,7 @@ dissect_pw_ach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ti = proto_tree_add_uint(mpls_pw_ach_tree, hf_mpls_pw_ach_res, tvb, 1, 1, res); if (res != 0) - proto_tree_add_text(mpls_pw_ach_tree, tvb, 1, 1, - "Error: this byte is reserved and must be 0"); - else - PROTO_ITEM_SET_HIDDEN(ti); + expert_add_info(pinfo, ti, &ei_mpls_pw_ach_res); proto_tree_add_uint_format_value(mpls_pw_ach_tree, hf_mpls_pw_ach_channel_type, tvb, 2, 2, channel_type, @@ -442,7 +445,7 @@ dissect_pw_mcw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvbuff_t *next_tvb; if (tvb_reported_length_remaining(tvb, 0) < 4) { - proto_tree_add_text(tree, tvb, 0, -1, "Error processing Message"); + proto_tree_add_expert(tree, pinfo, &ei_mpls_pw_mcw_error_processing_message, tvb, 0, -1); return; } @@ -540,7 +543,7 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 4; if ((label == MPLS_LABEL_GACH) && !bos) { - proto_tree_add_text(tree, tvb, 0, -1, "Invalid Label"); + proto_tree_add_expert(tree, pinfo, &ei_mpls_invalid_label, tvb, 0, -1); } if ((label == MPLS_LABEL_GACH) && bos) { @@ -720,6 +723,13 @@ proto_register_mpls(void) &ett_mpls_pw_mcw, }; + static ei_register_info ei[] = { + { &ei_mpls_pw_ach_error_processing_message, { "pwach.error_processing_message", PI_MALFORMED, PI_ERROR, "Error processing Message", EXPFILL }}, + { &ei_mpls_pw_ach_error_processing_message, { "pwmcw.error_processing_message", PI_MALFORMED, PI_ERROR, "Error processing Message", EXPFILL }}, + { &ei_mpls_pw_ach_res, { "pwach.res.not_zero", PI_PROTOCOL, PI_WARN, "Error: this byte is reserved and must be 0", EXPFILL }}, + { &ei_mpls_invalid_label, { "mpls.invalid_label", PI_PROTOCOL, PI_WARN, "Invalid Label", EXPFILL }}, + }; + /* Decode As handling */ static build_valid_func mpls_da_build_value[1] = {mpls_value}; static decode_as_value_t mpls_da_values = {mpls_prompt, 1, mpls_da_build_value}; @@ -731,6 +741,7 @@ proto_register_mpls(void) static decode_as_t pw_ach_da = {"pwach", "PW Associated Channel", "pwach.channel_type", 1, 0, &pw_ach_da_values, NULL, NULL, decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL}; + expert_module_t* expert_mpls; module_t * module_mpls; /* FF: mpls subdissector table is indexed by label */ @@ -746,6 +757,9 @@ proto_register_mpls(void) proto_register_field_array(proto_mpls, mplsf_info, array_length(mplsf_info)); proto_register_subtree_array(ett, array_length(ett)); + expert_mpls = expert_register_protocol(proto_mpls); + expert_register_field_array(expert_mpls, ei, array_length(ei)); + register_dissector("mpls", dissect_mpls, proto_mpls); register_dissector("mplspwcw", dissect_pw_mcw, proto_pw_mcw ); diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c index b67aa79daf..475c11aca6 100644 --- a/epan/dissectors/packet-netflow.c +++ b/epan/dissectors/packet-netflow.c @@ -1116,6 +1116,8 @@ static int hf_cflow_samplerate = -1; static int hf_cflow_unknown_field_type = -1; static int hf_cflow_padding = -1; +static int hf_cflow_reserved = -1; +static int hf_cflow_extra_packets = -1; /* * cflow version specific info @@ -1187,6 +1189,7 @@ static int hf_cflow_srcport = -1; static int hf_cflow_dstport = -1; static int hf_cflow_prot = -1; static int hf_cflow_tos = -1; +static int hf_cflow_marked_tos = -1; static int hf_cflow_flags = -1; static int hf_cflow_tcpflags = -1; static int hf_cflow_tcpflags16 = -1; @@ -1821,13 +1824,19 @@ static int flow_process_aspair(proto_tree *pdutree, tvbuff_t *tvb, int offset); static int flow_process_sizecount(proto_tree *pdutree, tvbuff_t *tvb, int offset); -static int flow_process_textfield(proto_tree *pdutree, tvbuff_t *tvb, - int offset, int bytes, - const char *text); static v9_v10_tmplt_t *v9_v10_tmplt_build_key(v9_v10_tmplt_t *tmplt_p, packet_info *pinfo, guint32 src_id, guint16 tmplt_id); +static int +flow_process_textfield(proto_tree *pdutree, tvbuff_t *tvb, int offset, int bytes, int hf) +{ + proto_tree_add_item(pdutree, hf, tvb, offset, bytes, ENC_NA); + offset += bytes; + + return offset; +} + static int pen_to_type_hf_list (guint32 pen) { @@ -2068,7 +2077,7 @@ dissect_netflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data tvb, offset++, 1, ENC_BIG_ENDIAN); } if (ver == 7 || ver == 8) - offset = flow_process_textfield(netflow_tree, tvb, offset, 4, "reserved"); + offset = flow_process_textfield(netflow_tree, tvb, offset, 4, hf_cflow_reserved); else if (ver == 5) { proto_tree_add_item(netflow_tree, hf_cflow_samplingmode, tvb, offset, 2, ENC_BIG_ENDIAN); @@ -2222,15 +2231,6 @@ flow_process_sizecount(proto_tree *pdutree, tvbuff_t *tvb, int offset) } static int -flow_process_textfield(proto_tree *pdutree, tvbuff_t *tvb, int offset, int bytes, const char *text) -{ - proto_tree_add_text(pdutree, tvb, offset, bytes, "%s", text); - offset += bytes; - - return offset; -} - -static int dissect_v8_flowpdu(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *pdutree, int offset, hdrinfo_t *hdrinfo_p) { @@ -2271,14 +2271,14 @@ dissect_v8_flowpdu(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *pdutre proto_tree_add_item(pdutree, hf_cflow_tos, tvb, offset++, 1, ENC_BIG_ENDIAN); if (verspec == V8PDU_FULL_METHOD) proto_tree_add_item(pdutree, hf_cflow_prot, tvb, offset++, 1, ENC_BIG_ENDIAN); - offset = flow_process_textfield(pdutree, tvb, offset, 1, "marked tos"); + offset = flow_process_textfield(pdutree, tvb, offset, 1, hf_cflow_marked_tos); if (verspec == V8PDU_SRCDEST_METHOD) - offset = flow_process_textfield(pdutree, tvb, offset, 2, "reserved"); + offset = flow_process_textfield(pdutree, tvb, offset, 2, hf_cflow_reserved); else if (verspec == V8PDU_FULL_METHOD) - offset = flow_process_textfield(pdutree, tvb, offset, 1, "padding"); + offset = flow_process_textfield(pdutree, tvb, offset, 1, hf_cflow_padding); - offset = flow_process_textfield(pdutree, tvb, offset, 4, "extra packets"); + offset = flow_process_textfield(pdutree, tvb, offset, 4, hf_cflow_extra_packets); proto_tree_add_item(pdutree, hf_cflow_routersc, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; @@ -2318,8 +2318,8 @@ dissect_v8_aggpdu(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *pdutree if (verspec == V8PDU_TOSAS_METHOD) { proto_tree_add_item(pdutree, hf_cflow_tos, tvb, offset++, 1, ENC_BIG_ENDIAN); - offset = flow_process_textfield(pdutree, tvb, offset, 1, "padding"); - offset = flow_process_textfield(pdutree, tvb, offset, 2, "reserved"); + offset = flow_process_textfield(pdutree, tvb, offset, 1, hf_cflow_padding); + offset = flow_process_textfield(pdutree, tvb, offset, 2, hf_cflow_reserved); } /* ACF - Seen in the wild and documented here... http://www.caida.org/tools/measurement/cflowd/configuration/configuration-9.html#ss9.1 @@ -2332,11 +2332,11 @@ dissect_v8_aggpdu(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *pdutree proto_tree_add_item(pdutree, hf_cflow_prot, tvb, offset++, 1, ENC_BIG_ENDIAN); if (verspec == V8PDU_PROTO_METHOD) - offset = flow_process_textfield(pdutree, tvb, offset, 1, "padding"); + offset = flow_process_textfield(pdutree, tvb, offset, 1, hf_cflow_padding); else if (verspec == V8PDU_TOSPROTOPORT_METHOD) proto_tree_add_item(pdutree, hf_cflow_tos, tvb, offset++, 1, ENC_BIG_ENDIAN); - offset = flow_process_textfield(pdutree, tvb, offset, 2, "reserved"); + offset = flow_process_textfield(pdutree, tvb, offset, 2, hf_cflow_reserved); offset = flow_process_ports(pdutree, tvb, offset); if (verspec == V8PDU_TOSPROTOPORT_METHOD) @@ -2373,7 +2373,7 @@ dissect_v8_aggpdu(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *pdutree proto_tree_add_item(pdutree, local_cflow_mask, tvb, offset++, 1, ENC_NA); if ((verspec == V8PDU_SPREFIX_METHOD) || (verspec == V8PDU_DPREFIX_METHOD)) - offset = flow_process_textfield(pdutree, tvb, offset, 1, "padding"); + offset = flow_process_textfield(pdutree, tvb, offset, 1, hf_cflow_padding); else if ((verspec == V8PDU_TOSSRCPREFIX_METHOD) || (verspec == V8PDU_TOSDSTPREFIX_METHOD)) proto_tree_add_item(pdutree, hf_cflow_tos, tvb, offset++, 1, ENC_BIG_ENDIAN); @@ -2384,7 +2384,7 @@ dissect_v8_aggpdu(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *pdutree proto_tree_add_item(pdutree, local_cflow_int, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - offset = flow_process_textfield(pdutree, tvb, offset, 2, "reserved"); + offset = flow_process_textfield(pdutree, tvb, offset, 2, hf_cflow_reserved); break; case V8PDU_MATRIX_METHOD: @@ -2404,12 +2404,12 @@ dissect_v8_aggpdu(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *pdutree (verspec == V8PDU_PREPORTPROTOCOL_METHOD)) { proto_tree_add_item(pdutree, hf_cflow_tos, tvb, offset++, 1, ENC_BIG_ENDIAN); if (verspec == V8PDU_TOSMATRIX_METHOD) { - offset = flow_process_textfield(pdutree, tvb, offset, 1, "padding"); + offset = flow_process_textfield(pdutree, tvb, offset, 1, hf_cflow_padding); } else if (verspec == V8PDU_PREPORTPROTOCOL_METHOD) { proto_tree_add_item(pdutree, hf_cflow_prot, tvb, offset++, 1, ENC_BIG_ENDIAN); } } else { - offset = flow_process_textfield(pdutree, tvb, offset, 2, "reserved"); + offset = flow_process_textfield(pdutree, tvb, offset, 2, hf_cflow_reserved); } if ((verspec == V8PDU_MATRIX_METHOD) @@ -5997,7 +5997,7 @@ dissect_v9_v10_options_template(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p remaining -= offset - orig_offset; } if (remaining > 0) - flow_process_textfield(pdutree, tvb, offset, remaining, "[Padding]"); + flow_process_textfield(pdutree, tvb, offset, remaining, hf_cflow_padding); return length; } @@ -6082,7 +6082,7 @@ dissect_v9_v10_data_template(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdut remaining -= offset - orig_offset; } if (remaining > 0) - flow_process_textfield(pdutree, tvb, offset, remaining, "[Padding]"); + flow_process_textfield(pdutree, tvb, offset, remaining, hf_cflow_padding); return length; } @@ -6172,7 +6172,7 @@ dissect_pdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *pdutree, int offs ver = hdrinfo_p->vspec; if (ver == 1) { - offset = flow_process_textfield(pdutree, tvb, offset, 2, "padding"); + offset = flow_process_textfield(pdutree, tvb, offset, 2, hf_cflow_padding); proto_tree_add_item(pdutree, hf_cflow_prot, tvb, offset++, 1, ENC_BIG_ENDIAN); @@ -6180,12 +6180,12 @@ dissect_pdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *pdutree, int offs proto_tree_add_item(pdutree, hf_cflow_tcpflags, tvb, offset++, 1, ENC_BIG_ENDIAN); - offset = flow_process_textfield(pdutree, tvb, offset, 3, "padding"); + offset = flow_process_textfield(pdutree, tvb, offset, 3, hf_cflow_padding); - offset = flow_process_textfield(pdutree, tvb, offset, 4, "reserved"); + offset = flow_process_textfield(pdutree, tvb, offset, 4, hf_cflow_reserved); } else { if (ver == 5) - offset = flow_process_textfield(pdutree, tvb, offset, 1, "padding"); + offset = flow_process_textfield(pdutree, tvb, offset, 1, hf_cflow_padding); else { proto_tree_add_item(pdutree, hf_cflow_flags, tvb, offset++, 1, ENC_BIG_ENDIAN); } @@ -6212,7 +6212,7 @@ dissect_pdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *pdutree, int offs mask, getprefix(&dstaddr, mask), mask != 0 ? mask : 32); - offset = flow_process_textfield(pdutree, tvb, offset, 2, "padding"); + offset = flow_process_textfield(pdutree, tvb, offset, 2, hf_cflow_padding); if (ver == 7) { proto_tree_add_item(pdutree, hf_cflow_routersc, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -6543,6 +6543,11 @@ proto_register_netflow(void) FT_UINT8, BASE_HEX, NULL, 0x0, "IP Type of Service", HFILL} }, + {&hf_cflow_marked_tos, + {"Marked ToS", "cflow.marked_tos", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL} + }, {&hf_cflow_flags, {"Export Flags", "cflow.flags", FT_UINT8, BASE_HEX, NULL, 0x0, @@ -8326,6 +8331,18 @@ proto_register_netflow(void) NULL, HFILL} }, + {&hf_cflow_reserved, + {"Reserved", "cflow.reserved", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL} + }, + + {&hf_cflow_extra_packets, + {"Extra packets", "cflow.extra_packets", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL} + }, + /* IPFIX */ {&hf_cflow_unknown_field_type, {"Unknown Field Type", "cflow.unknown_field_type", diff --git a/epan/dissectors/packet-nsip.c b/epan/dissectors/packet-nsip.c index 0aca414b2b..10dcd10013 100644 --- a/epan/dissectors/packet-nsip.c +++ b/epan/dissectors/packet-nsip.c @@ -69,7 +69,8 @@ static int hf_nsip_transaction_id = -1; static int hf_nsip_ip_element_udp_port = -1; static int hf_nsip_ip_element_signalling_weight = -1; static int hf_nsip_ip_element_data_weight = -1; - +static int hf_nsip_ns_pdu = -1; +static int hf_nsip_ns_sdu = -1; /* Initialize the subtree pointers */ static gint ett_nsip = -1; @@ -289,7 +290,7 @@ check_correct_iei(nsip_ie_t *ie, build_info_t *bi) { #if NSIP_DEBUG if (fetched_iei != ie->iei) { - proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, 1, + proto_tree_add_debug(bi->nsip_tree, bi->tvb, bi->offset, 1, "Tried IEI %s (%#02x), found IEI %s (%#02x)", val_to_str_const(ie->iei, tab_nsip_ieis, "Unknown"), ie->iei, @@ -338,8 +339,8 @@ static void decode_iei_ns_pdu(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { tvbuff_t * next_tvb; - proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, - ie->total_length, + proto_tree_add_bytes_format(bi->nsip_tree, hf_nsip_ns_pdu, bi->tvb, ie_start_offset, + ie->total_length, NULL, "NS PDU (%u bytes)", ie->value_length); next_tvb = tvb_new_subset(bi->tvb, bi->offset, ie->value_length, -1); if (nsip_handle) { @@ -721,8 +722,8 @@ decode_pdu_ns_unitdata(build_info_t *bi) { } else { sdu_length = tvb_length_remaining(bi->tvb, bi->offset); - proto_tree_add_text(bi->nsip_tree, bi->tvb, bi->offset, sdu_length, - "NS SDU (%u bytes)", sdu_length); + proto_tree_add_bytes_format(bi->nsip_tree, hf_nsip_ns_sdu, bi->tvb, bi->offset, sdu_length, + NULL, "NS SDU (%u bytes)", sdu_length); } } @@ -1126,6 +1127,16 @@ proto_register_nsip(void) FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_nsip_ns_pdu, + { "NS PDU", "nsip.ns_pdu", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_nsip_ns_sdu, + { "NS SDU", "nsip.ns_sdu", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, }; /* Setup protocol subtree array */ diff --git a/epan/dissectors/packet-radius_packetcable.c b/epan/dissectors/packet-radius_packetcable.c index 9df03463f3..14ef0b7f20 100644 --- a/epan/dissectors/packet-radius_packetcable.c +++ b/epan/dissectors/packet-radius_packetcable.c @@ -86,12 +86,37 @@ static int hf_packetcable_terminal_display_info_general_display = -1; static int hf_packetcable_terminal_display_info_calling_number = -1; static int hf_packetcable_terminal_display_info_calling_name = -1; static int hf_packetcable_terminal_display_info_message_waiting = -1; +static int hf_packetcable_qos_desc_flags_sfst = -1; +static int hf_packetcable_qos_desc_flags_gi = -1; +static int hf_packetcable_qos_desc_flags_tgj = -1; +static int hf_packetcable_qos_desc_flags_gpi = -1; +static int hf_packetcable_qos_desc_flags_ugs = -1; +static int hf_packetcable_qos_desc_flags_tp = -1; +static int hf_packetcable_qos_desc_flags_msr = -1; +static int hf_packetcable_qos_desc_flags_mtb = -1; +static int hf_packetcable_qos_desc_flags_mrtr = -1; +static int hf_packetcable_qos_desc_flags_mps = -1; +static int hf_packetcable_qos_desc_flags_mcb = -1; +static int hf_packetcable_qos_desc_flags_srtp = -1; +static int hf_packetcable_qos_desc_flags_npi = -1; +static int hf_packetcable_qos_desc_flags_tpj = -1; +static int hf_packetcable_qos_desc_flags_toso = -1; +static int hf_packetcable_qos_desc_flags_mdl = -1; + +/* Generated from convert_proto_tree_add_text.pl */ +static int hf_packetcable_bcid_time_zone_offset = -1; +static int hf_packetcable_bcid_element_id = -1; +static int hf_packetcable_electronic_surveillance_indication_df_df_key = -1; +static int hf_packetcable_redirected_from_original_called_party = -1; +static int hf_packetcable_em_header_element_id = -1; +static int hf_packetcable_redirected_from_last_redirecting_party = -1; +static int hf_packetcable_bcid_time_zone_dst = -1; +static int hf_packetcable_em_header_time_zone_offset = -1; +static int hf_packetcable_qos_service_class_name = -1; +static int hf_packetcable_em_header_event_time = -1; +static int hf_packetcable_em_header_time_zone_dst = -1; /* This is slightly ugly. */ -static int hf_packetcable_qos_desc_flags[] = -{ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -}; static int hf_packetcable_qos_desc_fields[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -242,26 +267,18 @@ static const value_string packetcable_state_indication_vals[] = /* Decode a PacketCable BCID. */ -/* XXX - This should probably be combinde with the equivalent COPS code */ +/* XXX - This should probably be combined with the equivalent COPS code */ static void decode_packetcable_bcid (tvbuff_t *tvb, proto_tree *tree, int offset) { - guint8 packetcable_buf[64]; - - proto_tree_add_item(tree, hf_packetcable_bcid_timestamp, - tvb, offset, 4, ENC_BIG_ENDIAN); - tvb_memcpy(tvb, packetcable_buf, offset + 4, 8); packetcable_buf[8] = '\0'; - proto_tree_add_text(tree, tvb, offset + 4, 8, - "Element ID: %s", packetcable_buf); - tvb_memcpy(tvb, packetcable_buf, offset + 13, 7); packetcable_buf[7] = '\0'; - proto_tree_add_text(tree, tvb, offset + 12, 8, - "Time Zone: DST: %c, Offset: %s", tvb_get_guint8(tvb, offset + 12), - packetcable_buf); - proto_tree_add_item(tree, hf_packetcable_bcid_event_counter, - tvb, offset + 20, 4, ENC_BIG_ENDIAN); + + proto_tree_add_item(tree, hf_packetcable_bcid_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_packetcable_bcid_element_id, tvb, offset + 4, 8, ENC_ASCII|ENC_NA); + proto_tree_add_item(tree, hf_packetcable_bcid_time_zone_dst, tvb, offset + 12, 1, ENC_NA); + proto_tree_add_item(tree, hf_packetcable_bcid_time_zone_offset, tvb, offset + 13, 7, ENC_ASCII|ENC_NA); + proto_tree_add_item(tree, hf_packetcable_bcid_event_counter, tvb, offset + 20, 4, ENC_BIG_ENDIAN); } static const gchar* dissect_packetcable_em_hdr(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo _U_) { - guint8 packetcable_buf[64]; proto_item *ti; proto_tree *obj_tree; @@ -271,13 +288,11 @@ static const gchar* dissect_packetcable_em_hdr(proto_tree* tree, tvbuff_t* tvb, proto_tree_add_item(tree, hf_packetcable_em_header_event_message_type, tvb, 26, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_packetcable_em_header_element_type, tvb, 28, 2, ENC_BIG_ENDIAN); - tvb_memcpy(tvb, packetcable_buf, 30, 8); packetcable_buf[8] = '\0'; - proto_tree_add_text(tree, tvb, 30, 8, "Element ID: %s", packetcable_buf ); - tvb_memcpy(tvb, packetcable_buf, 39, 7); packetcable_buf[7] = '\0'; - proto_tree_add_text(tree, tvb, 38, 8, "Time Zone: DST: %c, Offset: %s", tvb_get_guint8(tvb, 38), packetcable_buf); + proto_tree_add_item(tree, hf_packetcable_em_header_element_id, tvb, 30, 8, ENC_ASCII|ENC_NA); + proto_tree_add_item(tree, hf_packetcable_em_header_time_zone_dst, tvb, 38, 1, ENC_NA); + proto_tree_add_item(tree, hf_packetcable_em_header_time_zone_offset, tvb, 39, 7, ENC_ASCII|ENC_NA); proto_tree_add_item(tree, hf_packetcable_em_header_sequence_number, tvb, 46, 4, ENC_BIG_ENDIAN); - tvb_memcpy(tvb, packetcable_buf, 50, 18); packetcable_buf[18] = '\0'; - proto_tree_add_text(tree, tvb, 50, 18, "Event Time: %s", packetcable_buf); + proto_tree_add_item(tree, hf_packetcable_em_header_event_time, tvb, 50, 18, ENC_ASCII|ENC_NA); ti = proto_tree_add_item(tree, hf_packetcable_em_header_status, tvb, 68, 4, ENC_BIG_ENDIAN); obj_tree = proto_item_add_subtree(ti, ett_radius_vendor_packetcable_status); @@ -314,24 +329,34 @@ static const gchar* dissect_packetcable_trunk_group_id(proto_tree* tree, tvbuff_ } static const gchar* dissect_packetcable_qos_descriptor(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo _U_) { - guint8 packetcable_buf[64]; guint32 intval; guint32 packetcable_qos_flags = tvb_get_ntohl(tvb, 0); - proto_item* ti = proto_tree_add_item(tree, hf_packetcable_qos_status, tvb, 0, 4, ENC_BIG_ENDIAN); - proto_tree* obj_tree = proto_item_add_subtree(ti, ett_radius_vendor_packetcable_qos_status); - guint packetcable_qos_off = 20; + static const int * qos_flags[] = { + &hf_packetcable_qos_status_indication, + &hf_packetcable_qos_desc_flags_sfst, + &hf_packetcable_qos_desc_flags_gi, + &hf_packetcable_qos_desc_flags_tgj, + &hf_packetcable_qos_desc_flags_gpi, + &hf_packetcable_qos_desc_flags_ugs, + &hf_packetcable_qos_desc_flags_tp, + &hf_packetcable_qos_desc_flags_msr, + &hf_packetcable_qos_desc_flags_mtb, + &hf_packetcable_qos_desc_flags_mrtr, + &hf_packetcable_qos_desc_flags_mps, + &hf_packetcable_qos_desc_flags_mcb, + &hf_packetcable_qos_desc_flags_srtp, + &hf_packetcable_qos_desc_flags_npi, + &hf_packetcable_qos_desc_flags_tpj, + &hf_packetcable_qos_desc_flags_toso, + &hf_packetcable_qos_desc_flags_mdl, + NULL + }; - proto_tree_add_item(obj_tree, hf_packetcable_qos_status_indication, tvb, 0, 4, ENC_BIG_ENDIAN); - - for (intval = 0; intval < PACKETCABLE_QOS_DESC_BITFIELDS; intval++) { - proto_tree_add_item(obj_tree, hf_packetcable_qos_desc_flags[intval], tvb, 0, 4, ENC_BIG_ENDIAN); - } - - tvb_memcpy(tvb, packetcable_buf, 4, 16); - packetcable_buf[16] = '\0'; + proto_tree_add_bitmask(tree, tvb, 0, hf_packetcable_qos_status, + ett_radius_vendor_packetcable_qos_status, qos_flags, ENC_BIG_ENDIAN); - proto_tree_add_text(tree, tvb, 4, 16, "Service Class Name: %s", packetcable_buf); + proto_tree_add_item(tree, hf_packetcable_qos_service_class_name, tvb, 4, 16, ENC_ASCII|ENC_NA); for (intval = 0; intval < PACKETCABLE_QOS_DESC_BITFIELDS; intval++) { if (packetcable_qos_flags & packetcable_qos_desc_mask[intval]) { @@ -351,15 +376,10 @@ static const gchar* dissect_packetcable_time_adjustment(proto_tree* tree, tvbuff } static const gchar* dissect_packetcable_redirected_from_info(proto_tree* tree, tvbuff_t* tvb, packet_info *pinfo _U_) { - guint8 packetcable_buf[64]; - tvb_memcpy(tvb, packetcable_buf, 0, 20); packetcable_buf[20] = '\0'; - proto_tree_add_text(tree, tvb, 0, 20, - "Last-Redirecting-Party: %s", packetcable_buf); + proto_tree_add_item(tree, hf_packetcable_redirected_from_last_redirecting_party, tvb, 0, 20, ENC_ASCII|ENC_NA); - tvb_memcpy(tvb, packetcable_buf, 20, 20); packetcable_buf[20] = '\0'; - proto_tree_add_text(tree, tvb, 20, 20, - "Original-Called-Party: %s", packetcable_buf); + proto_tree_add_item(tree, hf_packetcable_redirected_from_original_called_party, tvb, 20, 20, ENC_ASCII|ENC_NA); proto_tree_add_item(tree, hf_packetcable_redirected_from_info_number_of_redirections, tvb, 40, 2, ENC_BIG_ENDIAN); @@ -380,7 +400,7 @@ static const gchar* dissect_packetcable_time_electr_surv_ind(proto_tree* tree, t tvb, 8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_packetcable_electronic_surveillance_indication_ccc_port, tvb, 10, 2, ENC_BIG_ENDIAN); - proto_tree_add_text(tree, tvb, 12, tvb_length(tvb) - 12, "DF-DF-Key"); + proto_tree_add_item(tree, hf_packetcable_electronic_surveillance_indication_df_df_key, tvb, 12, -1, ENC_NA); return ""; } @@ -539,82 +559,82 @@ void proto_register_packetcable(void) { FT_UINT32, BASE_DEC, VALS(packetcable_state_indication_vals), PACKETCABLE_QOS_STATE_INDICATION_MASK, "PacketCable QoS Descriptor Attribute QoS State Indication", HFILL } }, - { &hf_packetcable_qos_desc_flags[0], + { &hf_packetcable_qos_desc_flags_sfst, { "Service Flow Scheduling Type","packetcable_avps.qs.flags.sfst", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_SERVICE_FLOW_SCHEDULING_TYPE_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Service Flow Scheduling Type", HFILL } }, - { &hf_packetcable_qos_desc_flags[1], + { &hf_packetcable_qos_desc_flags_gi, { "Grant Interval","packetcable_avps.qs.flags.gi", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_NOMINAL_GRANT_INTERVAL_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Grant Interval", HFILL } }, - { &hf_packetcable_qos_desc_flags[2], + { &hf_packetcable_qos_desc_flags_tgj, { "Tolerated Grant Jitter","packetcable_avps.qs.flags.tgj", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_TOLERATED_GRANT_JITTER_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Tolerated Grant Jitter", HFILL } }, - { &hf_packetcable_qos_desc_flags[3], + { &hf_packetcable_qos_desc_flags_gpi, { "Grants Per Interval","packetcable_avps.qs.flags.gpi", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_GRANTS_PER_INTERVAL_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Grants Per Interval", HFILL } }, - { &hf_packetcable_qos_desc_flags[4], + { &hf_packetcable_qos_desc_flags_ugs, { "Unsolicited Grant Size","packetcable_avps.qs.flags.ugs", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_UNSOLICITED_GRANT_SIZE_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Unsolicited Grant Size", HFILL } }, - { &hf_packetcable_qos_desc_flags[5], + { &hf_packetcable_qos_desc_flags_tp, { "Traffic Priority","packetcable_avps.qs.flags.tp", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_TRAFFIC_PRIORITY_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Traffic Priority", HFILL } }, - { &hf_packetcable_qos_desc_flags[6], + { &hf_packetcable_qos_desc_flags_msr, { "Maximum Sustained Rate","packetcable_avps.qs.flags.msr", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MAXIMUM_SUSTAINED_RATE_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Maximum Sustained Rate", HFILL } }, - { &hf_packetcable_qos_desc_flags[7], + { &hf_packetcable_qos_desc_flags_mtb, { "Maximum Traffic Burst","packetcable_avps.qs.flags.mtb", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MAXIMUM_TRAFFIC_BURST_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Maximum Traffic Burst", HFILL } }, - { &hf_packetcable_qos_desc_flags[8], + { &hf_packetcable_qos_desc_flags_mrtr, { "Minimum Reserved Traffic Rate","packetcable_avps.qs.flags.mrtr", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MINIMUM_RESERVED_TRAFFIC_RATE_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Minimum Reserved Traffic Rate", HFILL } }, - { &hf_packetcable_qos_desc_flags[9], + { &hf_packetcable_qos_desc_flags_mps, { "Minimum Packet Size","packetcable_avps.qs.flags.mps", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MINIMUM_PACKET_SIZE_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Minimum Packet Size", HFILL } }, - { &hf_packetcable_qos_desc_flags[10], + { &hf_packetcable_qos_desc_flags_mcb, { "Maximum Concatenated Burst","packetcable_avps.qs.flags.mcb", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MAXIMUM_CONCATENATED_BURST_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Maximum Concatenated Burst", HFILL } }, - { &hf_packetcable_qos_desc_flags[11], + { &hf_packetcable_qos_desc_flags_srtp, { "Status Request/Transmission Policy","packetcable_avps.qs.flags.srtp", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_REQUEST_TRANSMISSION_POLICY_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Status Request/Transmission Policy", HFILL } }, - { &hf_packetcable_qos_desc_flags[12], + { &hf_packetcable_qos_desc_flags_npi, { "Nominal Polling Interval","packetcable_avps.qs.flags.npi", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_NOMINAL_POLLING_INTERVAL_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Nominal Polling Interval", HFILL } }, - { &hf_packetcable_qos_desc_flags[13], + { &hf_packetcable_qos_desc_flags_tpj, { "Tolerated Poll Jitter","packetcable_avps.qs.flags.tpj", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_TOLERATED_POLL_JITTER_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Tolerated Poll Jitter", HFILL } }, - { &hf_packetcable_qos_desc_flags[14], + { &hf_packetcable_qos_desc_flags_toso, { "Type of Service Override","packetcable_avps.qs.flags.toso", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_IP_TYPE_OF_SERVICE_OVERRIDE_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Type of Service Override", HFILL } }, - { &hf_packetcable_qos_desc_flags[15], + { &hf_packetcable_qos_desc_flags_mdl, { "Maximum Downstream Latency","packetcable_avps.qs.flags.mdl", FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MAXIMUM_DOWNSTREAM_LATENCY_MASK, "PacketCable QoS Descriptor Attribute Bitmask: Maximum Downstream Latency", HFILL } @@ -774,7 +794,19 @@ void proto_register_packetcable(void) { { "Message_Waiting","packetcable_avps.tdi.mw", FT_STRING, BASE_NONE, NULL, 0, "PacketCable Terminal_Display_Info Message_Waiting", HFILL } - } + }, + /* Generated from convert_proto_tree_add_text.pl */ + { &hf_packetcable_bcid_element_id, { "Element ID", "packetcable_avps.bcid.element_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_packetcable_bcid_time_zone_dst, { "Time Zone: DST", "packetcable_avps.bcid.time_zone.dst", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_packetcable_bcid_time_zone_offset, { "Time Zone: Offset", "packetcable_avps.bcid.time_zone.offset", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_packetcable_em_header_element_id, { "Element ID", "packetcable_avps.emh.element_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_packetcable_em_header_time_zone_dst, { "Time Zone: DST", "packetcable_avps.emh.time_zone.dst", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_packetcable_em_header_time_zone_offset, { "Time Zone: Offset", "packetcable_avps.emh.time_zone.offset", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_packetcable_em_header_event_time, { "Event Time", "packetcable_avps.emh.event_time", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_packetcable_qos_service_class_name, { "Service Class Name", "packetcable_avps.qs.sc_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_packetcable_redirected_from_last_redirecting_party, { "Last-Redirecting-Party", "packetcable_avps.rfi.last_redirecting_party", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_packetcable_redirected_from_original_called_party, { "Original-Called-Party", "packetcable_avps.rfi.original_called_party", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_packetcable_electronic_surveillance_indication_df_df_key, { "DF-DF-Key", "packetcable_avps.esi.df_df_key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { diff --git a/epan/dissectors/packet-rmi.c b/epan/dissectors/packet-rmi.c index dbf38cc26d..3cf47283c6 100644 --- a/epan/dissectors/packet-rmi.c +++ b/epan/dissectors/packet-rmi.c @@ -52,6 +52,8 @@ static int hf_rmi_outputmessage = -1; static int hf_rmi_epid_length = -1; static int hf_rmi_epid_hostname = -1; static int hf_rmi_epid_port = -1; +static int hf_rmi_serialization_data = -1; +static int hf_rmi_unique_identifier = -1; static int hf_ser_magic = -1; static int hf_ser_version = -1; @@ -65,6 +67,7 @@ static gint ett_rmi_outputmessage = -1; static gint ett_rmi_epid_length = -1; static gint ett_rmi_epid_hostname = -1; static gint ett_rmi_epid_port = -1; +static gint ett_rmi_endpoint_identifier = -1; static gint ett_ser = -1; @@ -112,7 +115,7 @@ dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvbuff_t *next_tvb; - gint offset; + gint offset = 0; gint next_offset; int datalen; @@ -121,11 +124,6 @@ dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) rmi_type rmitype; - const char *epid_hostname; - guint epid_len; - - offset = 0; - /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RMI"); @@ -188,28 +186,27 @@ dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(rmi_tree, hf_rmi_inputmessage, tvb, offset, 1, message); if(message == RMI_INPUTSTREAM_MESSAGE_ACK) { - proto_tree_add_text(rmi_tree, tvb, offset + 1, -1, - "EndPointIdentifier"); + proto_tree* endpoint_tree = proto_tree_add_subtree(rmi_tree, tvb, offset + 1, -1, + ett_rmi_endpoint_identifier, NULL, "EndPointIdentifier"); /* MESSAGE_ACK should include EndpointIdentifier */ len = tvb_get_ntohs(tvb, 1); - proto_tree_add_uint(rmi_tree, hf_rmi_epid_length, + proto_tree_add_uint(endpoint_tree, hf_rmi_epid_length, tvb, offset + 1, 2, len); - epid_len = len < ITEM_LABEL_LENGTH ? len : ITEM_LABEL_LENGTH; - if (epid_len > 0) { - epid_hostname = tvb_format_text(tvb, offset + 3, epid_len); + if (len > 0) { + proto_tree_add_item(endpoint_tree, hf_rmi_epid_hostname, + tvb, offset + 3, len, ENC_ASCII|ENC_NA); } else { - epid_hostname = "[Empty]"; + proto_tree_add_string(endpoint_tree, hf_rmi_epid_hostname, + tvb, offset + 3, len, "[Empty]"); } - proto_tree_add_string(rmi_tree, hf_rmi_epid_hostname, - tvb, offset + 3, len, epid_hostname); port = tvb_get_ntohs(tvb, offset + len + 5); - proto_tree_add_uint(rmi_tree, hf_rmi_epid_port, + proto_tree_add_uint(endpoint_tree, hf_rmi_epid_port, tvb, offset + len + 5, 2, port); } if(message == RMI_INPUTSTREAM_MESSAGE_RETURNDATA) { - proto_tree_add_text(rmi_tree, tvb, offset + 1, -1, - "Serialization Data"); + proto_tree_add_bytes_format(rmi_tree, hf_rmi_serialization_data, tvb, offset + 1, -1, + NULL, "Serialization Data"); next_tvb = tvb_new_subset_remaining(tvb, offset + 1); dissect_ser(next_tvb, tree); } @@ -219,15 +216,14 @@ dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(rmi_tree, hf_rmi_outputmessage, tvb, offset, 1, message); if(message == RMI_OUTPUTSTREAM_MESSAGE_CALL) { - proto_tree_add_text(rmi_tree, tvb, offset + 1, -1, - "Serialization Data"); + proto_tree_add_bytes_format(rmi_tree, hf_rmi_serialization_data, tvb, offset + 1, -1, + NULL, "Serialization Data"); /* XXX */ next_tvb = tvb_new_subset_remaining(tvb, offset + 1); dissect_ser(next_tvb, tree); } if(message == RMI_OUTPUTSTREAM_MESSAGE_DGCACK) { - proto_tree_add_text(rmi_tree, tvb, offset + 1, -1, - "UniqueIdentifier"); + proto_tree_add_item(rmi_tree, hf_rmi_unique_identifier, tvb, offset + 1, -1, ENC_NA); } break; case SERIALIZATION_DATA: @@ -334,6 +330,14 @@ proto_register_rmi(void) { "Port", "rmi.endpoint_id.port", FT_UINT16, BASE_DEC, NULL, 0x0, "RMI Endpointindentifier Port", HFILL }}, + { &hf_rmi_serialization_data, + { "Serialization Data", "rmi.serialization_data", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + { &hf_rmi_unique_identifier, + { "UniqueIdentifier", "rmi.unique_identifier", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, { &hf_ser_magic, { "Magic", "rmi.ser.magic", @@ -355,6 +359,7 @@ proto_register_rmi(void) &ett_rmi_epid_hostname, &ett_rmi_epid_port, &ett_ser, + &ett_rmi_endpoint_identifier, }; proto_rmi = proto_register_protocol("Java RMI", "RMI", "rmi"); diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c index a3c192005b..c0b4f271a0 100644 --- a/epan/dissectors/packet-rtsp.c +++ b/epan/dissectors/packet-rtsp.c @@ -135,6 +135,7 @@ static int hf_rtsp_X_Vig_Msisdn = -1; static int hf_rtsp_magic = -1; static int hf_rtsp_channel = -1; static int hf_rtsp_length = -1; +static int hf_rtsp_data = -1; static int voip_tap = -1; @@ -391,8 +392,7 @@ dissect_rtspinterleaved(tvbuff_t *tvb, int offset, packet_info *pinfo, (dissector = data->interleaved[rf_chan].dissector)) { call_dissector(dissector, next_tvb, pinfo, tree); } else { - proto_tree_add_text(rtspframe_tree, tvb, offset, rf_len, - "Data (%u bytes)", rf_len); + proto_tree_add_item(rtspframe_tree, hf_rtsp_data, tvb, offset, rf_len, ENC_NA); } offset += rf_len; @@ -1230,8 +1230,8 @@ dissect_rtspmessage(tvbuff_t *tvb, int offset, packet_info *pinfo, */ datalen = 0; } else { - proto_tree_add_text(rtsp_tree, tvb, offset, - datalen, "Data (%d bytes)", + proto_tree_add_bytes_format(rtsp_tree, hf_rtsp_data, tvb, offset, + datalen, NULL, "Data (%d bytes)", reported_datalen); } } @@ -1424,6 +1424,9 @@ proto_register_rtsp(void) { &hf_rtsp_length, { "Length", "rtsp.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_rtsp_data, + { "Data", "rtsp.data", FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, }; module_t *rtsp_module; |