35 #if PPP_SUPPORT && PPPOL2TP_SUPPORT
47 #define PPPOL2TP_CONTROL_TIMEOUT (5*1000)
48 #define PPPOL2TP_SLOW_RETRY (60*1000)
50 #define PPPOL2TP_MAXSCCRQ 4
51 #define PPPOL2TP_MAXICRQ 4
52 #define PPPOL2TP_MAXICCN 4
55 #define PPPOL2TP_HEADERFLAG_CONTROL 0x8000
56 #define PPPOL2TP_HEADERFLAG_LENGTH 0x4000
57 #define PPPOL2TP_HEADERFLAG_SEQUENCE 0x0800
58 #define PPPOL2TP_HEADERFLAG_OFFSET 0x0200
59 #define PPPOL2TP_HEADERFLAG_PRIORITY 0x0100
60 #define PPPOL2TP_HEADERFLAG_VERSION 0x0002
63 #define PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY (PPPOL2TP_HEADERFLAG_CONTROL|PPPOL2TP_HEADERFLAG_LENGTH|PPPOL2TP_HEADERFLAG_SEQUENCE|PPPOL2TP_HEADERFLAG_VERSION)
65 #define PPPOL2TP_HEADERFLAG_CONTROL_FORBIDDEN (PPPOL2TP_HEADERFLAG_OFFSET|PPPOL2TP_HEADERFLAG_PRIORITY)
68 #define PPPOL2TP_HEADERFLAG_DATA_MANDATORY (PPPOL2TP_HEADERFLAG_VERSION)
71 #define PPPOL2TP_AVPHEADERFLAG_MANDATORY 0x8000
72 #define PPPOL2TP_AVPHEADERFLAG_HIDDEN 0x4000
73 #define PPPOL2TP_AVPHEADERFLAG_LENGTHMASK 0x03ff
76 #define PPPOL2TP_AVPTYPE_MESSAGE 0
79 #define PPPOL2TP_MESSAGETYPE_SCCRQ 1
80 #define PPPOL2TP_MESSAGETYPE_SCCRP 2
81 #define PPPOL2TP_MESSAGETYPE_SCCCN 3
82 #define PPPOL2TP_MESSAGETYPE_STOPCCN 4
83 #define PPPOL2TP_MESSAGETYPE_HELLO 6
85 #define PPPOL2TP_MESSAGETYPE_OCRQ 7
86 #define PPPOL2TP_MESSAGETYPE_OCRP 8
87 #define PPPOL2TP_MESSAGETYPE_OCCN 9
88 #define PPPOL2TP_MESSAGETYPE_ICRQ 10
89 #define PPPOL2TP_MESSAGETYPE_ICRP 11
90 #define PPPOL2TP_MESSAGETYPE_ICCN 12
91 #define PPPOL2TP_MESSAGETYPE_CDN 14
93 #define PPPOL2TP_MESSAGETYPE_WEN 15
95 #define PPPOL2TP_MESSAGETYPE_SLI 16
98 #define PPPOL2TP_AVPTYPE_RESULTCODE 1
99 #define PPPOL2TP_RESULTCODE 1
102 #define PPPOL2TP_AVPTYPE_VERSION 2
103 #define PPPOL2TP_VERSION 0x0100
106 #define PPPOL2TP_AVPTYPE_FRAMINGCAPABILITIES 3
107 #define PPPOL2TP_FRAMINGCAPABILITIES 0x00000003
110 #define PPPOL2TP_AVPTYPE_BEARERCAPABILITIES 4
111 #define PPPOL2TP_BEARERCAPABILITIES 0x00000003
114 #define PPPOL2TP_AVPTYPE_TIEBREAKER 5
117 #define PPPOL2TP_AVPTYPE_HOSTNAME 7
118 #define PPPOL2TP_HOSTNAME "lwIP"
121 #define PPPOL2TP_AVPTYPE_VENDORNAME 8
122 #define PPPOL2TP_VENDORNAME "lwIP"
125 #define PPPOL2TP_AVPTYPE_TUNNELID 9
128 #define PPPOL2TP_AVPTYPE_RECEIVEWINDOWSIZE 10
129 #define PPPOL2TP_RECEIVEWINDOWSIZE 8
132 #define PPPOL2TP_AVPTYPE_CHALLENGE 11
135 #define PPPOL2TP_AVPTYPE_CAUSECODE 12
138 #define PPPOL2TP_AVPTYPE_CHALLENGERESPONSE 13
139 #define PPPOL2TP_AVPTYPE_CHALLENGERESPONSE_SIZE 16
142 #define PPPOL2TP_AVPTYPE_SESSIONID 14
145 #define PPPOL2TP_AVPTYPE_CALLSERIALNUMBER 15
148 #define PPPOL2TP_AVPTYPE_FRAMINGTYPE 19
149 #define PPPOL2TP_FRAMINGTYPE 0x00000001
152 #define PPPOL2TP_AVPTYPE_TXCONNECTSPEED 24
153 #define PPPOL2TP_TXCONNECTSPEED 100000000
156 #define PPPOL2TP_STATE_INITIAL 0
157 #define PPPOL2TP_STATE_SCCRQ_SENT 1
158 #define PPPOL2TP_STATE_ICRQ_SENT 2
159 #define PPPOL2TP_STATE_ICCN_SENT 3
160 #define PPPOL2TP_STATE_DATA 4
162 #define PPPOL2TP_OUTPUT_DATA_HEADER_LEN 6
167 typedef struct pppol2tp_pcb_s pppol2tp_pcb;
168 struct pppol2tp_pcb_s {
175 #if PPPOL2TP_AUTH_SUPPORT
179 u8_t challenge_hash[16];
187 u16_t source_tunnel_id;
188 u16_t remote_tunnel_id;
189 u16_t source_session_id;
190 u16_t remote_session_id;
199 ppp_pcb *pppol2tp_create(
struct netif *pppif,
201 const u8_t *secret,
u8_t secret_len,
202 ppp_link_status_cb_fn link_status_cb,
void *ctx_cb);
uint8_t u8_t
Definition: arch.h:125
uint16_t u16_t
Definition: arch.h:127
ip6_addr_t ip_addr_t
Definition: ip_addr.h:318