Make all "padding" fields filterable

Change-Id: Ic4e4d9142a9b05ef3b628fac2e8766014c5fccec
Reviewed-on: https://code.wireshark.org/review/4073
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2014-09-10 19:58:33 -04:00
parent 76d776ee8a
commit 8a580b3e28
8 changed files with 73 additions and 36 deletions

View File

@ -68,6 +68,8 @@ static int hf_bfcp_supp_prim = -1;
static int hf_bfcp_user_disp_name = -1;
static int hf_bfcp_user_uri = -1;
static int hf_bfcp_req_by_id = -1;
static int hf_bfcp_padding = -1;
static int hf_bfcp_error_specific_details = -1;
/* Initialize subtree pointers */
static gint ett_bfcp = -1;
@ -240,13 +242,13 @@ dissect_bfcp_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
offset++;
if(length>3){
/* We have Error Specific Details */
proto_tree_add_text(bfcp_attr_tree, tvb, offset, length-3, "Error Specific Details");
proto_tree_add_item(bfcp_attr_tree, hf_bfcp_error_specific_details, tvb, offset, length-3, ENC_NA);
}
offset = offset + length-3;
pad_len = length & 0x03;
if(pad_len != 0){
pad_len = 4 - pad_len;
proto_tree_add_text(bfcp_attr_tree, tvb, offset, pad_len, "Padding");
proto_tree_add_item(bfcp_attr_tree, hf_bfcp_padding, tvb, offset, pad_len, ENC_NA);
}
offset = offset + pad_len;
break;
@ -256,7 +258,7 @@ dissect_bfcp_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
pad_len = length & 0x03;
if(pad_len != 0){
pad_len = 4 - pad_len;
proto_tree_add_text(bfcp_attr_tree, tvb, offset, pad_len, "Padding");
proto_tree_add_item(bfcp_attr_tree, hf_bfcp_padding, tvb, offset, pad_len, ENC_NA);
}
offset = offset + pad_len;
break;
@ -266,7 +268,7 @@ dissect_bfcp_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
pad_len = length & 0x03;
if(pad_len != 0){
pad_len = 4 - pad_len;
proto_tree_add_text(bfcp_attr_tree, tvb, offset, pad_len, "Padding");
proto_tree_add_item(bfcp_attr_tree, hf_bfcp_padding, tvb, offset, pad_len, ENC_NA);
}
offset = offset + pad_len;
break;
@ -276,7 +278,7 @@ dissect_bfcp_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
pad_len = length & 0x03;
if(pad_len != 0){
pad_len = 4 - pad_len;
proto_tree_add_text(bfcp_attr_tree, tvb, offset, pad_len, "Padding");
proto_tree_add_item(bfcp_attr_tree, hf_bfcp_padding, tvb, offset, pad_len, ENC_NA);
}
offset = offset + pad_len;
break;
@ -289,7 +291,7 @@ dissect_bfcp_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
pad_len = length & 0x03;
if(pad_len != 0){
pad_len = 4 - pad_len;
proto_tree_add_text(bfcp_attr_tree, tvb, offset, pad_len, "Padding");
proto_tree_add_item(bfcp_attr_tree, hf_bfcp_padding, tvb, offset, pad_len, ENC_NA);
}
offset = offset + pad_len;
break;
@ -302,7 +304,7 @@ dissect_bfcp_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
pad_len = length & 0x03;
if(pad_len != 0){
pad_len = 4 - pad_len;
proto_tree_add_text(bfcp_attr_tree, tvb, offset, pad_len, "Padding");
proto_tree_add_item(bfcp_attr_tree, hf_bfcp_padding, tvb, offset, pad_len, ENC_NA);
}
offset = offset + pad_len;
break;
@ -312,7 +314,7 @@ dissect_bfcp_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
pad_len = length & 0x03;
if(pad_len != 0){
pad_len = 4 - pad_len;
proto_tree_add_text(bfcp_attr_tree, tvb, offset, pad_len, "Padding");
proto_tree_add_item(bfcp_attr_tree, hf_bfcp_padding, tvb, offset, pad_len, ENC_NA);
}
offset = offset + pad_len;
break;
@ -322,7 +324,7 @@ dissect_bfcp_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
pad_len = length & 0x03;
if(pad_len != 0){
pad_len = 4 - pad_len;
proto_tree_add_text(bfcp_attr_tree, tvb, offset, pad_len, "Padding");
proto_tree_add_item(bfcp_attr_tree, hf_bfcp_padding, tvb, offset, pad_len, ENC_NA);
}
offset = offset + pad_len;
break;
@ -654,6 +656,18 @@ void proto_register_bfcp(void)
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{
&hf_bfcp_padding,
{ "Padding", "bfcp.padding",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{
&hf_bfcp_error_specific_details,
{ "Error Specific Details", "bfcp.error_specific_details",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
};
static gint *ett[] = {

View File

@ -5373,7 +5373,7 @@ dissect_bootp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* Padding after the end option.
*/
proto_tree_add_text(bp_tree, tvb, voff, eoff - voff, "Padding");
proto_tree_add_item(bp_tree, hf_bootp_option_padding, tvb, voff, eoff - voff, ENC_NA);
}
}

View File

@ -217,6 +217,7 @@ static int hf_ipv6_fragment_count = -1;
static int hf_ipv6_reassembled_in = -1;
static int hf_ipv6_reassembled_length = -1;
static int hf_ipv6_reassembled_data = -1;
static int hf_ipv6_padding = -1;
static int hf_ipv6_mipv6_home_address = -1;
@ -1360,7 +1361,7 @@ dissect_shim6_opt_loclist(proto_tree * opt_tree, tvbuff_t * tvb, gint *offset)
/* Padding, included in length field */
if ((7 - optlen % 8) > 0) {
proto_tree_add_text(opt_tree, tvb, p, (7 - optlen % 8), "Padding");
proto_tree_add_item(opt_tree, hf_ipv6_padding, tvb, p, (7 - optlen % 8), ENC_NA);
p += (7 - optlen % 8);
}
@ -1468,7 +1469,7 @@ dissect_shimopts(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo
case SHIM6_OPT_RESPVAL:
p += dissect_shim_hex(tvb, p, len, "Validator:", 0xff, opt_tree);
if (total_len-(len+4) > 0)
proto_tree_add_text(opt_tree, tvb, p, total_len-(len+4), "Padding");
proto_tree_add_item(opt_tree, hf_ipv6_padding, tvb, p, total_len-(len+4), ENC_NA);
break;
case SHIM6_OPT_LOCLIST:
dissect_shim6_opt_loclist(opt_tree, tvb, &p);
@ -1476,17 +1477,17 @@ dissect_shimopts(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo
case SHIM6_OPT_LOCPREF:
dissect_shim6_opt_loc_pref(opt_tree, tvb, &p, offset+len+4, pinfo);
if (total_len-(len+4) > 0)
proto_tree_add_text(opt_tree, tvb, p, total_len-(len+4), "Padding");
proto_tree_add_item(opt_tree, hf_ipv6_padding, tvb, p, total_len-(len+4), ENC_NA);
break;
case SHIM6_OPT_CGAPDM:
p += dissect_shim_hex(tvb, p, len, "CGA Parameter Data Structure:", 0xff, opt_tree);
if (total_len-(len+4) > 0)
proto_tree_add_text(opt_tree, tvb, p, total_len-(len+4), "Padding");
proto_tree_add_item(opt_tree, hf_ipv6_padding, tvb, p, total_len-(len+4), ENC_NA);
break;
case SHIM6_OPT_CGASIG:
p += dissect_shim_hex(tvb, p, len, "CGA Signature:", 0xff, opt_tree);
if (total_len-(len+4) > 0)
proto_tree_add_text(opt_tree, tvb, p, total_len-(len+4), "Padding");
proto_tree_add_item(opt_tree, hf_ipv6_padding, tvb, p, total_len-(len+4), ENC_NA);
break;
case SHIM6_OPT_ULIDPAIR:
proto_tree_add_text(opt_tree, tvb, p, 4, "Reserved");
@ -2646,6 +2647,12 @@ proto_register_ipv6(void)
{ "Reassembled IPv6 data", "ipv6.reassembled.data",
FT_BYTES, BASE_NONE, NULL, 0x0,
"The reassembled payload", HFILL }},
{ &hf_ipv6_padding,
{ "Padding", "ipv6.padding",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
/* RPL Routing Header */
{ &hf_ipv6_routing_hdr_rpl_cmprI,
{ "Compressed Internal Octets (CmprI)", "ipv6.routing_hdr.rpl.cmprI",

View File

@ -1104,6 +1104,7 @@ static int hf_cflow_samplingmode = -1;
static int hf_cflow_samplerate = -1;
static int hf_cflow_unknown_field_type = -1;
static int hf_cflow_padding = -1;
/*
* cflow version specific info
@ -2493,9 +2494,7 @@ dissect_v9_v10_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, int
length -= (pdu_len < length) ? pdu_len : length;
}
if (length != 0) {
proto_tree_add_text(pdutree, tvb, offset, length,
"Padding (%u byte%s)",
length, plurality(length, "", "s"));
proto_tree_add_item(pdutree, hf_cflow_padding, tvb, offset, length, ENC_NA);
}
} else {
proto_tree_add_text(pdutree, tvb, offset, length,
@ -3978,9 +3977,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
break;
case 210: /* paddingOctets */
ti = proto_tree_add_text(pdutree, tvb, offset, length,
"Padding (%u byte%s)",
length, plurality(length, "", "s"));
ti = proto_tree_add_item(pdutree, hf_cflow_padding, tvb, offset, length, ENC_NA);
break;
case 211: /* collectorIPv4Address */
@ -8660,6 +8657,12 @@ proto_register_netflow(void)
"Option Scope Template", HFILL}
},
{&hf_cflow_padding,
{"Padding", "cflow.padding",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
/* IPFIX */
{&hf_cflow_unknown_field_type,
{"Unknown Field Type", "cflow.unknown_field_type",

View File

@ -208,6 +208,8 @@ static gint hf_pnrp_message_inquire_flags_Xbit = -1;
static gint hf_pnrp_message_inquire_flags_Cbit = -1;
static gint hf_pnrp_message_inquire_flags_reserved2 = -1;
static gint hf_pnrp_padding = -1;
static const int *inquire_flags[] = {
&hf_pnrp_message_inquire_flags_reserved1,
&hf_pnrp_message_inquire_flags_Abit,
@ -503,7 +505,7 @@ static int dissect_pnrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
switch (message_type) {
case INQUIRE:
proto_tree_add_bitmask(pnrp_message_tree, tvb, offset+4, hf_pnrp_message_inquire_flags, ett_pnrp_message_inquire_flags, inquire_flags, ENC_BIG_ENDIAN);
proto_tree_add_text(pnrp_message_tree, tvb, offset + 6, 2, "Padding : %d - 2 Bytes",tvb_get_ntohs(tvb,offset+6));
proto_tree_add_item(pnrp_message_tree, hf_pnrp_padding, tvb, offset + 6, 2, ENC_NA);
offset += data_length+2;
break;
@ -524,7 +526,7 @@ static int dissect_pnrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
}
else {
padding_bytes = 2;
proto_tree_add_text(pnrp_message_tree, tvb, offset + 6, padding_bytes, "Padding: %d bytes", padding_bytes);
proto_tree_add_item(pnrp_message_tree, hf_pnrp_padding, tvb, offset + 6, padding_bytes, ENC_NA);
offset += data_length+2;
}
break;
@ -554,7 +556,7 @@ static int dissect_pnrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
/* Reserved 2 */
proto_tree_add_text(pnrp_message_tree, tvb, offset + 6, 1, "Reserved 2: %d",tvb_get_guint8(tvb,offset+6));
/* Padding 1 */
proto_tree_add_text(pnrp_message_tree, tvb, offset + 7, 1, "Padding: %d",tvb_get_guint8(tvb,offset+7));
proto_tree_add_item(pnrp_message_tree, hf_pnrp_padding, tvb, offset + 7, 1, ENC_NA);
}
offset += data_length+1;
@ -654,7 +656,7 @@ static int dissect_pnrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
}
/* Check if we actually had some padding bytes */
if (0<padding_bytes) {
proto_tree_add_text(pnrp_message_tree, tvb, offset + data_length-padding_bytes, padding_bytes, "Padding: %d bytes", padding_bytes);
proto_tree_add_item(pnrp_message_tree, hf_pnrp_padding, tvb, offset + data_length-padding_bytes, padding_bytes, ENC_NA);
}
offset += data_length;
break;
@ -685,7 +687,7 @@ static int dissect_pnrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
}
/* Check if we actually had some padding bytes */
if (0<padding_bytes) {
proto_tree_add_text(pnrp_message_tree, tvb, offset + data_length-padding_bytes, padding_bytes, "Padding: %d bytes", padding_bytes);
proto_tree_add_item(pnrp_message_tree, hf_pnrp_padding, tvb, offset + data_length-padding_bytes, padding_bytes, ENC_NA);
}
offset += data_length;
break;
@ -752,7 +754,7 @@ static int dissect_pnrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
}
/* Check if we actually had some padding bytes */
if (0<padding_bytes) {
proto_tree_add_text(pnrp_message_tree, tvb, offset + data_length-padding_bytes, padding_bytes, "Padding: %d bytes", padding_bytes);
proto_tree_add_item(pnrp_message_tree, hf_pnrp_padding, tvb, offset + data_length-padding_bytes, padding_bytes, ENC_NA);
}
offset += data_length;
break;
@ -1122,6 +1124,9 @@ void proto_register_pnrp(void)
{ &hf_pnrp_message_inquire_flags_reserved2,
{ "Reserved 2", "pnrp.segment.inquire.flags.reserved2", FT_UINT16, BASE_HEX, NULL, FLAGS_INQUIRE_RESERVED2,
NULL, HFILL }},
{ &hf_pnrp_padding,
{ "Padding", "pnrp.padding", FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
/* Classifier */
{ &hf_pnrp_message_classifier_unicodeCount,
{ "Number of Unicode Characters", "pnrp.segment.classifier.unicodeCount", FT_UINT16, BASE_DEC, NULL, 0x0,

View File

@ -136,6 +136,9 @@ static header_field_info hfi_rip_route_tag RIP_HFI_INIT =
{ "Route Tag", "rip.route_tag", FT_UINT16, BASE_DEC,
NULL, 0, NULL, HFILL };
static header_field_info hfi_rip_zero_padding RIP_HFI_INIT =
{ "Zero Padding", "rip.zero_padding", FT_STRING, BASE_NONE,
NULL, 0, "Authentication password", HFILL };
static gint ett_rip = -1;
static gint ett_rip_vec = -1;
static gint ett_auth_vec = -1;
@ -309,8 +312,7 @@ dissect_rip_authentication(tvbuff_t *tvb, int offset, proto_tree *tree)
val = tvb_get_ntohl( tvb, offset+8 );
proto_tree_add_text( rip_authentication_tree, tvb, offset+8, 4,
"Seq num: %u" , val );
proto_tree_add_text( rip_authentication_tree, tvb, offset+12, 8,
"Zero Padding" );
proto_tree_add_item( rip_authentication_tree, &hfi_rip_zero_padding, tvb, offset+12, 8, ENC_NA);
rip_authentication_tree = proto_tree_add_subtree( rip_authentication_tree, tvb, offset-4+digest_off,
MD5_AUTH_DATA_LEN+4, ett_auth_vec, NULL, "Authentication Data Trailer" );
proto_tree_add_text( rip_authentication_tree, tvb, offset-4+digest_off+4,

View File

@ -106,6 +106,7 @@ static int hf_param_desc = -1;
static int hf_return_desc = -1;
static int hf_aux_data_desc = -1;
static int hf_detail_level = -1;
static int hf_padding = -1;
static int hf_recv_buf_len = -1;
static int hf_send_buf_len = -1;
/* static int hf_continuation_from = -1; */
@ -1780,7 +1781,7 @@ dissect_request_parameters(tvbuff_t *tvb, int offset, packet_info *pinfo,
* One or more pad bytes.
*/
desc = get_count(desc, &count);
proto_tree_add_text(tree, tvb, offset, count, "Padding");
proto_tree_add_item(tree, hf_padding, tvb, offset, count, ENC_NA);
offset += count;
break;
@ -2882,6 +2883,10 @@ proto_register_pipe_lanman(void)
{ "Detail Level", "lanman.level", FT_UINT16, BASE_DEC,
NULL, 0, "LANMAN Detail Level", HFILL }},
{ &hf_padding,
{ "Padding", "lanman.padding", FT_BYTES, BASE_NONE,
NULL, 0, NULL, HFILL }},
{ &hf_recv_buf_len,
{ "Receive Buffer Length", "lanman.recv_buf_len", FT_UINT16, BASE_DEC,
NULL, 0, "LANMAN Receive Buffer Length", HFILL }},

View File

@ -248,6 +248,7 @@ static int hf_sna_control_05_type = -1;
static int hf_sna_control_05_ptp = -1;
static int hf_sna_control_0e_type = -1;
static int hf_sna_control_0e_value = -1;
static int hf_sna_padding = -1;
static gint ett_sna = -1;
static gint ett_sna_th = -1;
@ -995,8 +996,7 @@ dissect_optional_14(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pad = (len+3) & 0xfffc;
if (pad > len)
proto_tree_add_text(sub_tree, tvb, offset+len, pad-len,
"Padding");
proto_tree_add_item(sub_tree, hf_sna_padding, tvb, offset+len, pad-len, ENC_NA);
offset += pad;
len = tvb_get_guint8(tvb, offset);
@ -2353,10 +2353,7 @@ dissect_control_05hpr(tvbuff_t *tvb, proto_tree *tree, int hpr,
dissect_control(tvb, offset, len, tree, hpr, parse);
pad = (len+3) & 0xfffc;
if (pad > len) {
/* XXX - fix this, ensure tvb is large enough for pad */
tvb_ensure_bytes_exist(tvb, offset+len, pad-len);
proto_tree_add_text(tree, tvb, offset+len,
pad-len, "Padding");
proto_tree_add_item(tree, hf_sna_padding, tvb, offset+len, pad-len, ENC_NA);
}
offset += pad;
} else {
@ -3469,6 +3466,10 @@ proto_register_sna(void)
{ &hf_sna_control_0e_value,
{ "Value", "sna.control.0e.value",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
{ &hf_sna_padding,
{ "Padding", "sna.padding",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
};
static gint *ett[] = {
&ett_sna,