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: stack/pico_socket.c
- Revision:
- 51:ab4529a384a6
- Parent:
- 49:4b404dd2c97a
- Child:
- 63:97f481e33cb2
- Child:
- 64:0225b609335e
--- a/stack/pico_socket.c Tue Aug 06 08:04:03 2013 +0000 +++ b/stack/pico_socket.c Mon Sep 02 08:02:21 2013 +0000 @@ -461,7 +461,7 @@ /* IPv4 */ #ifdef PICO_SUPPORT_NAT - if (pico_ipv4_nat_find(port,NULL, 0,proto) == 0) { + if (pico_ipv4_nat_find(port, NULL, 0, proto)) { dbg("In use by nat....\n"); return 0; } @@ -518,24 +518,24 @@ struct pico_socket* pico_sockets_find(uint16_t local,uint16_t remote) { - struct pico_socket * sock = NULL; - struct pico_tree_node *index = NULL; - struct pico_sockport *sp = NULL; + struct pico_socket * sock = NULL; + struct pico_tree_node *index = NULL; + struct pico_sockport *sp = NULL; - sp = pico_get_sockport(PICO_PROTO_TCP,local); - if(sp) - { - pico_tree_foreach(index,&sp->socks) - { - if( ((struct pico_socket *)index->keyValue)->remote_port == remote) - { - sock = (struct pico_socket *)index->keyValue; - break; - } - } - } + sp = pico_get_sockport(PICO_PROTO_TCP,local); + if(sp) + { + pico_tree_foreach(index,&sp->socks) + { + if( ((struct pico_socket *)index->keyValue)->remote_port == remote) + { + sock = (struct pico_socket *)index->keyValue; + break; + } + } + } - return sock; + return sock; } @@ -569,7 +569,7 @@ pico_tree_insert(&sp->socks,s); s->state |= PICO_SOCKET_STATE_BOUND; - UNLOCK(Mutex); + UNLOCK(Mutex); #if DEBUG_SOCKET_TREE { struct pico_tree_node * index; @@ -587,6 +587,7 @@ static void socket_garbage_collect(unsigned long now, void *arg) { struct pico_socket *s = (struct pico_socket *) arg; + IGNORE_PARAMETER(now); pico_free(s); } @@ -650,7 +651,7 @@ s->state = PICO_SOCKET_STATE_CLOSED; pico_timer_add(3000, socket_garbage_collect, s); - UNLOCK(Mutex); + UNLOCK(Mutex); return 0; } @@ -2016,14 +2017,14 @@ if (mode & PICO_SHUT_RDWR) pico_socket_alter_state(s, PICO_SOCKET_STATE_CLOSED, PICO_SOCKET_STATE_CLOSING |PICO_SOCKET_STATE_BOUND | PICO_SOCKET_STATE_CONNECTED, 0); else if (mode & PICO_SHUT_RD) - pico_socket_alter_state(s, PICO_SOCKET_STATE_BOUND, 0, 0); + pico_socket_alter_state(s, 0, PICO_SOCKET_STATE_BOUND, 0); } #endif #ifdef PICO_SUPPORT_TCP if (PROTO(s) == PICO_PROTO_TCP) { - if(mode & PICO_SHUT_RDWR) - pico_socket_alter_state(s, PICO_SOCKET_STATE_SHUT_LOCAL | PICO_SOCKET_STATE_SHUT_REMOTE, 0, 0); - else if (mode & PICO_SHUT_WR) + if(mode & PICO_SHUT_RDWR) + pico_socket_alter_state(s, PICO_SOCKET_STATE_SHUT_LOCAL | PICO_SOCKET_STATE_SHUT_REMOTE, 0, 0); + else if (mode & PICO_SHUT_WR) pico_socket_alter_state(s, PICO_SOCKET_STATE_SHUT_LOCAL, 0, 0); else if (mode & PICO_SHUT_RD) pico_socket_alter_state(s, PICO_SOCKET_STATE_SHUT_REMOTE, 0, 0); @@ -2079,7 +2080,8 @@ #else static inline int pico_transport_crc_check(struct pico_frame *f) { - return 1; + IGNORE_PARAMETER(f); + return 1; } #endif /* PICO_SUPPORT_CRC */