8000 Event driven xTCP with support for uIP and LwIP libraries by louisja · Pull Request #20 · xmos/lib_xtcp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Event driven xTCP with support for uIP and LwIP libraries #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 172 commits into from
Jan 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
a9306fd
LWIP clone from git
Aug 17, 2015
0229d05
Remove binary from git
Sep 1, 2015
983e68d
Improved gitignore
Sep 1, 2015
183c20d
Hack module build info for LWIP
Sep 7, 2015
c0df558
Remove IGMP callback
Sep 7, 2015
ef7845d
Rename timer member to igmp_timer to prevent XC clash
Sep 7, 2015
df71e86
Remove init and receive callbacks
Sep 7, 2015
56c1a78
Replace output callback with a function call
Sep 7, 2015
cfb57c6
Remove UDP receive callback
Sep 7, 2015
fc851d2
Remove TCP error function callback
Sep 7, 2015
084dc85
Replace UDP receive callback with function call
Sep 7, 2015
67df49d
Add extern C guard for XC include
Sep 7, 2015
53b78ab
Remove UDP receive callback from structure
Sep 7, 2015
e5172f1
Prefix uip autoip functions to prevent namespace clash with LWIP
Sep 7, 2015
c366b3c
Update autoip calls with new prefixed name
Sep 7, 2015
031e742
Remove callbacks from TCP and interface headers
Sep 7, 2015
c49a911
Add xcore port of LWIP config and driver
Sep 7, 2015
2e1fd6c
Add temporary XTCP LWIP prototype
Sep 7, 2015
dd444ff
Add LWIP timers
Sep 8, 2015
5153d21
Add tcp select handler to service clients
Sep 8, 2015
f381c32
Fix print formatters
Sep 8, 2015
3e60417
Add Ethernet transmit driver
Sep 8, 2015
e2a2b14
Move header to include directory
Sep 9, 2015
d01a386
Add xtcp receive function to handle lwip pbufs
Sep 9, 2015
589fdc1
Return a err_t to prevent return-type warning
Sep 9, 2015
a2ba496
Add xtcp state lookup within lwip TCP PCBs
Sep 9, 2015
9f303bb
Add lwip TCP event handler
Sep 9, 2015
5ea90e7
Add xtcp link up event handling
Sep 9, 2015
8262a65
Add XTCP TCP socket listen support
Sep 9, 2015
250f8bd
Hack module build info for LWIP compile
Sep 9, 2015
ae771a2
Remove HTONS conversion of stored port number
Sep 9, 2015
012f125
Remove error event handler due to recursion detection in mapper
Sep 9, 2015
008dd57
Add split send function to allow lwip to segment copy
Sep 11, 2015
6afcd51
Add new lwip TCP api flag to do a copy over an xcore channel
Sep 11, 2015
aa7f5e9
Fix IP packet dump compatibility for debug_printf
Sep 14, 2015
7dfbf42
Add missing XC extern guard
Sep 14, 2015
773ef59
Fix TCP write flag - should be a power of 2
Sep 14, 2015
c83b386
Add TCP socket connect funtionality
Sep 14, 2015
1eec226
Fix issue with volatile variable definition included in XC
Sep 14, 2015
8ebfa73
Add ICMP and TX single buf to LWIP options
Sep 14, 2015
4e50585
Remove debug print
Sep 14, 2015
879d172
Remove unused appcall function
Sep 14, 2015
4d589a2
Fix int to pointer conversion warnings
Sep 14, 2015
e29de32
Fix sign of char array pointer warning
Sep 14, 2015
3a4074b
Add vanilla mbedTLS source 2.1.0
Sep 14, 2015
8b90c9c
Add mbedTLS source to module build info
Sep 17, 2015
ef2795a
Add missing xccompat header
Sep 17, 2015
6d84d3d
Add __XC__ guards to extern "C" blocks in headers
Sep 17, 2015
2b3cc36
Replace random number gen function pointer with callback function
Sep 21, 2015
7b6b4f7
Replace 0 with NULL to fix compiler error
Sep 21, 2015
5ec9c5e
Replace cipher padding function pointers
Sep 21, 2015
72d31bc
Replace cipher function pointers
Sep 21, 2015
594f204
Replace entropy function pointer with function call
Sep 21, 2015
e0f711c
Replace ECP function pointers with a function call
Sep 21, 2015
635846b
Replace MD function pointers with function calls
Sep 21, 2015
0a67433
Replace PK function pointers with function calls
Sep 21, 2015
f42ef7e
Rename master struct field due to XC keyword clash
Sep 21, 2015
b2c5fad
Add temporary #define to turn on CRT verification callback
Sep 21, 2015
996f61a
Replace checksum, send, receive function pointers
Sep 21, 2015
e06e3ef
Remove get/set timer function calls
Sep 21, 2015
ed7c9f8
Temporarily remove recursion as TODO
Sep 21, 2015
e9fe31b
Update mbedtls config with minimal support
Sep 21, 2015
1568c40
Move LWIP behind a build flag / define
Sep 21, 2015
352f3fb
Move header so it available in both configs
Sep 21, 2015
f18adfd
Add DNS receive hook to UDP receive
Sep 23, 2015
a0f5fef
Move DNS defines and structs to header for global use
Sep 23, 2015
444c17d
Move DNS functions to header, called from XTCP
Sep 23, 2015
b0b8ffc
Remove DNS callback functions and add a used flag
Sep 23, 2015
2700a8f
Pull DNS_STATE_ASKING out into a function call
Sep 23, 2015
9993621
Pulls out code to find DNS entry into a function call
Sep 23, 2015
06bf14f
Remove LWIP dns_gethostbyname()
Sep 23, 2015
6d09aac
Add DNS lookup/result to XTCP server and client
Sep 23, 2015
d59184b
Add DNS get host by name blocking implementation
Sep 23, 2015
0a03543
XTCP blocking write call now returns number of bytes written
Sep 23, 2015
cdb1cca
Add SMI link up/down handling and enable DHCP
Sep 23, 2015
6aecac7
Fix crash due to DHCP PCB recv_arg not being set
Sep 23, 2015
e4fafef
Rename port variable to work with XC
Sep 23, 2015
cbce7fe
Enable DNS in LWIP options, reduce max name length
Sep 23, 2015
d793458
Remove unused variables
Sep 23, 2015
f305ca9
Increase TCP buffering
Sep 29, 2015
dc19751
Add copyright headers
Sep 30, 2015
e0e513c
Add lib_crypto module version dependency
Sep 30, 2015
931c5b4
Update XTCP version for lwip branch
Sep 30, 2015
e381928
Update xtcp_send to receive a read index from the server
Oct 14, 2015
7c7d94c
Update blocking send to only support MSS
Oct 14, 2015
d119a25
Add temporary assertions for XTCP blocking debug
Oct 14, 2015
8ee085e
Add missing XTCP channel copy when TCP_OVERSIZE=1
Oct 14, 2015
09fe9b5
Increase TCP send window size to tune transmit performance
Oct 14, 2015
37938c0
Enable TCP oversize to allocate a max sized buffer on transmit
Oct 14, 2015
31d4365
Does not begin a TCP write if the send buffer is smaller than the MSS
Oct 14, 2015
ee3e5f1
Update TLS config to use TLS 1.0 instead of 1.1
Oct 14, 2015
c616af5
Add wait for closed blocking call
Nov 2, 2015
b335284
Add asynchronous receive to XTCP
Nov 3, 2015
1b5c9cb
Fix interaction of TLS with XTCP receive
Nov 3, 2015
df513ae
Fix compiler warnings
Nov 3, 2015
be99a2d
Resolve issue with close event being issued multiple times
Nov 3, 2015
165ced4
Remove oversize debug check option
Nov 9, 2015
77d8f82
Update lwip buffer sizes used in demo
Nov 11, 2015
686b087
Add lock implementation for use with pbuf allocation
Nov 25, 2015
74a291e
Add legacy section to changelog
samchesney Dec 12, 2015
1a91582
Add change section for current release
samchesney Dec 12, 2015
caca507
Changelog updated using xmos_changelog_check.py
samchesney Dec 12, 2015
4e4cae6
Changelog updated using xmos_changelog_check.py
samchesney Jan 5, 2016
1850518
Fix bad indentation
Jan 8000 26, 2016
a2e8fbb
Merge branch 'lwip' of github.com:xmos/lib_xtcp into lwip
Jan 26, 2016
d14c6a8
Fix license typo
samchesney Jan 29, 2016
e1dc95b
Merge pull request #5 from samchesney/lwip
samchesney Jan 29, 2016
2de81cc
Added SSL probe to allow Wireshark to decode pacekts.
Feb 4, 2016
ac6156e
Merge branch 'lwip' of github.com:pthedinger/lib_xtcp into lwip
Feb 25, 2016
dae93ee
Merge pull request #8 from pthedinger/lwip
Feb 25, 2016
53c6bc8
Fix missing string arg in call to fail()
samchesney Mar 7, 2016
cb3b833
Add experimental beginnings of LwIP + WiFi task
samchesney Mar 7, 2016
f6ec3aa
Merge pull request #9 from samchesney/lwip
samchesney Mar 7, 2016
6b90d75
Bump version number to reflect WiFi support changes
samchesney Mar 8, 2016
9660ec9
Add a little detail to the CHANGELOG
samchesney Mar 8, 2016
0ae3182
Merge pull request #10 from samchesney/lwip
Mar 8, 2016
0332c15
Wiring up the packet reception.
Mar 9, 2016
8552d2e
Connect up packet transmit to the wifi.
Mar 11, 2016
5800bfb
Merge pull request #11 from pthedinger/lwip_wifi
samchesney Mar 11, 2016
5312585
Now able to ping board. Reserve extra bytes in pbuf header for BDC he…
Mar 17, 2016
1fa6025
Merge pull request #13 from pthedinger/lwip_wifi
samchesney Mar 17, 2016
1a36d01
Changelog updated using xmos_changelog_check.py
samchesney Mar 24, 2016
d2f56a7
Remove dependency on lib_wifi
samchesney Mar 29, 2016
4895606
Revert "Now able to ping board. Reserve extra bytes in pbuf header fo…
samchesney Apr 14, 2016
e951315
Make room in the pbufs for the WICED SDPCM headers
samchesney Apr 22, 2016
88d875c
Add guards to allow non LWIP apps to build
samchesney Apr 25, 2016
e449558
Change maximum size frame that LWIP will deliver to the client from 6…
Apr 26, 2016
f81aa7e
Connect up the eth_tx and eth_rx interfaces.
Apr 26, 2016
127ca2c
Add support for UDP.
Apr 26, 2016
955939b
Prevent crash on ERROR notification from LWIP.
Apr 26, 2016
5f33929
Ensure link up notification happens even when using fixed IP address.
Apr 26, 2016
cfd3050
Whitespace cleanup and other non-changes.
Apr 26, 2016
9255c03
Prevent a 250ms delay on all TCP data.
Apr 26, 2016
3b6efce
Merge branch 'lwip' of github.com:xmos/lib_xtcp into lwip
Apr 26, 2016
d2b85e8
Merge pull request #17 from pthedinger/lwip
samchesney Apr 26, 2016
a0b03dc
Delete generated PDF
samchesney Apr 26, 2016
7434bfa
Revert "Make room in the pbufs for the WICED SDPCM headers"
samchesney Apr 26, 2016
b18d03a
Include app specific config alongside LwIP options
samchesney Apr 26, 2016
c350c87
Merge branch 'lwip_wifi' into lwip
samchesney Apr 27, 2016
e930116
Merge pull request #18 from samchesney/lwip
Apr 27, 2016
4f44d06
Add/update copyright notices
samchesney Apr 28, 2016
c74da2f
Add test_result.csv gitignore rule
samchesney Apr 28, 2016
23efcb7
Update to latest XMOS permissive license
samchesney Apr 28, 2016
ef15ed2
Merge pull request #19 from samchesney/lwip
Apr 28, 2016
87f69a8
Update copyright with first and latest publication dates
samchesney Aug 9, 2016
15ed3c3
Merge remote-tracking branch 'upstream/master' into lwip
Oct 25, 2016
5b7d6c1
First commit of event driven XTCP.
Oct 25, 2016
960a116
More work done on combining.
Oct 25, 2016
d4446c6
Remove recv event if aborting.
Oct 25, 2016
3bcabb5
Moved shared code from the stacks to a separate file.
Oct 26, 2016
8a1ade1
Updated app note and fixed AutoIP problem.
Oct 26, 2016
e08bb64
Removed old tests. Added uIP config functionality. Many other things...
Nov 16, 2016
4b6108a
Update module build info version number.
Nov 16, 2016
157bf73
Fixes to AN00121 source and documentation to match version 6.0.0 of t…
Nov 16, 2016
6a88fc0
Making app_simple_webserver work for both UIP/LWIP.
Nov 18, 2016
8caffe1
Fixed MSS, setting appstate and getting appstate in the webserver.
Nov 21, 2016
a386bec
Fixed close of TCP connection.
Nov 22, 2016
82bbcb1
First pass update of documentation and fix to actually run on the sli…
Nov 23, 2016
3e15913
Update diagrams
Nov 23, 2016
6822c2d
Cleanup makefile
Nov 23, 2016
11a0e35
Removed tls code
Nov 23, 2016
3c29688
Update documentation and changelog to reflect the removal of XTCP_EXC…
Nov 23, 2016
de2e42d
Added tests from Original_uip_lwip_merge + new test for web server.
Nov 23, 2016
8863698
Pulled Peter's changed.
Nov 23, 2016
262825a
Removed traces of xtcp_connection_type_t and added info to changelog.
Nov 23, 2016
a95b6cd
Fixed connections not have a packet_length & netif reporting an error
Dec 2, 2016
4401b86
Fixed appnote using incorrect number of ethernet config clients.
Dec 2, 2016
ed83ea5
Fix for issue #23.
Jan 4, 2017
5d35b7a
Update CHANGELOG.rst
Jan 5, 2017
283a198
Removed dependancy on lib_crypto.
Jan 13, 2017
9f084dc
Merge branch 'master' of https://github.com/louisja/lib_xtcp
Jan 13, 2017
d20bf2d
Update changelog.
Jan 13, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
**/.build*/*
bin/
_build/
__gen/
_README/
*.o
*.xe
*.vcd
Expand All @@ -22,6 +24,7 @@ Doxyfile-e
.DS_Store
*.pyc
*.xmt
**/test_results.csv
examples/AN01032_100Mbit_avb_i2s_demo/.settings/
*.pptx
examples/AN01032_100Mbit_avb_i2s_demo/doc/pdf/
62 changes: 52 additions & 10 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,30 +1,72 @@
TCP/IP Library Change Log
TCP/IP library change log
=========================

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're going to need to bump the version number in the module_build_info file and detail it here before this pull request is merged.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6D40

This has now been done.

6.0.0
-----

* CHANGE: Unified the branches of uIP and lwIP as the backend of the XTCP
stack. The default is uIP. To change the stack, define XTCP_STACK in your
makefile to be either UIP or LWIP. Then, instead of calling xtcp(...), call
either xtcp_uip(...) or xtcp_lwip(...) respectively.
* CHANGE: The interface between the client and server is now event-driven
rather than polling.
* CHANGE: Channels have been replaced by interfaces as communication medium
between client and server.
* REMOVED: The following xtcp_event_types: XTCP_PUSH_DATA, XTCP_REQUEST_DATA,
XTCP_POLL, XTCP_ALREADY_HANDLED
* CHANGE: The fields of packet_length and client_num have been added to the
xtcp_connection_t structure.
* REMOVED: xtcp_connection_t no longer has a xtcp_connection_type_t field.
* REMOVED: The ability to pause a connection
* REMOVED: The ability to partially acknowledge a packet
* REMOVED: Support for IPv6
* REMOVED: the ability to send with an index. This functionality is easily
replicated with a call to send() with the pointer of the array index
location, i.e. &(data[index]).
* REMOVED: Support for XTCP_EXCLUDE_* macros which reduced functionality in
order to save code size
* FIXED: Problem where ethernet packets smaller than 64 bytes would be incorrectly padded with uIP.
* REMOVED: Dependancy on lib_crypto.

5.1.0
-----

* ADDED: Support for using lib_wifi to provide the physical transport

5.0.0
-----

* ADDED: Port of LwIP TCP/IP stack

* Changes to dependencies:

- lib_crypto: Added dependency 1.0.0

4.0.3
-----

* Update to support enabling link status notifications
* ADDED: Support to enable link status notifications

4.0.2
-----

* Change uIP timer.h to uip_timer.h to avoid conflict with xcore timer.h
* Update to source code license and copyright
* CHANGE: uIP timer.h renamed to uip_timer.h to avoid conflict with xcore
timer.h
* CHANGE: Update to source code license and copyright

4.0.1
-----

* Fixed issue with link up/down events being ignored when SMI is not polled
within XTCP
* MAC address parameter to xtcp() is now qualified as const to allow parallel
usage
* CHANGE: MAC address parameter to xtcp() is now qualified as const to allow
parallel usage
* RESOLVED: Fixed issue with link up/down events being ignored when SMI is not
polled within XTCP

4.0.0
-----

* Moved over to new file structure
* Updated to use new lib_ethernet
* CHANGE: Moved over to new file structure
* CHANGE: Updated to use new lib_ethernet

* Changes to dependencies:

Expand Down
57 changes: 44 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,70 @@ TCP/IP Library
Overview
--------

A TCP/UDP/IP protocol stack for XMOS devices. This library connects to
the XMOS Ethernet library to provide layer-3 traffic over Ethernet via
MII or RGMII.
A library providing two alternative TCP/UDP/IP protocol stacks for XMOS devices.
This library connects to the XMOS Ethernet library to provide layer-3 traffic
over Ethernet via MII or RGMII.

Features
........

* TCP + UDP connection handling
* TCP and UDP connection handling
* DHCP, IP4LL, ICMP, IGMP support
* Low level, event based interface for efficient memory usage
* Based on the open-source uIP stack
* Currently, the library does not officially support IPv6. However,
experimental code for IPv6 support is contained in the
library. Contact XMOS for more details if you require IPv6.
* Supports IPv4 only, not IPv6

Stacks
......

This library provides two different TCP/IP stack implementations ported to the
xCORE architecture.

uIP stack
+++++++++

The first stack ported is the uIP (micro IP) stack. The uIP stack has been
designed to have a minimal resource footprint. As a result, it has limited
performance and does not provide support for TCP windowing.

lwIP stack
++++++++++

The second stack ported is the lwIP (lightweight IP) stack. The lwIP stack
requires more resources than uIP, but is designed to provide
better throughput and also has support for TCP windowing.

Typical Resource Usage
......................

.. resusage::

* - configuration: Standard
* - configuration: UIP
- globals: xtcp_ipconfig_t ipconfig = {
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 }
};
char mac_addr[6] = {0};
- locals: interface mii_if i_mii; xtcp_if i_xtcp[1];
- fn: xtcp_uip(i_xtcp, 1, i_mii,
null, null, null,
null, 0, mac_addr, null, ipconfig);
- pins: 0
- ports: 0
* - configuration: LWIP
- globals: xtcp_ipconfig_t ipconfig = {
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 }
};
char mac_addr[6] = {0};
- locals: interface mii_if i_mii; chan c_xtcp[1];
- fn: xtcp(c_xtcp, 1, i_mii,
null, null, null,
null, 0, mac_addr, null, ipconfig);
- locals: interface mii_if i_mii; xtcp_if i_xtcp[1];
- fn: xtcp_lwip(i_xtcp, 1, i_mii,
null, null, null,
null, 0, mac_addr, null, ipconfig);
- pins: 0
- ports: 0
- target: XCORE-200-EXPLORER


Software version and dependencies
Expand Down
10 changes: 8 additions & 2 deletions examples/AN00121_udp_demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ TARGET = SLICEKIT-L16
APP_NAME =

# The USED_MODULES variable lists other module used by the application.
USED_MODULES = lib_xtcp
USED_MODULES = lib_xtcp(>=6.0.0)

# The flags passed to xcc when building the application
# You can also set the following to override flags for a particular language:
# XCC_XC_FLAGS, XCC_C_FLAGS, XCC_ASM_FLAGS, XCC_CPP_FLAGS
# If the variable XCC_MAP_FLAGS is set it overrides the flags passed to
# xcc for the final link (mapping) stage.
XCC_FLAGS = -g -O2 -save-temps -DXTCP_VERBOSE_DEBUG
GEN_XCC_FLAGS = -g -O2 -save-temps -fxscope

XCC_FLAGS =

XCC_C_FLAGS = $(GEN_XCC_FLAGS)
XCC_XC_FLAGS = $(GEN_XCC_FLAGS)
XCC_MAP_FLAGS = -report

# The VERBOSE variable, if set to 1, enables verbose output from the make
# system.
Expand Down
16 changes: 7 additions & 9 deletions examples/AN00121_udp_demo/README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Using XMOS TCP/IP Library for UDP-based Networking
==================================================

.. version:: 2.0.1
.. version:: 6.0.0

Summary
-------

This application note demonstrates the use of XMOS TCP/IP stack on
This application note demonstrates the use of XMOS TCP/IP stack on
an XMOS multicore micro controller to communicate on an ethernet-based network.

The code associated with this application note provides an example of
Expand All @@ -28,19 +28,17 @@ networks.
Note: This application note requires an application to be run on the
host machine to test the communication with the XMOS device.


Required tools and libraries
............................

* xTIMEcomposer Tools - Version 14.0.0
* XMOS TCP/IP library - Version 4.0.0
.. appdeps::

Required hardware
.................

This application note is designed to run on an XMOS xCORE
General-Purpose
device.
General-Purpose
device.

The example code provided with the application has been implemented and tested
on the xCORE General-Purpose sliceKIT (XP-SKC-L2) with an ethernet sliceCARD (XA-SK-E100) but there is no dependancy on this board and it can be
Expand All @@ -51,9 +49,9 @@ Prerequisites

- This document assumes familiarity with the XMOS xCORE architecture, the XMOS tool chain and the xC language. Documentation related to these aspects which are not specific to this application note are lin 9FA8 ked to in the references appendix.

- For descriptions of XMOS related terms found in this document please see the *XMOS glossary* [#]_.
- For descriptions of XMOS related terms found in this document please see the *XMOS glossary* [#]_.

- For an overview of XTCP TCP/IP stack please see the *XMOS TCP/IP stack design guide* [#]_ for reference.
- For an overview of XTCP TCP/IP stack please see the *XMOS TCP/IP stack design guide* [#]_ for reference.

.. [#] http://www.xmos.com/published/glossary

Expand Down
Binary file removed examples/AN00121_udp_demo/bin/AN00121_udp_demo.xe
Binary file not shown.
Binary file removed examples/AN00121_udp_demo/doc/pdf/AN00121.pdf
Binary file not shown.
Loading
0