From 7857c222773d3342e61e394dd84fb0ab681e0780 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 8 Mar 2015 01:09:44 +0100 Subject: [PATCH] PPP, Documentation, updated --- doc/ppp.txt | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/ppp.txt b/doc/ppp.txt index 08aedd46..f5ffc0cd 100644 --- a/doc/ppp.txt +++ b/doc/ppp.txt @@ -69,20 +69,28 @@ struct netif ppp_netif; /* PPP status callback example */ static void status_cb(ppp_pcb *pcb, int err_code, void *ctx) { + struct netif *pppif = ppp_netif(pcb); LWIP_UNUSED_ARG(ctx); switch(err_code) { case PPPERR_NONE: { - struct ppp_addrs *ppp_addrs = ppp_addrs(pcb); +#if LWIP_DNS + ip_addr_t ns; +#endif /* LWIP_DNS */ printf("status_cb: Connected\n"); - printf(" our_ipaddr = %s\n", ip_ntoa(&ppp_addrs->our_ipaddr)); - printf(" his_ipaddr = %s\n", ip_ntoa(&ppp_addrs->his_ipaddr)); - printf(" netmask = %s\n", ip_ntoa(&ppp_addrs->netmask)); - printf(" dns1 = %s\n", ip_ntoa(&ppp_addrs->dns1)); - printf(" dns2 = %s\n", ip_ntoa(&ppp_addrs->dns2)); +#if PPP_IPV4_SUPPORT + printf(" our_ipaddr = %s\n", ip_ntoa(&pppif->ip_addr)); + printf(" his_ipaddr = %s\n", ip_ntoa(&pppif->gw)); + printf(" netmask = %s\n", ip_ntoa(&pppif->netmask)); +#if LWIP_DNS + ns = dns_getserver(0); + printf(" dns1 = %s\n", ip_ntoa(&ns)); + ns = dns_getserver(1); + printf(" dns2 = %s\n", ip_ntoa(&ns)); +#endif /* LWIP_DNS */ +#endif /* PPP_IPV4_SUPPORT */ #if PPP_IPV6_SUPPORT - printf(" our6_ipaddr = %s\n", ip6addr_ntoa(&ppp_addrs->our6_ipaddr)); - printf(" his6_ipaddr = %s\n", ip6addr_ntoa(&ppp_addrs->his6_ipaddr)); + printf(" our6_ipaddr = %s\n", ip6addr_ntoa(netif_ip6_addr(pppif, 0))); #endif /* PPP_IPV6_SUPPORT */ break; }