-
Notifications
You must be signed in to change notification settings - Fork 17
Configuring and compiling
Each module, option and feature included in the code base must be explicitly enabled by
defining a specific PICO_SUPPORT
preprocessor variable. If the default Makefile is used to
compile PicoTCP, this can be done using command line options when running make.
The Makefile will generate a default header file containing the configuration defines (in a syntax like #define PICO_SUPPORT_$MAKEARG 1
) selected during the invocation of the make command.
The command-line syntax required to compile the protocol in a library (the default Makefile target) is the following:
make [MAKEARG=VALUE]
Where MAKEARG
is a set of zero or more of the following:
Make argument | Possible values | Default value | Description |
---|---|---|---|
ADDRESS_SANITIZER | 0,1 | 1 | ... |
AODV | 0,1 | 1 | ... |
CRC | 0,1 | 1 | If enabled, CRC values are validated at IP and transport layer. |
CROSS_COMPILE | compiler prefix | Use a cross compile prefix when calling the binaries needed to build. | |
CYASSL | 0,1 | 0 | ... |
DEBUG | 0,1 | 1 | When enabled (=1), the resulting library will contain debug symbols. The size of the library will be much larger than the production build, but it will be possible to run the stack into a debugger to inspect its behaviour. When the option is disabled (=0), the library will be optimized for size in flash, resulting in a smaller binary to be used in production. |
DEVLOOP | 0,1 | 1 | If enabled, a loopback device will be added to the stack, and can be configured to run local traffic. |
DHCP_CLIENT | 0,1 | 1 | When activated, it will be possible to get the IP address for network devices automatically, when a DHCP server is present on the network. |
DHCP_SERVER | 0,1 | 1 | If activated, it will be possible to run a small DHCP server to provide addresses for automatic configuration to the other hosts in the network. |
DNS_CLIENT | 0,1 | 1 | This feature is required to resolve host names into IP addresses and vice-versa. |
DNS_SD | 0,1 | 1 | If enabled, it is possible to register services on the network via Multicast DNS. |
ENDIAN | little, big | little | Force to build against little-endian or big-endian architecture. |
ETH | 0,1 | 1 | ... |
GENERIC | 0,1 | 0 | ... |
HTTP_CLIENT | 0,1 | 1 | Activates a basic HTTP client. |
HTTP_SERVER | 0,1 | 1 | Activates a basic HTTP server. |
ICMP4 | 0,1 | 1 | Enables the support for control messages over IPv4, (not including the ping functionalities). |
IPC | 0,1 | 0 | ... |
IPFILTER | 0,1 | 1 | If enabled, provides basic filtering. |
IPV4 | 0,1 | 1 | Enables the support for basic IP networking functionalities. At least one network protocol is required for most of the features to work, as all types of sockets depend on the networking layer. |
IPV4FRAG | 0,1 | 1 | Enables the support for fragmentation and reassembly of IPV4 packets. |
IPV6 | 0,1 | 1 | Enables the support for IPV6 networking functionalities. At least one network protocol is required for most of the features to work, as all types of sockets depend on the networking layer. |
IPV6FRAG | 0,1 | 0 | Enables the support for fragmentation and reassembly of IPV6 packets. |
MCAST | 0,1 | 1 | If enabled, the support for multicast sockets will be included in the resulting library. |
MDNS | 0,1 | 1 | If enabled, registering and resolving DNS records on the network via Multicast DNS is possible. |
MEMORY_MANAGER | 0,1 | 0 | ... |
MEMORY_MANAGER_PROFILING | 0,1 | 0 | ... |
NAT | 0,1 | 1 | Activates the support for network address translation to IPv4. |
OSLR | 0,1 | 0 | ... |
PCAP | 0,1 | 0 | ... |
PERF | 0,1 | 0 | ... |
PING | 0,1 | 1 | When activated, the ping API will be available to test whether the hosts on the network are reachable. Requires ICMP4 support. |
POLARSSL | 0,1 | 0 | ... |
PPP | 0,1 | 1 | ... |
PREFIX | any valid path | ./build | The target directory where the library and all the objects will be placed after the compilation. |
PROFILE | 0,1 | 0 | ... |
PTHREAD | 0,1 | 0 | ... |
RTOS | 0,1 | 0 | ... |
SLAACV4 | 0,1 | 1 | ... |
SNTP_CLIENT | 0,1 | 1 | Enables synchronising the local time to a given ntp server. |
STRIP | 0,1 | 0 | ... |
TAP | 0,1 | 0 | ... |
TCP | 0,1 | 1 | Enables the support for Transmission Control Protocol by allowing the usage of stream sockets. |
TFTP | 0,1 | 1 | ... |
TUN | 0,1 | 0 | ... |
UDP | 0,1 | 1 | Enables the support for User Datagram Protocol by allowing the usage of datagram sockets. |
WOLFSSL | 0,1 | 0 | ... |
If you are not using a Makefile, you need to provide a pico_defines.h
file yourself which is automatically included by all the interfaces. An automatically generated pico_defines.h file with all the defaults on looks like this:
/* PicoTCP - Definition file - DO NOT EDIT */
/* This file is automatically generated at compile time */
#ifndef PICO_DEFINES_H
#define PICO_DEFINES_H
#define PICO_SUPPORT_TFTP
#define PICO_SUPPORT_AODV
#define PICO_SUPPORT_ETH
#define PICO_SUPPORT_IPV4
#define PICO_SUPPORT_IPV4FRAG
#define PICO_SUPPORT_ICMP4
#define PICO_SUPPORT_PING
#define PICO_SUPPORT_TCP
#define PICO_SUPPORT_UDP
#define PICO_SUPPORT_MCAST
#define PICO_SUPPORT_IGMP
#define PICO_SUPPORT_MLD
#define PICO_SUPPORT_NAT
#define PICO_SUPPORT_DEVLOOP
#define PICO_SUPPORT_DHCPC
#define PICO_SUPPORT_DHCPD
#define PICO_SUPPORT_DNS_CLIENT
#define PICO_SUPPORT_MDNS
#define PICO_SUPPORT_DNS_SD
#define PICO_SUPPORT_IPFILTER
#define PICO_SUPPORT_CRC
#define PICO_SUPPORT_SLAACV4
#define PICO_SUPPORT_IPV6
#define PICO_SUPPORT_ICMP6
#define PICO_SUPPORT_IPV6FRAG
#define PICO_SUPPORT_SNTP_CLIENT
#define PICO_SUPPORT_PPP
#define PICO_SUPPORT_IPV6
#endif
Getting Started
- Setting up the environment
- Testing
- Configuring and compiling
- Running picoTCP on Linux - Deprecated (see setting up)
- Running picoTCP on Windows
Porting
- Build process explained
- Porting the build to another compiler or IDE
- Porting picoTCP to your favorite embedded target
- Porting picoTCP to your favorite Operating System
- Example device driver
Development