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