75#if PPP_SUPPORT && PPPOE_SUPPORT
86#ifdef PACK_STRUCT_USE_INCLUDES
87# include "arch/bpstruct.h"
91 PACK_STRUCT_FLD_8(u8_t vertype);
92 PACK_STRUCT_FLD_8(u8_t code);
93 PACK_STRUCT_FIELD(u16_t session);
94 PACK_STRUCT_FIELD(u16_t plen);
97#ifdef PACK_STRUCT_USE_INCLUDES
98# include "arch/epstruct.h"
101#ifdef PACK_STRUCT_USE_INCLUDES
102# include "arch/bpstruct.h"
106 PACK_STRUCT_FIELD(u16_t tag);
107 PACK_STRUCT_FIELD(u16_t len);
110#ifdef PACK_STRUCT_USE_INCLUDES
111# include "arch/epstruct.h"
115#define PPPOE_STATE_INITIAL 0
116#define PPPOE_STATE_PADI_SENT 1
117#define PPPOE_STATE_PADR_SENT 2
118#define PPPOE_STATE_SESSION 3
120#define PPPOE_STATE_PADO_SENT 1
122#define PPPOE_HEADERLEN sizeof(struct pppoehdr)
123#define PPPOE_VERTYPE 0x11
125#define PPPOE_TAG_EOL 0x0000
126#define PPPOE_TAG_SNAME 0x0101
127#define PPPOE_TAG_ACNAME 0x0102
128#define PPPOE_TAG_HUNIQUE 0x0103
129#define PPPOE_TAG_ACCOOKIE 0x0104
130#define PPPOE_TAG_VENDOR 0x0105
131#define PPPOE_TAG_RELAYSID 0x0110
132#define PPPOE_TAG_SNAME_ERR 0x0201
133#define PPPOE_TAG_ACSYS_ERR 0x0202
134#define PPPOE_TAG_GENERIC_ERR 0x0203
136#define PPPOE_CODE_PADI 0x09
137#define PPPOE_CODE_PADO 0x07
138#define PPPOE_CODE_PADR 0x19
139#define PPPOE_CODE_PADS 0x65
140#define PPPOE_CODE_PADT 0xA7
142#ifndef PPPOE_MAX_AC_COOKIE_LEN
143#define PPPOE_MAX_AC_COOKIE_LEN 64
147 struct pppoe_softc *next;
148 struct netif *sc_ethif;
151 struct eth_addr sc_dest;
156 u8_t *sc_service_name;
157 u8_t *sc_concentrator_name;
159 u8_t sc_ac_cookie[PPPOE_MAX_AC_COOKIE_LEN];
160 u8_t sc_ac_cookie_len;
165 u8_t sc_padi_retried;
166 u8_t sc_padr_retried;
172ppp_pcb *pppoe_create(
struct netif *pppif,
174 const char *service_name,
const char *concentrator_name,
175 ppp_link_status_cb_fn link_status_cb,
void *ctx_cb);