lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] PPP and ethernet, getting the IP and DNS addresses


From: Paul Archer
Subject: Re: [lwip-users] PPP and ethernet, getting the IP and DNS addresses
Date: Mon, 29 Nov 2010 23:52:52 +1100

Sweet, thanks for the response Yoav.

I'll try these out tomorrow.
I have set the pppOverSerialOpen() callback.

This would explain why I am seeing this callback called twice, one
with the null argument that I pass in, and one (from your comment) it
would seem with the struct ppp_addrs *.

I'll try this for the PPP path.

I have not finished writing the net interface driver the ethernet side
yet, so ill try that in a few of days.

Regards Paul

On Mon, Nov 29, 2010 at 8:40 PM, Yoav Nissim <address@hidden> wrote:
>
>
> Hi Paul,
>
> I've used a similar configuration.
>
>
> lwIP provides you with 2 DNS server addresses by default.
>
> You can change them using dns_setserver() defined in dns.h [If I am not
> mistaken the default DNS server is resolver1.opendns.com.]
>
>
> As for getting interface information:
>
> I do not use DHCP with ethernet interfaces, but I believe you can get
> that information by setting the status callback
> (*netif_set_status_callback). It is called whenever your interface is
> brought up or down.
>
> You should set the callback in your netif_init function (the one you
> provide to netif_add / netifapi_netif_add)
>
>
> As for PPP, I know of two methods:
>
> 1. PPP allows you to set a status callback for its internal netif -
> ppp_set_netif_statuscallback(). It should be called when your PPP
> connection is up, though I have not used it.
>
> 2. If you call pppOverSerialOpen you can provide a link_status callback,
> which provides an error code and a void * arg. When PPP is connected,
> you can cast the arg into a struct ppp_addrs* which contains the PPP
> link IP addresses, netmask, and one or two PPP-provided DNS server
> addresses. (note that these PPP IP addresses are probably NOT your
> actual IP address as seen by internet servers)
>
>
> Another problem is that the ppp code that sets the dns servers is
> remarked out (in ipcp.c - search for "pppGotDNSAddrs"). You can replace
> it with the following:
>
>
> if (ppp_settings.usepeerdns) {
>         if (go->dnsaddr[0])
>            dns_setserver(0, (struct ip_addr*)&go->dnsaddr[0]);
>          if (go->dnsaddr[1])
>            dns_setserver(1, (struct ip_addr*)&go->dnsaddr[1]);
> }
>
>
> HTH.
>
>
>
> On 29/11/2010 6:37, Paul Archer wrote:
>
>> Hi all,
>>
>> I am running lwIP with two interfaces, 1 over PPP and the other over 
>> Ethernet.
>>
>> Most probably both interfaces will run with automatic address
>> assignment (IPCP over PPP and DHCP over Ethernet).
>>
>> Is there an API in lwIP to find out what IP address and DNS addresses
>> I am given for these two interfaces? I had a look on the wiki and
>> google and I didn't come up with anything.
>>
>>
>>
>
>



-- 
----
Regards
Paul Archer
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]