diff options
author | Bill Meier <wmeier@newsguy.com> | 2012-09-28 19:50:49 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2012-09-28 19:50:49 +0000 |
commit | 562c8905607f4e8ccbcefee2da84fff9f7c5c6cb (patch) | |
tree | dcd5d665b94a451e851b1c250af8df60b5690778 /epan/dissectors/packet-pw-cesopsn.c | |
parent | da4b39e720b46046ee5c0d42fd2c16f163f334d5 (diff) |
Cleanup:
packet-mpls.c:
- refactor dissect_pw_ach();
- create/uer value_string_ext as appropriate;
- use call_dissector() rather than direct dissector call in one cse;
all:
- use 'LABEL' prefix for a set of rather generic enum identifiers;
- fix some cases of calling expert...() or sub-dissectors under 'if(tree)';
- reformat some hf[] entries;
- do some whitespace changes.
svn path=/trunk/; revision=45195
Diffstat (limited to 'epan/dissectors/packet-pw-cesopsn.c')
-rw-r--r-- | epan/dissectors/packet-pw-cesopsn.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/epan/dissectors/packet-pw-cesopsn.c b/epan/dissectors/packet-pw-cesopsn.c index 4fc01c1891..af659c9825 100644 --- a/epan/dissectors/packet-pw-cesopsn.c +++ b/epan/dissectors/packet-pw-cesopsn.c @@ -83,9 +83,9 @@ void dissect_pw_cesopsn( tvbuff_t * tvb_original ,pwc_demux_type_t demux) { const int encaps_size = 4; /*RTP header in encapsulation is not supported yet*/ - gint packet_size; - gint payload_size; - gint padding_size; + gint packet_size; + gint payload_size; + gint padding_size; pwc_packet_properties_t properties; packet_size = tvb_reported_length_remaining(tvb_original, 0); @@ -97,18 +97,12 @@ void dissect_pw_cesopsn( tvbuff_t * tvb_original */ if (packet_size < 4) /* 4 is smallest size which may be sensible (for PWACH dissector) */ { - if (tree) - { - proto_item *item; - item = proto_tree_add_item(tree, proto, tvb_original, 0, -1, ENC_NA); - expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, - "PW packet size (%d) is too small to carry sensible information" - ,(int)packet_size); - } - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - { - col_set_str(pinfo->cinfo, COL_PROTOCOL, shortname); - } + proto_item *item; + item = proto_tree_add_item(tree, proto, tvb_original, 0, -1, ENC_NA); + expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, + "PW packet size (%d) is too small to carry sensible information" + ,(int)packet_size); + col_set_str(pinfo->cinfo, COL_PROTOCOL, shortname); col_set_str(pinfo->cinfo, COL_INFO, "Malformed: PW packet is too small"); return; } @@ -153,7 +147,7 @@ void dissect_pw_cesopsn( tvbuff_t * tvb_original * * We will use RFC5086's definition here. */ - int cw_len; + int cw_len; gint payload_size_from_packet; cw_len = tvb_get_guint8(tvb_original, 1) & 0x3f; @@ -226,10 +220,7 @@ void dissect_pw_cesopsn( tvbuff_t * tvb_original } /* fill up columns*/ - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - { - col_set_str(pinfo->cinfo, COL_PROTOCOL, shortname); - } + col_set_str(pinfo->cinfo, COL_PROTOCOL, shortname); if (check_col(pinfo->cinfo, COL_INFO)) { col_clear(pinfo->cinfo, COL_INFO); @@ -443,7 +434,7 @@ void proto_reg_handoff_pw_cesopsn(void) { data_handle = find_dissector("data"); pw_padding_handle = find_dissector("pw_padding"); - dissector_add_uint("mpls.label", LABEL_INVALID, find_dissector("pw_cesopsn_mpls")); + dissector_add_uint("mpls.label", MPLS_LABEL_INVALID, find_dissector("pw_cesopsn_mpls")); dissector_add_handle("udp.port", find_dissector("pw_cesopsn_udp")); /* For Decode-As */ return; } |