VxWorks API Reference : OS Libraries
netShow - network information display routines
ifShow( ) - display the attached network interfaces
inetstatShow( ) - display all active connections for Internet protocol sockets
ipstatShow( ) - display IP statistics
netPoolShow( ) - show pool statistics
netStackDataPoolShow( ) - show network stack data pool statistics
netStackSysPoolShow( ) - show network stack system pool statistics
mbufShow( ) - report mbuf statistics
netShowInit( ) - initialize network show routines
arpShow( ) - display entries in the system ARP table
arptabShow( ) - display the known ARP entries
routestatShow( ) - display routing statistics
routeShow( ) - display all IP routes (summary information)
hostShow( ) - display the host table
mRouteShow( ) - display all IP routes (verbose information)
This library provides routines to show various network-related statistics, such as configuration parameters for network interfaces, protocol statistics, socket statistics, and so on.
Interpreting these statistics requires detailed knowledge of Internet network protocols. Information on these protocols can be found in the following books:
Internetworking with TCP/IP Volume III, by Douglas Comer and David Stevens UNIX Network Programming, by Richard Stevens The Design and Implementation of the 4.3 BSD UNIX Operating System, by Leffler, McKusick, Karels and Quarterman
The netShowInit( ) routine links the network show facility into the VxWorks system. This is performed automatically if INCLUDE_NET_SHOW is defined. If you want inetstatShow( ) to display TCP socket status, then INCLUDE_TCP_SHOW needs to be included.
ifLib, icmpShow, igmpShow, tcpShow, udpShow
ifShow( ) - display the attached network interfaces
void ifShow ( char * ifName /* name of the interface to show */ )
This routine displays the attached network interfaces for debugging and diagnostic purposes. If ifName is given, only the interfaces belonging to that group are displayed. If ifName is omitted, all attached interfaces are displayed.
For each interface selected, the following are shown: Internet address, point-to-point peer address (if using SLIP), broadcast address, netmask, subnet mask, Ethernet address, route metric, maximum transfer unit, number of packets sent and received on this interface, number of input and output errors, and flags (such as loopback, point-to-point, broadcast, promiscuous, ARP, running, and debug).
The following call displays all interfaces whose names begin with "ln", (such as "ln0", "ln1", and "ln2"):
-> ifShow "ln"The following call displays just the interface "ln0":-> ifShow "ln0"
N/A
inetstatShow( ) - display all active connections for Internet protocol sockets
void inetstatShow (void)
This routine displays a list of all active Internet protocol sockets in a format similar to the UNIX netstat command.
If you want inetstatShow( ) to display TCP socket status, then INCLUDE_TCP_SHOW needs to be included.
N/A
ipstatShow( ) - display IP statistics
void ipstatShow ( BOOL zero /* TRUE = reset statistics to 0 */ )
This routine displays detailed statistics for the IP protocol.
N/A
netPoolShow( ) - show pool statistics
void netPoolShow ( NET_POOL_ID pNetPool )
This routine displays the distribution of mBlks and clusters in a given network pool ID.
void endPoolShow ( char * devName, /* The inteface name: "dc", "ln" ...*/ int unit /* the unit number: usually 0 */ ) { END_OBJ * pEnd; if ((pEnd = endFindByName (devName, unit)) != NULL) netPoolShow (pEnd->pNetPool); else printf ("Could not find device %s\n", devName); return; }
N/A
netStackDataPoolShow( ) - show network stack data pool statistics
void netStackDataPoolShow (void)
This routine displays the distribution of mBlks and clusters in a the network data pool. The network data pool is used only for data transfer through the network stack.
The "clusters" column indicates the total number of clusters of that size that have been allocated. The "free" column indicates the number of available clusters of that size (the total number of clusters minus those clusters that are in use). The "usage" column indicates the number of times clusters have been allocated (not, as you might expect, the number of clusters currently in use).
N/A
netShow, netStackSysPoolShow( ), netBufLib
netStackSysPoolShow( ) - show network stack system pool statistics
void netStackSysPoolShow (void)
This routine displays the distribution of mBlks and clusters in a the network system pool. The network system pool is used only for system structures such as sockets, routes, interface addresses, protocol control blocks, multicast addresses, and multicast route entries.
The "clusters" column indicates the total number of clusters of that size that have been allocated. The "free" column indicates the number of available clusters of that size (the total number of clusters minus those clusters that are in use). The "usage" column indicates the number of times clusters have been allocated (not, as you might expect, the number of clusters currently in use).
N/A
netShow, netStackDataPoolShow( ), netBufLib
mbufShow( ) - report mbuf statistics
void mbufShow (void)
This routine displays the distribution of mbufs in the network.
N/A
netShowInit( ) - initialize network show routines
void netShowInit (void)
This routine links the network show facility into the VxWorks system. These routines are included automatically if INCLUDE_NET_SHOW is defined.
N/A
arpShow( ) - display entries in the system ARP table
void arpShow (void)
This routine displays the current Internet-to-Ethernet address mappings in the ARP table.
-> arpShow LINK LEVEL ARP TABLE Destination LL Address Flags Refcnt Use Interface --------------------------------------------------------------------- 90.0.0.63 08:00:3e:23:79:e7 0x405 0 82 lo0 ---------------------------------------------------------------------Some configuration is required when this routine is to be used remotely over the network eg. through a telnet session or through the host shell using WDB_COMM_NETWORK. If more than 5 entries are expected in the table the parameter RT_BUFFERED_DISPLAY should be set to TRUE to prevent a possible deadlock. This requires a buffer whose size can be set with RT_DISPLAY_MEMORY. It will limit the number of entries that can be displayed (each entry requires approx. 70 bytes).
N/A
arptabShow( ) - display the known ARP entries
void arptabShow (void)
This routine displays current Internet-to-Ethernet address mappings in the ARP table.
N/A
routestatShow( ) - display routing statistics
void routestatShow (void)
This routine displays routing statistics.
N/A
routeShow( ) - display all IP routes (summary information)
void routeShow (void)
This routine displays the list of destinations in the routing table along with the next-hop gateway and associated interface for each entry. It separates the routes into network routes and host-specific entries, but does not display the netmask for a route since it was created for class-based routes which used predetermined values for that field.
The IP forwarding process will only use the first route entry to a destination. When multiple routes exist to the same destination with the same netmask (which is not shown), the first route entry uses the lowest administrative weight. The remaining entries (listed as additional routes) use the same destination address. One of those entries will replace the primary route if it is deleted.
-> routeShow ROUTE NET TABLE Destination Gateway Flags Refcnt Use Interface -------------------------------------------------------------------- 90.0.0.0 90.0.0.63 0x1 1 142 enp0 10.0.0.0 90.0.0.70 0x1 1 142 enp0 Additional routes to 10.0.0.0: 80.0.0.70 0x1 0 120 enp1 -------------------------------------------------------------------- ROUTE HOST TABLE Destination Gateway Flags Refcnt Use Interface -------------------------------------------------------------------- 127.0.0.1 127.0.0.1 0x101 0 82 lo0 --------------------------------------------------------------------The flags field represents a decimal value of the flags specified for a given route. The following is a list of currently available flag values:
In the above display example, the entry in the ROUTE NET TABLE has a flag value of 1, which indicates that this route is "up" and usable and network specific (the 0x4 bit is turned off). The entry in the ROUTE HOST TABLE has a flag value of 5 (0x1 OR'ed with 0x4), which indicates that this route is "up" and usable and host-specific.
0x1 - route is usable (that is, "up") 0x2 - destination is a gateway 0x4 - host specific routing entry 0x8 - host or net unreachable 0x10 - created dynamically (by redirect) 0x20 - modified dynamically (by redirect) 0x40 - message confirmed 0x80 - subnet mask present 0x100 - generate new routes on use 0x200 - external daemon resolves name 0x400 - generated by ARP 0x800 - manually added (static) 0x1000 - just discard packets (during updates) 0x2000 - modified by management protocol 0x4000 - protocol specific routing flag 0x8000 - protocol specific routing flag Some configuration is required when this routine is to be used remotely over the network eg. through a telnet session or through the host shell using WDB_COMM_NETWORK. If more than 5 routes are expected in the table the parameter RT_BUFFERED_DISPLAY should be set to TRUE to prevent a possible deadlock. This requires a buffer whose size can be set with RT_DISPLAY_MEMORY. It will limit the number of routes that can be displayed (each route requires approx. 70 bytes).
N/A
hostShow( ) - display the host table
void hostShow (void)
This routine prints a list of remote hosts, along with their Internet addresses and aliases.
N/A
mRouteShow( ) - display all IP routes (verbose information)
void mRouteShow (void)
This routine displays the list of destinations in the routing table along with the next-hop gateway and associated interface. It also displays the netmask for a route (to handle classless routes which use arbitrary values for that field) and the value which indicates the route's creator, as well as any type-of-service information.
When multiple routes exist to the same destination with the same netmask, the IP forwarding process only uses the first route entry with the lowest administrative weight. The remaining entries (listed as additional routes) use the same address and netmask. One of those entries will replace the primary route if it is deleted.
Some configuration is required when this routine is to be used remotely over the network eg. through a telnet session or through the host shell using WDB_COMM_NETWORK. If more than 5 routes are expected in the table the parameter RT_BUFFERED_DISPLAY should be set to TRUE to prevent a possible deadlock. This requires a buffer whose size can be set with RT_DISPLAY_MEMORY. It will limit the number of routes that can be displayed (each route requires approx. 90 bytes).
N/A