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 RTOS
  • generic mbed Ethernet driver
  • high performance NXP LPC1768 specific Ethernet driver
  • Multi-threading support for mbed RTOS
  • Berkeley sockets and integration with the New Socket API
  • Fork of the apps running on top of the New Socket API
  • Scheduling 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.

Committer:
tass
Date:
Fri May 17 12:09:59 2013 +0000
Revision:
1:cfe8984a32b4
Parent:
libraries/picotcp/include/pico_frame.h@0:d7f2341ab245
Update for smaller SOCKETQ

Who changed what in which revision?

UserRevisionLine numberNew contents of line
daniele 0:d7f2341ab245 1 /*********************************************************************
daniele 0:d7f2341ab245 2 PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved.
daniele 0:d7f2341ab245 3 See LICENSE and COPYING for usage.
daniele 0:d7f2341ab245 4
daniele 0:d7f2341ab245 5 *********************************************************************/
daniele 0:d7f2341ab245 6 #ifndef _INCLUDE_PICO_FRAME
daniele 0:d7f2341ab245 7 #define _INCLUDE_PICO_FRAME
daniele 0:d7f2341ab245 8 #include "pico_config.h"
daniele 0:d7f2341ab245 9
daniele 0:d7f2341ab245 10
daniele 0:d7f2341ab245 11 #define PICO_FRAME_FLAG_BCAST (0x01)
daniele 0:d7f2341ab245 12 #define PICO_FRAME_FLAG_SACKED (0x80)
daniele 0:d7f2341ab245 13 #define IS_BCAST(f) ((f->flags & PICO_FRAME_FLAG_BCAST) == PICO_FRAME_FLAG_BCAST)
daniele 0:d7f2341ab245 14
daniele 0:d7f2341ab245 15
daniele 0:d7f2341ab245 16 struct pico_socket;
daniele 0:d7f2341ab245 17
daniele 0:d7f2341ab245 18
daniele 0:d7f2341ab245 19 struct pico_frame {
daniele 0:d7f2341ab245 20
daniele 0:d7f2341ab245 21 /* Connector for queues */
daniele 0:d7f2341ab245 22 struct pico_frame *next;
daniele 0:d7f2341ab245 23
daniele 0:d7f2341ab245 24 /* Start of the whole buffer, total frame length. */
daniele 0:d7f2341ab245 25 unsigned char *buffer;
daniele 0:d7f2341ab245 26 uint32_t buffer_len;
daniele 0:d7f2341ab245 27
daniele 0:d7f2341ab245 28 /* For outgoing packets: this is the meaningful buffer. */
daniele 0:d7f2341ab245 29 unsigned char *start;
daniele 0:d7f2341ab245 30 uint32_t len;
daniele 0:d7f2341ab245 31
daniele 0:d7f2341ab245 32 /* Pointer to usage counter */
daniele 0:d7f2341ab245 33 uint32_t *usage_count;
daniele 0:d7f2341ab245 34
daniele 0:d7f2341ab245 35 /* Pointer to protocol headers */
daniele 0:d7f2341ab245 36 uint8_t *datalink_hdr;
daniele 0:d7f2341ab245 37
daniele 0:d7f2341ab245 38 uint8_t *net_hdr;
daniele 0:d7f2341ab245 39 int net_len;
daniele 0:d7f2341ab245 40 uint8_t *transport_hdr;
daniele 0:d7f2341ab245 41 int transport_len;
daniele 0:d7f2341ab245 42 uint8_t *app_hdr;
daniele 0:d7f2341ab245 43 int app_len;
daniele 0:d7f2341ab245 44
daniele 0:d7f2341ab245 45 /* Pointer to the phisical device this packet belongs to.
daniele 0:d7f2341ab245 46 * Should be valid in both routing directions
daniele 0:d7f2341ab245 47 */
daniele 0:d7f2341ab245 48 struct pico_device *dev;
daniele 0:d7f2341ab245 49
daniele 0:d7f2341ab245 50 unsigned long timestamp;
daniele 0:d7f2341ab245 51
daniele 0:d7f2341ab245 52 /* Failures due to bad datalink addressing. */
daniele 0:d7f2341ab245 53 uint16_t failure_count;
daniele 0:d7f2341ab245 54
daniele 0:d7f2341ab245 55 /* Protocol over IP */
daniele 0:d7f2341ab245 56 uint8_t proto;
daniele 0:d7f2341ab245 57
daniele 0:d7f2341ab245 58 /* PICO_FRAME_FLAG_* */
daniele 0:d7f2341ab245 59 uint8_t flags;
daniele 0:d7f2341ab245 60
daniele 0:d7f2341ab245 61 /* Pointer to payload */
daniele 0:d7f2341ab245 62 unsigned char *payload;
daniele 0:d7f2341ab245 63 int payload_len;
daniele 0:d7f2341ab245 64
daniele 0:d7f2341ab245 65 #ifdef PICO_SUPPORT_IPFRAG
daniele 0:d7f2341ab245 66 /* Payload fragmentation info (big endian)*/
daniele 0:d7f2341ab245 67 uint16_t frag;
daniele 0:d7f2341ab245 68 #endif
daniele 0:d7f2341ab245 69
daniele 0:d7f2341ab245 70 /* Pointer to socket */
daniele 0:d7f2341ab245 71 struct pico_socket *sock;
daniele 0:d7f2341ab245 72
daniele 0:d7f2341ab245 73 /* Pointer to transport info, used to store remote UDP duple (IP + port) */
daniele 0:d7f2341ab245 74 void *info;
daniele 0:d7f2341ab245 75
daniele 0:d7f2341ab245 76 /*Priority. "best-effort" priority, the default value is 0. Priority can be in between -10 and +10*/
daniele 0:d7f2341ab245 77 int8_t priority;
daniele 0:d7f2341ab245 78 };
daniele 0:d7f2341ab245 79
daniele 0:d7f2341ab245 80 /** frame alloc/dealloc/copy **/
daniele 0:d7f2341ab245 81 void pico_frame_discard(struct pico_frame *f);
daniele 0:d7f2341ab245 82 struct pico_frame *pico_frame_copy(struct pico_frame *f);
daniele 0:d7f2341ab245 83 struct pico_frame *pico_frame_deepcopy(struct pico_frame *f);
daniele 0:d7f2341ab245 84 struct pico_frame *pico_frame_alloc(int size);
daniele 0:d7f2341ab245 85 uint16_t pico_checksum(void *inbuf, int len);
daniele 0:d7f2341ab245 86 uint16_t pico_dualbuffer_checksum(void *b1, int len1, void *b2, int len2);
daniele 0:d7f2341ab245 87
daniele 0:d7f2341ab245 88 static inline int pico_is_digit(char c)
daniele 0:d7f2341ab245 89 {
daniele 0:d7f2341ab245 90 if (c < '0' || c > '9')
daniele 0:d7f2341ab245 91 return 0;
daniele 0:d7f2341ab245 92 return 1;
daniele 0:d7f2341ab245 93 }
daniele 0:d7f2341ab245 94
daniele 0:d7f2341ab245 95 #endif