Akshat Bisht wrote: > Hello, > > How to set the IP address when using PPP? i initialize PPP using pppInit > and then call pppOpen, but where do i set the IP address?
Normally it's expected to be set by the remote end - you would usually expect the lwIP end to be a client. But if you do need to set it yourself, it's not something set by a config option. I _think_ you do it by setting: ipcp_wantoptions[0].ouraddr to the IP address wanted straight _after_ calling pppInit, and before calling pppOpen. The '0' assumes that you only have one PPP device, but you may want to change this accordingly if you have more than one). The ipcp_wantoptions is of type struct ipcp_options, which you can see in src/netif/ppp/ipcp.h Note the address in there is network byte order. Alternatively, you can just hack it into src/netif/ppp/ipcp.c:ipcp_init(). Change this line: wo->ouraddr = 0; to something like: wo->ouraddr = htonl( (172<<24) | (16<<16) | (1<<8) | 1 ); to for example set to 172.16.1.1 At a guess anyway - I haven't tried it. Jifl -- eCosCentric Limited http://www.eCosCentric.com/ The eCos experts Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No 4422071. ------["Si fractum non sit, noli id reficere"]------ Opinions==mine _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
