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.
include/pico_tree.h@131:4758606c9316, 2013-12-16 (annotated)
- Committer:
- TASS Belgium NV
- Date:
- Mon Dec 16 11:25:54 2013 +0100
- Revision:
- 131:4758606c9316
- Parent:
- 68:0847e35d08a6
- Child:
- 149:5f4cb161cec3
Syncronized with master branch
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tass | 68:0847e35d08a6 | 1 | /********************************************************************* |
TASS Belgium NV |
131:4758606c9316 | 2 | PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved. |
TASS Belgium NV |
131:4758606c9316 | 3 | See LICENSE and COPYING for usage. |
tass | 68:0847e35d08a6 | 4 | |
TASS Belgium NV |
131:4758606c9316 | 5 | Author: Andrei Carp <andrei.carp@tass.be> |
TASS Belgium NV |
131:4758606c9316 | 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 Belgium NV |
131:4758606c9316 | 14 | /* This is used to declare a new tree, leaf root by default */ |
TASS Belgium NV |
131:4758606c9316 | 15 | #define PICO_TREE_DECLARE(name, compareFunction) \ |
TASS Belgium NV |
131:4758606c9316 | 16 | struct pico_tree name = \ |
TASS Belgium NV |
131:4758606c9316 | 17 | { \ |
TASS Belgium NV |
131:4758606c9316 | 18 | &LEAF, \ |
TASS Belgium NV |
131:4758606c9316 | 19 | compareFunction \ |
TASS Belgium NV |
131:4758606c9316 | 20 | } |
tass | 68:0847e35d08a6 | 21 | |
tass | 68:0847e35d08a6 | 22 | struct pico_tree_node |
tass | 68:0847e35d08a6 | 23 | { |
TASS Belgium NV |
131:4758606c9316 | 24 | void*keyValue; /* generic key */ |
TASS Belgium NV |
131:4758606c9316 | 25 | struct pico_tree_node*parent; |
TASS Belgium NV |
131:4758606c9316 | 26 | struct pico_tree_node*leftChild; |
TASS Belgium NV |
131:4758606c9316 | 27 | struct pico_tree_node*rightChild; |
TASS Belgium NV |
131:4758606c9316 | 28 | uint8_t color; |
tass | 68:0847e35d08a6 | 29 | }; |
tass | 68:0847e35d08a6 | 30 | |
tass | 68:0847e35d08a6 | 31 | struct pico_tree |
tass | 68:0847e35d08a6 | 32 | { |
TASS Belgium NV |
131:4758606c9316 | 33 | struct pico_tree_node *root; /* root of the tree */ |
tass | 68:0847e35d08a6 | 34 | |
TASS Belgium NV |
131:4758606c9316 | 35 | /* this function directly provides the keys as parameters not the nodes. */ |
TASS Belgium NV |
131:4758606c9316 | 36 | int (*compare)(void*keyA, void*keyB); |
tass | 68:0847e35d08a6 | 37 | }; |
tass | 68:0847e35d08a6 | 38 | |
TASS Belgium NV |
131:4758606c9316 | 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 Belgium NV |
131:4758606c9316 | 43 | void *pico_tree_insert(struct pico_tree *tree, void *key); |
TASS Belgium NV |
131:4758606c9316 | 44 | void *pico_tree_delete(struct pico_tree *tree, void *key); |
TASS Belgium NV |
131:4758606c9316 | 45 | void *pico_tree_findKey(struct pico_tree *tree, void *key); |
TASS Belgium NV |
131:4758606c9316 | 46 | void pico_tree_drop(struct pico_tree *tree); |
TASS Belgium NV |
131:4758606c9316 | 47 | int pico_tree_empty(struct pico_tree *tree); |
TASS Belgium NV |
131:4758606c9316 | 48 | struct pico_tree_node *pico_tree_findNode(struct pico_tree *tree, void *key); |
tass | 68:0847e35d08a6 | 49 | |
TASS Belgium NV |
131:4758606c9316 | 50 | void *pico_tree_first(struct pico_tree *tree); |
TASS Belgium NV |
131:4758606c9316 | 51 | void *pico_tree_last(struct pico_tree *tree); |
tass | 68:0847e35d08a6 | 52 | /* |
tass | 68:0847e35d08a6 | 53 | * Traverse functions |
tass | 68:0847e35d08a6 | 54 | */ |
TASS Belgium NV |
131:4758606c9316 | 55 | struct pico_tree_node *pico_tree_lastNode(struct pico_tree_node *node); |
TASS Belgium NV |
131:4758606c9316 | 56 | struct pico_tree_node *pico_tree_firstNode(struct pico_tree_node *node); |
TASS Belgium NV |
131:4758606c9316 | 57 | struct pico_tree_node *pico_tree_next(struct pico_tree_node *node); |
TASS Belgium NV |
131:4758606c9316 | 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 Belgium NV |
131:4758606c9316 | 64 | #define pico_tree_foreach(idx, tree) \ |
TASS Belgium NV |
131:4758606c9316 | 65 | for ((idx) = pico_tree_firstNode((tree)->root); \ |
TASS Belgium NV |
131:4758606c9316 | 66 | (idx) != &LEAF; \ |
TASS Belgium NV |
131:4758606c9316 | 67 | (idx) = pico_tree_next(idx)) |
tass | 68:0847e35d08a6 | 68 | |
TASS Belgium NV |
131:4758606c9316 | 69 | #define pico_tree_foreach_reverse(idx, tree) \ |
TASS Belgium NV |
131:4758606c9316 | 70 | for ((idx) = pico_tree_lastNode((tree)->root); \ |
TASS Belgium NV |
131:4758606c9316 | 71 | (idx) != &LEAF; \ |
TASS Belgium NV |
131:4758606c9316 | 72 | (idx) = pico_tree_prev(idx)) |
tass | 68:0847e35d08a6 | 73 | |
TASS Belgium NV |
131:4758606c9316 | 74 | #define pico_tree_foreach_safe(idx, tree, idx2) \ |
TASS Belgium NV |
131:4758606c9316 | 75 | for ((idx) = pico_tree_firstNode((tree)->root); \ |
TASS Belgium NV |
131:4758606c9316 | 76 | ((idx) != &LEAF) && ((idx2) = pico_tree_next(idx), 1); \ |
TASS Belgium NV |
131:4758606c9316 | 77 | (idx) = (idx2)) |
tass | 68:0847e35d08a6 | 78 | |
TASS Belgium NV |
131:4758606c9316 | 79 | #define pico_tree_foreach_reverse_safe(idx, tree, idx2) \ |
TASS Belgium NV |
131:4758606c9316 | 80 | for ((idx) = pico_tree_lastNode((tree)->root); \ |
TASS Belgium NV |
131:4758606c9316 | 81 | ((idx) != &LEAF) && ((idx2) = pico_tree_prev(idx), 1); \ |
TASS Belgium NV |
131:4758606c9316 | 82 | (idx) = (idx2)) |
tass | 68:0847e35d08a6 | 83 | |
tass | 68:0847e35d08a6 | 84 | #endif |