diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-12-11 19:59:08 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-12-11 19:59:08 +0000 |
commit | 202253482635a37f548e5ac245161a28cc1d8b0d (patch) | |
tree | 938d1e8f0908299c76bf04d308d5f1ce9f8a5ac9 | |
parent | 79275e0079add5b9a2af9bcf08dac9fe10a2e03b (diff) | |
download | wireshark-202253482635a37f548e5ac245161a28cc1d8b0d.tar.gz wireshark-202253482635a37f548e5ac245161a28cc1d8b0d.tar.bz2 wireshark-202253482635a37f548e5ac245161a28cc1d8b0d.zip |
From Andreas Trauer: dissect the L2TP AVPs Initial Received LCP CONFREQ,
Last Received LCP CONFREQ, Last Sent LCP CONFREQ, and correct some AVP
names.
svn path=/trunk/; revision=6779
-rw-r--r-- | AUTHORS | 2 | ||||
-rw-r--r-- | packet-l2tp.c | 62 | ||||
-rw-r--r-- | packet-ppp.c | 10 |
3 files changed, 43 insertions, 31 deletions
@@ -1506,6 +1506,8 @@ Andreas Trauer <andreas.trauer [AT] siemens.com> { GTP enhancements Add subtrees for each link in a Router-LSA in an OSPF LS Update packet + Dissect the L2TP AVPs Initial Received LCP CONFREQ, Last + Received LCP CONFREQ, Last Sent LCP CONFREQ } Ronald Henderson <Ronald.Henderson [AT] CognicaseUSA.com> { diff --git a/packet-l2tp.c b/packet-l2tp.c index 9a1d73c066..aec2dea246 100644 --- a/packet-l2tp.c +++ b/packet-l2tp.c @@ -7,7 +7,7 @@ * Laurent Cazalet <laurent.cazalet@mailclub.net> * Thomas Parvais <thomas.parvais@advalvas.be> * - * $Id: packet-l2tp.c,v 1.35 2002/08/28 21:00:19 jmayer Exp $ + * $Id: packet-l2tp.c,v 1.36 2002/12/11 19:59:08 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -80,6 +80,7 @@ static int hf_l2tp_tie_breaker = -1; static gint ett_l2tp = -1; static gint ett_l2tp_ctrl = -1; static gint ett_l2tp_avp = -1; +static gint ett_l2tp_lcp = -1; #define AVP_SCCRQ 1 #define AVP_SCCRP 2 @@ -201,8 +202,8 @@ static const value_string authen_type_vals[] = { #define SUB_ADDRESS 23 #define TX_CONNECT_SPEED 24 #define PHYSICAL_CHANNEL 25 -#define INITIAL_RECEIVED_LCP 26 -#define LAST_SEND_LCP_CONFREQ 27 +#define INITIAL_RECEIVED_LCP_CONFREQ 26 +#define LAST_SENT_LCP_CONFREQ 27 #define LAST_RECEIVED_LCP_CONFREQ 28 #define PROXY_AUTHEN_TYPE 29 #define PROXY_AUTHEN_NAME 30 @@ -244,8 +245,8 @@ static const value_string avp_type_vals[] = { { SUB_ADDRESS, "Sub-Address" }, { TX_CONNECT_SPEED, "Connect Speed" }, { PHYSICAL_CHANNEL, "Physical Channel" }, - { INITIAL_RECEIVED_LCP, "Initial Received LCP" }, - { LAST_SEND_LCP_CONFREQ, "Last Send LCP CONFREQ" }, + { INITIAL_RECEIVED_LCP_CONFREQ, "Initial Received LCP CONFREQ" }, + { LAST_SENT_LCP_CONFREQ, "Last Sent LCP CONFREQ" }, { LAST_RECEIVED_LCP_CONFREQ, "Last Received LCP CONFREQ" }, { PROXY_AUTHEN_TYPE, "Proxy Authen Type" }, { PROXY_AUTHEN_NAME, "Proxy Authen Name" }, @@ -301,12 +302,13 @@ static const value_string avp_vendor_id_vals[] = static gchar textbuffer[200]; static dissector_handle_t ppp_hdlc_handle; +static dissector_handle_t ppp_lcp_options_handle; static void dissect_l2tp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_tree *l2tp_tree=NULL, *l2tp_avp_tree, *ctrl_tree; - proto_item *ti, *tf; + proto_tree *l2tp_tree=NULL, *l2tp_avp_tree, *l2tp_lcp_avp_tree, *ctrl_tree; + proto_item *ti, *tf, *te; int rhcode; int index = 0; int tmp_index; @@ -765,34 +767,31 @@ dissect_l2tp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvb_get_ntohl(tvb, index)); break; - case INITIAL_RECEIVED_LCP: - /* - * XXX - can this be dissected by stuff in the - * LCP dissector? - */ - proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len, - "Initial LCP CONFREQ: %s", - tvb_bytes_to_str(tvb, index, avp_len)); + case INITIAL_RECEIVED_LCP_CONFREQ: + te = proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len, + "Initial Received LCP CONFREQ: %s", + tvb_bytes_to_str(tvb, index, avp_len)); + l2tp_lcp_avp_tree = proto_item_add_subtree(te, ett_l2tp_lcp); + next_tvb = tvb_new_subset(tvb, index, avp_len, avp_len); + call_dissector(ppp_lcp_options_handle, next_tvb, pinfo, l2tp_lcp_avp_tree ); break; - case LAST_SEND_LCP_CONFREQ: - /* - * XXX - can this be dissected by stuff in the - * LCP dissector? - */ - proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len, - "Last Sent LCP CONFREQ: %s", - tvb_bytes_to_str(tvb, index, avp_len)); + case LAST_SENT_LCP_CONFREQ: + te = proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len, + "Last Sent LCP CONFREQ: %s", + tvb_bytes_to_str(tvb, index, avp_len)); + l2tp_lcp_avp_tree = proto_item_add_subtree(te, ett_l2tp_lcp); + next_tvb = tvb_new_subset(tvb, index, avp_len, avp_len); + call_dissector(ppp_lcp_options_handle, next_tvb, pinfo, l2tp_lcp_avp_tree ); break; case LAST_RECEIVED_LCP_CONFREQ: - /* - * XXX - can this be dissected by stuff in the - * LCP dissector? - */ - proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len, - "Last Received LCP CONFREQ: %s", - tvb_bytes_to_str(tvb, index, avp_len)); + te = proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len, + "Last Received LCP CONFREQ: %s", + tvb_bytes_to_str(tvb, index, avp_len)); + l2tp_lcp_avp_tree = proto_item_add_subtree(te, ett_l2tp_lcp); + next_tvb = tvb_new_subset(tvb, index, avp_len, avp_len); + call_dissector(ppp_lcp_options_handle, next_tvb, pinfo, l2tp_lcp_avp_tree ); break; case PROXY_AUTHEN_TYPE: @@ -1049,6 +1048,7 @@ proto_register_l2tp(void) &ett_l2tp, &ett_l2tp_ctrl, &ett_l2tp_avp, + &ett_l2tp_lcp, }; proto_l2tp = proto_register_protocol( @@ -1069,4 +1069,6 @@ proto_reg_handoff_l2tp(void) * Get a handle for the PPP-in-HDLC-like-framing dissector. */ ppp_hdlc_handle = find_dissector("ppp_hdlc"); + ppp_lcp_options_handle = find_dissector("ppp_lcp_options"); + } diff --git a/packet-ppp.c b/packet-ppp.c index 76276b2d90..d78ebd9bc3 100644 --- a/packet-ppp.c +++ b/packet-ppp.c @@ -1,7 +1,7 @@ /* packet-ppp.c * Routines for ppp packet disassembly * - * $Id: packet-ppp.c,v 1.102 2002/11/28 22:18:53 guy Exp $ + * $Id: packet-ppp.c,v 1.103 2002/12/11 19:59:08 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2506,6 +2506,13 @@ dissect_ppp_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } static void +dissect_lcp_options(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_ip_tcp_options(tvb, 0, tvb_reported_length(tvb), lcp_opts, N_LCP_OPTS, + -1, pinfo, tree); +} + +static void dissect_lcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { dissect_cp(tvb, proto_lcp, ett_lcp, lcp_vals, ett_lcp_options, @@ -3265,6 +3272,7 @@ proto_register_ppp(void) "PPP protocol", FT_UINT16, BASE_HEX); register_dissector("ppp_hdlc", dissect_ppp_hdlc, proto_ppp); + register_dissector("ppp_lcp_options", dissect_lcp_options, proto_ppp); register_dissector("ppp", dissect_ppp, proto_ppp); /* Register the preferences for the ppp protocol */ |