Networking

The Lightfoot SDK supports TCP/IP networking over Ethernet or PPP with a number of services. All the networking is controlled through the XML configuration file.

Enabling networking

Networking is disabled by default and can be simply enabled with all the standard options by adding the following line to config.xml.
    <network enabled="yes"/>

Network buffers

The Lightfoot networking preallocates buffers to use for all network data at boot time. The values used for these buffers is controlled by the buffers entry in config.xml.
    <buffers small="10" large="10"/>

Network transports

Network transports can be defined by the transport entry in config.xml.
    <transport name="ethernet" resolver="dhcp" enabled="yes" instance="0"/>
In order for a transport to be initialised, a library function called initialise<transport>Transport must exist. This is called with the instance number for that transport.
The transports currently supported are:
Transport
Initialiser function
Instance meaning
ethernet
initialiseEthernetTransport
Instance of the ethernet device to use
ppp
initialisePppTransport
Instance of the UART to use

Transport address resolvers

All network transports have to provide the system with an IP address. The following address resolvers are available.
Resolver
Description
dhcp
Sends out a DHCP query to get the ip address, netmask, DNS server and default gateway
bootp
Sends out a BOOTP query to get the ip address, netmask and default gateway
monitor
Uses the ip address used by the monitor.

It is possible to add a custom address resolver as described in the ipaddress example.

Network protocols

Network protocols can be defined by the protocol entry in config.xml.
    <protocol name="tcp" argument="10"/>
All protocols can take an argument. In the case of TCP and UDP, they are the number of connections that can be active at any one time using those protocols.
The protocols currently supported are
Protocol
Argument description
tcp
Number of TCP connections available
udp
Number of UDP connections available
icmp
No arguments

Network services

Network services can be defined by the service entry in config.xml.
    <service name="sntp"/>
All services can take an argument.
The services currently supported are
Service
Description
Argument description
sntp
Network time protocol that requests the time from a network time server.
No arguments
dns
Domain name lookup protocol that uses the DNS server to convert a hostname to an IP address.
No arguments
ftp
FTP server that allows files to be stored in flash.
No arguments