l2tp.h revision 56893
1/*
2 * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
3 *      The Regents of the University of California.  All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the University of California,
13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * L2TP support contributed by Motonori Shindo (mshindo@ascend.co.jp)
22 */
23
24
25#define L2TP_FLAG_TYPE		0x8000	/* Type (0=Data, 1=Control) */
26#define L2TP_FLAG_LENGTH	0x4000	/* Length */
27#define L2TP_FLAG_SEQUENCE	0x0800	/* Sequence */
28#define L2TP_FLAG_OFFSET	0x0200	/* Offset */
29#define L2TP_FLAG_PRIORITY	0x0100	/* Priority */
30
31#define L2TP_VERSION_MASK	0x000f	/* Version Mask */
32#define L2TP_VERSION_L2F	0x0001	/* L2F */
33#define L2TP_VERSION_L2TP	0x0002	/* L2TP */
34
35#define L2TP_AVP_HDR_FLAG_MANDATORY	0x8000	/* Mandatory Flag */
36#define L2TP_AVP_HDR_FLAG_HIDDEN	0x4000	/* Hidden Flag */
37#define L2TP_AVP_HDR_LEN_MASK		0x03ff	/* Length Mask */
38
39#define L2TP_FRAMING_CAP_SYNC_MASK	0x00000001	/* Synchronous */
40#define L2TP_FRAMING_CAP_ASYNC_MASK	0x00000002	/* Asynchronous */
41
42#define L2TP_FRAMING_TYPE_SYNC_MASK	0x00000001	/* Synchronous */
43#define L2TP_FRAMING_TYPE_ASYNC_MASK	0x00000002	/* Asynchronous */
44
45#define L2TP_BEARER_CAP_DIGITAL_MASK	0x00000001	/* Digital */
46#define L2TP_BEARER_CAP_ANALOG_MASK	0x00000002	/* Analog */
47
48#define L2TP_BEARER_TYPE_DIGITAL_MASK	0x00000001	/* Digital */
49#define L2TP_BEARER_TYPE_ANALOG_MASK	0x00000002	/* Analog */
50
51/* Authen Type */
52#define L2TP_AUTHEN_TYPE_RESERVED	0x0000	/* Reserved */
53#define L2TP_AUTHEN_TYPE_TEXTUAL	0x0001	/* Textual username/password exchange */
54#define L2TP_AUTHEN_TYPE_CHAP		0x0002	/* PPP CHAP */
55#define L2TP_AUTHEN_TYPE_PAP		0x0003	/* PPP PAP */
56#define L2TP_AUTHEN_TYPE_NO_AUTH	0x0004	/* No Authentication */
57#define L2TP_AUTHEN_TYPE_MSCHAP		0x0005	/* MSCHAPv1 */
58
59#define L2TP_PROXY_AUTH_ID_MASK		0x00ff
60
61
62struct l2tp_avp_vec {
63	const char *name;
64	void (*print)(const u_char *, u_int);
65};
66
67struct l2tp_call_errors {
68	u_short	reserved;
69	u_int	crc_errs;
70	u_int	framing_errs;
71	u_int	hardware_overruns;
72	u_int	buffer_overruns;
73	u_int	timeout_errs;
74	u_int	alignment_errs;
75};
76
77struct l2tp_accm {
78	u_short reserved;
79	u_int	send_accm;
80	u_int	recv_accm;
81};
82
83