aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pw-satop.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2012-09-28 19:50:49 +0000
committerBill Meier <wmeier@newsguy.com>2012-09-28 19:50:49 +0000
commit562c8905607f4e8ccbcefee2da84fff9f7c5c6cb (patch)
treedcd5d665b94a451e851b1c250af8df60b5690778 /epan/dissectors/packet-pw-satop.c
parentda4b39e720b46046ee5c0d42fd2c16f163f334d5 (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-satop.c')
-rw-r--r--epan/dissectors/packet-pw-satop.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/epan/dissectors/packet-pw-satop.c b/epan/dissectors/packet-pw-satop.c
index c594dd0ece..3042675367 100644
--- a/epan/dissectors/packet-pw-satop.c
+++ b/epan/dissectors/packet-pw-satop.c
@@ -69,10 +69,11 @@ void dissect_pw_satop(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;
+
enum {
PAY_NO_IDEA = 0
,PAY_LIKE_E1
@@ -89,14 +90,11 @@ void dissect_pw_satop(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);
- }
+ 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;
@@ -145,7 +143,7 @@ void dissect_pw_satop(tvbuff_t * tvb_original
*
* We will use RFC4553's definition here.
*/
- int cw_len;
+ int cw_len;
gint payload_size_from_packet;
cw_len = tvb_get_guint8(tvb_original, 1) & 0x3f;
@@ -221,10 +219,7 @@ void dissect_pw_satop(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);
@@ -249,7 +244,6 @@ void dissect_pw_satop(tvbuff_t * tvb_original
}
- if (tree)
{
proto_item* item;
item = proto_tree_add_item(tree, proto, tvb_original, 0, -1, ENC_NA);
@@ -456,6 +450,6 @@ void proto_reg_handoff_pw_satop(void)
{
data_handle = find_dissector("data");
pw_padding_handle = find_dissector("pw_padding");
- dissector_add_uint("mpls.label", LABEL_INVALID, find_dissector("pw_satop_mpls"));
+ dissector_add_uint("mpls.label", MPLS_LABEL_INVALID, find_dissector("pw_satop_mpls"));
dissector_add_handle("udp.port", find_dissector("pw_satop_udp")); /* for Decode-As */
}