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@149:5f4cb161cec3, 2014-04-09 (annotated)
- Committer:
- tass picotcp@tass.be
- Date:
- Wed Apr 09 14:31:41 2014 +0200
- Revision:
- 149:5f4cb161cec3
- Parent:
- 137:a1c8bfa9d691
- Child:
- 152:a3d286bf94e5
Update from git masterbranch
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 | *********************************************************************/ |
tass picotcp@tass.be | 149:5f4cb161cec3 | 6 | #ifndef INCLUDE_PICO_STACK |
tass picotcp@tass.be | 149:5f4cb161cec3 | 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 picotcp@tass.be | 149:5f4cb161cec3 | 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 Belgium NV |
131:4758606c9316 | 26 | /* The pico_ethernet_receive() function is used by |
TASS Belgium NV |
131:4758606c9316 | 27 | * those devices supporting ETH in order to push packets up |
TASS Belgium NV |
131:4758606c9316 | 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 picotcp@tass.be | 149:5f4cb161cec3 | 36 | * The zerocopy version will associate the current buffer to the newly created frame. |
tass picotcp@tass.be | 149:5f4cb161cec3 | 37 | * Warning: the buffer used in the zerocopy version MUST have been allocated using PICO_ZALLOC() |
tass | 68:0847e35d08a6 | 38 | */ |
tass | 70:cd218dd180e5 | 39 | int32_t pico_stack_recv(struct pico_device *dev, uint8_t *buffer, uint32_t len); |
tass picotcp@tass.be | 149:5f4cb161cec3 | 40 | int32_t pico_stack_recv_zerocopy(struct pico_device *dev, uint8_t *buffer, uint32_t len); |
tass | 68:0847e35d08a6 | 41 | |
tass | 68:0847e35d08a6 | 42 | |
tass | 68:0847e35d08a6 | 43 | /* ===== SENDIING FUNCTIONS (from socket down to dev) ===== */ |
tass | 68:0847e35d08a6 | 44 | |
tass | 70:cd218dd180e5 | 45 | int32_t pico_network_send(struct pico_frame *f); |
tass | 70:cd218dd180e5 | 46 | int32_t pico_ethernet_send(struct pico_frame *f); |
tass | 70:cd218dd180e5 | 47 | int32_t pico_sendto_dev(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 48 | |
tass | 68:0847e35d08a6 | 49 | /* ----- Initialization ----- */ |
tass picotcp@tass.be | 149:5f4cb161cec3 | 50 | int pico_stack_init(void); |
tass | 68:0847e35d08a6 | 51 | |
tass | 68:0847e35d08a6 | 52 | /* ----- Loop Function. ----- */ |
tass | 68:0847e35d08a6 | 53 | void pico_stack_tick(void); |
tass | 68:0847e35d08a6 | 54 | void pico_stack_loop(void); |
tass | 68:0847e35d08a6 | 55 | |
tass | 68:0847e35d08a6 | 56 | /* ---- Notifications for stack errors */ |
tass | 68:0847e35d08a6 | 57 | int pico_notify_socket_unreachable(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 58 | int pico_notify_proto_unreachable(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 59 | int pico_notify_dest_unreachable(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 60 | int pico_notify_ttl_expired(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 61 | |
tass | 68:0847e35d08a6 | 62 | /* Various. */ |
tass | 70:cd218dd180e5 | 63 | struct pico_timer; |
tass | 68:0847e35d08a6 | 64 | int pico_source_is_local(struct pico_frame *f); |
tass | 68:0847e35d08a6 | 65 | void pico_store_network_origin(void *src, struct pico_frame *f); |
tass | 128:ae39e6e81531 | 66 | struct pico_timer *pico_timer_add(pico_time expire, void (*timer)(pico_time, void *), void *arg); |
tass | 70:cd218dd180e5 | 67 | void pico_timer_cancel(struct pico_timer *t); |
tass picotcp@tass.be | 137:a1c8bfa9d691 | 68 | pico_time pico_timer_get_expire(struct pico_timer *t); |
tass | 68:0847e35d08a6 | 69 | uint32_t pico_rand(void); |
tass | 68:0847e35d08a6 | 70 | void pico_rand_feed(uint32_t feed); |
tass | 68:0847e35d08a6 | 71 | |
tass | 68:0847e35d08a6 | 72 | #endif |