lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Init - how to deal with static IP ?


From: Micael (abc)
Subject: [lwip-users] Init - how to deal with static IP ?
Date: Thu, 7 Jan 2010 10:27:44 +0100
User-agent: SquirrelMail/1.4.19

Hi Guys,

I have a problem with init of lwip, in conjunction with FreeRTOS.

The thing is that the example startup looks similar to this;

-------8<-------8<-------8<-------8<-------8<----
tcpip_init(NULL, NULL);

IP4_ADDR( &ip_address, 192,168,1,47 );
IP4_ADDR( &net_mask,255,255,255,0 );
IP4_ADDR( &gateway, 192,168,1,151 );

netif_add( &ether_if, &ip_address, &net_mask, &gateway, NULL, ethernetif_init, 
tcpip_input );
netif_set_default( &ether_if );
netif_set_up( &ether_if );
-------8<-------8<-------8<-------8<-------8<----

This is all (in the example code) done prior to OS has started.
Now the problem I have, is that if I want to get hold of the IP address 
(instead of hard coded
as above) of this node, I need to have the OS up and running.

So therefore, can I simply move the three netif_* lines later on, when the OS 
has started?
If so, what happens if a thread tries to open a connection (socket layer)? Will 
the stack give
appropriate (error) return codes on e.g. socket() and brothers.
OR do I need to protect the whole socket layer with some mutex or similar, 
until I have set-up
netif?


Cheers,
 Micael





reply via email to

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