aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pw-cesopsn.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2009-06-29 19:24:14 +0000
committerAnders Broman <anders.broman@ericsson.com>2009-06-29 19:24:14 +0000
commita98ce52e800e19c9920a69f6519ff728a0122d06 (patch)
tree36b9053c7004578238521b8d0194f95c171c44e9 /epan/dissectors/packet-pw-cesopsn.c
parenta539aa732c522c40d888d6274997fda01b6cd6f8 (diff)
From Artem Tamazov:
Added: PW ATM 1:1, AAL5 SDU, AAL5 PDU support + BFD fix + PW ATM OAM fix svn path=/trunk/; revision=28881
Diffstat (limited to 'epan/dissectors/packet-pw-cesopsn.c')
-rw-r--r--epan/dissectors/packet-pw-cesopsn.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/epan/dissectors/packet-pw-cesopsn.c b/epan/dissectors/packet-pw-cesopsn.c
index e8656adb1a..be77883010 100644
--- a/epan/dissectors/packet-pw-cesopsn.c
+++ b/epan/dissectors/packet-pw-cesopsn.c
@@ -56,12 +56,12 @@ static int hf_cw_frg = -1;
static int hf_cw_len = -1;
static int hf_cw_seq = -1;
static int hf_payload = -1;
-static int hf_padding = -1;
-static int hf_padding_f = -1;
+static int hf_payload_l = -1;
static dissector_handle_t data_handle;
+static dissector_handle_t pw_padding_handle;
-static const char pwc_longname_pw_cesopsn[] = "CESoPSN basic NxDS0 mode (no RTP support)";
+const char pwc_longname_pw_cesopsn[] = "CESoPSN basic NxDS0 mode (no RTP support)";
static const char shortname[] = "CESoPSN basic (no RTP)";
static const value_string vals_cw_lm[] = {
@@ -121,7 +121,7 @@ static void dissect_pw_cesopsn( tvbuff_t * tvb_original, packet_info * pinfo, pr
/* check how "good" is this packet */
/* also decide payload length from packet size and CW */
- properties = 0;
+ properties = PWC_PACKET_PROPERTIES_T_INITIALIZER;
if (0 != (tvb_get_guint8(tvb_original, 0) & 0xf0 /*bits03*/))
{
properties |= PWC_CW_BAD_BITS03;
@@ -188,7 +188,7 @@ static void dissect_pw_cesopsn( tvbuff_t * tvb_original, packet_info * pinfo, pr
{
guint8 cw_lm;
cw_lm = tvb_get_guint8(tvb_original, 0) & 0x0b /*l+mod*/;
- if (!pwc_value_listed_in_vals(cw_lm, vals_cw_lm))
+ if (NULL == match_strval(cw_lm, vals_cw_lm))
{
properties |= PWC_CW_SUSPECT_LM;
}
@@ -348,6 +348,9 @@ static void dissect_pw_cesopsn( tvbuff_t * tvb_original, packet_info * pinfo, pr
}
tree = proto_item_add_subtree(item, ett);
call_dissector(data_handle, tvb, pinfo, tree);
+ item = proto_tree_add_int(tree, hf_payload_l, tvb, 0, 0
+ ,(int)payload_size); /* allow filtering */
+ PROTO_ITEM_SET_HIDDEN(item);
}
}
@@ -357,12 +360,9 @@ static void dissect_pw_cesopsn( tvbuff_t * tvb_original, packet_info * pinfo, pr
proto_tree* tree;
tree = proto_item_add_subtree(item, ett);
{
- proto_item* item;
tvbuff_t* tvb;
tvb = tvb_new_subset(tvb_original, PWC_SIZEOF_CW + payload_size, padding_size, -1);
- item = proto_tree_add_item(tree, hf_padding, tvb, 0, -1, FALSE);
- pwc_item_append_text_n_items(item,(int)padding_size,"octet");
- call_dissector(data_handle, tvb, pinfo, tree);
+ call_dissector(pw_padding_handle, tvb, pinfo, tree);
}
}
}
@@ -396,11 +396,8 @@ void proto_register_pw_cesopsn(void)
,{&hf_payload ,{"TDM payload" ,"pwcesopsn.payload"
,FT_BYTES ,BASE_NONE ,NULL
,0 ,NULL ,HFILL }}
- ,{&hf_padding ,{"Padding" ,"pwcesopsn.padding"
- ,FT_BYTES ,BASE_NONE ,NULL
- ,0 ,NULL ,HFILL }}
- ,{&hf_padding_f ,{"Padding (formatted)" ,""
- ,FT_BYTES ,BASE_NONE ,NULL
+ ,{&hf_payload_l ,{"TDM payload length" ,"pwcesopsn.payload.len"
+ ,FT_INT32 ,BASE_DEC ,NULL
,0 ,NULL ,HFILL }}
};
@@ -420,6 +417,7 @@ void proto_reg_handoff_pw_cesopsn(void)
dissector_handle_t h;
h = find_dissector("pw_cesopsn");
data_handle = find_dissector("data");
+ pw_padding_handle = find_dissector("pw_padding");
dissector_add("mpls.label", LABEL_INVALID, h);
return;
}