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_protocol.h
- Revision:
- 137:a1c8bfa9d691
- Parent:
- 134:cc4e6d2654d9
- Child:
- 149:5f4cb161cec3
--- a/include/pico_protocol.h Fri Jan 17 10:13:51 2014 +0100 +++ b/include/pico_protocol.h Fri Feb 07 11:21:12 2014 +0100 @@ -42,8 +42,10 @@ PICO_ERR_EPROTONOSUPPORT = 93, /* ... */ + PICO_ERR_EOPNOTSUPP = 95, PICO_ERR_EADDRINUSE = 98, PICO_ERR_EADDRNOTAVAIL, + PICO_ERR_ENETDOWN, PICO_ERR_ENETUNREACH, /* ... */ @@ -58,16 +60,13 @@ PICO_ERR_ECONNREFUSED = 111, PICO_ERR_EHOSTDOWN, PICO_ERR_EHOSTUNREACH, - /* ... */ - PICO_ERR_EOPNOTSUPP = 122, - }; typedef enum pico_err_e pico_err_t; extern volatile pico_err_t pico_err; -#define IS_IPV6(f) ((((uint8_t *)(f->net_hdr))[0] & 0xf0) == 0x60) -#define IS_IPV4(f) ((((uint8_t *)(f->net_hdr))[0] & 0xf0) == 0x40) +#define IS_IPV6(f) (f && f->net_hdr && ((((uint8_t *)(f->net_hdr))[0] & 0xf0) == 0x60)) +#define IS_IPV4(f) (f && f->net_hdr && ((((uint8_t *)(f->net_hdr))[0] & 0xf0) == 0x40)) #define MAX_PROTOCOL_NAME 16 @@ -79,9 +78,9 @@ struct pico_queue *q_in; struct pico_queue *q_out; struct pico_frame *(*alloc)(struct pico_protocol *self, uint16_t size); /* Frame allocation. */ - int (*push) (struct pico_protocol *self, struct pico_frame *p); /* Push function, for active outgoing pkts from above */ - int (*process_out) (struct pico_protocol *self, struct pico_frame *p); /* Send loop. */ - int (*process_in) (struct pico_protocol *self, struct pico_frame *p); /* Recv loop. */ + int (*push)(struct pico_protocol *self, struct pico_frame *p); /* Push function, for active outgoing pkts from above */ + int (*process_out)(struct pico_protocol *self, struct pico_frame *p); /* Send loop. */ + int (*process_in)(struct pico_protocol *self, struct pico_frame *p); /* Recv loop. */ }; int pico_protocols_loop(int loop_score);