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:
Thu Jan 28 15:12:00 2016 +0100
Revision:
155:a70f34550c34
Parent:
152:a3d286bf94e5
Adding TCP flag for FIN.

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 Belgium NV 131:4758606c9316 6
TASS Belgium NV 131:4758606c9316 7 Authors: Kristof Roelants, Simon Maes, Brecht Van Cauwenberghe
TASS Belgium NV 131:4758606c9316 8 *********************************************************************/
tass 68:0847e35d08a6 9
tass picotcp@tass.be 149:5f4cb161cec3 10 #ifndef INCLUDE_PICO_NAT
tass picotcp@tass.be 149:5f4cb161cec3 11 #define INCLUDE_PICO_NAT
tass 68:0847e35d08a6 12 #include "pico_frame.h"
tass 68:0847e35d08a6 13
tass 68:0847e35d08a6 14 #define PICO_NAT_PORT_FORWARD_DEL 0
tass 68:0847e35d08a6 15 #define PICO_NAT_PORT_FORWARD_ADD 1
tass 68:0847e35d08a6 16
tass 68:0847e35d08a6 17 #ifdef PICO_SUPPORT_NAT
tass 68:0847e35d08a6 18 void pico_ipv4_nat_print_table(void);
tass 68:0847e35d08a6 19 int pico_ipv4_nat_find(uint16_t nat_port, struct pico_ip4 *src_addr, uint16_t src_port, uint8_t proto);
tass 68:0847e35d08a6 20 int pico_ipv4_port_forward(struct pico_ip4 nat_addr, uint16_t nat_port, struct pico_ip4 src_addr, uint16_t src_port, uint8_t proto, uint8_t flag);
tass 68:0847e35d08a6 21
tass 68:0847e35d08a6 22 int pico_ipv4_nat_inbound(struct pico_frame *f, struct pico_ip4 *link_addr);
tass 68:0847e35d08a6 23 int pico_ipv4_nat_outbound(struct pico_frame *f, struct pico_ip4 *link_addr);
tass 68:0847e35d08a6 24 int pico_ipv4_nat_enable(struct pico_ipv4_link *link);
tass 68:0847e35d08a6 25 int pico_ipv4_nat_disable(void);
tass 68:0847e35d08a6 26 int pico_ipv4_nat_is_enabled(struct pico_ip4 *link_addr);
tass 68:0847e35d08a6 27 #else
tass 68:0847e35d08a6 28
TASS Belgium NV 131:4758606c9316 29 #define pico_ipv4_nat_print_table() do {} while(0)
tass 68:0847e35d08a6 30 static inline int pico_ipv4_nat_inbound(struct pico_frame *f, struct pico_ip4 *link_addr)
tass 68:0847e35d08a6 31 {
tass 152:a3d286bf94e5 32 (void)f;
tass 152:a3d286bf94e5 33 (void)link_addr;
TASS Belgium NV 131:4758606c9316 34 pico_err = PICO_ERR_EPROTONOSUPPORT;
TASS Belgium NV 131:4758606c9316 35 return -1;
tass 68:0847e35d08a6 36 }
tass 68:0847e35d08a6 37
tass 68:0847e35d08a6 38 static inline int pico_ipv4_nat_outbound(struct pico_frame *f, struct pico_ip4 *link_addr)
tass 68:0847e35d08a6 39 {
tass 152:a3d286bf94e5 40 (void)f;
tass 152:a3d286bf94e5 41 (void)link_addr;
TASS Belgium NV 131:4758606c9316 42 pico_err = PICO_ERR_EPROTONOSUPPORT;
TASS Belgium NV 131:4758606c9316 43 return -1;
tass 68:0847e35d08a6 44 }
tass 68:0847e35d08a6 45
tass 68:0847e35d08a6 46 static inline int pico_ipv4_nat_enable(struct pico_ipv4_link *link)
tass 68:0847e35d08a6 47 {
tass 152:a3d286bf94e5 48 (void)link;
TASS Belgium NV 131:4758606c9316 49 pico_err = PICO_ERR_EPROTONOSUPPORT;
TASS Belgium NV 131:4758606c9316 50 return -1;
tass 68:0847e35d08a6 51 }
tass 68:0847e35d08a6 52
tass 68:0847e35d08a6 53 static inline int pico_ipv4_nat_disable(void)
tass 68:0847e35d08a6 54 {
TASS Belgium NV 131:4758606c9316 55 pico_err = PICO_ERR_EPROTONOSUPPORT;
TASS Belgium NV 131:4758606c9316 56 return -1;
tass 68:0847e35d08a6 57 }
tass 68:0847e35d08a6 58
tass 68:0847e35d08a6 59 static inline int pico_ipv4_nat_is_enabled(struct pico_ip4 *link_addr)
tass 68:0847e35d08a6 60 {
tass 152:a3d286bf94e5 61 (void)link_addr;
TASS Belgium NV 131:4758606c9316 62 pico_err = PICO_ERR_EPROTONOSUPPORT;
TASS Belgium NV 131:4758606c9316 63 return -1;
tass 68:0847e35d08a6 64 }
tass 68:0847e35d08a6 65
tass 68:0847e35d08a6 66 static inline int pico_ipv4_nat_find(uint16_t nat_port, struct pico_ip4 *src_addr, uint16_t src_port, uint8_t proto)
tass 68:0847e35d08a6 67 {
tass 152:a3d286bf94e5 68 (void)nat_port;
tass 152:a3d286bf94e5 69 (void)src_addr;
tass 152:a3d286bf94e5 70 (void)src_port;
tass 152:a3d286bf94e5 71 (void)proto;
TASS Belgium NV 131:4758606c9316 72 pico_err = PICO_ERR_EPROTONOSUPPORT;
TASS Belgium NV 131:4758606c9316 73 return -1;
tass 68:0847e35d08a6 74 }
tass 68:0847e35d08a6 75
tass 68:0847e35d08a6 76 static inline int pico_ipv4_port_forward(struct pico_ip4 nat_addr, uint16_t nat_port, struct pico_ip4 src_addr, uint16_t src_port, uint8_t proto, uint8_t flag)
tass 68:0847e35d08a6 77 {
tass 152:a3d286bf94e5 78 (void)nat_addr;
tass 152:a3d286bf94e5 79 (void)nat_port;
tass 152:a3d286bf94e5 80 (void)src_addr;
tass 152:a3d286bf94e5 81 (void)src_port;
tass 152:a3d286bf94e5 82 (void)proto;
tass 152:a3d286bf94e5 83 (void)flag;
TASS Belgium NV 131:4758606c9316 84 pico_err = PICO_ERR_EPROTONOSUPPORT;
TASS Belgium NV 131:4758606c9316 85 return -1;
tass 68:0847e35d08a6 86 }
tass 68:0847e35d08a6 87 #endif
tass 68:0847e35d08a6 88
tass 68:0847e35d08a6 89 #endif /* _INCLUDE_PICO_NAT */
tass 68:0847e35d08a6 90