summaryrefslogtreecommitdiff
path: root/epan/dissectors
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2006-10-11 06:11:54 +0000
committerAnders Broman <anders.broman@ericsson.com>2006-10-11 06:11:54 +0000
commitc16a3fa90a3ade08c4184a3364dcdd50417dfbde (patch)
tree2d29be1e220b73f51a3328cec31e3fb2324026ff /epan/dissectors
parent1e480346d1fc8cbeb7fbdfa405ed46ae3bba1380 (diff)
downloadwireshark-c16a3fa90a3ade08c4184a3364dcdd50417dfbde.tar.gz
From Donald White:
An enhancement to the PPP multiplexing protocol dissector in protocol-ppp.c. There are two changes: The protocol id field of the multiplexed sub-frame is added to the protocol tree using a header field. This allows filters to select the protocol as is the case when it is not multiplexed. I think this fixes a small bug as the ability to filter for a protocol should not depend on the lower level protocol. When the protocol id of the subframe is not present, the appropriate default protocol is displayed with the standard indication that Wireshark generated the value. svn path=/trunk/; revision=19488
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-ppp.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c
index 45787f0a88..a90b5bd5b5 100644
--- a/epan/dissectors/packet-ppp.c
+++ b/epan/dissectors/packet-ppp.c
@@ -131,6 +131,7 @@ static gint ett_pppmuxcp = -1;
static gint ett_pppmuxcp_options = -1;
static int proto_pppmux = -1;
+static int hf_pppmux_protocol = -1;
static gint ett_pppmux = -1;
static gint ett_pppmux_subframe = -1;
@@ -3039,9 +3040,12 @@ dissect_pppmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_text(hdr_tree,tvb,offset,length_field,"Sub-frame Length = %u",length);
- if (flags & PPPMUX_PFF_BIT_SET)
- proto_tree_add_text(hdr_tree,tvb,offset + length_field,pid_field,"%s: %s(0x%02x)",
- "Protocol ID",val_to_str(pid,ppp_vals,"Unknown"), pid);
+ ti = proto_tree_add_uint(hdr_tree,hf_pppmux_protocol,tvb,offset + length_field,pid_field, pid);
+
+ /* if protocol is not present in the sub-frame */
+ if (!(flags & PPPMUX_PFF_BIT_SET))
+ /* mark this item as generated */
+ PROTO_ITEM_SET_GENERATED(ti);
offset += hdr_length;
length_remaining -= hdr_length;
@@ -4290,6 +4294,14 @@ proto_reg_handoff_pppmuxcp(void)
void
proto_register_pppmux(void)
{
+ static hf_register_info hf[] =
+ {
+ { &hf_pppmux_protocol,
+ { "Protocol", "ppp.protocol", FT_UINT16, BASE_HEX,
+ VALS(ppp_vals), 0x0,
+ "The protocol of the sub-frame.", HFILL }},
+ };
+
static gint *ett[] = {
&ett_pppmux,
&ett_pppmux_subframe,
@@ -4301,6 +4313,7 @@ proto_register_pppmux(void)
proto_pppmux = proto_register_protocol("PPP Multiplexing",
"PPP PPPMux",
"pppmux");
+ proto_register_field_array(proto_pppmux, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}