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: include/pico_tree.h
- Revision:
- 1:cfe8984a32b4
- Parent:
- 0:d7f2341ab245
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/pico_tree.h Fri May 17 12:09:59 2013 +0000 @@ -0,0 +1,85 @@ +/********************************************************************* +PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved. +See LICENSE and COPYING for usage. + +Author: Andrei Carp <andrei.carp@tass.be> +*********************************************************************/ + +#ifndef __PICO_RBTREE_H__ +#define __PICO_RBTREE_H__ + +#include <stdint.h> +#include "pico_config.h" + +// This is used to declare a new tree, leaf root by default +#define PICO_TREE_DECLARE(name,compareFunction) \ +struct pico_tree name =\ +{ \ + &LEAF, \ + compareFunction \ +} + + +struct pico_tree_node +{ + void* keyValue; // generic key + struct pico_tree_node* parent; + struct pico_tree_node* leftChild; + struct pico_tree_node* rightChild; + uint8_t color; +}; + +struct pico_tree +{ + struct pico_tree_node * root; // root of the tree + + // this function directly provides the keys as parameters not the nodes. + int (*compare)(void* keyA, void* keyB); +}; + +extern struct pico_tree_node LEAF; // generic leaf node +/* + * Manipulation functions + */ +void * pico_tree_insert(struct pico_tree * tree, void * key); +void * pico_tree_delete(struct pico_tree * tree, void * key); +void * pico_tree_findKey(struct pico_tree * tree, void * key); +void pico_tree_drop(struct pico_tree * tree); +int pico_tree_empty(struct pico_tree * tree); +struct pico_tree_node * pico_tree_findNode(struct pico_tree * tree, void * key); + +void * pico_tree_first(struct pico_tree * tree); +void * pico_tree_last(struct pico_tree * tree); +/* + * Traverse functions + */ +struct pico_tree_node * pico_tree_lastNode(struct pico_tree_node * node); +struct pico_tree_node * pico_tree_firstNode(struct pico_tree_node * node); +struct pico_tree_node * pico_tree_next(struct pico_tree_node * node); +struct pico_tree_node * pico_tree_prev(struct pico_tree_node * node); + +/* + * For each macros + */ + +#define pico_tree_foreach(idx,tree) \ + for ((idx) = pico_tree_firstNode((tree)->root); \ + (idx) != &LEAF; \ + (idx) = pico_tree_next(idx)) + +#define pico_tree_foreach_reverse(idx,tree) \ + for ((idx) = pico_tree_lastNode((tree)->root); \ + (idx) != &LEAF; \ + (idx) = pico_tree_prev(idx)) + +#define pico_tree_foreach_safe(idx,tree,idx2) \ + for ((idx) = pico_tree_firstNode((tree)->root); \ + ((idx) != &LEAF) && ((idx2) = pico_tree_next(idx), 1); \ + (idx) = (idx2)) + +#define pico_tree_foreach_reverse_safe(idx,tree,idx2) \ + for ((idx) = pico_tree_lastNode((tree)->root); \ + ((idx) != &LEAF) && ((idx2) = pico_tree_prev(idx), 1); \ + (idx) = (idx2)) + +#endif