[Previous] [Contents] [Index] [Next]

npm-ttcpip.so

Tiny TCP/IP stack (QNX Neutrino)

Syntax:

io-net ... -p ttcpip ttcpip_options ...

Options:

The ttcpip_options are one or more of the following, separated by commas without whitespace:

default=gateway
The default gateway, in standard dot notation.
if=typex:ip_addr[:netmask]
A TCP/IP interface with the following parameters:
type
The type of interface being configured. Currently, it must be en (Ethernet: one of the devn-*.so drivers).
x
A number that specifies the particular instance of the interface type.
ip_addr
IP address of the interface, in standard dot notation.
netmask
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.
route=destination:netmask:gateway
A route for the interface, with the following parameters:
destination
IP address of the destination for this route, in standard dot notation.
netmask
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).
gateway
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.

verbose=level
Verbosity level; a higher level produces more diagnostic messages.

Description:

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.


Note: If you want name resolution to work, you should also set up /etc/resolv.conf and /etc/hosts.

Limitations

The npm-ttcpip.so interface has some limitations in order to keep it small. It doesn't support:

/proc/ipstats

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: 11.0.0.0        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

Note: 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.

Development Considerations

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.

Supported setsockopt() options

The following setsockopt() options are supported by npm-ttcpip.so:

For more information, see "Options" in the description of getsockopt() in the Library Reference.

Supported ioctl() options

The following ioctl() options are supported by npm-ttcpip.so:

FIONBIO
Set/clear nonblocking I/O.
FIONREAD
Get the number of bytes to read.
FIOSETOWN
Set the owner.
SIOCADDRT
Add a route.
SIOCATMARK
Determine if you're at an out-of-band mark.
SIOCDELRT
Delete a route.
SIOCGIFADDR
Get the address of the network associated with an interface.
SIOCGIFBRDADDR
Get the broadcast address.
SIOCGIFCONF
Get the list of networks associated with interfaces.
SIOCGIFDSTADDR
Get the point-to-point address.
SIOCGIFFLAGS
Get the flags for the network associated with an interface.
SIOCGIFNETMASK
Get the network address mask.
SIOCSIFADDR
Set the address of the network associated with an interface.
SIOCSIFDSTADDR
Set the point-to-point address.
SIOCSIFFLAGS
Set the flags for the network associated with an interface.
SIOCSIFNETMASK
Set the network address mask.

For more information, see <sys/ioctl.h>.

Examples:

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 11.0.0.0 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

See also:

/etc/autoconnect, dd, /etc/hosts, io-net, ping, pppd, /etc/resolv.conf

"Network drivers (devn-*)" and "Network protocol modules (npm-*)" in the Utilities Summary

getsockopt(), ioctl(), setsockopt() in the Library Reference

TCP/IP Networking in the Neutrino User's Guide


[Previous] [Contents] [Index] [Next]