Dallas Semiconductor DS80C400 C Libraries Home Page

Main Page   Data Structures   File List   Data Fields   Globals  

rom400_netstat.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------
00002  *  Copyright (C) 2003-2004 Dallas Semiconductor Corporation, All Rights Reserved.
00003  * 
00004  *  Permission is hereby granted, free of charge, to any person obtaining a
00005  *  copy of this software and associated documentation files (the "Software"),
00006  *  to deal in the Software without restriction, including without limitation
00007  *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008  *  and/or sell copies of the Software, and to permit persons to whom the
00009  *  Software is furnished to do so, subject to the following conditions:
00010  * 
00011  *  The above copyright notice and this permission notice shall be included
00012  *  in all copies or substantial portions of the Software.
00013  * 
00014  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00015  *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00016  *  MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00017  *  IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES
00018  *  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00019  *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00020  *  OTHER DEALINGS IN THE SOFTWARE.
00021  * 
00022  *  Except as contained in this notice, the name of Dallas Semiconductor
00023  *  shall not be used except as stated in the Dallas Semiconductor
00024  *  Branding Policy.
00025  * ---------------------------------------------------------------------------
00026  *
00027  * This file contains function definitions for the Netstat network statistics
00028  * library for the Dallas Semiconductor DS80C400 processor.  This file is intended for
00029  * use with the Keil MicroVision (uVision) C compiler.
00030  *
00031  * ---------------------------------------------------------------------------
00032  */
00033 #ifndef __rom400_netstat_
00034 #define __rom400_netstat_
00035 
00058 #define ROM400_NETSTAT_VERSION         1
00059 
00065 //---------------------------------------------------------------------------
00066 unsigned int netstat_version(void);
00067 
00068 
00069 #define NETSTAT_ARP_ENTRIES      8      
00070 
00071 
00076 typedef struct {
00077   unsigned char flags;  
00078   unsigned char ttl;    
00079   unsigned char mac[6]; 
00080   unsigned char ip[4];  
00081 } netstat_arp_entry;
00082 
00083 #define NETSTAT_ARP_USED         1      
00084 #define NETSTAT_ARP_REPLYPENDING 2      
00085 #define NETSTAT_ARP_STATIC       4      
00086 
00087 
00097 //---------------------------------------------------------------------------
00098 netstat_arp_entry far *netstat_get_arp_table(void);
00099 
00108 //---------------------------------------------------------------------------
00109 unsigned int netstat_num_arp_entries(void);
00110 
00111 
00112 #define NETSTAT_UDP_ENTRIES     16      
00113 
00114 
00118 typedef struct {
00119   unsigned char  flags;         
00120   unsigned short port;          
00121   unsigned char  queue_hpp[5];  
00122   unsigned char  reserved;      
00123 } netstat_udp_entry;
00124 
00125 #define NETSTAT_UDP_USED         1      
00126 
00127 
00137 //---------------------------------------------------------------------------
00138 netstat_udp_entry far *netstat_get_udp_table(void);
00139 
00148 //---------------------------------------------------------------------------
00149 unsigned int netstat_num_udp_entries(void);
00150 
00151 
00152 #define NETSTAT_TCP_MAXSOCKETS 25       
00153 
00154 
00159 typedef struct {
00160   unsigned char  flags;                 
00161   unsigned char  state;                 
00162   unsigned char  server_sock;           
00163   unsigned char  ack_timer;             
00164   unsigned short remote_port;           
00165   unsigned char  remote_addr[16];       
00166   unsigned short local_port;            
00167   unsigned char  local_addr[16];        
00168   unsigned long  sequence_num;          
00169   unsigned long  ack_num;               
00170   unsigned short input_retrieve_ptr;    
00171   unsigned short input_store_ptr;       
00172   unsigned char  input_buffer_hpp[5];   
00173   unsigned short output_retrieve_ptr;   
00174   unsigned short output_store_ptr;      
00175   unsigned char  output_buffer_hpp[5];  
00176   unsigned short receiver_win_size;     
00177   unsigned short sender_win_size;       
00178   unsigned short receiver_mss;          
00179   unsigned short sock;                  
00180   unsigned long  last_ack_received;     
00181   unsigned short output_ack_ptr;        
00182   unsigned char  reload_retry_min;      
00183   unsigned char  retry_timer[2];        
00184   unsigned char  retry_flags;           
00185   unsigned char  retry_count;           
00186   unsigned char  retry_timer_reload;    
00187   unsigned short death_timer;           
00188   unsigned char  options;               
00189   unsigned char  unacked_segs;          
00190   unsigned char  max_unacked_segs;      
00191   unsigned char  persist_timer;         
00192   unsigned char  persist_timer_cap;     
00193   unsigned short send_mss;              
00194 } netstat_tcp_socket;
00195 
00196 #define NETSTAT_TCP_OUTPUT_NEEDED_MASK        2 
00197 #define NETSTAT_TCP_ACK_NEEDED_MASK           4 
00198 #define NETSTAT_TCP_SERVER_MASK               8 
00199 #define NETSTAT_TCP_RESERVED_MASK            16 
00200 #define NETSTAT_TCP_HAVE_OUTPUT_DATA_MASK    32 
00201 #define NETSTAT_TCP_HAVE_FIN_MASK            64 
00202 #define NETSTAT_TCP_SEND_FIN_MASK           128 
00203 
00204 #define NETSTAT_TCP_OPTION_NAGLE_ENABLED_MASK 1 
00205 #define NETSTAT_TCP_OPTION_IPV6_MASK          2 
00206 #define NETSTAT_TCP_OPTION_SOCKET_ASSIGNED    4 
00207 
00208 #define NETSTAT_TCP_STATE_CLOSED              0 
00209 #define NETSTAT_TCP_STATE_LISTEN              1 
00210 #define NETSTAT_TCP_STATE_SYN_SENT            2 
00211 #define NETSTAT_TCP_STATE_SYN_RECEIVED        3 
00212 #define NETSTAT_TCP_STATE_ESTABLISHED         4 
00213 #define NETSTAT_TCP_STATE_FIN_WAIT_1          5 
00214 #define NETSTAT_TCP_STATE_FIN_WAIT_2          6 
00215 #define NETSTAT_TCP_STATE_CLOSE_WAIT          7 
00216 #define NETSTAT_TCP_STATE_LAST_ACK            8 
00217 #define NETSTAT_TCP_STATE_CLOSING             9 
00218 #define NETSTAT_TCP_STATE_TIME_WAIT          10 
00219 
00220 
00237 //---------------------------------------------------------------------------
00238 netstat_tcp_socket far *netstat_get_tcp_socket(unsigned int conn);
00239 
00247 //---------------------------------------------------------------------------
00248 unsigned int netstat_num_tcp_sockets(void);
00249 
00250 
00251 #endif

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