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 Sep 19 12:38:53 2013 +0000
Revision:
63:97f481e33cb2
Parent:
51:ab4529a384a6
Update from the master branch

Who changed what in which revision?

UserRevisionLine numberNew contents of line
daniele 3:b4047e8a0123 1 /*********************************************************************
daniele 3:b4047e8a0123 2 PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved.
daniele 3:b4047e8a0123 3 See LICENSE and COPYING for usage.
daniele 3:b4047e8a0123 4
daniele 3:b4047e8a0123 5 .
daniele 3:b4047e8a0123 6
daniele 3:b4047e8a0123 7 Authors: Kristof Roelants, Simon Maes, Brecht Van Cauwenberghe
daniele 3:b4047e8a0123 8 *********************************************************************/
daniele 3:b4047e8a0123 9
daniele 3:b4047e8a0123 10 #ifndef _INCLUDE_PICO_NAT
daniele 3:b4047e8a0123 11 #define _INCLUDE_PICO_NAT
daniele 3:b4047e8a0123 12 #include "pico_frame.h"
daniele 3:b4047e8a0123 13
tass 63:97f481e33cb2 14 #define PICO_DEL_FLAGS_FIN_FORWARD (0x8000)
tass 63:97f481e33cb2 15 #define PICO_DEL_FLAGS_FIN_BACKWARD (0x4000)
tass 63:97f481e33cb2 16 #define PICO_DEL_FLAGS_SYN (0x2000)
tass 63:97f481e33cb2 17 #define PICO_DEL_FLAGS_RST (0x1000)
tass 63:97f481e33cb2 18
tass 63:97f481e33cb2 19 #define PICO_IPV4_FORWARD_DEL 0
tass 63:97f481e33cb2 20 #define PICO_IPV4_FORWARD_ADD 1
daniele 3:b4047e8a0123 21
daniele 3:b4047e8a0123 22 #ifdef PICO_SUPPORT_NAT
daniele 3:b4047e8a0123 23 void pico_ipv4_nat_print_table(void);
tass 63:97f481e33cb2 24 int pico_ipv4_nat_add(struct pico_ip4 pub_addr, uint16_t pub_port, struct pico_ip4 priv_addr, uint16_t priv_port, uint8_t proto);
tass 63:97f481e33cb2 25 int pico_ipv4_nat_del(uint16_t pub_port, uint8_t proto);
tass 63:97f481e33cb2 26 int pico_ipv4_nat_find(uint16_t pub_port, struct pico_ip4 *priv_addr, uint16_t priv_port, uint8_t proto);
tass 63:97f481e33cb2 27 int pico_ipv4_port_forward(struct pico_ip4 pub_addr, uint16_t pub_port, struct pico_ip4 priv_addr, uint16_t priv_port, uint8_t proto, uint8_t persistant);
daniele 3:b4047e8a0123 28
tass 63:97f481e33cb2 29 int pico_ipv4_nat(struct pico_frame* f, struct pico_ip4 pub_addr);
daniele 3:b4047e8a0123 30 int pico_ipv4_nat_enable(struct pico_ipv4_link *link);
tass 63:97f481e33cb2 31 int pico_ipv4_nat_isenabled_out(struct pico_ipv4_link *link);
tass 63:97f481e33cb2 32 int pico_ipv4_nat_isenabled_in(struct pico_frame *f);
tass 63:97f481e33cb2 33
daniele 3:b4047e8a0123 34 #else
daniele 3:b4047e8a0123 35
tass 63:97f481e33cb2 36 static inline int pico_ipv4_nat_isenabled_out(struct pico_ipv4_link *link)
tass 63:97f481e33cb2 37 {
tass 63:97f481e33cb2 38 pico_err = PICO_ERR_EPROTONOSUPPORT;
tass 63:97f481e33cb2 39 return -1;
tass 63:97f481e33cb2 40 }
tass 63:97f481e33cb2 41 static inline int pico_ipv4_nat_isenabled_in(struct pico_frame *f)
daniele 3:b4047e8a0123 42 {
daniele 3:b4047e8a0123 43 pico_err = PICO_ERR_EPROTONOSUPPORT;
daniele 3:b4047e8a0123 44 return -1;
daniele 3:b4047e8a0123 45 }
daniele 3:b4047e8a0123 46
tass 63:97f481e33cb2 47 static inline int pico_ipv4_nat(struct pico_frame* f, struct pico_ip4 pub_addr)
daniele 3:b4047e8a0123 48 {
daniele 3:b4047e8a0123 49 pico_err = PICO_ERR_EPROTONOSUPPORT;
daniele 3:b4047e8a0123 50 return -1;
daniele 3:b4047e8a0123 51 }
daniele 3:b4047e8a0123 52
daniele 3:b4047e8a0123 53 static inline int pico_ipv4_nat_enable(struct pico_ipv4_link *link)
daniele 3:b4047e8a0123 54 {
daniele 3:b4047e8a0123 55 pico_err = PICO_ERR_EPROTONOSUPPORT;
daniele 3:b4047e8a0123 56 return -1;
daniele 3:b4047e8a0123 57 }
daniele 3:b4047e8a0123 58
tass 63:97f481e33cb2 59 #define pico_ipv4_nat_print_table() do{}while(0)
tass 63:97f481e33cb2 60
tass 63:97f481e33cb2 61 static inline int pico_ipv4_nat_add(struct pico_ip4 pub_addr, uint16_t pub_port, struct pico_ip4 priv_addr, uint16_t priv_port, uint8_t proto)
daniele 3:b4047e8a0123 62 {
daniele 3:b4047e8a0123 63 pico_err = PICO_ERR_EPROTONOSUPPORT;
daniele 3:b4047e8a0123 64 return -1;
daniele 3:b4047e8a0123 65 }
daniele 3:b4047e8a0123 66
tass 63:97f481e33cb2 67 static inline int pico_ipv4_nat_del(uint16_t pub_port, uint8_t proto)
daniele 3:b4047e8a0123 68 {
daniele 3:b4047e8a0123 69 pico_err = PICO_ERR_EPROTONOSUPPORT;
daniele 3:b4047e8a0123 70 return -1;
daniele 3:b4047e8a0123 71 }
daniele 3:b4047e8a0123 72
tass 63:97f481e33cb2 73
tass 63:97f481e33cb2 74 static inline int pico_ipv4_nat_find(uint16_t pub_port, struct pico_ip4 priv_addr, uint16_t priv_port, uint8_t proto)
daniele 3:b4047e8a0123 75 {
daniele 3:b4047e8a0123 76 pico_err = PICO_ERR_EPROTONOSUPPORT;
daniele 3:b4047e8a0123 77 return -1;
daniele 3:b4047e8a0123 78 }
daniele 3:b4047e8a0123 79
tass 63:97f481e33cb2 80 static inline int pico_ipv4_port_forward(struct pico_ip4 pub_addr, uint16_t pub_port, struct pico_ip4 priv_addr, uint16_t priv_port, uint8_t proto, uint8_t persistant)
daniele 3:b4047e8a0123 81 {
daniele 3:b4047e8a0123 82 pico_err = PICO_ERR_EPROTONOSUPPORT;
daniele 3:b4047e8a0123 83 return -1;
daniele 3:b4047e8a0123 84 }
daniele 3:b4047e8a0123 85 #endif
daniele 3:b4047e8a0123 86
daniele 3:b4047e8a0123 87 #endif /* _INCLUDE_PICO_NAT */
daniele 3:b4047e8a0123 88