mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-11-20 10:35:34 +00:00
Merge pull request #1256 from tadodotcom/tmp-refactor-tcpip-packet-input
Refactor tcpip.c packet input
This commit is contained in:
commit
222a75426a
@ -185,11 +185,17 @@ check_for_tcp_syn(void)
|
|||||||
static void
|
static void
|
||||||
packet_input(void)
|
packet_input(void)
|
||||||
{
|
{
|
||||||
|
if(uip_len > 0) {
|
||||||
|
|
||||||
#if UIP_CONF_IP_FORWARD
|
#if UIP_CONF_IP_FORWARD
|
||||||
if(uip_len > 0) {
|
|
||||||
tcpip_is_forwarding = 1;
|
tcpip_is_forwarding = 1;
|
||||||
if(uip_fw_forward() == UIP_FW_LOCAL) {
|
if(uip_fw_forward() != UIP_FW_LOCAL) {
|
||||||
tcpip_is_forwarding = 0;
|
tcpip_is_forwarding = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
tcpip_is_forwarding = 0;
|
||||||
|
#endif /* UIP_CONF_IP_FORWARD */
|
||||||
|
|
||||||
check_for_tcp_syn();
|
check_for_tcp_syn();
|
||||||
uip_input();
|
uip_input();
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
@ -198,33 +204,13 @@ packet_input(void)
|
|||||||
#else /* UIP_CONF_TCP_SPLIT */
|
#else /* UIP_CONF_TCP_SPLIT */
|
||||||
#if NETSTACK_CONF_WITH_IPV6
|
#if NETSTACK_CONF_WITH_IPV6
|
||||||
tcpip_ipv6_output();
|
tcpip_ipv6_output();
|
||||||
#else
|
#else /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
PRINTF("tcpip packet_input forward output len %d\n", uip_len);
|
|
||||||
tcpip_output();
|
|
||||||
#endif
|
|
||||||
#endif /* UIP_CONF_TCP_SPLIT */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tcpip_is_forwarding = 0;
|
|
||||||
}
|
|
||||||
#else /* UIP_CONF_IP_FORWARD */
|
|
||||||
if(uip_len > 0) {
|
|
||||||
check_for_tcp_syn();
|
|
||||||
uip_input();
|
|
||||||
if(uip_len > 0) {
|
|
||||||
#if UIP_CONF_TCP_SPLIT
|
|
||||||
uip_split_output();
|
|
||||||
#else /* UIP_CONF_TCP_SPLIT */
|
|
||||||
#if NETSTACK_CONF_WITH_IPV6
|
|
||||||
tcpip_ipv6_output();
|
|
||||||
#else
|
|
||||||
PRINTF("tcpip packet_input output len %d\n", uip_len);
|
PRINTF("tcpip packet_input output len %d\n", uip_len);
|
||||||
tcpip_output();
|
tcpip_output();
|
||||||
#endif
|
#endif /* NETSTACK_CONF_WITH_IPV6 */
|
||||||
#endif /* UIP_CONF_TCP_SPLIT */
|
#endif /* UIP_CONF_TCP_SPLIT */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_IP_FORWARD */
|
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_TCP
|
#if UIP_TCP
|
||||||
|
Loading…
Reference in New Issue
Block a user