Dallas Semiconductor DS80C400 C Libraries Home Page

Main Page   Data Structures   File List   Data Fields   Globals  

rom400_netstat.h File Reference


Detailed Description

Network statistics library for the DS80C400.

This library contains functions that return pointers to network information tables in the socket library.

Note that the tables and structures returned by these functions are the actual, physical tables used by the network stack and should not be modified by user applications. Since these are the actual network structures, it is possible they might change while an application is processing them. Any critical analysis of these structures should be protected from interruption.

For detailed information on the DS80C400 please see the High-Speed Microcontroller User's Guide: DS80C400 Supplement.

Go to the source code of this file.

Data Structures

struct  netstat_arp_entry
struct  netstat_tcp_socket
struct  netstat_udp_entry

Defines

#define ROM400_NETSTAT_VERSION   1
#define NETSTAT_ARP_ENTRIES   8
 Number of entries in the ARP table.

#define NETSTAT_ARP_USED   1
 Value for #netstat_arp_entry.flags. Table entry is used.

#define NETSTAT_ARP_REPLYPENDING   2
 Value for #netstat_arp_entry.flags. Table entry is not yet valid, request has been sent out.

#define NETSTAT_ARP_STATIC   4
 Value for #netstat_arp_entry.flags. Table entry does not expire.

#define NETSTAT_UDP_ENTRIES   16
 Number of entries in the UDP port table.

#define NETSTAT_UDP_USED   1
 Values for #netstat_udp_entry.flags. Table entry is used.

#define NETSTAT_TCP_MAXSOCKETS   25
 Maxmimum number of sockets supported.

#define NETSTAT_TCP_OUTPUT_NEEDED_MASK   2
 Value for netstat_tcp_socket.flags. Either ACK or data or both.

#define NETSTAT_TCP_ACK_NEEDED_MASK   4
 Value for netstat_tcp_socket.flags. Need an ACK.

#define NETSTAT_TCP_SERVER_MASK   8
 Value for netstat_tcp_socket.flags. This is a server connection.

#define NETSTAT_TCP_RESERVED_MASK   16
 Value for netstat_tcp_socket.flags. (Reserved).

#define NETSTAT_TCP_HAVE_OUTPUT_DATA_MASK   32
 Value for netstat_tcp_socket.flags. Have data in output buffer.

#define NETSTAT_TCP_HAVE_FIN_MASK   64
 Value for netstat_tcp_socket.flags. Set when we receive a FIN.

#define NETSTAT_TCP_SEND_FIN_MASK   128
 Value for netstat_tcp_socket.flags. Send a FIN after all data sent.

#define NETSTAT_TCP_OPTION_NAGLE_ENABLED_MASK   1
 Value for netstat_tcp_socket.options. Set when Nagle's algorithm enabled.

#define NETSTAT_TCP_OPTION_IPV6_MASK   2
 Value for netstat_tcp_socket.options. Set when we should talk IPv6 on the socket.

#define NETSTAT_TCP_OPTION_SOCKET_ASSIGNED   4
 Value for netstat_tcp_socket.options. Assigned an application socket for this TCB.

#define NETSTAT_TCP_STATE_CLOSED   0
 Value for netstat_tcp_socket.state. The socket is closed.

#define NETSTAT_TCP_STATE_LISTEN   1
 Value for netstat_tcp_socket.state. The socket is listening.

#define NETSTAT_TCP_STATE_SYN_SENT   2
 Value for netstat_tcp_socket.state. The socket has sent a SYN.

#define NETSTAT_TCP_STATE_SYN_RECEIVED   3
 Value for netstat_tcp_socket.state. The socket had received a SYN.

#define NETSTAT_TCP_STATE_ESTABLISHED   4
 Value for netstat_tcp_socket.state. The socket connection has been established.

#define NETSTAT_TCP_STATE_FIN_WAIT_1   5
 Value for netstat_tcp_socket.state. The socket has been closed, and is waiting for its peer to close.

#define NETSTAT_TCP_STATE_FIN_WAIT_2   6
 Value for netstat_tcp_socket.state. The socket's peer has ACKed a FIN.

#define NETSTAT_TCP_STATE_CLOSE_WAIT   7
 Value for netstat_tcp_socket.state. The socket's peer has sent a FIN, the application should now close the socket.

#define NETSTAT_TCP_STATE_LAST_ACK   8
 Value for netstat_tcp_socket.state. The socket has closed, and is waiting for it's peer to ACK.

#define NETSTAT_TCP_STATE_CLOSING   9
 Value for netstat_tcp_socket.state. Both ends have closed the socket.

#define NETSTAT_TCP_STATE_TIME_WAIT   10
 Value for netstat_tcp_socket.state. Timeout wait before returning to closed state.


Functions

unsigned int netstat_version (void)
 Returns the version number of this NETSTAT library.

netstat_arp_entry far * netstat_get_arp_table (void)
 Returns a pointer to the ARP cache table.

unsigned int netstat_num_arp_entries (void)
 Returns the number of entries in the ARP cache table.

netstat_udp_entry far * netstat_get_udp_table (void)
 Returns a pointer to the UDP port table.

unsigned int netstat_num_udp_entries (void)
 Returns the number of entries in the UDP port table.

netstat_tcp_socket far * netstat_get_tcp_socket (unsigned int conn)
 Returns a pointer to a TCP socket information block.

unsigned int netstat_num_tcp_sockets (void)
 Returns the number of entries in the TCP socket table.


Define Documentation

#define ROM400_NETSTAT_VERSION   1
 

Version number associated with this header file. Should be the same as the version number returned by the netstat_version function.

See also:
netstat_version


Function Documentation

netstat_arp_entry far* netstat_get_arp_table void   
 

Returns a pointer to the ARP cache table.

This function returns a pointer to the ARP cache table. There are NETSTAT_ARP_ENTRIES in the ARP cache. Each entry is a netstat_arp_entry. The entry is used when its "flags" has the NETSTAT_ARP_USED bit set.

Returns:
Far pointer to the ARP cache table

netstat_tcp_socket far* netstat_get_tcp_socket unsigned int    conn
 

Returns a pointer to a TCP socket information block.

This function returns a pointer to a specific TCP socket information block of type netstat_tcp_socket. There are at most NETSTAT_TCP_MAXSOCKETS, the function returns NULL when a given socket number doesn't exist. Note that the actual number of sockets in the socket table might change at any time. Table entries are not guaranteed to be contiguous. A user application * should therefore call this function for all values from 0 to NETSTAT_TCP_MAXSOCKETS - 1 and discard non-existent entries.

Parameters:
conn Socket number
Returns:
Far pointer to the socket's information block (or NULL if the socket doesn't exist).

netstat_udp_entry far* netstat_get_udp_table void   
 

Returns a pointer to the UDP port table.

This function returns a pointer to the UDP port table. There are NETSTAT_UDP_ENTRIES in the UDP port table. Each entry is a netstat_udp_entry. The entry is used when its "flags" has the NETSTAT_UDP_USED bit set.

Returns:
Far pointer to the UDP port table

unsigned int netstat_num_arp_entries void   
 

Returns the number of entries in the ARP cache table.

This function returns the number of used entries in the ARP cache table (entries with the NETSTAT_ARP_USED flag set).

Returns:
Number of entries in the ARP cache table

unsigned int netstat_num_tcp_sockets void   
 

Returns the number of entries in the TCP socket table.

This function returns the number of used entries in the TCP socket table.

Returns:
Number of entries in the TCP socket table

unsigned int netstat_num_udp_entries void   
 

Returns the number of entries in the UDP port table.

This function returns the number of used entries in the UDP port table (entries with the NETSTAT_UDP_USED flag set).

Returns:
Number of entries in the UDP port table

unsigned int netstat_version void   
 

Returns the version number of this NETSTAT library.

Returns:
Version number of this NETSTAT library.


Copyright 2004 Dallas Semiconductor, Inc.. Documentation generated by Doxygen.