From 8b9886bfe2ea8c2eab56fa58d050886b9665cd87 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 26 Jun 2016 21:59:25 +0200 Subject: [PATCH] PPP, documentation: rework client configuration vs server configuration Better describe what should be done for a client session and for a server session. --- doc/ppp.txt | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/doc/ppp.txt b/doc/ppp.txt index 43387c23..3dc8ad73 100644 --- a/doc/ppp.txt +++ b/doc/ppp.txt @@ -260,33 +260,28 @@ ppp = pppol2tp_create(&ppp_netif, ppp_link_status_cb_fn link_status_cb, void *ctx_cb); -/* - * PPP link configuration - * ====================== - */ - -/* Auth configuration, this is pretty self-explanatory */ -ppp_set_auth(ppp, PPPAUTHTYPE_ANY, "login", "password"); - -/* Set this interface as default route */ -ppp_set_default(ppp); - - /* * Initiate PPP client connection * ============================== */ +/* Set this interface as default route */ +ppp_set_default(ppp); + /* * Basic PPP client configuration. Can only be set if PPP session is in the * dead state (i.e. disconnected). We don't need to provide thread-safe * equivalents through PPPAPI because those helpers are only changing - * structure members. + * structure members while session is inactive for lwIP core. Configuration + * only need to be done once. */ /* Ask the peer for up to 2 DNS server addresses. */ ppp_set_usepeerdns(ppp, 1); +/* Auth configuration, this is pretty self-explanatory */ +ppp_set_auth(ppp, PPPAUTHTYPE_ANY, "login", "password"); + /* * Initiate PPP negotiation, without waiting (holdoff=0), can only be called * if PPP session is in the dead state (i.e. disconnected). @@ -304,7 +299,8 @@ ppp_connect(ppp, holdoff); * Basic PPP server configuration. Can only be set if PPP session is in the * dead state (i.e. disconnected). We don't need to provide thread-safe * equivalents through PPPAPI because those helpers are only changing - * structure members. + * structure members while session is inactive for lwIP core. Configuration + * only need to be done once. */ ip4_addr_t addr; @@ -324,6 +320,9 @@ ppp_set_ipcp_dnsaddr(ppp, 0, &addr); IP4_ADDR(&addr, 192,168,10,21); ppp_set_ipcp_dnsaddr(ppp, 1, &addr); +/* Auth configuration, this is pretty self-explanatory */ +ppp_set_auth(ppp, PPPAUTHTYPE_ANY, "login", "password"); + /* * Initiate PPP listener (i.e. wait for an incoming connection), can only * be called if PPP session is in the dead state (i.e. disconnected).