lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] tcp_connection (no SYN packet on server side)


From: Inderjit Singh
Subject: Re: [lwip-users] tcp_connection (no SYN packet on server side)
Date: Tue, 5 Jun 2018 09:47:38 +0000

Yeah, the procedure is exactly as you descript with address setting, netifadd, etc...

IP4_ADDR(&ip, 192, 168, 100, 250);
IP4_ADDR(&netmask, 255, 255, 255, 0);
IP4_ADDR(&gateway, 192, 168, 100, 1);
if (NULL == netif_add(&dev_netif, &ip, &netmask, &gateway, NULL,
ethernetif_init, ethernet_input)) {
LWIP_ASSERT("NULL == netif_add", 0);
}


netif_set_default(&dev_netif);
netif_set_status_callback(&dev_netif, eth_cb_netif_status);
netif_set_up(&dev_netif);

And both output low level functions are being called (catched by breakpoint). I presume you do mean (in my case):
ethernetif_output() -> etharp_output
ethernetif_linkoutput -> gmac_low_level_output

as they are set in netif:
netif->output = etharp_output;
netif->linkoutput = gmac_low_level_output;


________________________________________
From: lwip-users [lwip-users-bounces+address@hidden on behalf of Sergio R. Caprile address@hidden
Sent: 04 June 2018 18:18
To: address@hidden
Subject: Re: [lwip-users] tcp_connection (no SYN packet on server side)

OK, so it seems you are correctly calling lwIP in the loop, and your
networking parameters look good.
However, I failed to ask how do you setup your netif. You don't tell.
You should do something like this before actually calling tcp_connect():

IP4_ADDR(&gw, 192,168,100,1);
IP4_ADDR(&ipaddr, 192,168,100,250);
IP4_ADDR(&netmask, 255,255,255,0);

lwip_init();
netif_add(&netif, &ipaddr, &netmask, &gw, perhaps NULL,
ethernetif_init, ethernet_input);
netif_set_default(&netif);

Where your ethernetif_init() will properly init stuff...
netif->output = etharp_output;
netif->linkoutput = ethernetif_linkoutput;//driveroutputfunction

Can you fire a breakpoint at your ethernetif_output() and
ethernetif_linkoutput?

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

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