Tiny TCP/IP stack (QNX Neutrino)
io-net ... -p ttcpip ttcpip_options ...
The ttcpip_options are one or more of the following, separated by commas without whitespace:
- The default gateway, in standard dot notation.
- A TCP/IP interface with the following parameters:
- The type of interface being configured. Currently, it must be en (Ethernet: one of the devn-*.so drivers).
- A number that specifies the particular instance of the interface type.
- IP address of the interface, in standard dot notation.
- Netmask of the interface, in standard dot notation. The netmask is optional and defaults to something sensible, based on the class of the address specified in ip_addr.
- A route for the interface, with the following parameters:
- IP address of the destination for this route, in standard dot notation.
- Netmask for this route, to determine if the destination is a host or a network (a host has a netmask of 255.255.255.255).
- The gateway used to reach the destination in standard dot notation.
The route= options must be specified after if= options or you could get "no route to host" errors.
- Verbosity level; a higher level produces more diagnostic messages.
The npm-ttcpip.so interface is a tiny TCP/IP stack for use in resource-constrained environments; it implements a subset of the functionality usually found in full TCP/IP implementations, such as npm-tcpip.so.
The npm-ttcpip.so interface currently provides multiple interfaces, broadcasting, IP fragmentation, reception of urgent data, raw IP, some ICMP messages, UDP and TCP support to the network I/O manager, io-net.
After configuring your hardware you should try to ping the machine from another to make sure it's configured correctly. If that doesn't work, check the parameters specified to your networking hardware.
The npm-ttcpip.so interface has some limitations in order to keep it small. It doesn't support:
- ifconfig and route for setting configuration parameters
- netstat -- you can get information related to the interfaces, routes, and connections from the /proc/ipstats device (see below)
- Routing sockets
- The MSG_WAITALL flag used by the recv*() functions
- Ancillary data
- The MSG_DONTROUTE flag used by the send*() functions
- UNIX domain sockets
- Asynchronous notification via a SIGIO signal
While npm-ttcpip.so is running, you can get statistics on the interfaces, routes, and connections from the /proc/ipstats device:
$ cat /proc/ipstats Ttcpip Jan 11 1999 17:05:05 verbosity level 0 ip checksum errors: 0 udp checksum errors: 0 tcp checksum errors: 0 packets sent: 1306 packets received: 429 ppp0 : addr 10.0.0.163 netmask 255.0.0.0 up en0 : addr 10.0.0.163 netmask 255.0.0.0 up lo0 : addr 127.0.0.1 netmask 255.0.0.0 up DST: 10.0.0.25 NETMASK: 255.255.255.255 GATEWAY: ppp0 DST: 18.104.22.168 NETMASK: 255.0.0.0 GATEWAY: 10.0.0.109 DST: 10.0.0.0 NETMASK: 255.0.0.0 GATEWAY: en0 DST: 127.0.0.0 NETMASK: 255.0.0.0 GATEWAY: lo0 DST: 0.0.0.0 NETMASK: 0.0.0.0 GATEWAY: 10.0.0.25 TCP 10.0.0.163.19 > 10.0.0.25.1117 ESTABLISHED snd 8192 rcv 0 TCP 10.0.0.163.1026 > 10.0.0.25.2049 ESTABLISHED snd 0 rcv 0 TCP 10.0.0.163.1029 > 10.0.0.25.2049 ESTABLISHED snd 0 rcv 0 TCP 10.0.0.163.1030 > 10.0.0.25.2049 ESTABLISHED snd 0 rcv 0 TCP 0.0.0.0.19 LISTEN TCP 0.0.0.0.23 LISTEN TCP 0.0.0.0.21 LISTEN
|In order to obtain all current statistics, the client accessing the /proc/ipstats device must provide a buffer large enough to contain the information in a single read operation. If the default buffer for your client is too small, see the ibs option to the dd utility.|
If you are developing applications using the tiny stack, be aware that it supports only a subset of the options supported by the big stack.
The following setsockopt() options are supported by npm-ttcpip.so:
- IP_TOS -- supported for TCP sockets only
- SO_OOBINLINE -- supported for TCP sockets only
- SO_REUSEADDR -- supported for TCP sockets only
The following ioctl() options are supported by npm-ttcpip.so:
- Set/clear nonblocking I/O.
- Get the number of bytes to read.
- Set the owner.
- Add a route.
- Determine if you're at an out-of-band mark.
- Delete a route.
- Get the address of the network associated with an interface.
- Get the broadcast address.
- Get the list of networks associated with interfaces.
- Get the point-to-point address.
- Get the flags for the network associated with an interface.
- Get the network address mask.
- Set the address of the network associated with an interface.
- Set the point-to-point address.
- Set the flags for the network associated with an interface.
- Set the network address mask.
For more information, see <sys/ioctl.h>.
The following io-net command uses an NE-2000 driver (devn-ne2000.so), specifies an interface with an IP address of 10.0.0.163 and a netmask of 255.0.0.0 (the default), adds a route to reach network 22.214.171.124 through the gateway at 10.25 and is slightly verbose:
io-net -dne2000 -pttcpip \ if=en0:10.163,route=11.0:255.0:10.109,default=10.25,verbose=1
The following command tells io-net to load the NE-2000 driver and the tiny stack protocol. The tiny stack is told to preallocate an interface of type Ethernet and assign it the address 10.0.0.163:
io-net -dne2000 -pttcpip if=en0:10.163
- The directory where, by default, drivers and protocol modules add entries. For more information, the documentation for io-net.
TCP/IP Networking in the Neutrino User's Guide