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.

Committer:
tass
Date:
Thu Sep 19 13:26:14 2013 +0000
Revision:
68:0847e35d08a6
Child:
131:4758606c9316
Imported from masterbranch, again

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tass 68:0847e35d08a6 1 /*********************************************************************
tass 68:0847e35d08a6 2 PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved.
tass 68:0847e35d08a6 3 See LICENSE and COPYING for usage.
tass 68:0847e35d08a6 4
tass 68:0847e35d08a6 5 Author: Andrei Carp <andrei.carp@tass.be>
tass 68:0847e35d08a6 6 *********************************************************************/
tass 68:0847e35d08a6 7
tass 68:0847e35d08a6 8 #ifndef __PICO_RBTREE_H__
tass 68:0847e35d08a6 9 #define __PICO_RBTREE_H__
tass 68:0847e35d08a6 10
tass 68:0847e35d08a6 11 #include <stdint.h>
tass 68:0847e35d08a6 12 #include "pico_config.h"
tass 68:0847e35d08a6 13
tass 68:0847e35d08a6 14 // This is used to declare a new tree, leaf root by default
tass 68:0847e35d08a6 15 #define PICO_TREE_DECLARE(name,compareFunction) \
tass 68:0847e35d08a6 16 struct pico_tree name =\
tass 68:0847e35d08a6 17 { \
tass 68:0847e35d08a6 18 &LEAF, \
tass 68:0847e35d08a6 19 compareFunction \
tass 68:0847e35d08a6 20 }
tass 68:0847e35d08a6 21
tass 68:0847e35d08a6 22 struct pico_tree_node
tass 68:0847e35d08a6 23 {
tass 68:0847e35d08a6 24 void* keyValue; // generic key
tass 68:0847e35d08a6 25 struct pico_tree_node* parent;
tass 68:0847e35d08a6 26 struct pico_tree_node* leftChild;
tass 68:0847e35d08a6 27 struct pico_tree_node* rightChild;
tass 68:0847e35d08a6 28 uint8_t color;
tass 68:0847e35d08a6 29 };
tass 68:0847e35d08a6 30
tass 68:0847e35d08a6 31 struct pico_tree
tass 68:0847e35d08a6 32 {
tass 68:0847e35d08a6 33 struct pico_tree_node * root; // root of the tree
tass 68:0847e35d08a6 34
tass 68:0847e35d08a6 35 // this function directly provides the keys as parameters not the nodes.
tass 68:0847e35d08a6 36 int (*compare)(void* keyA, void* keyB);
tass 68:0847e35d08a6 37 };
tass 68:0847e35d08a6 38
tass 68:0847e35d08a6 39 extern struct pico_tree_node LEAF; // generic leaf node
tass 68:0847e35d08a6 40 /*
tass 68:0847e35d08a6 41 * Manipulation functions
tass 68:0847e35d08a6 42 */
tass 68:0847e35d08a6 43 void * pico_tree_insert(struct pico_tree * tree, void * key);
tass 68:0847e35d08a6 44 void * pico_tree_delete(struct pico_tree * tree, void * key);
tass 68:0847e35d08a6 45 void * pico_tree_findKey(struct pico_tree * tree, void * key);
tass 68:0847e35d08a6 46 void pico_tree_drop(struct pico_tree * tree);
tass 68:0847e35d08a6 47 int pico_tree_empty(struct pico_tree * tree);
tass 68:0847e35d08a6 48 struct pico_tree_node * pico_tree_findNode(struct pico_tree * tree, void * key);
tass 68:0847e35d08a6 49
tass 68:0847e35d08a6 50 void * pico_tree_first(struct pico_tree * tree);
tass 68:0847e35d08a6 51 void * pico_tree_last(struct pico_tree * tree);
tass 68:0847e35d08a6 52 /*
tass 68:0847e35d08a6 53 * Traverse functions
tass 68:0847e35d08a6 54 */
tass 68:0847e35d08a6 55 struct pico_tree_node * pico_tree_lastNode(struct pico_tree_node * node);
tass 68:0847e35d08a6 56 struct pico_tree_node * pico_tree_firstNode(struct pico_tree_node * node);
tass 68:0847e35d08a6 57 struct pico_tree_node * pico_tree_next(struct pico_tree_node * node);
tass 68:0847e35d08a6 58 struct pico_tree_node * pico_tree_prev(struct pico_tree_node * node);
tass 68:0847e35d08a6 59
tass 68:0847e35d08a6 60 /*
tass 68:0847e35d08a6 61 * For each macros
tass 68:0847e35d08a6 62 */
tass 68:0847e35d08a6 63
tass 68:0847e35d08a6 64 #define pico_tree_foreach(idx,tree) \
tass 68:0847e35d08a6 65 for ((idx) = pico_tree_firstNode((tree)->root); \
tass 68:0847e35d08a6 66 (idx) != &LEAF; \
tass 68:0847e35d08a6 67 (idx) = pico_tree_next(idx))
tass 68:0847e35d08a6 68
tass 68:0847e35d08a6 69 #define pico_tree_foreach_reverse(idx,tree) \
tass 68:0847e35d08a6 70 for ((idx) = pico_tree_lastNode((tree)->root); \
tass 68:0847e35d08a6 71 (idx) != &LEAF; \
tass 68:0847e35d08a6 72 (idx) = pico_tree_prev(idx))
tass 68:0847e35d08a6 73
tass 68:0847e35d08a6 74 #define pico_tree_foreach_safe(idx,tree,idx2) \
tass 68:0847e35d08a6 75 for ((idx) = pico_tree_firstNode((tree)->root); \
tass 68:0847e35d08a6 76 ((idx) != &LEAF) && ((idx2) = pico_tree_next(idx), 1); \
tass 68:0847e35d08a6 77 (idx) = (idx2))
tass 68:0847e35d08a6 78
tass 68:0847e35d08a6 79 #define pico_tree_foreach_reverse_safe(idx,tree,idx2) \
tass 68:0847e35d08a6 80 for ((idx) = pico_tree_lastNode((tree)->root); \
tass 68:0847e35d08a6 81 ((idx) != &LEAF) && ((idx2) = pico_tree_prev(idx), 1); \
tass 68:0847e35d08a6 82 (idx) = (idx2))
tass 68:0847e35d08a6 83
tass 68:0847e35d08a6 84 #endif