X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7de355927bb4dac90db045d52a69bf95c841b807..47fc89d711eec0a073d9b3b293a1af901b5bd791:/print-l2tp.c diff --git a/print-l2tp.c b/print-l2tp.c index 840239cd..ca98e9a9 100644 --- a/print-l2tp.c +++ b/print-l2tp.c @@ -21,11 +21,6 @@ * L2TP support contributed by Motonori Shindo (mshindo@mshindo.net) */ -#ifndef lint -static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-l2tp.c,v 1.20 2006-06-23 02:03:09 hannes Exp $"; -#endif - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -34,11 +29,46 @@ static const char rcsid[] _U_ = #include -#include "l2tp.h" #include "interface.h" #include "extract.h" -static char tstr[] = " [|l2tp]"; +#define L2TP_FLAG_TYPE 0x8000 /* Type (0=Data, 1=Control) */ +#define L2TP_FLAG_LENGTH 0x4000 /* Length */ +#define L2TP_FLAG_SEQUENCE 0x0800 /* Sequence */ +#define L2TP_FLAG_OFFSET 0x0200 /* Offset */ +#define L2TP_FLAG_PRIORITY 0x0100 /* Priority */ + +#define L2TP_VERSION_MASK 0x000f /* Version Mask */ +#define L2TP_VERSION_L2F 0x0001 /* L2F */ +#define L2TP_VERSION_L2TP 0x0002 /* L2TP */ + +#define L2TP_AVP_HDR_FLAG_MANDATORY 0x8000 /* Mandatory Flag */ +#define L2TP_AVP_HDR_FLAG_HIDDEN 0x4000 /* Hidden Flag */ +#define L2TP_AVP_HDR_LEN_MASK 0x03ff /* Length Mask */ + +#define L2TP_FRAMING_CAP_SYNC_MASK 0x00000001 /* Synchronous */ +#define L2TP_FRAMING_CAP_ASYNC_MASK 0x00000002 /* Asynchronous */ + +#define L2TP_FRAMING_TYPE_SYNC_MASK 0x00000001 /* Synchronous */ +#define L2TP_FRAMING_TYPE_ASYNC_MASK 0x00000002 /* Asynchronous */ + +#define L2TP_BEARER_CAP_DIGITAL_MASK 0x00000001 /* Digital */ +#define L2TP_BEARER_CAP_ANALOG_MASK 0x00000002 /* Analog */ + +#define L2TP_BEARER_TYPE_DIGITAL_MASK 0x00000001 /* Digital */ +#define L2TP_BEARER_TYPE_ANALOG_MASK 0x00000002 /* Analog */ + +/* Authen Type */ +#define L2TP_AUTHEN_TYPE_RESERVED 0x0000 /* Reserved */ +#define L2TP_AUTHEN_TYPE_TEXTUAL 0x0001 /* Textual username/password exchange */ +#define L2TP_AUTHEN_TYPE_CHAP 0x0002 /* PPP CHAP */ +#define L2TP_AUTHEN_TYPE_PAP 0x0003 /* PPP PAP */ +#define L2TP_AUTHEN_TYPE_NO_AUTH 0x0004 /* No Authentication */ +#define L2TP_AUTHEN_TYPE_MSCHAPv1 0x0005 /* MSCHAPv1 */ + +#define L2TP_PROXY_AUTH_ID_MASK 0x00ff + +static const char tstr[] = " [|l2tp]"; #define L2TP_MSGTYPE_SCCRQ 1 /* Start-Control-Connection-Request */ #define L2TP_MSGTYPE_SCCRP 2 /* Start-Control-Connection-Reply */