44#if LWIP_MPU_COMPATIBLE
48#define PPPAPI_VAR_REF(name) API_VAR_REF(name)
49#define PPPAPI_VAR_DECLARE(name) API_VAR_DECLARE(struct pppapi_msg, name)
50#define PPPAPI_VAR_ALLOC(name) API_VAR_ALLOC_POOL(struct pppapi_msg, PPPAPI_MSG, name, ERR_MEM)
51#define PPPAPI_VAR_ALLOC_RETURN_NULL(name) API_VAR_ALLOC_POOL(struct pppapi_msg, PPPAPI_MSG, name, NULL)
52#define PPPAPI_VAR_FREE(name) API_VAR_FREE_POOL(PPPAPI_MSG, name)
62 struct pppapi_msg *
msg = (
struct pppapi_msg *)(
void*)
m;
64 ppp_set_default(
msg->msg.ppp);
73pppapi_set_default(ppp_pcb *pcb)
76 PPPAPI_VAR_DECLARE(
msg);
77 PPPAPI_VAR_ALLOC(
msg);
79 PPPAPI_VAR_REF(
msg).msg.ppp = pcb;
95 struct pppapi_msg *
msg = (
struct pppapi_msg *)(
void*)
m;
97 ppp_set_notify_phase_callback(
msg->msg.ppp,
msg->msg.msg.setnotifyphasecb.notify_phase_cb);
106pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb)
109 PPPAPI_VAR_DECLARE(
msg);
110 PPPAPI_VAR_ALLOC(
msg);
112 PPPAPI_VAR_REF(
msg).msg.ppp = pcb;
113 PPPAPI_VAR_REF(
msg).msg.msg.setnotifyphasecb.notify_phase_cb = notify_phase_cb;
115 PPPAPI_VAR_FREE(
msg);
130 struct pppapi_msg *
msg = (
struct pppapi_msg *)(
void*)
m;
132 msg->msg.ppp = pppos_create(
msg->msg.msg.serialcreate.pppif,
msg->msg.msg.serialcreate.output_cb,
133 msg->msg.msg.serialcreate.link_status_cb,
msg->msg.msg.serialcreate.ctx_cb);
142pppapi_pppos_create(
struct netif *pppif, pppos_output_cb_fn output_cb,
143 ppp_link_status_cb_fn link_status_cb,
void *ctx_cb)
146 PPPAPI_VAR_DECLARE(
msg);
147 PPPAPI_VAR_ALLOC_RETURN_NULL(
msg);
149 PPPAPI_VAR_REF(
msg).msg.ppp =
NULL;
150 PPPAPI_VAR_REF(
msg).msg.msg.serialcreate.pppif = pppif;
151 PPPAPI_VAR_REF(
msg).msg.msg.serialcreate.output_cb = output_cb;
152 PPPAPI_VAR_REF(
msg).msg.msg.serialcreate.link_status_cb = link_status_cb;
153 PPPAPI_VAR_REF(
msg).msg.msg.serialcreate.ctx_cb = ctx_cb;
156 PPPAPI_VAR_FREE(
msg);
171 struct pppapi_msg *
msg = (
struct pppapi_msg *)(
void*)
m;
173 msg->msg.ppp = pppoe_create(
msg->msg.msg.ethernetcreate.pppif,
msg->msg.msg.ethernetcreate.ethif,
174 msg->msg.msg.ethernetcreate.service_name,
msg->msg.msg.ethernetcreate.concentrator_name,
175 msg->msg.msg.ethernetcreate.link_status_cb,
msg->msg.msg.ethernetcreate.ctx_cb);
185 const char *concentrator_name, ppp_link_status_cb_fn link_status_cb,
189 PPPAPI_VAR_DECLARE(
msg);
190 PPPAPI_VAR_ALLOC_RETURN_NULL(
msg);
192 PPPAPI_VAR_REF(
msg).msg.ppp =
NULL;
193 PPPAPI_VAR_REF(
msg).msg.msg.ethernetcreate.pppif = pppif;
194 PPPAPI_VAR_REF(
msg).msg.msg.ethernetcreate.ethif = ethif;
195 PPPAPI_VAR_REF(
msg).msg.msg.ethernetcreate.service_name =
service_name;
196 PPPAPI_VAR_REF(
msg).msg.msg.ethernetcreate.concentrator_name = concentrator_name;
197 PPPAPI_VAR_REF(
msg).msg.msg.ethernetcreate.link_status_cb = link_status_cb;
198 PPPAPI_VAR_REF(
msg).msg.msg.ethernetcreate.ctx_cb = ctx_cb;
201 PPPAPI_VAR_FREE(
msg);
216 struct pppapi_msg *
msg = (
struct pppapi_msg *)(
void*)
m;
218 msg->msg.ppp = pppol2tp_create(
msg->msg.msg.l2tpcreate.pppif,
219 msg->msg.msg.l2tpcreate.netif,
API_EXPR_REF(
msg->msg.msg.l2tpcreate.ipaddr),
msg->msg.msg.l2tpcreate.port,
221 msg->msg.msg.l2tpcreate.secret,
222 msg->msg.msg.l2tpcreate.secret_len,
227 msg->msg.msg.l2tpcreate.link_status_cb,
msg->msg.msg.l2tpcreate.ctx_cb);
238 ppp_link_status_cb_fn link_status_cb,
void *ctx_cb)
241 PPPAPI_VAR_DECLARE(
msg);
242 PPPAPI_VAR_ALLOC_RETURN_NULL(
msg);
243#if !PPPOL2TP_AUTH_SUPPORT
248 PPPAPI_VAR_REF(
msg).msg.ppp =
NULL;
249 PPPAPI_VAR_REF(
msg).msg.msg.l2tpcreate.pppif = pppif;
250 PPPAPI_VAR_REF(
msg).msg.msg.l2tpcreate.netif =
netif;
251 PPPAPI_VAR_REF(
msg).msg.msg.l2tpcreate.ipaddr = PPPAPI_VAR_REF(ipaddr);
252 PPPAPI_VAR_REF(
msg).msg.msg.l2tpcreate.port =
port;
253#if PPPOL2TP_AUTH_SUPPORT
254 PPPAPI_VAR_REF(
msg).msg.msg.l2tpcreate.secret =
secret;
255 PPPAPI_VAR_REF(
msg).msg.msg.l2tpcreate.secret_len = secret_len;
257 PPPAPI_VAR_REF(
msg).msg.msg.l2tpcreate.link_status_cb = link_status_cb;
258 PPPAPI_VAR_REF(
msg).msg.msg.l2tpcreate.ctx_cb = ctx_cb;
261 PPPAPI_VAR_FREE(
msg);
275 struct pppapi_msg *
msg = (
struct pppapi_msg *)(
void*)
m;
277 return ppp_connect(
msg->msg.ppp,
msg->msg.msg.connect.holdoff);
285pppapi_connect(ppp_pcb *pcb,
u16_t holdoff)
288 PPPAPI_VAR_DECLARE(
msg);
289 PPPAPI_VAR_ALLOC(
msg);
291 PPPAPI_VAR_REF(
msg).msg.ppp = pcb;
292 PPPAPI_VAR_REF(
msg).msg.msg.connect.holdoff = holdoff;
294 PPPAPI_VAR_FREE(
msg);
308 struct pppapi_msg *
msg = (
struct pppapi_msg *)(
void*)
m;
310 return ppp_listen(
msg->msg.ppp);
318pppapi_listen(ppp_pcb *pcb)
321 PPPAPI_VAR_DECLARE(
msg);
322 PPPAPI_VAR_ALLOC(
msg);
324 PPPAPI_VAR_REF(
msg).msg.ppp = pcb;
326 PPPAPI_VAR_FREE(
msg);
340 struct pppapi_msg *
msg = (
struct pppapi_msg *)(
void*)
m;
342 return ppp_close(
msg->msg.ppp,
msg->msg.msg.close.nocarrier);
350pppapi_close(ppp_pcb *pcb,
u8_t nocarrier)
353 PPPAPI_VAR_DECLARE(
msg);
354 PPPAPI_VAR_ALLOC(
msg);
356 PPPAPI_VAR_REF(
msg).msg.ppp = pcb;
357 PPPAPI_VAR_REF(
msg).msg.msg.close.nocarrier = nocarrier;
359 PPPAPI_VAR_FREE(
msg);
372 struct pppapi_msg *
msg = (
struct pppapi_msg *)(
void*)
m;
374 return ppp_free(
msg->msg.ppp);
382pppapi_free(ppp_pcb *pcb)
385 PPPAPI_VAR_DECLARE(
msg);
386 PPPAPI_VAR_ALLOC(
msg);
388 PPPAPI_VAR_REF(
msg).msg.ppp = pcb;
390 PPPAPI_VAR_FREE(
msg);
403 struct pppapi_msg *
msg = (
struct pppapi_msg *)(
void*)
m;
405 return ppp_ioctl(
msg->msg.ppp,
msg->msg.msg.ioctl.cmd,
msg->msg.msg.ioctl.arg);
413pppapi_ioctl(ppp_pcb *pcb,
u8_t cmd,
void *
arg)
416 PPPAPI_VAR_DECLARE(
msg);
417 PPPAPI_VAR_ALLOC(
msg);
419 PPPAPI_VAR_REF(
msg).msg.ppp = pcb;
420 PPPAPI_VAR_REF(
msg).msg.msg.ioctl.cmd =
cmd;
421 PPPAPI_VAR_REF(
msg).msg.msg.ioctl.arg =
arg;
423 PPPAPI_VAR_FREE(
msg);
static char service_name[100]
#define LWIP_UNUSED_ARG(x)
#define LWIP_MEMPOOL_DECLARE(name, num, size, desc)
static DATA_BLOB CRYPTPROTECT_PROMPTSTRUCT DATA_BLOB *static LPWSTR DATA_BLOB CRYPTPROTECT_PROMPTSTRUCT DATA_BLOB *static char secret[]
#define PPPOL2TP_AUTH_SUPPORT
err_t tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call)
#define API_EXPR_REF(expr)