diff options
author | Michael Mann <mmann78@netscape.net> | 2015-01-03 21:56:16 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-01-04 16:32:03 +0000 |
commit | 553da374461efb87436dbbed7d319d252d4fe2e6 (patch) | |
tree | 1f581449dc0a022f8feb4f2088aec6fb47fd023f /epan/dissectors/packet-mip6.c | |
parent | 2085bbec9d0e4661af77a6e9530cffd5df15ecc8 (diff) |
Create BASE_DOT, BASE_DASH, and BASE_SEMICOLON types for the FT_BYTES field type.
These "bases" will put a ".", "-", or ":" respectively between hexidecimal bytes in the field in packet view and display filter. FT_BYTES with BASE_NONE will have no separator in the packet view, but continue to have the ':' as a separator in the display filter.
Converted the "string" hf_ entries that used tvb_fc_to_str as a string to use proto_tree_add_item with FT_BYTES/BASE_DOT type.
Converted applicable tvb_bytes_to_ep_str_punct() calls to use the new BASE values.
Change-Id: I2442185bb314d04a3ff2ba57883652ecd738b5f9
Reviewed-on: https://code.wireshark.org/review/6098
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-mip6.c')
-rw-r--r-- | epan/dissectors/packet-mip6.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/epan/dissectors/packet-mip6.c b/epan/dissectors/packet-mip6.c index 09bcda14c7..8d2c7e99dd 100644 --- a/epan/dissectors/packet-mip6.c +++ b/epan/dissectors/packet-mip6.c @@ -1031,6 +1031,7 @@ static int hf_mip6_ni_cni = -1; static int hf_mip6_bad_auth = -1; +static int hf_fmip6_lla = -1; static int hf_fmip6_lla_optcode = -1; static int hf_mip6_mnid_subtype = -1; @@ -1979,7 +1980,7 @@ dissect_fmip6_opt_lla(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset, proto_tree *opt_tree, proto_item *hdr_item _U_ ) { proto_tree *field_tree; - int len, p; + int len; field_tree = proto_tree_add_subtree(opt_tree, tvb, offset, optlen, *optp->subtree_index, NULL, optp->name); @@ -1988,13 +1989,10 @@ dissect_fmip6_opt_lla(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset, proto_tree_add_item(field_tree, hf_fmip6_lla_optcode, tvb, offset + FMIP6_LLA_OPTCODE_OFF, FMIP6_LLA_OPTCODE_LEN, ENC_BIG_ENDIAN); - p = offset + FMIP6_LLA_LLA_OFF; len = optlen - FMIP6_LLA_LLA_OFF; if (len > 0) { - proto_tree_add_text(field_tree, tvb, - p, len, "Link-layer address: %s", - tvb_bytes_to_ep_str_punct(tvb, p, len, ':')); + proto_tree_add_item(field_tree, hf_fmip6_lla, tvb, offset + FMIP6_LLA_LLA_OFF, len, ENC_NA); } } @@ -4382,6 +4380,12 @@ proto_register_mip6(void) NULL, HFILL } }, + { &hf_fmip6_lla, + { "Link-layer address", "mip6.lla", + FT_BYTES, BASE_SEMICOLON, NULL, 0, + NULL, HFILL } + }, + { &hf_fmip6_lla_optcode, { "Option-Code", "mip6.lla.optcode", FT_UINT8, BASE_DEC, VALS(fmip6_lla_optcode_value), 0, |