mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-05 08:28:32 +00:00
PPP, Documentation, updated
This commit is contained in:
parent
b3c7e948be
commit
7857c22277
24
doc/ppp.txt
24
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user