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_stack.h@73:dfb737147f6e, 2013-09-27 (annotated)
- Committer:
- tass
- Date:
- Fri Sep 27 12:43:36 2013 +0000
- Revision:
- 73:dfb737147f6e
- Parent:
- 70:cd218dd180e5
- Child:
- 128:ae39e6e81531
Import from master branch.
Who changed what in which revision?
User | Revision | Line number | New 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 | *********************************************************************/ |
tass | 68:0847e35d08a6 | 6 | #ifndef _INCLUDE_PICO_STACK |
tass | 68:0847e35d08a6 | 7 | #define _INCLUDE_PICO_STACK |
tass | 68:0847e35d08a6 | 8 | #include "pico_config.h" |
tass | 68:0847e35d08a6 | 9 | #include "pico_frame.h" |
tass | 68:0847e35d08a6 | 10 | |
tass | 68:0847e35d08a6 | 11 | #define PICO_MAX_TIMERS 20 |
tass | 68:0847e35d08a6 | 12 | |
tass | 68:0847e35d08a6 | 13 | #define PICO_ETH_MTU 1514 |
tass | 70:cd218dd180e5 | 14 | #define PICO_IP_MTU 1500u |
tass | 68:0847e35d08a6 | 15 | |
tass | 68:0847e35d08a6 | 16 | /* ===== RECEIVING FUNCTIONS (from dev up to socket) ===== */ |
tass | 68:0847e35d08a6 | 17 | |
tass | 68:0847e35d08a6 | 18 | /* TRANSPORT LEVEL */ |
tass | 68:0847e35d08a6 | 19 | /* interface towards network */ |
tass | 70:cd218dd180e5 | 20 | int32_t pico_transport_receive(struct pico_frame *f, uint8_t proto); |
tass | 68:0847e35d08a6 | 21 | |
tass | 68:0847e35d08a6 | 22 | /* NETWORK LEVEL */ |
tass | 68:0847e35d08a6 | 23 | /* interface towards ethernet */ |
tass | 70:cd218dd180e5 | 24 | int32_t pico_network_receive(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 25 | |
tass | 68:0847e35d08a6 | 26 | /* The pico_ethernet_receive() function is used by |
tass | 68:0847e35d08a6 | 27 | * those devices supporting ETH in order to push packets up |
tass | 68:0847e35d08a6 | 28 | * into the stack. |
tass | 68:0847e35d08a6 | 29 | */ |
tass | 68:0847e35d08a6 | 30 | /* DATALINK LEVEL */ |
tass | 70:cd218dd180e5 | 31 | int32_t pico_ethernet_receive(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 32 | |
tass | 68:0847e35d08a6 | 33 | /* LOWEST LEVEL: interface towards devices. */ |
tass | 68:0847e35d08a6 | 34 | /* Device driver will call this function which returns immediately. |
tass | 68:0847e35d08a6 | 35 | * Incoming packet will be processed later on in the dev loop. |
tass | 68:0847e35d08a6 | 36 | */ |
tass | 70:cd218dd180e5 | 37 | int32_t pico_stack_recv(struct pico_device *dev, uint8_t *buffer, uint32_t len); |
tass | 68:0847e35d08a6 | 38 | |
tass | 68:0847e35d08a6 | 39 | |
tass | 68:0847e35d08a6 | 40 | /* ===== SENDIING FUNCTIONS (from socket down to dev) ===== */ |
tass | 68:0847e35d08a6 | 41 | |
tass | 70:cd218dd180e5 | 42 | int32_t pico_transport_send(struct pico_frame *f); |
tass | 70:cd218dd180e5 | 43 | int32_t pico_network_send(struct pico_frame *f); |
tass | 70:cd218dd180e5 | 44 | int32_t pico_ethernet_send(struct pico_frame *f); |
tass | 70:cd218dd180e5 | 45 | int32_t pico_sendto_dev(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 46 | |
tass | 68:0847e35d08a6 | 47 | /* ----- Initialization ----- */ |
tass | 68:0847e35d08a6 | 48 | void pico_stack_init(void); |
tass | 68:0847e35d08a6 | 49 | |
tass | 68:0847e35d08a6 | 50 | /* ----- Loop Function. ----- */ |
tass | 68:0847e35d08a6 | 51 | void pico_stack_tick(void); |
tass | 68:0847e35d08a6 | 52 | void pico_stack_loop(void); |
tass | 68:0847e35d08a6 | 53 | |
tass | 68:0847e35d08a6 | 54 | /* ---- Notifications for stack errors */ |
tass | 68:0847e35d08a6 | 55 | int pico_notify_socket_unreachable(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 56 | int pico_notify_proto_unreachable(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 57 | int pico_notify_dest_unreachable(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 58 | int pico_notify_ttl_expired(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 59 | |
tass | 68:0847e35d08a6 | 60 | /* Various. */ |
tass | 70:cd218dd180e5 | 61 | struct pico_timer; |
tass | 68:0847e35d08a6 | 62 | int pico_source_is_local(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 63 | int pico_destination_is_local(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 64 | void pico_store_network_origin(void *src, struct pico_frame *f); |
tass | 73:dfb737147f6e | 65 | struct pico_timer *pico_timer_add(uint32_t expire, void (*timer)(uint32_t, void *), void *arg); |
tass | 70:cd218dd180e5 | 66 | void pico_timer_cancel(struct pico_timer *t); |
tass | 68:0847e35d08a6 | 67 | uint32_t pico_rand(void); |
tass | 68:0847e35d08a6 | 68 | void pico_rand_feed(uint32_t feed); |
tass | 68:0847e35d08a6 | 69 | |
tass | 68:0847e35d08a6 | 70 | #endif |