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 RTOS
  • generic mbed Ethernet driver
  • high performance NXP LPC1768 specific Ethernet driver
  • Multi-threading support for mbed RTOS
  • Berkeley sockets and integration with the New Socket API
  • Fork of the apps running on top of the New Socket API
  • Scheduling 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.

Revision:
49:4b404dd2c97a
Parent:
48:40fc4462265c
Child:
51:ab4529a384a6
diff -r 40fc4462265c -r 4b404dd2c97a stack/pico_socket.c
--- a/stack/pico_socket.c	Fri Aug 02 07:28:05 2013 +0000
+++ b/stack/pico_socket.c	Mon Aug 05 12:58:56 2013 +0000
@@ -516,6 +516,28 @@
   return -1;
 }
 
+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;
+
+    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;
+}
+
 
 int pico_socket_add(struct pico_socket *s)
 {
@@ -2095,22 +2117,6 @@
   return ret;
 }
 
-int pico_sockets_find(struct pico_socket *s)
-{
-        struct pico_tree_node *index = NULL;
-        pico_tree_foreach(index,&TCPTable) // for each sockport
-        {
-            struct pico_tree_node *sp_index = NULL;
-            struct pico_sockport * sp = (struct pico_sockport *)index->keyValue;
-            pico_tree_foreach(sp_index,&sp->socks) // for each socket in sockport
-            {
-                if(sp_index->keyValue == s)
-                    return 1;
-            }
-        }
-    return 0;
-}
-
 #define SL_LOOP_MIN 1