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:
Mon Sep 28 13:16:18 2015 +0200
Revision:
152:a3d286bf94e5
Parent:
149:5f4cb161cec3
Mercurial: latest development version of PicoTCP

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tass 68:0847e35d08a6 1 /*********************************************************************
tass 152:a3d286bf94e5 2 PicoTCP. Copyright (c) 2012-2015 Altran Intelligent Systems. 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_CONST
tass picotcp@tass.be 149:5f4cb161cec3 7 #define INCLUDE_PICO_CONST
tass 68:0847e35d08a6 8 /* Included from pico_config.h */
tass picotcp@tass.be 149:5f4cb161cec3 9
tass picotcp@tass.be 149:5f4cb161cec3 10 /** Non-endian dependant constants */
tass picotcp@tass.be 149:5f4cb161cec3 11 #define PICO_SIZE_IP4 4
tass picotcp@tass.be 149:5f4cb161cec3 12 #define PICO_SIZE_IP6 16
tass picotcp@tass.be 149:5f4cb161cec3 13 #define PICO_SIZE_ETH 6
tass picotcp@tass.be 149:5f4cb161cec3 14 #define PICO_SIZE_TRANS 8
tass picotcp@tass.be 149:5f4cb161cec3 15
tass 68:0847e35d08a6 16 /** Endian-dependant constants **/
tass 128:ae39e6e81531 17 typedef uint64_t pico_time;
tass 128:ae39e6e81531 18 extern volatile uint64_t pico_tick;
tass 68:0847e35d08a6 19
tass 68:0847e35d08a6 20
tass picotcp@tass.be 133:5b075f5e141a 21 /*** *** *** *** *** *** ***
tass picotcp@tass.be 133:5b075f5e141a 22 *** ARP CONFIG ***
tass picotcp@tass.be 133:5b075f5e141a 23 *** *** *** *** *** *** ***/
tass picotcp@tass.be 149:5f4cb161cec3 24
tass picotcp@tass.be 149:5f4cb161cec3 25 #include "pico_addressing.h"
tass picotcp@tass.be 149:5f4cb161cec3 26
tass picotcp@tass.be 133:5b075f5e141a 27 /* Maximum amount of accepted ARP requests per burst interval */
tass picotcp@tass.be 133:5b075f5e141a 28 #define PICO_ARP_MAX_RATE 1
tass picotcp@tass.be 133:5b075f5e141a 29 /* Duration of the burst interval in milliseconds */
tass picotcp@tass.be 133:5b075f5e141a 30 #define PICO_ARP_INTERVAL 1000
tass 68:0847e35d08a6 31
tass 68:0847e35d08a6 32 /* Add well-known host numbers here. (bigendian constants only beyond this point) */
tass 68:0847e35d08a6 33 #define PICO_IP4_ANY (0x00000000U)
tass 68:0847e35d08a6 34 #define PICO_IP4_BCAST (0xffffffffU)
tass 68:0847e35d08a6 35
tass 68:0847e35d08a6 36 /* defined in modules/pico_ipv6.c */
tass 68:0847e35d08a6 37 #ifdef PICO_SUPPORT_IPV6
tass 68:0847e35d08a6 38 extern const uint8_t PICO_IPV6_ANY[PICO_SIZE_IP6];
tass 68:0847e35d08a6 39 #endif
tass 68:0847e35d08a6 40
tass picotcp@tass.be 133:5b075f5e141a 41 static inline uint32_t pico_hash(const void *buf, uint32_t size)
tass 68:0847e35d08a6 42 {
TASS Belgium NV 131:4758606c9316 43 uint32_t hash = 5381;
tass picotcp@tass.be 133:5b075f5e141a 44 uint32_t i;
tass picotcp@tass.be 137:a1c8bfa9d691 45 const uint8_t *ptr = (const uint8_t *)buf;
tass picotcp@tass.be 133:5b075f5e141a 46 for(i = 0; i < size; i++)
tass picotcp@tass.be 133:5b075f5e141a 47 hash = ((hash << 5) + hash) + ptr[i]; /* hash * 33 + char */
TASS Belgium NV 131:4758606c9316 48 return hash;
tass 68:0847e35d08a6 49 }
tass 68:0847e35d08a6 50
tass 68:0847e35d08a6 51 /* Debug */
TASS Belgium NV 131:4758606c9316 52 /* #define PICO_SUPPORT_DEBUG_MEMORY */
TASS Belgium NV 131:4758606c9316 53 /* #define PICO_SUPPORT_DEBUG_TOOLS */
tass 68:0847e35d08a6 54 #endif