2 * Redistribution and use in source and binary forms, with or without modification,
3 * are permitted provided that the following conditions are met:
5 * 1. Redistributions of source code must retain the above copyright notice,
6 * this list of conditions and the following disclaimer.
7 * 2. Redistributions in binary form must reproduce the above copyright notice,
8 * this list of conditions and the following disclaimer in the documentation
9 * and/or other materials provided with the distribution.
10 * 3. The name of the author may not be used to endorse or promote products
11 * derived from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
16 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
17 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
18 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
21 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
24 * This file is part of the lwIP TCP/IP stack.
31 #include "netif/ppp/ppp_opts.h"
33 #if LWIP_PPP_API /* don't build if not configured for use in lwipopts.h */
36 #include "lwip/netif.h"
37 #include "lwip/priv/tcpip_priv.h"
38 #include "netif/ppp/ppp.h"
40 #include "netif/ppp/pppos.h"
41 #endif /* PPPOS_SUPPORT */
47 struct pppapi_msg_msg {
52 ppp_notify_phase_cb_fn notify_phase_cb;
54 #endif /* PPP_NOTIFY_PHASE */
58 pppos_output_cb_fn output_cb;
59 ppp_link_status_cb_fn link_status_cb;
62 #endif /* PPPOS_SUPPORT */
67 const char *service_name;
68 const char *concentrator_name;
69 ppp_link_status_cb_fn link_status_cb;
72 #endif /* PPPOE_SUPPORT */
77 API_MSG_M_DEF_C(ip_addr_t, ipaddr);
79 #if PPPOL2TP_AUTH_SUPPORT
82 #endif /* PPPOL2TP_AUTH_SUPPORT */
83 ppp_link_status_cb_fn link_status_cb;
86 #endif /* PPPOL2TP_SUPPORT */
101 struct tcpip_api_call_data call;
102 struct pppapi_msg_msg msg;
105 /* API for application */
106 err_t pppapi_set_default(ppp_pcb *pcb);
108 err_t pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb);
109 #endif /* PPP_NOTIFY_PHASE */
111 ppp_pcb *pppapi_pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
112 #endif /* PPPOS_SUPPORT */
114 ppp_pcb *pppapi_pppoe_create(struct netif *pppif, struct netif *ethif, const char *service_name,
115 const char *concentrator_name, ppp_link_status_cb_fn link_status_cb,
117 #endif /* PPPOE_SUPPORT */
119 ppp_pcb *pppapi_pppol2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipaddr, u16_t port,
120 const u8_t *secret, u8_t secret_len,
121 ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
122 #endif /* PPPOL2TP_SUPPORT */
123 err_t pppapi_connect(ppp_pcb *pcb, u16_t holdoff);
125 err_t pppapi_listen(ppp_pcb *pcb);
126 #endif /* PPP_SERVER */
127 err_t pppapi_close(ppp_pcb *pcb, u8_t nocarrier);
128 err_t pppapi_free(ppp_pcb *pcb);
129 err_t pppapi_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg);
135 #endif /* LWIP_PPP_API */
137 #endif /* LWIP_PPPAPI_H */