Re: [lwip-users] restarting a connection with the raw api

2011-09-02 Thread goldsi...@gmx.de
Kieran Mansley wrote: 3) Then call tcp_connect() - this will either succeed and call the connected callback passed to tcp_connect, or fail and call the error callback specified by tcp_err() - if the error callback is called because of a timeout I think you could immediately call tcp_connect()

Re: [lwip-users] restarting a connection with the raw api

2011-09-02 Thread Kieran Mansley
On Thu, 2011-09-01 at 16:09 -0400, Richie Bonventre wrote: > I was wondering if anyone knew of any examples using the tcp raw api > that involved closing and restarting the connection (specifically as > the client using tcp_connect), as well as properly handling a > tcp_connect() timeout so that it

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread ake . forslund
Thanks for the advice, I seem to have gotten it right when I wrote the code. I use tcpip_input() for handling input, so that part should be safe. I'll go through my calls into lwip and add protection. Thank you for your help and clarification. Best regards /Åke - Åk

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread Simon Goldschmidt
ake.forsl...@nibe.se wrote: > So protection around my calls it is, but I don't quite see how RX and TX > can be handled in the same thread since the TX-function is registered with > lwip in the netif-structure and RX isn't. By using tcpip_input() as the input function. This passes received pack

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread ake . forslund
Ok I clearly can't read my own code anymore. I do use it but inside the drivers _input()-function so I'm still at a loss how I'm supposed to handle RX and TX in the same thread... I'll try to be more coherent next time Thanks for all the help /Åke - Åke Forslund 04

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread ake . forslund
Ok, I now I get it. So protection around my calls it is, but I don't quite see how RX and TX can be handled in the same thread since the TX-function is registered with lwip in the netif-structure and RX isn't. OK I see now that there is an input-pointer in the netif-structure as well but it's

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread Simon Goldschmidt
ake.forsl...@nibe.se wrote: > I'm not quite sure what you're suggesting. Is it to put all calls that may > change states of netif, dhcp etc. in a single thread or is it the use of a > separate thread to handle RX, or something else? I'm just repeating the mantra that lwIP core code is not thread p

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread ake . forslund
I'm not quite sure what you're suggesting. Is it to put all calls that may change states of netif, dhcp etc. in a single thread or is it the use of a separate thread to handle RX, or something else? - Åke Forslund 0433-273296 NIBE AB Box 14 S-285 21 Markaryd Tel +46-

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread Simon Goldschmidt
ake.forsl...@nibe.se wrote: > Thanks for the tip. set_link_up/down looks pretty safe to use from my > rx-thread (rx handled by a separate thread triggered by eth-interrupt). Is > it the callback that need to be protected from threding issues? Even if it is now, it is only so by chance and you sh

[lwip-users] restarting a connection with the raw api

2011-09-02 Thread Richie Bonventre
I was wondering if anyone knew of any examples using the tcp raw api that involved closing and restarting the connection (specifically as the client using tcp_connect), as well as properly handling a tcp_connect() timeout so that it keeps trying until it successfully gets a connection. When in that

Re: [lwip-users] LwIP TCP reset, sequence number bug?

2011-09-02 Thread Matias Mandell
On 9/2/11 1:45 PM, Simon Goldschmidt wrote: I'm really sorry that I bother you by sending a personal email but you seem to be involved in the LwIP development and this is such a small bug. Nevertheless, I'm not the only developer/user, and others might be interested in this, too, so please

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread ake . forslund
Thanks for the tip. set_link_up/down looks pretty safe to use from my rx-thread (rx handled by a separate thread triggered by eth-interrupt). Is it the callback that need to be protected from threding issues? /Åke - Åke Forslund 0433-273296 NIBE AB Box 14 S-285 21 Ma

Re: [lwip-users] DHCP works but ping doesn't reply

2011-09-02 Thread Simon Goldschmidt
Kieran Mansley wrote: > On Thu, 2011-09-01 at 23:52 +, vincent cui wrote: > > > > It is possible to realize PING command base on Lwip ? > > Yes. My god, there's even an example app for this in the contrib module, please look at what we provide as examples (or else we wouldn't need them)!

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread Simon Goldschmidt
Kieran Mansley wrote: > An: lwip-users@nongnu.org > Betreff: Re: [lwip-users] how lwip know internet cable is unplug > On Fri, 2011-09-02 at 05:26 +, vincent cui wrote: > > When unplug internet cable, how lwip deal it ? > > It doesn't. Whether the link is up or not is of no real interest t

Re: [lwip-users] DHCP works but ping doesn't reply

2011-09-02 Thread Kieran Mansley
On Thu, 2011-09-01 at 23:52 +, vincent cui wrote: > > It is possible to realize PING command base on Lwip ? Yes. Kieran ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread Kieran Mansley
On Fri, 2011-09-02 at 05:26 +, vincent cui wrote: > When unplug internet cable, how lwip deal it ? It doesn't. Whether the link is up or not is of no real interest to a TCP/IP stack. It will just try to send packets, and the lower layers (e.g. the driver you're using) have to deal with the l

Re: [lwip-users] LwIP TCP reset, sequence number bug?

2011-09-02 Thread Simon Goldschmidt
Matias Mandell wrote: > I'm really sorry that I bother you by sending a personal email but > you seem to be involved in the LwIP development and this is such a > small > bug. Nevertheless, I'm not the only developer/user, and others might be interested in this, too, so please always

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread Stephane Lesage
> When unplug internet cable, how lwip deal it ? I want to show message > to user in LCD to notice user ! Hi, Here's what I do (NOSYS=0) In my PHY driver init: bfphy_msg = tcpip_callbackmsg_new(bfphy_interrupt_callback, netif); In the interrupt: tcpip_trycallback(bfphy_msg); In the callback, e

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread vincent cui
Simon: I will try to play chargen.c and chargen.h., the readme show that test it by telnet ip 19 and see pattern in screen, But it is only one connection . how to test 5 or 10 muli-connection ? 锘?Vincent Cui Sr.Firmware Engineer Mobile: +8613482482211 Tel: +86 21 34612525x6104 Fax: +86 21 34619

Re: [lwip-users] FreeRTOS / lwip multiple connections

2011-09-02 Thread vincent cui
Thank you 锘?Vincent Cui Sr.Firmware Engineer Mobile: +8613482482211 Tel: +86 21 34612525x6104 Fax: +86 21 34619770 E-Mail: vincent@enlogic.com Shanghai EnLogic Electric Technology Co., Ltd. Address: 1104-1106, Building A, No.391, Guiping Road, Xuhui District, Shanghai, 200233 http://www.enl

Re: [lwip-users] FreeRTOS / lwip multiple connections

2011-09-02 Thread FreeRTOS Info
On 02/09/2011 01:12, vincent cui wrote: > HI : > > I want to create a semaphore (value is 10) to deal with max connection . but > freertos only provide mutex and binary semaphore... > Is there other way to come it true ? Yes. http://www.freertos.org/CreateCounting.html Regards, Richard. + h

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread vincent cui
Simon:' Good, it is easy to deal with. Thank you very much. 锘?Vincent Cui Sr.Firmware Engineer Mobile: +8613482482211 Tel: +86 21 34612525x6104 Fax: +86 21 34619770 E-Mail: vincent@enlogic.com Shanghai EnLogic Electric Technology Co., Ltd. Address: 1104-1106, Building A, No.391, Guiping Roa

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread Simon Goldschmidt
ake.forsl...@nibe.se wrote: > Maybe it should be > handled with the netif_set_up/down-functions Nearly: it should call netif_set_link_up/down (watch out for threading issues!), which in turn calls user-specified callbacks. This has to be enabled using a define (I think it's turned off by defaul

[lwip-users] lwip unix port IPv6 patch 2

2011-09-02 Thread Rahul Gundecha
Hi all, Please find the patch uploaded at below link which calls netif_create_ip6_linklocal_address() after a interface is added. Its of lwip unix port. This tested my FC11 machine, it works fine. Link local address is set using MAC address and ping from Linux interface works fine. https://savanna

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread vincent cui
Dear: I define a semaphore used to send signal to tell upper app….the semaphore is controlled by ethernet driver.. Vincent Cui Sr.Firmware Engineer Mobile: +8613482482211 Tel: +86 21 34612525x6104 Fax: +86 21 34619770 E-Mail: vincent@enlogic.com Shanghai EnLo

Re: [lwip-users] how lwip know internet cable is unplug

2011-09-02 Thread ake . forslund
Hi! I think that is something you define in your ethernet driver. My approach is to send a signal to a separate task to handle the cable-plug/unplug events. In the task I currently disable dhcp (if active) on cable-unplug signal and reenable it on cable-connect. it might be good to set an auto