mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-15 20:56:51 +08:00
PPP: removed ppp_new(), merged with ppp_over_X_create()
The only benefit of ppp_new() call was about having a persistent netif interface. netif was moved out of PPP pcb so we don't need ppp_new() anymore, first step in simplifying the weird new/open/free/delete PPP API.
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#if LWIP_PPP_API /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/sys.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "netif/ppp/ppp.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -46,9 +47,6 @@ struct pppapi_msg_msg {
|
||||
int err;
|
||||
ppp_pcb *ppp;
|
||||
union {
|
||||
struct {
|
||||
struct netif *pppif;
|
||||
} pppnew;
|
||||
struct {
|
||||
u8_t authtype;
|
||||
const char *user;
|
||||
@@ -61,6 +59,7 @@ struct pppapi_msg_msg {
|
||||
#endif /* PPP_NOTIFY_PHASE */
|
||||
#if PPPOS_SUPPORT
|
||||
struct {
|
||||
struct netif *pppif;
|
||||
sio_fd_t fd;
|
||||
ppp_link_status_cb_fn link_status_cb;
|
||||
void *ctx_cb;
|
||||
@@ -68,6 +67,7 @@ struct pppapi_msg_msg {
|
||||
#endif /* PPPOS_SUPPORT */
|
||||
#if PPPOE_SUPPORT
|
||||
struct {
|
||||
struct netif *pppif;
|
||||
struct netif *ethif;
|
||||
const char *service_name;
|
||||
const char *concentrator_name;
|
||||
@@ -77,6 +77,7 @@ struct pppapi_msg_msg {
|
||||
#endif /* PPPOE_SUPPORT */
|
||||
#if PPPOL2TP_SUPPORT
|
||||
struct {
|
||||
struct netif *pppif;
|
||||
struct netif *netif;
|
||||
ip_addr_t *ipaddr;
|
||||
u16_t port;
|
||||
@@ -114,22 +115,21 @@ struct pppapi_msg {
|
||||
};
|
||||
|
||||
/* API for application */
|
||||
ppp_pcb *pppapi_new(struct netif *pppif);
|
||||
void pppapi_set_default(ppp_pcb *pcb);
|
||||
void pppapi_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd);
|
||||
#if PPP_NOTIFY_PHASE
|
||||
void pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb);
|
||||
#endif /* PPP_NOTIFY_PHASE */
|
||||
#if PPPOS_SUPPORT
|
||||
int pppapi_over_serial_create(ppp_pcb *pcb, sio_fd_t fd, ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
|
||||
ppp_pcb *pppapi_over_serial_create(struct netif *pppif, sio_fd_t fd, ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
|
||||
#endif /* PPPOS_SUPPORT */
|
||||
#if PPPOE_SUPPORT
|
||||
int pppapi_over_ethernet_create(ppp_pcb *pcb, struct netif *ethif, const char *service_name,
|
||||
ppp_pcb *pppapi_over_ethernet_create(struct netif *pppif, struct netif *ethif, const char *service_name,
|
||||
const char *concentrator_name, ppp_link_status_cb_fn link_status_cb,
|
||||
void *ctx_cb);
|
||||
#endif /* PPPOE_SUPPORT */
|
||||
#if PPPOL2TP_SUPPORT
|
||||
int pppapi_over_l2tp_create(ppp_pcb *pcb, struct netif *netif, ip_addr_t *ipaddr, u16_t port,
|
||||
ppp_pcb *pppapi_over_l2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipaddr, u16_t port,
|
||||
u8_t *secret, u8_t secret_len,
|
||||
ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
|
||||
#endif /* PPPOL2TP_SUPPORT */
|
||||
|
||||
@@ -469,17 +469,6 @@ struct ppp_pcb_s {
|
||||
*** PUBLIC FUNCTIONS ***
|
||||
************************/
|
||||
|
||||
/*
|
||||
* Create a new PPP session.
|
||||
*
|
||||
* This initializes the PPP control block but does not
|
||||
* attempt to negotiate the LCP session.
|
||||
*
|
||||
* Return a new PPP connection control block pointer
|
||||
* on success or a null pointer on failure.
|
||||
*/
|
||||
ppp_pcb *ppp_new(struct netif *pppif);
|
||||
|
||||
/*
|
||||
* Set a PPP interface as the default network interface
|
||||
* (used to output all packets for which no specific route is found).
|
||||
@@ -540,7 +529,7 @@ typedef void (*ppp_link_status_cb_fn)(ppp_pcb *pcb, int err_code, void *ctx);
|
||||
*
|
||||
* Return 0 on success, an error code on failure.
|
||||
*/
|
||||
int ppp_over_serial_create(ppp_pcb *pcb, sio_fd_t fd, ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
|
||||
ppp_pcb *ppp_over_serial_create(struct netif *pppif, sio_fd_t fd, ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
|
||||
#endif /* PPPOS_SUPPORT */
|
||||
|
||||
#if PPPOE_SUPPORT
|
||||
@@ -549,7 +538,7 @@ int ppp_over_serial_create(ppp_pcb *pcb, sio_fd_t fd, ppp_link_status_cb_fn link
|
||||
*
|
||||
* Return 0 on success, an error code on failure.
|
||||
*/
|
||||
int ppp_over_ethernet_create(ppp_pcb *pcb, struct netif *ethif, const char *service_name, const char *concentrator_name,
|
||||
ppp_pcb *ppp_over_ethernet_create(struct netif *pppif, struct netif *ethif, const char *service_name, const char *concentrator_name,
|
||||
ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
|
||||
#endif /* PPPOE_SUPPORT */
|
||||
|
||||
@@ -557,7 +546,7 @@ int ppp_over_ethernet_create(ppp_pcb *pcb, struct netif *ethif, const char *serv
|
||||
/*
|
||||
* Create a new PPP Over L2TP (PPPoL2TP) connection.
|
||||
*/
|
||||
int ppp_over_l2tp_create(ppp_pcb *pcb, struct netif *netif, ip_addr_t *ipaddr, u16_t port,
|
||||
ppp_pcb *ppp_over_l2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipaddr, u16_t port,
|
||||
u8_t *secret, u8_t secret_len,
|
||||
ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
|
||||
#endif /* PPPOL2TP_SUPPORT */
|
||||
|
||||
Reference in New Issue
Block a user