Free (GPLv2) TCP/IP stack developed by TASS Belgium
Dependents: lpc1768-picotcp-demo ZeroMQ_PicoTCP_Publisher_demo TCPSocket_HelloWorld_PicoTCP Pico_TCP_UDP_Test ... more
PicoTCP. Copyright (c) 2013 TASS Belgium NV.
Released under the GNU General Public License, version 2.
Different licensing models may exist, at the sole discretion of the Copyright holders.
Official homepage: http://www.picotcp.com
Bug tracker: https://github.com/tass-belgium/picotcp/issues
Development steps:
initial integration with mbed RTOSgeneric mbed Ethernet driverhigh performance NXP LPC1768 specific Ethernet driverMulti-threading support for mbed RTOSBerkeley sockets and integration with the New Socket APIFork of the apps running on top of the New Socket APIScheduling optimizations- Debugging/benchmarking/testing
Demo application (measuring TCP sender performance):
Import programlpc1768-picotcp-demo
A PicoTCP demo app testing the ethernet throughput on the lpc1768 mbed board.
Diff: modules/pico_ipv4.c
- Revision:
- 88:0e827d0d8017
- Parent:
- 74:c146c4e346c4
- Child:
- 105:47c74c5d3d15
--- a/modules/pico_ipv4.c Mon Oct 07 06:38:59 2013 +0000 +++ b/modules/pico_ipv4.c Mon Oct 07 06:51:23 2013 +0000 @@ -529,8 +529,7 @@ /* don't forward broadcast frame, discard! */ pico_frame_discard(f); } else if (pico_ipv4_forward(f) != 0) { - /* Packet is not local. Try to forward. */ - pico_ipv4_forward(f); + //dbg("Forward failed.\n"); } } return 0; @@ -936,6 +935,20 @@ } #endif /* PICO_SUPPORT_MCAST */ +#ifdef DEBUG_ROUTE +static void dbg_route(void) +{ + struct pico_ipv4_route *r; + struct pico_tree_node * index; + pico_tree_foreach(index,&Routes){ + r = index->keyValue; + dbg("Route to %08x/%08x, gw %08x, dev: %s, metric: %d\n", r->dest.addr, r->netmask.addr, r->gateway.addr, r->link->dev->name, r->metric); + } +} +#else +#define dbg_route() do{ }while(0) +#endif + int pico_ipv4_frame_push(struct pico_frame *f, struct pico_ip4 *dst, uint8_t proto) { @@ -968,7 +981,9 @@ route = route_find(dst); if (!route) { - dbg("Route to %08x not found.\n", long_be(dst->addr)); + //dbg("Route to %08x not found.\n", long_be(dst->addr)); + + pico_err = PICO_ERR_EHOSTUNREACH; goto drop; } else { @@ -1080,20 +1095,6 @@ } -#ifdef DEBUG_ROUTE -static void dbg_route(void) -{ - struct pico_ipv4_route *r; - struct pico_tree_node * index; - pico_tree_foreach(index,&Routes){ - r = index->keyValue; - dbg("Route to %08x/%08x, gw %08x, dev: %s, metric: %d\n", r->dest.addr, r->netmask.addr, r->gateway.addr, r->link->dev->name, r->metric); - } -} -#else -#define dbg_route() do{ }while(0) -#endif - int pico_ipv4_route_add(struct pico_ip4 address, struct pico_ip4 netmask, struct pico_ip4 gateway, int metric, struct pico_ipv4_link *link) { struct pico_ipv4_route test, *new; @@ -1139,7 +1140,7 @@ } pico_tree_insert(&Routes,new); - dbg_route(); + //dbg_route(); return 0; } @@ -1157,7 +1158,7 @@ pico_tree_delete(&Routes,found); pico_free(found); - dbg_route(); + //dbg_route(); return 0; } pico_err = PICO_ERR_EINVAL; @@ -1396,6 +1397,7 @@ hdr->ttl= (uint8_t)(hdr->ttl - 1); if (hdr->ttl < 1) { pico_notify_ttl_expired(f); + dbg(" ------------------- TTL EXPIRED\n"); return -1; } hdr->crc++;