mirror of
https://github.com/ep00ch/lwip-contrib-mac.git
synced 2024-07-07 20:29:04 +00:00
Fix BUG22983: multiple fixes for unixsim
This commit is contained in:
parent
d959889ab5
commit
8df3d8bdc0
@ -312,13 +312,6 @@ tapif_input(struct netif *netif)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static void
|
|
||||||
arp_timer(void *arg)
|
|
||||||
{
|
|
||||||
etharp_tmr();
|
|
||||||
sys_timeout(ARP_TMR_INTERVAL, (sys_timeout_handler)arp_timer, NULL);
|
|
||||||
}
|
|
||||||
/*-----------------------------------------------------------------------------------*/
|
|
||||||
/*
|
/*
|
||||||
* tapif_init():
|
* tapif_init():
|
||||||
*
|
*
|
||||||
@ -347,9 +340,7 @@ tapif_init(struct netif *netif)
|
|||||||
|
|
||||||
tapif->ethaddr = (struct eth_addr *)&(netif->hwaddr[0]);
|
tapif->ethaddr = (struct eth_addr *)&(netif->hwaddr[0]);
|
||||||
low_level_init(netif);
|
low_level_init(netif);
|
||||||
etharp_init();
|
|
||||||
|
|
||||||
sys_timeout(ARP_TMR_INTERVAL, (sys_timeout_handler)arp_timer, NULL);
|
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
|
@ -58,7 +58,9 @@ tcpdump(struct pbuf *p)
|
|||||||
{
|
{
|
||||||
struct ip_hdr *iphdr;
|
struct ip_hdr *iphdr;
|
||||||
struct tcp_hdr *tcphdr;
|
struct tcp_hdr *tcphdr;
|
||||||
|
#if LWIP_UDP
|
||||||
struct udp_hdr *udphdr;
|
struct udp_hdr *udphdr;
|
||||||
|
#endif
|
||||||
char flags[5];
|
char flags[5];
|
||||||
int i;
|
int i;
|
||||||
int len;
|
int len;
|
||||||
@ -139,6 +141,7 @@ tcpdump(struct pbuf *p)
|
|||||||
pbuf_header(p, IP_HLEN);
|
pbuf_header(p, IP_HLEN);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if LWIP_UDP
|
||||||
case IP_PROTO_UDP:
|
case IP_PROTO_UDP:
|
||||||
udphdr = (struct udp_hdr *)((char *)iphdr + IP_HLEN);
|
udphdr = (struct udp_hdr *)((char *)iphdr + IP_HLEN);
|
||||||
|
|
||||||
@ -174,6 +177,7 @@ tcpdump(struct pbuf *p)
|
|||||||
|
|
||||||
pbuf_header(p, IP_HLEN);
|
pbuf_header(p, IP_HLEN);
|
||||||
break;
|
break;
|
||||||
|
#endif /* LWIP_UDP */
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* IPv4 */
|
#endif /* IPv4 */
|
||||||
|
@ -80,7 +80,7 @@ clos [connection #]: closes a TCP or UDP connection.\n\
|
|||||||
stat: prints out lwIP statistics.\n\
|
stat: prints out lwIP statistics.\n\
|
||||||
quit: quits.\n";
|
quit: quits.\n";
|
||||||
|
|
||||||
#define STAT_NUM ((6 * 13) + (6) + (4) + (11 * 4) + (2 * 3))
|
#define STAT_NUM (((5 + LWIP_UDP) * 13) + (4) + (11 * 4) + (2 * 3))
|
||||||
|
|
||||||
static char *stat_msgs[STAT_NUM] = {
|
static char *stat_msgs[STAT_NUM] = {
|
||||||
"Link level * transmitted ",
|
"Link level * transmitted ",
|
||||||
@ -135,6 +135,7 @@ static char *stat_msgs[STAT_NUM] = {
|
|||||||
" option errors ",
|
" option errors ",
|
||||||
" * misc errors ",
|
" * misc errors ",
|
||||||
" cache hits ",
|
" cache hits ",
|
||||||
|
#if LWIP_UDP
|
||||||
"UDP * transmitted ",
|
"UDP * transmitted ",
|
||||||
" retransmitted ",
|
" retransmitted ",
|
||||||
" * received ",
|
" * received ",
|
||||||
@ -148,6 +149,7 @@ static char *stat_msgs[STAT_NUM] = {
|
|||||||
" option errors ",
|
" option errors ",
|
||||||
" * misc errors ",
|
" * misc errors ",
|
||||||
" cache hits ",
|
" cache hits ",
|
||||||
|
#endif
|
||||||
"TCP * transmitted ",
|
"TCP * transmitted ",
|
||||||
" * retransmitted ",
|
" * retransmitted ",
|
||||||
" * received ",
|
" * received ",
|
||||||
@ -161,12 +163,6 @@ static char *stat_msgs[STAT_NUM] = {
|
|||||||
" * option errors ",
|
" * option errors ",
|
||||||
" * misc errors ",
|
" * misc errors ",
|
||||||
" * cache hits ",
|
" * cache hits ",
|
||||||
"Pbufs * available ",
|
|
||||||
" * used ",
|
|
||||||
" * high water mark ",
|
|
||||||
" * errors ",
|
|
||||||
" pbuf_alloc() locked ",
|
|
||||||
" pbuf_refresh() locked ",
|
|
||||||
"Memory * available ",
|
"Memory * available ",
|
||||||
" * used ",
|
" * used ",
|
||||||
" * high water mark ",
|
" * high water mark ",
|
||||||
@ -280,6 +276,7 @@ static char *stat_formats[STAT_NUM] = {
|
|||||||
U16_F, /* icmp err */
|
U16_F, /* icmp err */
|
||||||
U16_F, /* icmp cachehit */
|
U16_F, /* icmp cachehit */
|
||||||
|
|
||||||
|
#if LWIP_UDP
|
||||||
U16_F, /* udp xmit */
|
U16_F, /* udp xmit */
|
||||||
U16_F, /* udp rexmit */
|
U16_F, /* udp rexmit */
|
||||||
U16_F, /* udp recv */
|
U16_F, /* udp recv */
|
||||||
@ -293,6 +290,7 @@ static char *stat_formats[STAT_NUM] = {
|
|||||||
U16_F, /* udp opterr */
|
U16_F, /* udp opterr */
|
||||||
U16_F, /* udp err */
|
U16_F, /* udp err */
|
||||||
U16_F, /* udp cachehit */
|
U16_F, /* udp cachehit */
|
||||||
|
#endif
|
||||||
|
|
||||||
U16_F, /* tcp xmit */
|
U16_F, /* tcp xmit */
|
||||||
U16_F, /* tcp exmit */
|
U16_F, /* tcp exmit */
|
||||||
@ -308,14 +306,6 @@ static char *stat_formats[STAT_NUM] = {
|
|||||||
U16_F, /* tcp err */
|
U16_F, /* tcp err */
|
||||||
U16_F, /* tcp cachehit */
|
U16_F, /* tcp cachehit */
|
||||||
|
|
||||||
/* FIXME: pbuf stats have moved to memp stats */
|
|
||||||
U16_F, /* pbuf avail */
|
|
||||||
U16_F, /* pbuf used */
|
|
||||||
U16_F, /* pbuf max */
|
|
||||||
U16_F, /* pbuf err */
|
|
||||||
U16_F, /* pbuf alloc_locked */
|
|
||||||
U16_F, /* pbuf refresh_locked */
|
|
||||||
|
|
||||||
/* FIXME: always using 11 memp pools is wrong! */
|
/* FIXME: always using 11 memp pools is wrong! */
|
||||||
U32_F, /* mem avail */
|
U32_F, /* mem avail */
|
||||||
U32_F, /* mem used */
|
U32_F, /* mem used */
|
||||||
@ -443,6 +433,7 @@ static void *stat_ptrs[STAT_NUM] = {
|
|||||||
&lwip_stats.icmp.err,
|
&lwip_stats.icmp.err,
|
||||||
&lwip_stats.icmp.cachehit,
|
&lwip_stats.icmp.cachehit,
|
||||||
|
|
||||||
|
#if LWIP_UDP
|
||||||
&lwip_stats.udp.xmit,
|
&lwip_stats.udp.xmit,
|
||||||
&lwip_stats.udp.rexmit,
|
&lwip_stats.udp.rexmit,
|
||||||
&lwip_stats.udp.recv,
|
&lwip_stats.udp.recv,
|
||||||
@ -456,6 +447,7 @@ static void *stat_ptrs[STAT_NUM] = {
|
|||||||
&lwip_stats.udp.opterr,
|
&lwip_stats.udp.opterr,
|
||||||
&lwip_stats.udp.err,
|
&lwip_stats.udp.err,
|
||||||
&lwip_stats.udp.cachehit,
|
&lwip_stats.udp.cachehit,
|
||||||
|
#endif
|
||||||
|
|
||||||
&lwip_stats.tcp.xmit,
|
&lwip_stats.tcp.xmit,
|
||||||
&lwip_stats.tcp.rexmit,
|
&lwip_stats.tcp.rexmit,
|
||||||
@ -471,15 +463,6 @@ static void *stat_ptrs[STAT_NUM] = {
|
|||||||
&lwip_stats.tcp.err,
|
&lwip_stats.tcp.err,
|
||||||
&lwip_stats.tcp.cachehit,
|
&lwip_stats.tcp.cachehit,
|
||||||
|
|
||||||
/* FIXME: pbuf stats have moved to memp stats */
|
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL,
|
|
||||||
/*&lwip_stats.pbuf.avail,
|
|
||||||
&lwip_stats.pbuf.used,
|
|
||||||
&lwip_stats.pbuf.max,
|
|
||||||
&lwip_stats.pbuf.err,
|
|
||||||
&lwip_stats.pbuf.alloc_locked,
|
|
||||||
&lwip_stats.pbuf.refresh_locked,*/
|
|
||||||
|
|
||||||
&lwip_stats.mem.avail,
|
&lwip_stats.mem.avail,
|
||||||
&lwip_stats.mem.used,
|
&lwip_stats.mem.used,
|
||||||
&lwip_stats.mem.max,
|
&lwip_stats.mem.max,
|
||||||
|
Loading…
Reference in New Issue
Block a user