Re: [lwip-users] PPP server problem

2015-05-05 Thread LMao
Yes, it works now.

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Tuesday, May 05, 2015 8:52 AM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] PPP server problem

Hello Charles,

On Tue, May 05, 2015 at 11:45:41AM +, l...@moog.com wrote:
> Hi Sylvain,
> 
> Thanks for your help. Yes, you're right. I was using the wrong PPPoS 
> input path. I should have used pppos_input_tcpip() instead of
> pppos_input() in my circumstance.

Does it work now ?

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


Re: [lwip-users] PPP server problem

2015-05-05 Thread LMao
Hi Sylvain,

Thanks for your help. Yes, you're right. I was using the wrong PPPoS input 
path. I should have used pppos_input_tcpip() instead of pppos_input() in my 
circumstance. 

Regards,

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Monday, May 04, 2015 4:41 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] PPP server problem

Hi,


On Mon, May 04, 2015 at 07:31:52PM +, l...@moog.com wrote:
> Hi Sylvain,
> 
> NO_SYS = 0. I am using freeRTOS.

You didn't answer fully, which PPPoS input path are you using ?  There are 3 of 
them and only one of them is right for NO_SYS = 0.


> I increased both main lwIP thread and my PPP application thread stack 
> size from 200 to 500 and problem not solved. The message after 
> enabling PRINTPKT_SUPPORT is as following:
> 
> ppp phase changed[1]: phase=0..
> ppp_listen[1]..
> ppp phase changed[1]: phase=1..
> pppos_listen: unit 1: listening..
> ppp_start[1]..
> pppos_send_config[1]: in_accm=FF FF FF FF..
> ppp_send_config[1]..
> pppos_recv_config[1]: in_accm=FF FF FF FF..
> ppp_recv_config[1]..
> ppp_start[1]: finished..
> pppos_input[1]: got 1 bytes..
> pppos_input[1]: got 9 bytes..
> pppos_input[1]: got 8 bytes..
> pppos_input[1]: got 9 bytes..
> pppos_input[1]: got 5 bytes..
> pppos_input[1]: got 3 bytes..
> pppos_input[1]: got 1 bytes..
> pppos_input[1]: got 9 bytes..
> pppos_input[1]: got 1 bytes..
> rcvd [LCP ConfReq id=0x1]..
> ppp: auth protocols: PAP=1 CHAP=0 CHAP_MD5=0 CHAP_MS=0 CHAP_MS2=0 EAP=0..
> sent [LCP ConfReq id=0x1 
> ]..
> pppos_write[1]: len=28..
> sent [LCP ConfAck id=0x1]..
> pppos_write[1]: len=24..
> pppos_input[1]: got 20 bytes..
> pppos_input[1]: got 20 bytes..
> pppos_input[1]: got 20 bytes..
> rcvd [LCP ConfAck id=0x1 
> ]..
> pppos_send_config[1]: in_accm=0 0 0 0..
> ppp_send_config[1]..
> pppos_recv_config[1]: in_accm=0 0 0 0..
> ppp_recv_config[1]..
> pppos_write[1]: len=12..
> ppp phase changed[1]: phase=5..
> pppos_input[1]: got 20 bytes..
> pppos_write[1]: len=12..
> pppos_input[1]: got 16 by

Why is the last message truncated ? Are you buffering debug print ? If 
yes, could you remove the buffering so we may have the latest output ?


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


Re: [lwip-users] PPP server problem

2015-05-04 Thread LMao
Hi Sylvain,

NO_SYS = 0. I am using freeRTOS. I increased both main lwIP thread and my PPP 
application thread stack size from 200 to 500 and problem not solved. The 
message after enabling PRINTPKT_SUPPORT is as following: 

ppp phase changed[1]: phase=0..
ppp_listen[1]..
ppp phase changed[1]: phase=1..
pppos_listen: unit 1: listening..
ppp_start[1]..
pppos_send_config[1]: in_accm=FF FF FF FF..
ppp_send_config[1]..
pppos_recv_config[1]: in_accm=FF FF FF FF..
ppp_recv_config[1]..
ppp_start[1]: finished..
pppos_input[1]: got 1 bytes..
pppos_input[1]: got 9 bytes..
pppos_input[1]: got 8 bytes..
pppos_input[1]: got 9 bytes..
pppos_input[1]: got 5 bytes..
pppos_input[1]: got 3 bytes..
pppos_input[1]: got 1 bytes..
pppos_input[1]: got 9 bytes..
pppos_input[1]: got 1 bytes..
rcvd [LCP ConfReq id=0x1]..
ppp: auth protocols: PAP=1 CHAP=0 CHAP_MD5=0 CHAP_MS=0 CHAP_MS2=0 EAP=0..
sent [LCP ConfReq id=0x1 
]..
pppos_write[1]: len=28..
sent [LCP ConfAck id=0x1]..
pppos_write[1]: len=24..
pppos_input[1]: got 20 bytes..
pppos_input[1]: got 20 bytes..
pppos_input[1]: got 20 bytes..
rcvd [LCP ConfAck id=0x1 
]..
pppos_send_config[1]: in_accm=0 0 0 0..
ppp_send_config[1]..
pppos_recv_config[1]: in_accm=0 0 0 0..
ppp_recv_config[1]..
pppos_write[1]: len=12..
ppp phase changed[1]: phase=5..
pppos_input[1]: got 20 bytes..
pppos_write[1]: len=12..
pppos_input[1]: got 16 by

Thanks,

Charles





-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Monday, May 04, 2015 3:48 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] PPP server problem

Hi Charles,


On Mon, May 04, 2015 at 06:16:54PM +, l...@moog.com wrote:
> Hi Sylvain,
> 
> I try to use PPP server on AT91SAM7x chip and it failed authentication 
> (both sides using PAP). Here's the debug message from a Linux (PPP
> client) followed by lwIP PPP debug message. Interesting thing is the 
> PPP authentication failure also causes the whole lwIP stack stop 
> working. I continuously PING my Ethernet interface while I start the 
> PPP client on Linux, after a while, the PING stopped and never come 
> back.

Looks like something is wrong in your SIO port… or you don't have enough 
stack ?   PPP stack requirement is pretty huge, but for PAP it should be 
rather low.

Which PPPoS input method are you using ?  NO_SYS ?



> Could you take a look at those messages and tell me what could be 
> wrong?

PPP_SERVER support if fairly new, but humm, it should work.


> (...)
> ppp_send_config[1]..
> pppos_recv_config[1]: in_accm=0 0 0 0..
> (...)

Above anything else, please enable PRINTPKT_SUPPORT in lwIP.


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

[lwip-users] PPP server problem

2015-05-04 Thread LMao
Hi Sylvain,

I try to use PPP server on AT91SAM7x chip and it failed authentication (both 
sides using PAP). Here's the debug message from a Linux (PPP client) followed 
by lwIP PPP debug message. Interesting thing is the PPP authentication failure 
also causes the whole lwIP stack stop working. I continuously PING my Ethernet 
interface while I start the PPP client on Linux, after a while, the PING 
stopped and never come back.

Could you take a look at those messages and tell me what could be wrong?

Thanks,

Charles



Linux (PPP client) debug message:

cm@cm-ppp:/etc/ppp$ sudo pppd /dev/ttyS0 nodetach
using channel 5
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS0
sent [LCP ConfReq id=0x1]
sent [LCP ConfReq id=0x1]
sent [LCP ConfReq id=0x1]
rcvd [LCP ConfReq id=0x1 
]
sent [LCP ConfAck id=0x1 
]
rcvd [LCP ConfAck id=0x1]
sent [LCP EchoReq id=0x0 magic=0x15fea63a]
sent [PAP AuthReq id=0x1 user="test" password="test"]
rcvd [LCP EchoReq id=0x0 magic=0xeefa19da]
sent [LCP EchoRep id=0x0 magic=0x15fea63a]
rcvd [LCP EchoRep id=0x0 magic=0xeefa19da]
sent [PAP AuthReq id=0x2 user="test" password="test"]
sent [PAP AuthReq id=0x3 user="test" password="test"]
sent [PAP AuthReq id=0x4 user="test" password="test"]
sent [PAP AuthReq id=0x5 user="test" password="test"]
sent [PAP AuthReq id=0x6 user="test" password="test"]
sent [PAP AuthReq id=0x7 user="test" password="test"]
sent [PAP AuthReq id=0x8 user="test" password="test"]
sent [PAP AuthReq id=0x9 user="test" password="test"]
sent [PAP AuthReq id=0xa user="test" password="test"]
sent [LCP EchoReq id=0x1 magic=0x15fea63a]
No response to PAP authenticate-requests
sent [LCP TermReq id=0x2 "Failed to authenticate ourselves to peer"]
sent [LCP TermReq id=0x3 "Failed to authenticate ourselves to peer"]
Connection terminated.
Modem hangup
cm@cm-ppp:/etc/ppp$


lwIP PPP debug message:

ppp phase changed[1]: phase=0..
ppp_listen[1]..
ppp phase changed[1]: phase=1..
pppos_listen: unit 1: listening..
ppp_start[1]..
pppos_send_config[1]: in_accm=FF FF FF FF..
ppp_send_config[1]..
pppos_recv_config[1]: in_accm=FF FF FF FF..
ppp_recv_config[1]..
ppp_start[1]: finished..
pppos_input[1]: got 20 bytes..
pppos_input[1]: got 20 bytes..
pppos_input[1]: got 7 bytes..
ppp: auth protocols: PAP=1 CHAP=0 CHAP_MD5=0 CHAP_MS=0 CHAP_MS2=0 EAP=0..
pppos_write[1]: len=28..
pppos_write[1]: len=24..
pppos_input[1]: got 1 bytes..
pppos_input[1]: got 3 bytes..
pppos_input[1]: got 4 bytes..
pppos_input[1]: got 4 bytes..
pppos_input[1]: got 6 bytes..
pppos_input[1]: got 17 bytes..
pppos_input[1]: got 6 bytes..
pppos_input[1]: got 2 bytes..
pppos_input[1]: got 4 bytes..
pppos_input[1]: got 3 bytes..
pppos_input[1]: got 8 bytes..
pppos_send_config[1]: in_accm=0 0 0 0..
ppp_send_config[1]..
pppos_recv_config[1]: in_accm=0 0 0 0..
ppp_recv_config[1]..
pppos_write[1]: len=12..
ppp phase changed[


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

Re: [lwip-users] ppp-new IP forwarding only works one direction (Ethernet to PPP)

2014-04-15 Thread LMao
Sylvain,

I observed similar messages. I think VJ is in effect in my test.

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Monday, April 14, 2014 10:19 AM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] ppp-new IP forwarding only works one direction 
(Ethernet to PPP)

Hello Charles,


On Mon, Apr 14, 2014 at 01:05:07PM +, l...@moog.com wrote:
> Hi Sylvain,
> 
> I applied the patch and it seems everything is working. However, I 
> don't know much about VJ support, so I don't know if the PPP server 
> and my gateway device have actually negotiated to use VJ at all.
> Please tell me how to check VJ is in effect. Is there any specific 
> debug options for VJ ?

pppd negotiate VJ by default unless novj option is set.

pppd debug display the VJ negotiation, for example:

Apr 12 01:55:14 ornithopter pppd[990]: rcvd [IPCP ConfAck id=0x1  ] Apr 12 01:55:14 ornithopter pppd[990]: sent [IPCP 
ConfAck id=0x2
]


> I did set VJ_SUPPORT to 1 in lwipopts.h, is there anything else need 
> be set up?

That should be enough, as long as your PPP server accept VJ.


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


Re: [lwip-users] ppp-new IP forwarding only works one direction (Ethernet to PPP)

2014-04-14 Thread LMao
Hi Sylvain,

I applied the patch and it seems everything is working. However, I don't know 
much about VJ support, 
so I don't know if the PPP server and my gateway device have actually 
negotiated to use VJ at all.
Please tell me how to check VJ is in effect. Is there any specific debug 
options for VJ?
I did set VJ_SUPPORT to 1 in lwipopts.h, is there anything else need be set up?

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Saturday, April 12, 2014 3:03 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] ppp-new IP forwarding only works one direction 
(Ethernet to PPP)

Hello Charles,

On Sat, Apr 12, 2014 at 01:29:33AM +0200, Sylvain Rochet wrote:
> 
> Finally, here we are… Hey!, since you have the setup to check IP 
> forwarding could you check IP forwarding with VJ support enabled ? :)

Humm, I should have added that you must update your Git repository before 
testing.

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

Re: [lwip-users] ppp-new IP forwarding only works one direction (Ethernet to PPP)

2014-04-11 Thread LMao
Sylvain,

Great, the latest patch works. Thank you very much.

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Friday, April 11, 2014 2:01 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] ppp-new IP forwarding only works one direction 
(Ethernet to PPP)

Hello Charles,


On Fri, Apr 11, 2014 at 12:13:02PM +, l...@moog.com wrote:
> Sylvain,
> 
> I applied the new patch, but the following statement always cause Data 
> Abort exception run-time error. No matter I set ETH_PAD_SIZE to 0 or 
> 2. The good thing is my compiler doesn't generate any error message 
> for the new patch.
> 
> *((ppp_pcb**)payload) = pcb;

Yeah, of course, there is an alignment problem here, pbuf->payload might be 
unaligned, here is a new patch with an helper packed struct which should fix 
the issue.

It was fine with a PBUF_RAW because the pointer was put deliberately in front 
of the buffer, buffer which was allocated on alignment by lwIP.

You don't need to set ETH_PAD_SIZE, this is not necessary.


> Another thing I am not so sure is the macro PPP_USE_PBUF_RAM. I always 
> set it to 1 in lwipopts.h, but I think the default is set to 0 in 
> opt.h. Am I doing the right thing?

Yes!, if you have a heap PPP_USE_PBUF_RAM is the option you should use, it 
allows you to use a smaller PBUF_POOL_BUFSIZE.


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


Re: [lwip-users] ppp-new IP forwarding only works one direction (Ethernet to PPP)

2014-04-11 Thread LMao
Sylvain,

I applied the new patch, but the following statement always cause Data Abort 
exception run-time error. No matter I set ETH_PAD_SIZE to 0 or 2. The good 
thing is my compiler doesn't generate any error message for the new patch.
*((ppp_pcb**)payload) = pcb;

Another thing I am not so sure is the macro PPP_USE_PBUF_RAM. I always set it 
to 1 in lwipopts.h, but I think the default is set to 0 in opt.h. Am I doing 
the right thing?

Thanks,

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Thursday, April 10, 2014 6:15 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] ppp-new IP forwarding only works one direction 
(Ethernet to PPP)

Hello Charles,


On Thu, Apr 10, 2014 at 08:03:13PM +, l...@moog.com wrote:
> Hi Sylvain,
> 
> Good news, I got it work with your patch

Yeah, happy to hear that.

Here is another patch, which should fix the issue in a way that can be pushed 
to the repository, would you test it ?


> plus the replacement of (PBUF_LINK_HLEN +2), however, set ETH_PAD_SIZE 
> to 2 actually doesn't work. It seems fail at ARP and infinitely repeat 
> with the following debug messages:

Humm, this is strange, using ETH_PAD_SIZE should work.


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


Re: [lwip-users] ppp-new IP forwarding only works one direction (Ethernet to PPP)

2014-04-10 Thread LMao
Hi Sylvain,

Good news, I got it work  with your patch plus the replacement of 
(PBUF_LINK_HLEN +2), however, set ETH_PAD_SIZE to 2 actually doesn't work. It 
seems fail at ARP and infinitely repeat with the following debug messages:

ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:c8:d7:19:ee:1f:fc, type:806
etharp_update_arp_entry: 192.168.0.211 - c8:d7:19:ee:1f:fc
etharp_find_entry: found empty entry 0
etharp_find_entry: no empty entry found and not allowed to recycle
etharp_arp_input: incoming ARP request
etharp_arp_input: ARP request was not for us.
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:c8:d7:19:ee:1f:fc, type:806
etharp_update_arp_entry: 192.168.0.211 - c8:d7:19:ee:1f:fc
etharp_find_entry: found empty entry 0
etharp_find_entry: no empty entry found and not allowed to recycle
etharp_arp_input: incoming ARP request
etharp_arp_input: ARP request was not for us.
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:c8:d7:19:ee:1f:fc, type:806
etharp_update_arp_entry: 192.168.0.211 - c8:d7:19:ee:1f:fc
etharp_find_entry: found empty entry 0
etharp_find_entry: no empty entry found and not allowed to recycle
etharp_arp_input: incoming ARP request
etharp_arp_input: ARP request was not for us.

The reason I originally found it didn't work because I forgot to set the 
default route in my Linux PPP server. Now we need a more elegant way to fix the 
problem. 

Thanks,

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Thursday, April 10, 2014 3:49 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] ppp-new IP forwarding only works one direction 
(Ethernet to PPP)

Hello Charles,

On Thu, Apr 10, 2014 at 06:37:02PM +, l...@moog.com wrote:
> Below is more debug information and hope it's helpful for fixing the problem.
> 
> Regarding the code stalled at early stage, that's hardware related. I 
> am using ARM7 (AT91SAM7 to be specific), so the data alignment is 4 
> and PBUF_LINK_HLEN is 14 by default, so I replaced all PBUF_LINK_HLEN 
> in the patch with (PBUF_LINK_HLEN + 2). It fixed the run-time problem 
> which keep the code running fine. Now I can build-up the PPP 
> connection. However, the patch seems fix the pbuf issue but it 
> actually breaks the traffic from Ethernet to PPP side which was fine 
> before the patch. If you need me do any test, please let me know.

Humm, you should set ETH_PAD_SIZE to 2 in your lwipopts.h instead of doing that.

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


Re: [lwip-users] ppp-new IP forwarding only works one direction (Ethernet to PPP)

2014-04-10 Thread LMao
Below is more debug information and hope it's helpful for fixing the problem.

Regarding the code stalled at early stage, that's hardware related. I am using 
ARM7 (AT91SAM7 to be specific), so the data alignment is 4 and PBUF_LINK_HLEN 
is 14 by default, so I replaced all PBUF_LINK_HLEN in the patch with 
(PBUF_LINK_HLEN + 2). It fixed the run-time problem which keep the code running 
fine. Now I can build-up the PPP connection. However, the patch seems fix the 
pbuf issue but it actually breaks the traffic from Ethernet to PPP side which 
was fine before the patch. If you need me do any test, please let me know.

etharp_timer
etharp_timer
ethernet_input: dest:00:bd:33:06:68:22, src:c8:d7:19:ee:1f:fc, type:800
ip_input: iphdr->dest 0x6901a8c0 netif->ip_addr 0x3200a8c0 (0x1a8c0, 0xa8c0, 
0x6900)
ip_input: iphdr->dest 0x6901a8c0 netif->ip_addr 0x6901a8c0 (0x6901a8c0, 
0x6901a8c0, 0x0)
ip_input: packet accepted on interface pp
ip_input: 
IP header:
+---+
| 4 | 5 |  0x00 |60 | (v, hl, tos, len)
+---+
| 3897  |000|   0   | (id, flags, offset)
+---+
|  128  |1  |0xa7fb | (ttl, proto, chksum)
+---+
|  192  |  168  |0  |  211  | (src)
+---+
|  192  |  168  |1  |  105  | (dest)
+---+
ip_input: p->len 60 p->tot_len 60
ip_output_if: em0
IP header:
+---+
| 4 | 5 |  0x00 |60 | (v, hl, tos, len)
+---+
| 3897  |000|   0   | (id, flags, offset)
+---+
|  255  |1  |0x28fb | (ttl, proto, chksum)
+---+
|  192  |  168  |1  |  105  | (src)
+---+
|  192  |  168  |0  |  211  | (dest)
+---+
netif->output()
etharp_send_ip: sending packet 0020d520
etharp_timer
etharp_timer
etharp_timer
etharp_timer
etharp_timer
etharp_timer
ethernet_input: dest:00:bd:33:06:68:22, src:c8:d7:19:ee:1f:fc, type:800
ip_input: iphdr->dest 0x6a01a8c0 netif->ip_addr 0x3200a8c0 (0x1a8c0, 0xa8c0, 
0x6a00)
ip_input: iphdr->dest 0x6a01a8c0 netif->ip_addr 0x6901a8c0 (0x6a01a8c0, 
0x6901a8c0, 0x0)
ip_input: packet not for us.
ip_forward: forward packets to interface.pp
ip_forward: forwarding packet to 192.168.1.106
etharp_timer
etharp_timer
etharp_timer
etharp_timer
etharp_timer
etharp_timer
etharp_timer
etharp_timer
ethernet_input: dest:00:bd:33:06:68:22, src:c8:d7:19:ee:1f:fc, type:800
ip_input: iphdr->dest 0x6a01a8c0 netif->ip_addr 0x3200a8c0 (0x1a8c0, 0xa8c0, 
0x6a00)
ip_input: iphdr->dest 0x6a01a8c0 netif->ip_addr 0x6901a8c0 (0x6a01a8c0, 
0x6901a8c0, 0x0)
ip_input: packet not for us.
ip_forward: forward packets to interface.pp
ip_forward: forwarding packet to 192.168.1.106
etharp_timer
etharp_timer



Thanks,

Charles



-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of l...@moog.com
Sent: Thursday, April 10, 2014 2:30 PM
To: lwip-users@nongnu.org
Subject: Re: [lwip-users] ppp-new IP forwarding only works one direction 
(Ethernet to PPP)

Sylvain,

It seems the patch makes things worse - PPP connection couldn’t build-up 
anymore. Below is the complete log message after applying the patch. It seems 
the code stalled at very early stage. 

*** FreeRTOS Demo Started! ***

netif_set_ipaddr: netif addrnetif: IP address of interface  set to 0.0.0.0
netif: netmask of interface  set to 0.0.0.0
 eteif: GW sasd dbreeissn go fc hinatnegrefdace
  snete ttiof 0.0.0.0:
 nIePti fa:d darddeesds  iontfe rifnatcee pp IP addr 0.0.0.r0 netfmask 0.0.0.0 
gw 0.0.0.0 ace  set to 192.168.0.50
netif: netif: setting default interface pp netmask of interface  set to 
255.255.255.0
netif: GW address of interface  set to 192.168.0.1 etharp_timer etharp_timer 
etharp_timer etharp_timer etharp_timer
netif: added interface em IP addr 192.168.0.50 netmask 255.255.255.0 gw 
192.168.0.1
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:c8:d7:19:ee:1f:fc, type:806
etharp_update_arp_entry: 0.0.0.0 - c8:d7:19:ee:1f:fc
etharp_update_arp_entry: will not add non-unicast IP address to ARP cache
etharp_arp_input: incoming ARP request
etharp_arp_input: ARP request was not for us.
etharp_timer
etharp_timer

Regarding the patch, my compiler complains the following statement
  u8_t *payload = next_pbuf->payload + PBUF_LINK_HLEN; so I made a small 
change to make it work with my compiler
 u8_t *payload = (u8_t*)next_pbuf->payload + PBUF_LINK_HLEN; 

Thanks again,

Charels

>Oh dear, now I see what is happening.
>PPP header is smaller than Ethernet header, plus PPPoS needs to reallocate a 
>new PPP to do HDLC encoding, so Ethernet to PPPoS forwarding will always works.
>But, PPPoS to Ethernet will not work, because there is not enough header space 
>in the pbuf to put Ethernet header

Re: [lwip-users] ppp-new IP forwarding only works one direction (Ethernet to PPP)

2014-04-10 Thread LMao
Sylvain,

It seems the patch makes things worse - PPP connection couldn’t build-up 
anymore. Below is the complete log message after applying the patch. It seems 
the code stalled at very early stage. 

*** FreeRTOS Demo Started! ***

netif_set_ipaddr: netif addrnetif: IP address of interface  set to 0.0.0.0
netif: netmask of interface  set to 0.0.0.0
 eteif: GW sasd dbreeissn go fc hinatnegrefdace
  snete ttiof 0.0.0.0:
 nIePti fa:d darddeesds  iontfe rifnatcee pp IP addr 0.0.0.r0 netfmask 0.0.0.0 
gw 0.0.0.0
ace  set to 192.168.0.50
netif: netif: setting default interface pp
netmask of interface  set to 255.255.255.0
netif: GW address of interface  set to 192.168.0.1
etharp_timer
etharp_timer
etharp_timer
etharp_timer
etharp_timer
netif: added interface em IP addr 192.168.0.50 netmask 255.255.255.0 gw 
192.168.0.1
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:c8:d7:19:ee:1f:fc, type:806
etharp_update_arp_entry: 0.0.0.0 - c8:d7:19:ee:1f:fc
etharp_update_arp_entry: will not add non-unicast IP address to ARP cache
etharp_arp_input: incoming ARP request
etharp_arp_input: ARP request was not for us.
etharp_timer
etharp_timer

Regarding the patch, my compiler complains the following statement
  u8_t *payload = next_pbuf->payload + PBUF_LINK_HLEN;
so I made a small change to make it work with my compiler
 u8_t *payload = (u8_t*)next_pbuf->payload + PBUF_LINK_HLEN; 

Thanks again,

Charels

>Oh dear, now I see what is happening.
>PPP header is smaller than Ethernet header, plus PPPoS needs to reallocate a 
>new PPP to do HDLC encoding, so Ethernet to PPPoS forwarding will always works.
>But, PPPoS to Ethernet will not work, because there is not enough header space 
>in the pbuf to put Ethernet header in place of the PPP header.
>This is actually a lwIP design issue, the only way we can fix that is by 
>adding a configuration option so pbuf from PPP are allocated with enough extra 
>space so a Ethernet header will fit in place of a PPP header.
>So, let's try that with a stupid patch, at least it will confirm what I 
>thought is happening.

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

Re: [lwip-users] ppp-new IP forwarding only works one direction (Ethernet to PPP)

2014-04-10 Thread LMao
Hi Sylvain,

Thank you for your reply. I really appreciate your help. The below are a few 
comments and more observations.

>Well, ip_forward() should call netif->output(), which in our case is 
>ppp_netif_output_ip4(), could you first check that ?
Sorry, I may confuse you about which direction the problem is. Actually, the 
problem is it doesn't output the corresponding Ethernet packets based on the 
incoming PPP packets.

>You can also enable PPP_DEBUG in your lwipopts.h, this will display discarded 
>frames in ppp_netif_output_ip4() if any.
The following logging messages are captured with PPP_DEBUG enabled. I also 
enabled ETHARP_DEBUG & NETIF_DEBUG.

>From the newly captured messages below(last line), it seems there's a memory 
>issue.
etharp_timer
etharp_timer
ethernet_input: dest:00:bd:33:06:68:22, src:c8:d7:19:ee:1f:fc, type:800
ip_input: iphdr->dest 0x6a01a8c0 netif->ip_addr 0x3200a8c0 (0x1a8c0, 0xa8c0, 
0x6a00)
ip_input: iphdr->dest 0x6a01a8c0 netif->ip_addr 0x6901a8c0 (0x6a01a8c0, 
0x6901a8c0, 0x0)
ip_input: packet not for us.
ip_forward: forward packets to interface.pp
ip_forward: forwarding packet to 192.168.1.106
ip_input: iphdr->dest 0xd300a8c0 netif->ip_addr 0x6901a8c0 (0xd300a8c0, 
0x6901a8c0, 0x0)
ip_input: iphdr->dest 0xd300a8c0 netif->ip_addr 0x3200a8c0 (0xa8c0, 0xa8c0, 
0xd300)
ip_input: packet not for us.
ip_forward: forward packets to interface.em
ip_forward: forwarding packet to 192.168.0.211
etharp_output: could not allocate room for header.

I looked at the code of etharp_output function, it seems pbuf_header function 
cannot find room for Ethernet header (code snippet is shown below).
  /* make room for Ethernet header - should not fail */
#if ETHARP_SUPPORT_VLAN && defined(LWIP_HOOK_VLAN_SET)
  if (pbuf_header(q, sizeof(struct eth_hdr) + SIZEOF_VLAN_HDR) != 0) {
#else /* ETHARP_SUPPORT_VLAN && defined(LWIP_HOOK_VLAN_SET) */
  if (pbuf_header(q, sizeof(struct eth_hdr)) != 0) {
#endif /* ETHARP_SUPPORT_VLAN && defined(LWIP_HOOK_VLAN_SET) */
/* bail out */
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS,
  ("etharp_output: could not allocate room for header.\n"));
LINK_STATS_INC(link.lenerr);
return ERR_BUF;

However, the non-forwarded IP packets have no problem to be sent out. For 
example, if I ping 192.168.1.105 which is the PPP interface on the gateway 
device, we can IP packet is sent out without problem (log messages are shown 
below).
etharp_timer
etharp_timer
ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:c8:d7:19:ee:1f:fc, type:806
etharp_update_arp_entry: 192.168.0.211 - c8:d7:19:ee:1f:fc
etharp_find_entry: found matching entry 0
etharp_update_arp_entry: updating stable entry 0
etharp_arp_input: incoming ARP request
etharp_arp_input: replying to ARP request for our IP address
ethernet_input: dest:00:bd:33:06:68:22, src:c8:d7:19:ee:1f:fc, type:800
ip_input: iphdr->dest 0x6901a8c0 netif->ip_addr 0x3200a8c0 (0x1a8c0, 0xa8c0, 
0x6900)
ip_input: iphdr->dest 0x6901a8c0 netif->ip_addr 0x6901a8c0 (0x6901a8c0, 
0x6901a8c0, 0x0)
ip_input: packet accepted on interface pp
ip_input: 
IP header:
+---+
| 4 | 5 |  0x00 |60 | (v, hl, tos, len)
+---+
| 3005  |000|   0   | (id, flags, offset)
+---+
|  128  |1  |0xab77 | (ttl, proto, chksum)
+---+
|  192  |  168  |0  |  211  | (src)
+---+
|  192  |  168  |1  |  105  | (dest)
+---+
ip_input: p->len 60 p->tot_len 60
ip_output_if: em0
IP header:
+---+
| 4 | 5 |  0x00 |60 | (v, hl, tos, len)
+---+
| 3005  |000|   0   | (id, flags, offset)
+---+
|  255  |1  |0x2c77 | (ttl, proto, chksum)
+---+
|  192  |  168  |1  |  105  | (src)
+---+
|  192  |  168  |0  |  211  | (dest)
+---+
netif->output()
etharp_send_ip: sending packet 0020cf34
etharp_timer
etharp_timer

Now, what I really don't understand is the forwarded and non-forwarded IP 
packets both need room for Ethernet header before sending out, why one 
succeeded in making room for Ethernet header and the other failed. Is it 
because these two type packets use different types of PBUF?

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


[lwip-users] ppp-new IP forwarding only works one direction (Ethernet to PPP)

2014-04-09 Thread LMao
Hi Sylvain,

I try to get IP forwarding work between two interfaces - Ethernet and PPP. So 
far, I can see it works in one direction, i.e., Packets from Ethernet can be 
forward to PPP, but it seems lwIP stack silently drop the packets in the 
opposite direction, i.e., from PPP to Ethernet. Can you think of any reason 
causing the problem?

In order to forward packets between two interfaces, I slightly modified 
ip_forward function in ip4.c. As shown in the following code snippet, I 
eliminate the call to ip_route function. Instead, I just route traffic from one 
interface to the other interface and also print out debug message showing which 
interface is used for forwarding (either Ethernet interface "em" or PPP 
interface "pp" as shown in the log at the bottom.)

// -
// !!! Really bad action !!! Hacking lwIP stack for experiement only
// -
#if 0
  /* Find network interface where to forward this IP packet to. */
  netif = ip_route(ip_current_dest_addr());
  if (netif == NULL) {
LWIP_DEBUGF(IP_DEBUG, ("ip_forward: no forwarding route for 
%"U16_F".%"U16_F".%"U16_F".%"U16_F" found\n",
  ip4_addr1_16(ip_current_dest_addr()), 
ip4_addr2_16(ip_current_dest_addr()),
  ip4_addr3_16(ip_current_dest_addr()), 
ip4_addr4_16(ip_current_dest_addr(;
/* @todo: send ICMP_DUR_NET? */
goto return_noroute;
  }
#endif

  for (netif = netif_list; netif != NULL; netif = netif->next) 
  {
if (netif != inp)
{
  LWIP_DEBUGF(IP_DEBUG, ("ip_forward: forward packets to interface.%c%c\n",
netif->name[0], netif->name[1]));
  break;
}
  }
// -
// !!! Really bad action !!! Hacking lwIP stack for experiement only
// -



My test setup is like this:

Ethernet
PPP
 PC   -  My gateway device    Linux PPP server
192.168.0.211   192.168.0.50192.168.1.105   192.168.1.106

I ping from my PC to the PPP server. Here's some logging messages showing the 
modified ip_forward function works as expected.

ip_input: iphdr->dest 0x6a01a8c0 netif->ip_addr 0x3200a8c0 (0x1a8c0, 0xa8c0, 
0x6a00)
ip_input: iphdr->dest 0x6a01a8c0 netif->ip_addr 0x6901a8c0 (0x6a01a8c0, 
0x6901a8c0, 0x0)
ip_input: packet not for us.
ip_forward: forward packets to interface.pp
ip_forward: forwarding packet to 192.168.1.106
ip_input: iphdr->dest 0xd300a8c0 netif->ip_addr 0x6901a8c0 (0xd300a8c0, 
0x6901a8c0, 0x0)
ip_input: iphdr->dest 0xd300a8c0 netif->ip_addr 0x3200a8c0 (0xa8c0, 0xa8c0, 
0xd300)
ip_input: packet not for us.
ip_forward: forward packets to interface.em
ip_forward: forwarding packet to 192.168.0.211

I captured PPP traffic on the serial port and also captured Ethernet traffic 
using Wireshark. I can clearly see PPP traffic on both directions(into and out 
from the PPP server) and they are correct frames as expected. However, the 
traffic from PPP server to my PC NEVER showed up in Wireshark. It seems lwIP 
silently drop those packets. What should I do to find out the cause of the 
problem?

Thanks,

Charles


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


Re: [lwip-users] I cannot get PPP-new IP forwarding and pppapi_set_default() work

2014-04-08 Thread LMao
Sylvain,

Thanks for the suggestion. I will try to implement a static routing.

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Tuesday, April 08, 2014 2:00 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] I cannot get PPP-new IP forwarding and 
pppapi_set_default() work

Hello Charles,

On Tue, Apr 08, 2014 at 06:30:56PM +0200, Sylvain Rochet wrote:
> 
> It should works, but I am not a lwIP expert when used with IP 
> forwarding between multiple interfaces, lwIP is not really designed to 
> act as an IP router.

Anyway, if you would like to route IP packets, you should take a look at the 
really new LWIP_HOOK_ETHARP_GET_GW macro :-)

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


Re: [lwip-users] I cannot get PPP-new IP forwarding and pppapi_set_default() work

2014-04-08 Thread LMao
You're right. It was a typo.

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Tuesday, April 08, 2014 1:31 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] I cannot get PPP-new IP forwarding and 
pppapi_set_default() work

Hi Charles,


On Tue, Apr 08, 2014 at 04:19:12PM +, l...@moog.com wrote:
> Sylvain,
> 
> The Ethernet and PPP interfaces don't share the same subnet, actually 
> they are in different subnet, i.e., Ethernet uses subnet 192.168.0.0 
> with netmask 255.255.255.0 while PPP uses subnet 192.168.1.0 with 
> netmask 255.255.255.0.

I assumed the netmask was 255.255.0.0 (default for 192.168.0.0/16
subnets) because it was not specified.

What about 192.168.0.106 you told before ?
Is it a miswritten 192.168.1.106 ?


> Any problem with the above settings?

It should works, but I am not a lwIP expert when used with IP forwarding 
between multiple interfaces, lwIP is not really designed to act as an IP router.


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


Re: [lwip-users] I cannot get PPP-new IP forwarding and pppapi_set_default() work

2014-04-08 Thread LMao
Sylvain,

The Ethernet and PPP interfaces don't share the same subnet, actually they are 
in different subnet, i.e., Ethernet uses subnet 192.168.0.0 with netmask 
255.255.255.0 while PPP uses subnet 192.168.1.0 with netmask 255.255.255.0.

Any problem with the above settings?

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Tuesday, April 08, 2014 1:04 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] I cannot get PPP-new IP forwarding and 
pppapi_set_default() work

Hi Charles,

On Tue, Apr 08, 2014 at 03:55:29PM +, l...@moog.com wrote:
> Hi Sylvain,
> 
> Here's my scenario: 
> 
> I am developing a gateway between Ethernet and PPP using ppp-new 
> branch. The gateway device has one Ethernet port(IP 192.168.0.50, 
> i.e., 0x3200a8c0) and one PPP port (IP 192.168.1.105, i.e., 
> 0x6901a8c0). For testing purpose, I connected the Ethernet port to a 
> PC (IP 192.168.0.211, i.e., 0xd300a8c0) and connected the PPP port to 
> a Linux PPP server's PPP port(IP 192.168.1.106, i.e., 0x6a01a8c0). PPP 
> connection has been successfully built up. From my PC, I can ping my 
> gateway's PPP port (192.168.1.105) but I couldn't ping PPP server 
> (192.168.0.106). I am sure I have set PC routing correctly because the 
> ping packet can reach my gateway's serial port as the debug message 
> shows below. Here are the debug messages, the first part shows the 
> success of ping my gateway's PPP port while the second part shows the 
> failure of ping PPP server.

This setting looks wrong, lwIP does not support IP subnets shared by multiple 
interface.

But the PPP session is UP, which is a good news for me ;-)

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


[lwip-users] I cannot get PPP-new IP forwarding and pppapi_set_default() work

2014-04-08 Thread LMao
Hi Sylvain,

Here's my scenario: 
I am developing a gateway between Ethernet and PPP using ppp-new branch. The 
gateway device has one Ethernet port(IP 192.168.0.50, i.e., 0x3200a8c0) and one 
PPP port (IP 192.168.1.105, i.e., 0x6901a8c0). For testing purpose, I connected 
the Ethernet port to a PC (IP 192.168.0.211, i.e., 0xd300a8c0) and connected 
the PPP port to a Linux PPP server's PPP port(IP 192.168.1.106, i.e., 
0x6a01a8c0). PPP connection has been successfully built up. From my PC, I can 
ping my gateway's PPP port (192.168.1.105) but I couldn't ping PPP server 
(192.168.0.106). I am sure I have set PC routing correctly because the ping 
packet can reach my gateway's serial port as the debug message shows below. 
Here are the debug messages, the first part shows the success of ping my 
gateway's PPP port while the second part shows the failure of ping PPP server.

First log - success of ping my gateway's PPP port
--
ip_input: iphdr->dest 0x6901a8c0 netif->ip_addr 0x3200a8c0 (0x1a8c0, 0xa8c0, 
0x6900)
ip_input: iphdr->dest 0x6901a8c0 netif->ip_addr 0x6901a8c0 (0x6901a8c0, 
0x6901a8c0, 0x0)
ip_input: packet accepted on interface pp
ip_input: 
IP header:
+---+
| 4 | 5 |  0x00 |60 | (v, hl, tos, len)
+---+
|  736  |000|   0   | (id, flags, offset)
+---+
|  128  |1  |0xb454 | (ttl, proto, chksum)
+---+
|  192  |  168  |0  |  211  | (src)
+---+
|  192  |  168  |1  |  105  | (dest)
+---+
ip_input: p->len 60 p->tot_len 60
ip_output_if: em0
IP header:
+---+
| 4 | 5 |  0x00 |60 | (v, hl, tos, len)
+---+
|  736  |000|   0   | (id, flags, offset)
+---+
|  255  |1  |0x3554 | (ttl, proto, chksum)
+---+
|  192  |  168  |1  |  105  | (src)
+---+
|  192  |  168  |0  |  211  | (dest)
+---+
netif->output()


Second log - Fail to ping PPP server
--
ip_input: iphdr->dest 0x6a01a8c0 netif->ip_addr 0x3200a8c0 (0x1a8c0, 0xa8c0, 
0x6a00)
ip_input: iphdr->dest 0x6a01a8c0 netif->ip_addr 0x6901a8c0 (0x6a01a8c0, 
0x6901a8c0, 0x0)
ip_input: packet not for us.
ip_forward: not bouncing packets back on incoming interface.

I enabled IP_FORWARDING and also called pppapi_set_default() function. Should I 
expect the above scenario working? Or I have to implement my own static routing?

Another thing I noticed is ip_forward function seems give false debugging 
information " ip_forward: not bouncing packets back on incoming interface". The 
packet was coming from Ethernet interface (from my PC) and its destination 
should be PPP interface, so there's not bouncing back packet.


Thanks,

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


[lwip-users] PPP-new threaded vs non-threaded application

2014-04-07 Thread LMao
Hi Sylvain,

I think in your post 
http://lists.nongnu.org/archive/html/lwip-users/2013-06/msg00011.html, you gave 
some code snippet  showing how to use ppp-new in user's application. I believe 
that snippet is used in a non-threaded application, am I right?

Can you give an example application code snippet for threaded environment? I 
have problem to get my threaded application work with PPP-new. Basically, I 
followed your example for non-threaded environment, but use functions with 
pre-fix pppapi_ instead of ppp_ as you suggested in that post. The following 
code snippet is my task(freeRTOS is used) function handling PPP. 

void vPPPApplication(void)
{
  ppp_pcb *ppps;
  char *username = "test";
  char *password = "test";

  int connected = 0;
  int pd;
  
  ppps = pppapi_new();

  /* set the method of authentication. Use PPPAUTHTYPE_PAP, or
   * PPPAUTHTYPE_CHAP for more security .
   * If this is not called, the default is PPPAUTHTYPE_NONE. 
   */
  pppapi_set_auth(ppps, PPPAUTHTYPE_PAP, username, password);
  
  pppapi_over_serial_create(ppps, 0, ppp_link_status_cb, NULL);
  
  pppapi_open(ppps, 0);
  while(1) 
  {
u8_t buffer[128];
int len;
len = sio_read(0, buffer, 20);
if(len <= 0) {
  vTaskDelay( 10 );
} else {
  pppos_input(ppps, buffer, len);
}
  }
}

Thanks,

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


Re: [lwip-users] Missing typedef in vj.h fsm.h ppp.h etc

2014-04-04 Thread LMao
Sylvain,

Thank you very much. It works now.

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Friday, April 04, 2014 3:52 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Missing typedef in vj.h fsm.h ppp.h etc

Hello Charles,

On Fri, Apr 04, 2014 at 05:44:17PM +, l...@moog.com wrote:
> Hi Sylvain,
> 
> The compiler log is in the attached file. Keil uVision use ARMCC 
> compiler, here's the command line options for compiling:

Thank you, this is helpful, I pushed a little change about the order of
u_* type compat declarations, does it work for you ?

Anyway, this is quite surprising to still find a compiler without u_* type 
native support.

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


Re: [lwip-users] Missing typedef in vj.h fsm.h ppp.h etc

2014-04-04 Thread LMao
Hi Sylvain,

The compiler log is in the attached file. Keil uVision use ARMCC compiler, 
here's the command line options for compiling:

--thumb -c --cpu ARM7TDMI -g -O0 --apcs=interwork --asm --interleave --asm_dir 
".\\lst\\" -I. -I.\EMAC -I..\..\Source\include 
-I..\..\Source\portable\Keil\SAM7 -I..\Common\include 
-I.\lwip-1.3.0\src\include -I.\lwip-1.3.0\contrib\port\FreeRTOS\AT91SAM7X 
-I.\lwip-1.3.0\src\include\ipv4 -I.\lwip-1.3.0\src\include\ipv6 
-I C:\Keil\ARM\RV31\INC 
-I C:\Keil\ARM\CMSIS\Include 
-I C:\Keil\ARM\Inc\Atmel\SAM7X 
-DKEIL_SAM7 -DKEIL_THUMB_INTERWORK -o ".\build\*.o" --list_dir ".\\lst\\" 
--list --omf_browse ".\build\*.crf" --depend ".\build\*.d"

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Friday, April 04, 2014 2:28 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Missing typedef in vj.h fsm.h ppp.h etc

Hello Charles,

On Fri, Apr 04, 2014 at 04:47:38PM +, l...@moog.com wrote:
> 
> A few files have the problem: init.c, memp.c, pbuf.c, timers.c, ppp.c, 
> api_lib.c, api_msg.c, pppapi.c, sockets.c and tcpip.c

Well, this is not helping much, could you paste the full compiler output from a 
cleaned source tree, including compiler command line ?

Sylvain
 
*** Rebuild Pass #1 with Cross-Module Feedback - 'Clean' invoked.
Clean started: Project: 'rtosdemo'
   deleting intermediate output files for target 'rtosdemo'
Build target 'rtosdemo'
assembling SAM7.s...
compiling main.c...
main.c(216): warning:  #167-D: argument of type "void (*)(void)" is 
incompatible with parameter of type "pdTASK_CODE"
main.c(373): warning:  #167-D: argument of type "void (*)(void *, int, void *)" 
is incompatible with parameter of type "ppp_link_status_cb_fn"
main.c(361): warning:  #177-D: variable "connected" was declared but never 
referenced
main.c(362): warning:  #177-D: variable "pd" was declared but never referenced
main.c(417): warning:  #177-D: variable "addrs" was declared but never 
referenced
compiling Retarget.c...
compiling ParTest.c...
compiling serial.c...
serial\serial.c(267): warning:  #223-D: function "xTaskGetTickCount" declared 
implicitly
serial\serial.c(271): warning:  #167-D: argument of type "u8_t *" is 
incompatible with parameter of type "signed char *"
assembling serialISR.s...
compiling dbgu.c...
compiling USBSample.c...
USB\USBSample.c(137): warning:  #47-D: incompatible redefinition of macro 
"AT91C_UDP_STALLSENT" (declared at line 1410 of 
"C:\Keil\ARM\Inc\Atmel\SAM7X\AT91SAM7X256.h")
assembling USB_ISR.s...
compiling SAM7_EMAC_ISR.c...
compiling SAM7_EMAC.c...
EMAC\SAM7_EMAC.c(744): warning:  #61-D: integer operation result is out of range
EMAC\SAM7_EMAC.c(766): warning:  #61-D: integer operation result is out of range
assembling emacISR.s...
compiling sys_arch.c...
compiling ethernetif.c...
lwip-1.3.0\contrib\port\FreeRTOS\AT91SAM7X\ethernetif.c(103): warning:  
#3048-D: inline assembly not permitted when generating Thumb1 code
lwip-1.3.0\contrib\port\FreeRTOS\AT91SAM7X\ethernetif.c(103): warning:  
#3042-D: detected use of ARM inline assembly in a Thumb function; automatically 
promoted function to ARM
lwip-1.3.0\contrib\port\FreeRTOS\AT91SAM7X\ethernetif.c(103): warning:  
#3043-D: automatic promotion of functions to ARM is deprecated; use "#pragma 
arm" instead
lwip-1.3.0\contrib\port\FreeRTOS\AT91SAM7X\ethernetif.c(260): warning:  #550-D: 
variable "ethernetif" was set but never used
lwip-1.3.0\contrib\port\FreeRTOS\AT91SAM7X\ethernetif.c(329): warning:  #223-D: 
function "sys_timeout" declared implicitly
lwip-1.3.0\contrib\port\FreeRTOS\AT91SAM7X\ethernetif.c(355): warning:  #223-D: 
function "sys_timeout" declared implicitly
lwip-1.3.0\contrib\port\FreeRTOS\AT91SAM7X\ethernetif.c(60): warning:  #177-D: 
variable "ethbroadcast" was declared but never referenced
compiling portISR.c...
assembling portasm.s...
compiling port.c...
compiling flash.c...
compiling BlockQ.c...
compiling integer.c...
compiling PollQ.c...
compiling semtest.c...
compiling tasks.c...
compiling list.c...
compiling queue.c...
compiling heap_2.c...
compiling def.c...
compiling dhcp.c...
compiling dns.c...
compiling inet_chksum.c...
compiling init.c...
.\lwip-1.3.0\src\include\netif/ppp/vj.h(110): error:  #20: identifier "u_short" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(111): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(112): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(138): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(139): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(140): error:  #20: identifier "u_short" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(141): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(142): error:  #20: identi

Re: [lwip-users] Missing typedef in vj.h fsm.h ppp.h etc

2014-04-04 Thread LMao
A few files have the problem: init.c, memp.c, pbuf.c, timers.c, ppp.c, 
api_lib.c, api_msg.c, pppapi.c, sockets.c and tcpip.c

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Friday, April 04, 2014 1:33 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Missing typedef in vj.h fsm.h ppp.h etc

Hello Charles,

On Fri, Apr 04, 2014 at 03:54:07PM +, l...@moog.com wrote:
>  Sylvain,
> 
> I try to compile ppp-new and my compiler(Keil) gave compiling errors 
> like this:
> 
> I find the missing typedefs are defined in ppp_impl.h file. It seems 
> vj.h etc doesn't include ppp_impl.h. Am I doing something wrong?

Well, but vj.c includes "netif/ppp/ppp_impl.h" before "netif/ppp/vj.h", so this 
should not happen.

Looks like a buggy preprocessor/compiler at first sight, could you tell on 
which .c files it happens ?

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


Re: [lwip-users] Missing typedef in vj.h fsm.h ppp.h etc

2014-04-04 Thread LMao
Hi Sylvain,

Don't be fooled by the folder name lwip-1.3.0. Actually the whole src folder 
under it contains the ppp-new's src folder. I just kept lwip1.3.0 folder name 
to minimize the change to Keil project files.

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of l...@moog.com
Sent: Friday, April 04, 2014 12:54 PM
To: lwip-users@nongnu.org
Subject: [lwip-users] Missing typedef in vj.h fsm.h ppp.h etc

 Sylvain,

I try to compile ppp-new and my compiler(Keil) gave compiling errors like this:

.\lwip-1.3.0\src\include\netif/ppp/vj.h(110): error:  #20: identifier "u_short" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(111): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(112): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(138): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(139): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(140): error:  #20: identifier "u_short" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(141): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(142): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(154): error:  #20: identifier "u_int" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(100): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(102): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(104): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(106): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(108): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(122): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(169): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(171): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(171): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(171): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/lcp.h(165): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/ppp.h(266): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/ppp.h(578): error:  #20: identifier "u_char" 
is undefined

I find the missing typedefs are defined in ppp_impl.h file. It seems vj.h etc 
doesn't include ppp_impl.h. Am I doing something wrong? 

Thanks,

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



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


[lwip-users] Missing typedef in vj.h fsm.h ppp.h etc

2014-04-04 Thread LMao
 Sylvain,

I try to compile ppp-new and my compiler(Keil) gave compiling errors like this:

.\lwip-1.3.0\src\include\netif/ppp/vj.h(110): error:  #20: identifier "u_short" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(111): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(112): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(138): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(139): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(140): error:  #20: identifier "u_short" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(141): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(142): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/vj.h(154): error:  #20: identifier "u_int" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(100): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(102): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(104): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(106): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(108): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(122): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(169): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(171): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(171): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/fsm.h(171): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/lcp.h(165): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/ppp.h(266): error:  #20: identifier "u_char" 
is undefined
.\lwip-1.3.0\src\include\netif/ppp/ppp.h(578): error:  #20: identifier "u_char" 
is undefined

I find the missing typedefs are defined in ppp_impl.h file. It seems vj.h etc 
doesn't include ppp_impl.h. Am I doing something wrong? 

Thanks,

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


Re: [lwip-users] Which PPP implementation should be used? PPP-new or PPP from the master branch

2014-04-01 Thread LMao
Hi Sylvain,

Thanks for your support. 

I didn't know it doesn't support PPP server. Any plans to add PPP server? What 
needs be done in order to support PPP server?

Charles

-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Monday, March 31, 2014 6:04 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Which PPP implementation should be used? PPP-new or 
PPP from the master branch

Hello Charles,


On Mon, Mar 31, 2014 at 08:17:59PM +, l...@moog.com wrote:
> 
> Thanks, Sylvain. I think the answer is quite obvious now: ppp-new is 
> the way to go since it has you and the community's support.
> 
> I couldn't find a complete example code of using ppp-new's PPP 
> implementation.
> 
> Especially an example at application layer shows how to specify IP 
> address for a PPP interface, etc.

This is kind of unusual, since our PPP stack only supports PPP client the IP 
address is usually given by the server. If you really need this we can add 
macro to set the necessary field in the PPP neg-configuration.


> Could you quickly sketch a code snippet for PPP application layer?

It mostly depends on which lower level protocol you wish to use, PPPoS, PPPoE 
or PPPoL2TP, I am sure I already provided hints on this list which should be on 
the list archive.

Anyway, this isn't hard, the API is fully documented in headers and should be 
explanatory enough to give you the way to proceed.

If you really need an example, you can checkout the ppp-new branch of the 
contrib Git repository, it contains my quick'n'dirty source code I use to test 
the ppp-new branch in "lwip-contrib/ports/unix/proj/minimal".


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


Re: [lwip-users] Which PPP implementation should be used? PPP-new or PPP from the master branch

2014-03-31 Thread LMao
Thanks, Sylvain. I think the answer is quite obvious now: ppp-new is the way to 
go since it has you and the community's support.

I couldn't find a complete example code of using ppp-new's PPP implementation. 
Especially an example at application layer shows how to specify IP address for 
a PPP interface, etc. Could you quickly sketch a code snippet for PPP 
application layer?

Thanks,

Charles


-Original Message-
From: lwip-users-bounces+cmao=moog@nongnu.org 
[mailto:lwip-users-bounces+cmao=moog@nongnu.org] On Behalf Of Sylvain Rochet
Sent: Monday, March 31, 2014 3:46 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Which PPP implementation should be used? PPP-new or 
PPP from the master branch

Hello LMao,


On Mon, Mar 31, 2014 at 12:57:56PM +, l...@moog.com wrote:
> Hi there,
> 
> I am new to the lwIP community and try to use lwIP v1.4.1 to implement 
> a gateway between an Ethernet interface and PPP on ATM91SAM7x.  I 
> found a port (with lwIP 1.3) in FreeRTOS community contributions and 
> migrated to lwIP 1.4.1. It works fine with the Ethernet part, but the 
> port doesn't contain PPP part. Therefore I need add PPP application by 
> myself.

Are you sure Atmel does not provide a working and well-written lwIP port in 
their lovely ASF ?

I guess there is one along with a MAC driver for AT91SAM µC in the same way 
they do for AT32 µC.


> I have read the lwIP PPP wiki and some archived messages regarding PPP 
> from this mail list. In the wiki, it talks about the PPP 
> implementation contained in the master branch, but in the mail list, 
> it seems everybody uses ppp-new.

> My question is which one should I use?

Well, cannot answer, because I am the ppp-new maintainer, so my answer 
is pretty obvious on this point ;-)


> What are their differences?

ppp-new is a fresh new port of the latest pppd codebase for lwIP, 
including 10 missing years of pppd improvement in lwIP and some features 
are added.

So, IIRC, at least:
  + MSCHAP support (pppd)
  + EAP support (pppd)
  + multiple PPP sessions support (me)
  + L2TPv2 LAC support (me)
  + IPv6 support (pppd+me)
  + 10 years of bugfixes (pppd)

And, I guess this is worth considering it, but I am willing to help you 
if you encounter issues with ppp-new, but I will NOT for master branch, 
and no one will.


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

[lwip-users] Which PPP implementation should be used? PPP-new or PPP from the master branch

2014-03-31 Thread LMao
Hi there,

I am new to the lwIP community and try to use lwIP v1.4.1 to implement a 
gateway between an Ethernet interface and PPP on ATM91SAM7x.  I found a port 
(with lwIP 1.3) in FreeRTOS community contributions and migrated to lwIP 1.4.1. 
It works fine with the Ethernet part, but the port doesn't contain PPP part. 
Therefore I need add PPP application by myself.

I have read the lwIP PPP wiki and some archived messages regarding PPP from 
this mail list. In the wiki, it talks about the PPP implementation contained in 
the master branch, but in the mail list, it seems everybody uses ppp-new. My 
question is which one should I use? What are their differences?

Thanks,

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