From ee2936ffbff7be254fe0473163ae2f1a4bf434e4 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Tue, 17 Feb 2015 22:51:35 +0100 Subject: [PATCH] PPP, all protocols, uniformised naming Uniformised fonction naming between and inside PPPoS, PPPoE, PPPoL2TP. --- src/api/pppapi.c | 36 ++++++++++++++++---------------- src/include/lwip/pppapi.h | 6 +++--- src/include/netif/ppp/pppoe.h | 8 +++---- src/include/netif/ppp/pppol2tp.h | 7 ++++--- src/include/netif/ppp/pppos.h | 4 ++-- src/netif/ppp/pppoe.c | 8 +++---- src/netif/ppp/pppol2tp.c | 7 ++++--- src/netif/ppp/pppos.c | 5 ++--- 8 files changed, 41 insertions(+), 40 deletions(-) diff --git a/src/api/pppapi.c b/src/api/pppapi.c index b1426c66..08e7508e 100644 --- a/src/api/pppapi.c +++ b/src/api/pppapi.c @@ -122,26 +122,26 @@ pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_pha #if PPPOS_SUPPORT /** - * Call ppp_over_serial_create() inside the tcpip_thread context. + * Call pppos_create() inside the tcpip_thread context. */ static void -pppapi_do_ppp_over_serial_create(struct pppapi_msg_msg *msg) +pppapi_do_pppos_create(struct pppapi_msg_msg *msg) { - msg->ppp = ppp_over_serial_create(msg->msg.serialcreate.pppif, msg->msg.serialcreate.fd, + msg->ppp = pppos_create(msg->msg.serialcreate.pppif, msg->msg.serialcreate.fd, msg->msg.serialcreate.link_status_cb, msg->msg.serialcreate.ctx_cb); TCPIP_PPPAPI_ACK(msg); } /** - * Call ppp_over_serial_create() in a thread-safe way by running that function inside the + * Call pppos_create() in a thread-safe way by running that function inside the * tcpip_thread context. */ ppp_pcb* -pppapi_over_serial_create(struct netif *pppif, sio_fd_t fd, ppp_link_status_cb_fn link_status_cb, +pppapi_pppos_create(struct netif *pppif, sio_fd_t fd, ppp_link_status_cb_fn link_status_cb, void *ctx_cb) { struct pppapi_msg msg; - msg.function = pppapi_do_ppp_over_serial_create; + msg.function = pppapi_do_pppos_create; msg.msg.msg.serialcreate.pppif = pppif; msg.msg.msg.serialcreate.fd = fd; msg.msg.msg.serialcreate.link_status_cb = link_status_cb; @@ -154,29 +154,29 @@ pppapi_over_serial_create(struct netif *pppif, sio_fd_t fd, ppp_link_status_cb_f #if PPPOE_SUPPORT /** - * Call ppp_over_ethernet_create() inside the tcpip_thread context. + * Call pppoe_create() inside the tcpip_thread context. */ static void -pppapi_do_ppp_over_ethernet_create(struct pppapi_msg_msg *msg) +pppapi_do_pppoe_create(struct pppapi_msg_msg *msg) { - msg->ppp = ppp_over_ethernet_create(msg->msg.ethernetcreate.pppif, msg->msg.ethernetcreate.ethif, + msg->ppp = pppoe_create(msg->msg.ethernetcreate.pppif, msg->msg.ethernetcreate.ethif, msg->msg.ethernetcreate.service_name, msg->msg.ethernetcreate.concentrator_name, msg->msg.ethernetcreate.link_status_cb, msg->msg.ethernetcreate.ctx_cb); TCPIP_PPPAPI_ACK(msg); } /** - * Call ppp_over_ethernet_create() in a thread-safe way by running that function inside the + * Call pppoe_create() in a thread-safe way by running that function inside the * tcpip_thread context. */ ppp_pcb* -pppapi_over_ethernet_create(struct netif *pppif, struct netif *ethif, const char *service_name, +pppapi_pppoe_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) { struct pppapi_msg msg; - msg.function = pppapi_do_ppp_over_ethernet_create; + msg.function = pppapi_do_pppoe_create; msg.msg.msg.ethernetcreate.pppif = pppif; msg.msg.msg.ethernetcreate.ethif = ethif; msg.msg.msg.ethernetcreate.service_name = service_name; @@ -191,12 +191,12 @@ pppapi_over_ethernet_create(struct netif *pppif, struct netif *ethif, const char #if PPPOL2TP_SUPPORT /** - * Call ppp_over_l2tp_create() inside the tcpip_thread context. + * Call pppol2tp_create() inside the tcpip_thread context. */ static void -pppapi_do_ppp_over_l2tp_create(struct pppapi_msg_msg *msg) +pppapi_do_pppol2tp_create(struct pppapi_msg_msg *msg) { - msg->ppp = ppp_over_l2tp_create(msg->msg.l2tpcreate.pppif, + msg->ppp = pppol2tp_create(msg->msg.l2tpcreate.pppif, msg->msg.l2tpcreate.netif, msg->msg.l2tpcreate.ipaddr, msg->msg.l2tpcreate.port, #if PPPOL2TP_AUTH_SUPPORT msg->msg.l2tpcreate.secret, @@ -209,16 +209,16 @@ pppapi_do_ppp_over_l2tp_create(struct pppapi_msg_msg *msg) } /** - * Call ppp_over_l2tp_create() in a thread-safe way by running that function inside the + * Call pppol2tp_create() in a thread-safe way by running that function inside the * tcpip_thread context. */ ppp_pcb* -pppapi_over_l2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipaddr, u16_t port, +pppapi_pppol2tp_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) { struct pppapi_msg msg; - msg.function = pppapi_do_ppp_over_l2tp_create; + msg.function = pppapi_do_pppol2tp_create; msg.msg.msg.l2tpcreate.pppif = pppif; msg.msg.msg.l2tpcreate.netif = netif; msg.msg.msg.l2tpcreate.ipaddr = ipaddr; diff --git a/src/include/lwip/pppapi.h b/src/include/lwip/pppapi.h index 98a44bd9..aed14c6b 100644 --- a/src/include/lwip/pppapi.h +++ b/src/include/lwip/pppapi.h @@ -121,15 +121,15 @@ void pppapi_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char * void pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb); #endif /* PPP_NOTIFY_PHASE */ #if PPPOS_SUPPORT -ppp_pcb *pppapi_over_serial_create(struct netif *pppif, sio_fd_t fd, ppp_link_status_cb_fn link_status_cb, void *ctx_cb); +ppp_pcb *pppapi_pppos_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 -ppp_pcb *pppapi_over_ethernet_create(struct netif *pppif, struct netif *ethif, const char *service_name, +ppp_pcb *pppapi_pppoe_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 -ppp_pcb *pppapi_over_l2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipaddr, u16_t port, +ppp_pcb *pppapi_pppol2tp_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 */ diff --git a/src/include/netif/ppp/pppoe.h b/src/include/netif/ppp/pppoe.h index b61d0d1e..802a62d1 100644 --- a/src/include/netif/ppp/pppoe.h +++ b/src/include/netif/ppp/pppoe.h @@ -162,10 +162,10 @@ struct pppoe_softc { #define pppoe_init() /* compatibility define, no initialization needed */ -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); +ppp_pcb *pppoe_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); void pppoe_disc_input(struct netif *netif, struct pbuf *p); void pppoe_data_input(struct netif *netif, struct pbuf *p); diff --git a/src/include/netif/ppp/pppol2tp.h b/src/include/netif/ppp/pppol2tp.h index df1f6725..df57c189 100644 --- a/src/include/netif/ppp/pppol2tp.h +++ b/src/include/netif/ppp/pppol2tp.h @@ -192,9 +192,10 @@ struct pppol2tp_pcb_s { /* Create a new L2TP session. */ -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); +ppp_pcb *pppol2tp_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_H_ */ #endif /* PPP_SUPPORT && PPPOL2TP_SUPPORT */ diff --git a/src/include/netif/ppp/pppos.h b/src/include/netif/ppp/pppos.h index 5c91d3a5..62d11acf 100644 --- a/src/include/netif/ppp/pppos.h +++ b/src/include/netif/ppp/pppos.h @@ -90,8 +90,8 @@ struct pppos_pcb_s { }; /* Create a new PPPoS session. */ -ppp_pcb *ppp_over_serial_create(struct netif *pppif, sio_fd_t fd, - ppp_link_status_cb_fn link_status_cb, void *ctx_cb); +ppp_pcb *pppos_create(struct netif *pppif, sio_fd_t fd, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb); /* PPP over Serial: this is the input function to be called for received data. */ void pppos_input(ppp_pcb *ppp, u_char* data, int len); diff --git a/src/netif/ppp/pppoe.c b/src/netif/ppp/pppoe.c index 01c1a69d..60200e1e 100644 --- a/src/netif/ppp/pppoe.c +++ b/src/netif/ppp/pppoe.c @@ -153,10 +153,10 @@ static struct pppoe_softc *pppoe_softc_list; * * Return 0 on success, an error code on failure. */ -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) +ppp_pcb *pppoe_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) { ppp_pcb *ppp; struct pppoe_softc *sc; diff --git a/src/netif/ppp/pppol2tp.c b/src/netif/ppp/pppol2tp.c index 948ff31b..26af09be 100644 --- a/src/netif/ppp/pppol2tp.c +++ b/src/netif/ppp/pppol2tp.c @@ -99,9 +99,10 @@ static err_t pppol2tp_xmit(pppol2tp_pcb *l2tp, struct pbuf *pb); /* Create a new L2TP session. */ -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) { +ppp_pcb *pppol2tp_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) { ppp_pcb *ppp; pppol2tp_pcb *l2tp; struct udp_pcb *udp; diff --git a/src/netif/ppp/pppos.c b/src/netif/ppp/pppos.c index d86af1be..a826f2cc 100644 --- a/src/netif/ppp/pppos.c +++ b/src/netif/ppp/pppos.c @@ -148,9 +148,8 @@ static pppos_pcb *pppos_pcb_list; * * Return 0 on success, an error code on failure. */ -ppp_pcb * -ppp_over_serial_create(struct netif *pppif, sio_fd_t fd, - ppp_link_status_cb_fn link_status_cb, void *ctx_cb) +ppp_pcb *pppos_create(struct netif *pppif, sio_fd_t fd, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb) { pppos_pcb *pppos; ppp_pcb *ppp;