Hi,

RFC 3145 (L2TP Disconnect Cause Information) has been
published. Here's a patch to decode this new AVP. I don't have a trace
file that includes this AVP, so it's not thoroughly debugged. If
anyone has such  a trace, I'd be happy to take a look and debug if
necessary.

BTW, I, as an author of print-l2tp.c, have to admit that this code has
to be TCHECK()-ify. I'll work on this later.

Regards,

=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=
 +----+----+     
 |.. .|    |     Motonori Shindo
 |_~__|    |     
 | .. |~~_~|     Sr. Systems Engineer
 | .  |    |     CoSine Communications Inc.
 +----+----+     
 C o S i n e     e-mail:  [EMAIL PROTECTED] 
Communications
=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=

Index: print-l2tp.c
===================================================================
RCS file: /tcpdump/master/tcpdump/print-l2tp.c,v
retrieving revision 1.8
diff -u -r1.8 print-l2tp.c
--- print-l2tp.c        2000/08/18 07:44:46     1.8
+++ print-l2tp.c        2001/10/19 09:24:28
@@ -110,8 +110,11 @@
 static void l2tp_private_grp_id_print(const u_char *dat, u_int length);
 static void l2tp_rx_conn_speed_print(const u_char *dat, u_int length);
 static void l2tp_seq_required_print(const u_char *dat, u_int length);
+static void l2tp_ppp_discon_cc_print(const u_char *dat, u_int length);
+static void l2tp_not_defined_print(const u_char *dat, u_int length);
 static void l2tp_avp_print(const u_char *dat, u_int length);
 
+/* XXX: need better way to handle discrete AVP numbers */
 static struct l2tp_avp_vec l2tp_avp[] = {
   {"MSGTYPE", l2tp_msgtype_print},             /* 0  Message Type */
   {"RESULT_CODE", l2tp_result_code_print},     /* 1  Result Code */
@@ -153,7 +156,14 @@
   {"PRIVATE_GRP_ID", l2tp_private_grp_id_print},/* 37 Private Group ID */
   {"RX_CONN_SPEED", l2tp_rx_conn_speed_print}, /* 38 (Rx) Connect Speed */
   {"SEQ_REQUIRED", l2tp_seq_required_print},   /* 39 Sequencing Required */
-#define L2TP_MAX_AVP_INDEX     40
+  {"NOT_DEFINED", l2tp_not_defined_print},     /* 40 Not Defined */
+  {"NOT_DEFINED", l2tp_not_defined_print},     /* 41 Not Defined */
+  {"NOT_DEFINED", l2tp_not_defined_print},     /* 42 Not Defined */
+  {"NOT_DEFINED", l2tp_not_defined_print},     /* 43 Not Defined */
+  {"NOT_DEFINED", l2tp_not_defined_print},     /* 44 Not Defined */
+  {"NOT_DEFINED", l2tp_not_defined_print},     /* 45 Not Defined */
+  {"PPP_DISCON_CC", l2tp_ppp_discon_cc_print}, /* 46 PPP Disconnect Cause Code */
+#define L2TP_MAX_AVP_INDEX     47
 };
 
 #if 0
@@ -562,6 +572,25 @@
 
 static void
 l2tp_seq_required_print(const u_char *dat, u_int length)
+{
+       return;
+}
+
+static void
+l2tp_ppp_discon_cc_print(const u_char *dat, u_int length)
+{
+       print_short((u_short*)dat);
+       printf(", ");
+       print_short((u_short*)(dat+2));
+       printf(", %02x", dat[4]);
+       if (length > 5) {
+               printf(" ");
+               print_string(dat+5, length-4);
+       }
+}
+
+static void
+l2tp_not_defined_print(const u_char *dat, u_int length)
 {
        return;
 }

Reply via email to