[lwip-users] ppp-new threading question

2014-08-29 Thread Ivan Delamer
I feel almost embarrassed asking this but I haven't completely figured 
it out yet.


In ppp-new, are packets sent to sio_write() from tcpip thread, or from 
the RX process thread? Or both?


I just ask because sio_write() may block for some time (at least in my 
basic implementation) and I'm wondering if this is blocking the rest of 
the stack.


Cheers
Ivan


___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users


[lwip-users] DHCP callback was removed - Correct way to obtain new address?

2014-08-29 Thread Chris Maier
Hi all, 
 
I am just porting my application from version 1.3.2 to the latest
1.4.2. and I was wondering why my application does not get called back
from the stack when the DHCP
 
As I found out the callback was removed. My application has to know the
address for displaying purposes, so do I have to poll for a new address?

 
What is the proper way to obtain a new address? 
 
Regards 
 
Chris 

 
DÜRR DENTAL AG 
Höpfigheimer Strasse 17 
74321 Bietigheim-Bissingen 
Deutschland / Germany 
Tel. + 49 (0) 7142 / 705-0 
Fax + 49 (0) 7142 / 705-500 
http://www.duerrdental.com
Join us on Facebook www.facebook.com/DuerrDentalAG  

Firmensitz / Registered Office: 
Höpfigheimer Str. 17, 74321 Bietigheim-Bissingen 
Handelsregister / Register of Commerce: Amtsgericht Stuttgart HRB 727006

Vorstand / Executive Board: Martin Dürrstein (Vorsitzender / CEO), Axel
Schramm 
Vorsitzender des Aufsichtsrates / Chairman of the Supervisory Board:
Joachim Loh 

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] DHCP callback was removed - Correct way to obtain new address?

2014-08-29 Thread Paul Webber
Chris,
I am using the TCP RAW. After starting DHCP I wait for the IP by using: 
While(main_netif.dchp-state != DHCP_BOUND). After the state changes to 
DHCP_BOUND the ip is in the pcb (main_netif.ip_addr). You can periodically 
check to see if the ip changes. I also include in the while statement a timer 
in case there is a DHCP problem.
Paul

From: lwip-users-bounces+pwebber=heat-timer@nongnu.org 
[mailto:lwip-users-bounces+pwebber=heat-timer@nongnu.org] On Behalf Of 
Chris Maier
Sent: Friday, August 29, 2014 10:33 AM
To: lwip-users@nongnu.org
Subject: [lwip-users] DHCP callback was removed - Correct way to obtain new 
address?

Hi all,

I am just porting my application from version 1.3.2 to the latest 1.4.2. and I 
was wondering why my application does not get called back from the stack when 
the DHCP

As I found out the callback was removed. My application has to know the address 
for displaying purposes, so do I have to poll for a new address?

What is the proper way to obtain a new address?

Regards

Chris


DÜRR DENTAL AG
Höpfigheimer Strasse 17
74321 Bietigheim-Bissingen Deutschland / Germany
Tel. + 49 (0) 7142 / 705-0
Fax + 49 (0) 7142 / 705-500
http://www.duerrdental.com
Join us on Facebook 
www.facebook.com/DuerrDentalAGhttp://www.facebook.com/DuerrDentalAG

Firmensitz / Registered Office: Höpfigheimer Str. 17, 74321 
Bietigheim-Bissingen Handelsregister / Register of Commerce: Amtsgericht 
Stuttgart HRB 727006

Vorstand / Executive Board: Martin Dürrstein (Vorsitzender / CEO), Axel Schramm 
Vorsitzender des Aufsichtsrates / Chairman of the Supervisory Board: Joachim Loh
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] DHCP callback was removed - Correct way to obtain new address?

2014-08-29 Thread Sergio R. Caprile
When I did it, I basically polled for
netif.dhcp-state == DHCP_BOUND
and read
ipaddr = netif.ip_addr;
netmask = netif.netmask;
gw = netif.gw;

but now I realize the dhcp code calls netif_set_up() when it reaches
that state, which also calls NETIF_STATUS_CALLBACK if
LWIP_NETIF_STATUS_CALLBACK is defined.

Now, I've been calling netif_set_up() before dhcp_start() cause I though
the ifc needed to be somehow up before UDP/IP would be sent through
it... looks like I was wrong and that was not necessary, or worse, not
correct.


___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users


Re: [lwip-users] ppp-new threading question

2014-08-29 Thread Sylvain Rochet
Hi Ivan,


On Fri, Aug 29, 2014 at 10:16:04AM -0600, Ivan Delamer wrote:
 I feel almost embarrassed asking this but I haven't completely
 figured it out yet.
 
 In ppp-new, are packets sent to sio_write() from tcpip thread, or
 from the RX process thread? Or both?

tcpip thread only.

(The stack owned RX process thread does not exist anymore, this was 
broken by design).


 I just ask because sio_write() may block for some time (at least in
 my basic implementation) and I'm wondering if this is blocking the
 rest of the stack.

Yes, it will, sio_write() should not block.


Sylvain


signature.asc
Description: Digital signature
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] ppp-new threading question

2014-08-29 Thread Ivan Delamer

Ok, that's what I thought. I will have to re-implement sio_write().

What I'm concerned also is, sio_write() is meant to block until all 
data is pushed out. This can be more than a second in a slow 9600bps 
connection (still used sometimes!!!). Will PPP try to do something 
during this time like try to re-send the packet or think it was lost? 
I'm not familiar with the internal ppp timer processes.


It also means more dynamic memory allocation since a reference to pbuf 
is not passed to sio_write().


Just thinking out loud I guess :-)

Cheers
Ivan



Date: Fri, 29 Aug 2014 22:29:17 +0200
From: Sylvain Rochet grada...@gradator.net
To: Mailing list for lwIP users lwip-users@nongnu.org
Subject: Re: [lwip-users] ppp-new threading question
Message-ID: 20140829202917.ga29...@gradator.net
Content-Type: text/plain; charset=utf-8

Hi Ivan,


On Fri, Aug 29, 2014 at 10:16:04AM -0600, Ivan Delamer wrote:

I feel almost embarrassed asking this but I haven't completely
figured it out yet.

In ppp-new, are packets sent to sio_write() from tcpip thread, or
from the RX process thread? Or both?


tcpip thread only.

(The stack owned RX process thread does not exist anymore, this was
broken by design).



I just ask because sio_write() may block for some time (at least in
my basic implementation) and I'm wondering if this is blocking the
rest of the stack.


Yes, it will, sio_write() should not block.


Sylvain


___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users


Re: [lwip-users] ppp-new threading question

2014-08-29 Thread Sylvain Rochet
Hi Ivan,


On Fri, Aug 29, 2014 at 02:38:11PM -0600, Ivan Delamer wrote:
 Ok, that's what I thought. I will have to re-implement sio_write().
 
 What I'm concerned also is, sio_write() is meant to block until all
 data is pushed out. This can be more than a second in a slow 9600bps
 connection (still used sometimes!!!). Will PPP try to do something
 during this time like try to re-send the packet or think it was
 lost? I'm not familiar with the internal ppp timer processes.

Packet is lost, in my opinion this is the TCP job (or application job in 
case of UDP or anything else) to retry. Dropping the packet if 
sio_write() is going to block (eg. buffer full) is the right thing to 
do. PPP only retries controls (LCP/IPCP/...) packets, with default 
timeouts long enough for any link speed. Input IP and IPv6 encapsulated 
in PPP packets are just decapsulated/deHDLCified and forwarded straight 
off to the lwIP stack, same for IP and IPv6 output packets.

I would have preferred an API which used pbuf instead of raw data, so 
that you can keep a ref on the pbuf while it is being sent over the 
serial link, therefore preventing the double buffering requirement, but 
I already changed the API too much ;-) ... and SIO API is also used for 
SLIP links.


 It also means more dynamic memory allocation since a reference to
 pbuf is not passed to sio_write().

Hey, you are reading my mind.


Sylvain


signature.asc
Description: Digital signature
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] DHCP callback was removed - Correct way to obtainnew address?

2014-08-29 Thread Noam weissman
Hi,

ST micro has an example on how to use it. Check their latest examples for 
STM32F4

Hope that helped,
Noam.


-Original Message-
From: lwip-users-bounces+noam=silrd@nongnu.org on behalf of Sergio R. 
Caprile
Sent: Fri 8/29/2014 9:02 PM
To: lwip-users@nongnu.org
Subject: Re: [lwip-users] DHCP callback was removed - Correct way to obtainnew 
address?
 
When I did it, I basically polled for
netif.dhcp-state == DHCP_BOUND
and read
ipaddr = netif.ip_addr;
netmask = netif.netmask;
gw = netif.gw;

but now I realize the dhcp code calls netif_set_up() when it reaches
that state, which also calls NETIF_STATUS_CALLBACK if
LWIP_NETIF_STATUS_CALLBACK is defined.

Now, I've been calling netif_set_up() before dhcp_start() cause I though
the ifc needed to be somehow up before UDP/IP would be sent through
it... looks like I was wrong and that was not necessary, or worse, not
correct.


___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

 
 

This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals  computer 
viruses.









This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals  computer 
viruses.




winmail.dat___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users