inner T | 2 May 2009 05:31
Picon
Favicon

Re: How to handle the passive FIN when waiting (inner T)

> On Wed, 2009-04-29 at 10:00 +0800, inner T wrote:
>> Thanks for your reply
>> 
>> 
>> I have tryed this, but if get passive close when lwip_recv() suspend
>> the Client thread, it did not return zero but keep suspend at
>> sys_arch_mbox_fetch(). 
>> lwip_recv() can return zero only when the connection is not
>> established.
>
> That is not what is supposed to happen: if you have blocked in lwip_recv
> () and the other end closes the connection lwip_recv() should return
> zero immediately.
>
> Kieran

I traced the code but did not find where the lwip send the message to make lwip_recv() goon,
I set some breakpoint after sys_arch_mbox_fetch() but no one reached. 

Can you tell me in the code, where does the lwip send message to lwip_recv()? It may help me
fix this problem.

好玩贺卡等你发,邮箱贺卡全新上线!
_______________________________________________
lwip-users mailing list
lwip-users@...
http://lists.nongnu.org/mailman/listinfo/lwip-users
HM2 | 3 May 2009 14:33
Picon
Favicon

Input function for RAW

I'm a little confused as to what the actual input function needs to be for
RAW in 1.3.
The possible choices seem to be:

- ip_input()
- ethernetif_input()
- raw_input()
- ethernet_input()

What is the correct input function to use?

Regards, Chris.
Picon
Picon

Re: Input function for RAW

HM2 wrote:
> I'm a little confused as to what the actual input function needs to be for
> RAW in 1.3.
> The possible choices seem to be:
>
> - ip_input()
>   
Input function for packets starting with IP header
> - ethernetif_input()
>   
Private input helper function for the example ethernetif (you couldn't 
even use that since it a) does not compile and b) it is declared static!)
> - raw_input()
>   
Input function for packets starting *after* IP header (raw!)
> - ethernet_input()
>   
Input function for packets starting with ethernet header.

The only new function to 1.3.0 is ethernet_input, which implements the 
ethernet-protocol handling (plus ARP) in the tcpip_thread (which was 
previously done elsewhere).

The correct function to use depends on your interface: if you are using 
ethernet, pass the complete received packet to ethernet_input, if you 
use PPP, pass the packet starting with the IP header to ip_input.

There are some example ports in the contrib module that also show this...

Simon
Timmy Brolin | 3 May 2009 23:01
Picon
Favicon

Re: 2 different network number

I think there is some confusion about exactly what you want to do, and
why you want to do it?

Regards,
Timmy Brolin

Bandu wrote:
> Hi All,
>  
> thank you very much for you answer.
>  
> Is that mean in LWIP, we need a small routing table ?
>  
> thanks.
>
> On Thu, Apr 30, 2009 at 3:51 PM, Bernhard Wiegel
> <bernhard.wiegel@...
<mailto:bernhard.wiegel@...>> wrote:
>
>     Hello all,
>
>     0.0.0.0 will not work at all!
>
>     The purpose of the netmask is the separation of the host and the
>     network part of the IP-adress.
>
>     Lets make an example: Netmaske 255.255.255.0, IP 192.168.1.23
>     All leading ones of the netmask  -> adress of the subnet  the
>     machine is located. -> subnet: 192.168.1
>     The host can be identified with the zeros of the netmask. -> the
>     host part is 23
>
>     So the netmask really determines the number of hsts within your
>     subnet.
>     Do you have more than 253 hosts in your netmask that you need
>     something different than 255.255.255.0 ?
>
>     Regards,
>     Bernhard
>
>
>     Eric Haver schrieb:
>
>         "0.0.0.0"....That sounds like something reserved.
>
>         On Thu, Apr 30, 2009 at 8:11 AM, Bandu <m.bandu@...
>         <mailto:m.bandu@...> <mailto:m.bandu@...
>         <mailto:m.bandu@...>>> wrote:
>
>            I think that's a good idea.
>            How about if i use 0.0.0.0 mask?
>            On Thu, Apr 30, 2009 at 12:46 PM, Eric Haver
>         <havereric1@... <mailto:havereric1@...>
>            <mailto:havereric1@...
>         <mailto:havereric1@...>>> wrote:
>
>
>
>                On Thu, Apr 30, 2009 at 7:39 AM, Bandu
>         <m.bandu@... <mailto:m.bandu@...>
>                <mailto:m.bandu@... <mailto:m.bandu@...>>>
>         wrote:
>
>                    Is there anyway that I can achieve that?
>
>                A subnet mask of ff.ff.fe.00 would do that, or am I
>         barking up
>                a different tree?
>
>                *E
>
>
>                _______________________________________________
>                lwip-users mailing list
>                lwip-users@... <mailto:lwip-users@...>
>         <mailto:lwip-users@... <mailto:lwip-users@...>>
>
>                http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
>
>
>            --    Bandu
>            m.bandu@... <mailto:m.bandu@...>
>         <mailto:m.bandu@... <mailto:m.bandu@...>>
>
>            _______________________________________________
>            lwip-users mailing list
>            lwip-users@... <mailto:lwip-users@...>
>         <mailto:lwip-users@... <mailto:lwip-users@...>>
>
>            http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
>         ------------------------------------------------------------------------
>
>
>
>         _______________________________________________
>         lwip-users mailing list
>         lwip-users@... <mailto:lwip-users@...>
>         http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
>
>     -- 
>     Dipl-Ing Bernhard Wiegel
>
>     Universität Ulm - Ulm University
>     Institut für Organisation und Management von Informationssystemen
>     (OMI) - Institute for Information Resource Management
>
>     Albert-Einstein-Allee 43
>     89081 Ulm, Germany Tel: +49 731 - 50 28788
>     Fax: +49 731 - 50 28789
>     E-Mail: bernhard.wiegel@...
>     <mailto:bernhard.wiegel@...>
>
>
>
>
>     _______________________________________________
>     lwip-users mailing list
>     lwip-users@... <mailto:lwip-users@...>
>     http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
>
>
> -- 
> Bandu
> m.bandu@... <mailto:m.bandu@...>
> ------------------------------------------------------------------------
>
> _______________________________________________
> lwip-users mailing list
> lwip-users@...
> http://lists.nongnu.org/mailman/listinfo/lwip-users
Deepak Gopalakrishnan | 4 May 2009 06:42
Favicon

lwip on linux(ubuntu 8.04)


Im having 3 doubts:
first one:
Im tryig to run the simhost application provided in the contrib/ports/unix/proj/unixsim
When i run the application this is the following response i get:
Host at <some address> mask <some address> gateway <some address>
System initialized.
TCP/IP initialized.
Applications started.

im pretty much new to networking and im not sure how to test if simhost is working properly.

second doubt:
Another thing what i noticed is that each time i run the simhost application, the HWaddr gets changed. Is that the way it should work or do i have to set the MAC address. If so, where should i set it. Im setting my ip address, gateway and net mask addres in the simhost.c file

third doubt:
even though i set the address properly in simhost.c, while running the application the address are getting interchanged ie ipaddress displayed is the gateway address set in the code.
Regards,
Deepak Gopalakrishnan

_______________________________________________
lwip-users mailing list
lwip-users@...
http://lists.nongnu.org/mailman/listinfo/lwip-users
Deepak Gopalakrishnan | 4 May 2009 08:27
Favicon

lwip on linux(ubuntu 8.04)


While trying to compare the ports (provided in contrib) for unix and win32, i found that the following files were not present in unix port:
lwippools.h
pktdrv.c
pktdrv.h
pktif.c
pktif.h
test.c

On inspecting the code, i found that the functions defined in pktif.c have similarity to the functions defined in tapif.c and etherneif.c.
But could not do the same with the functions in pktdrv.c.
What all modifications should i make so that i have something similar for unix port or are these defined  under some other name.?
Also, is there any test.c file available for unix port similar to the one in win32?

Regards,
Deepak Gopalakrishnan
_______________________________________________
lwip-users mailing list
lwip-users@...
http://lists.nongnu.org/mailman/listinfo/lwip-users
Simon Goldschmidt | 4 May 2009 08:54
Picon
Picon

Re: lwip on linux(ubuntu 8.04)


> While trying to compare the ports (provided in contrib) for unix and 
> win32, i found that the following files were not present in unix port:
> lwippools.h

This file is only needed if mem_malloc uses the memp pools, which is not the case for the unix port. The win32
port can be set to that option, thus it needs the file.

> pktdrv.c
> pktdrv.h
> pktif.c
> pktif.h

The win32 port uses the pcap library (known from wireshark, for example), while the unix port uses some
other mechanism to get on the wire (I think tapif or something). Indeed, pktif.c is ethernetif.c adapted
to the pcap library, while pktdrv.c contains the actual code to interface the pcap library (used by pktif.c).

> test.c

This is the entry file (containing the main() function and some initialization). The unix port has a
similar file (though named differently) which does about the same.

> What all modifications should i make so that i have something similar for 
> unix port or are these defined  under some other name.?

The unix port should already work like it is, you don't need to adapt anything, you only might have configure
something to get it working. Unfortunately, I cannot help you there: I tried the unix port myself one time
and found getting the network interface to work quite hard (compared to the windows port which kind of just
works after installing pcap and configuring the MAC/IP addresses in the header file).

> Also, is there any test.c file available for unix port similar to the one 
> in win32?

As I said above, this is the main entry file which the unix port also has (under a different name).

Simon
--

-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a
Deepak Gopalakrishnan | 4 May 2009 13:52
Favicon

Re: lwip on linux(ubuntu 8.04)


yes as you have mentioned there is a entry file for the examples provided for
unix port.
contrib/ports/unix/proj/unixsim/simhost.c

but im not sure how to use this application. 
i tried the ping option provided but this is the response i got..
Using <some addr1> to ping
Host at <some addr2> mask <some addr3> gateway <some addr4>
System initialized
TCP/IP initializes
sending ping
Applications started

How can i find out if this is working?
yes im breaking my head to find out where the MAC address is being set cause
im getting a new MAC address each time i run this application...did you find
a solution to get around this problem..?

--

-- 
View this message in context: http://www.nabble.com/lwip-on-linux%28ubuntu-8.04%29-tp23363680p23366704.html
Sent from the lwip-users mailing list archive at Nabble.com.
Mathias Zenger | 4 May 2009 13:58

NTP on lwIP

Hi

You already gave me many valuable hints to my questions. Thanks a lot! Now I
have a new one which hopefully someone can answer:

I asked the technical support from ATMEL if it's possible to obtain a time
stamp for a NTP packet at the time it was received (e.g. in the receive
interrupt routine). The answer was simply that NTP was supported by lwIP by
default. Is this true? I have never read anything about this and think that
it's unlikely that NTP belongs to the standard stack...

Regards, Mathias
Jeff Barber | 4 May 2009 15:17
Picon

Re: lwip on linux(ubuntu 8.04)

The MAC address you're seeing is being created by the kernel tap
interface each time you bring simhost up.  If this is your machine
before you run simhost (use a fixed width font for best results):

 ------------------
 | Linux host     |
 |                |
 |          eth0 [|--------- (Your existing network interface)
 |                |
 |                |
 ------------------

This is what it looks like afterward (logically that is; in reality
the simulated lwip host is actually a process running inside your
linux machine):

 ------------------
 | Linux host     |
 |                |
 |          eth0 [|--------- (Your existing network interface)
 |                |
 |                |        ---------------
 |          tap0 [|--------| (simulated) |
 |                |        |  lwip host  |
 ------------------        |             |
                           ---------------

tap0 has the "gateway" address you specified on the simhost command
line (192.168.0.1 by default), the primary IP address specified is the
address of the simulated lwip host (192.168.0.2 by default).

If you use the "-p xx.xx.xx.xx" option, you're pinging out from within
the lwip host.  So the only thing you can really ping is the tap0
"gateway" address (although due to linux idiosyncrasies, it also lets
you ping local interface addresses like the one attached to eth0).

Several things you can try:
Bring up the simhost program (as root).  (For example, "sudo ./simhost")
Then from another shell window, you can ping the lwip simulation with
"ping 192.168.0.2".
You can also telnet to it with "telnet 192.168.0.2" (note that you do
not get a bash shell, you get a limited shell implemented entirely
within the 'fake' lwip host).
Finally, if you have a web browser, you can connect to
http://192.168.0.2 which connects you to the web server implemented
inside the lwip host.

Jeff

On Mon, May 4, 2009 at 7:52 AM, Deepak Gopalakrishnan
<Deepak.Gopalakrishnan@...> wrote:
>
> yes as you have mentioned there is a entry file for the examples provided for
> unix port.
> contrib/ports/unix/proj/unixsim/simhost.c
>
> but im not sure how to use this application.
> i tried the ping option provided but this is the response i got..
> Using <some addr1> to ping
> Host at <some addr2> mask <some addr3> gateway <some addr4>
> System initialized
> TCP/IP initializes
> sending ping
> Applications started
>
> How can i find out if this is working?
> yes im breaking my head to find out where the MAC address is being set cause
> im getting a new MAC address each time i run this application...did you find
> a solution to get around this problem..?
>
> --
> View this message in context: http://www.nabble.com/lwip-on-linux%28ubuntu-8.04%29-tp23363680p23366704.html
> Sent from the lwip-users mailing list archive at Nabble.com.
>
>
>
> _______________________________________________
> lwip-users mailing list
> lwip-users@...
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>

Gmane