diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-10-19 09:12:53 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-10-19 09:12:53 +0000 |
commit | 22d0ffbe06583d783dc0b71f2d215de3b686005e (patch) | |
tree | e7fdb3db12ab72e5b8c5e81ac417ace008be6bcf /packet-l2tp.c | |
parent | 40e944337db43f01ee2fb69cc9dc43f63d32578b (diff) | |
download | wireshark-22d0ffbe06583d783dc0b71f2d215de3b686005e.tar.gz wireshark-22d0ffbe06583d783dc0b71f2d215de3b686005e.tar.bz2 wireshark-22d0ffbe06583d783dc0b71f2d215de3b686005e.zip |
L2TP Dissconnect Cause Information AVP support, from Motonori Shindo.
svn path=/trunk/; revision=4041
Diffstat (limited to 'packet-l2tp.c')
-rw-r--r-- | packet-l2tp.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/packet-l2tp.c b/packet-l2tp.c index 1b8bec6a32..dd529dc0c9 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.25 2001/10/15 03:27:38 guy Exp $ + * $Id: packet-l2tp.c,v 1.26 2001/10/19 09:12:53 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -155,6 +155,13 @@ static const value_string l2tp_type_vals[] = { { 0, NULL }, }; +static const value_string cause_code_direction_vals[] = { + { 0, "global error" }, + { 1, "at peer" }, + { 2, "at local" }, + { 0, NULL }, +}; + static const true_false_string l2tp_length_bit_truth = { "Length field is present", "Length field is not present" }; @@ -216,6 +223,7 @@ static const value_string authen_type_vals[] = { #define PRIVATE_GROUP_ID 37 #define RX_CONNECT_SPEED 38 #define SEQUENCING_REQUIRED 39 +#define PPP_DISCONNECT_CAUSE_CODE 46 /* RFC 3145 */ #define NUM_AVP_TYPES 40 static const value_string avp_type_vals[] = { @@ -258,6 +266,7 @@ static const value_string avp_type_vals[] = { { PRIVATE_GROUP_ID, "Private group ID" }, { RX_CONNECT_SPEED, "RxConnect Speed" }, { SEQUENCING_REQUIRED, "Sequencing Required" }, + { PPP_DISCONNECT_CAUSE_CODE, "PPP Disconnect Cause Code" }, { 0, NULL } }; @@ -922,6 +931,40 @@ dissect_l2tp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvb_get_ntohl(tvb, index)); break; + case PPP_DISCONNECT_CAUSE_CODE: + if (avp_len < 2) + break; + proto_tree_add_text(l2tp_avp_tree, tvb, index, 2, + "Disconnect Code: %u", + tvb_get_ntohs(tvb, index)); + index += 2; + avp_len -= 2; + + if (avp_len < 2) + break; + proto_tree_add_text(l2tp_avp_tree, tvb, index, 2, + "Control Protocol Number: %u", + tvb_get_ntohs(tvb, index)); + index += 2; + avp_len -= 2; + + if (avp_len < 1) + break; + proto_tree_add_text(l2tp_avp_tree, tvb, index, 1, + "Direction: %s", + val_to_str(tvb_get_guint8(tvb, index), + cause_code_direction_vals, + "Reserved (%u)")); + index += 1; + avp_len -= 1; + + if (avp_len == 0) + break; + proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len, + "Message: %.*s", avp_len, + tvb_get_ptr(tvb, index, avp_len)); + break; + default: proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len, "Unknown AVP"); |