diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-10-11 06:11:54 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-10-11 06:11:54 +0000 |
commit | 7b8d676e96ec764ace05b5f5dad5b71b120e17b2 (patch) | |
tree | 2d29be1e220b73f51a3328cec31e3fb2324026ff /epan/dissectors/packet-ppp.c | |
parent | 5b4fd89f5384ab9a808bee7945a041a29af85a43 (diff) |
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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19488 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-ppp.c')
-rw-r--r-- | epan/dissectors/packet-ppp.c | 19 |
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)); } |