Dallas Semiconductor DS80C400 C Libraries Home Page

Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

rom400_netstat.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------
00002  *  Copyright (C) 2003-2006 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 
00059 /*
00060  * Version 2 - Updates for new ARP Cache routines
00061  *
00062  * Version 1 - Inital Release
00063  */
00064 
00065 #define ROM400_NETSTAT_VERSION         2
00066 
00072 //---------------------------------------------------------------------------
00073 unsigned int netstat_version(void);
00074 
00079 #define NETSTAT_ROM_ARP_ENTRIES      8
00080 
00086 typedef struct {
00087   unsigned char flags;  
00088   unsigned char ttl;    
00089   unsigned char mac[6]; 
00090   unsigned char ip[4];  
00091 } netstat_arp_entry;
00092 
00096 #define NETSTAT_ARP_USED         1
00097 
00101 #define NETSTAT_ARP_REPLYPENDING 2
00102 
00106 #define NETSTAT_ARP_STATIC       4
00107 
00117 //---------------------------------------------------------------------------
00118 netstat_arp_entry far *netstat_get_arp_table(void);
00119 
00128 //---------------------------------------------------------------------------
00129 unsigned int netstat_num_arp_entries(void);
00130 
00131 
00132 #define NETSTAT_UDP_ENTRIES     16      
00133 
00134 
00138 typedef struct {
00139   unsigned char  flags;         
00140   unsigned short port;          
00141   unsigned char  queue_hpp[5];  
00142   unsigned char  reserved;      
00143 } netstat_udp_entry;
00144 
00145 #define NETSTAT_UDP_USED         1      
00146 
00147 
00157 //---------------------------------------------------------------------------
00158 netstat_udp_entry far *netstat_get_udp_table(void);
00159 
00168 //---------------------------------------------------------------------------
00169 unsigned int netstat_num_udp_entries(void);
00170 
00171 
00172 #define NETSTAT_TCP_MAXSOCKETS 25       
00173 
00174 
00179 typedef struct {
00180   unsigned char  flags;                 
00181   unsigned char  state;                 
00182   unsigned char  server_sock;           
00183   unsigned char  ack_timer;             
00184   unsigned short remote_port;           
00185   unsigned char  remote_addr[16];       
00186   unsigned short local_port;            
00187   unsigned char  local_addr[16];        
00188   unsigned long  sequence_num;          
00189   unsigned long  ack_num;               
00190   unsigned short input_retrieve_ptr;    
00191   unsigned short input_store_ptr;       
00192   unsigned char  input_buffer_hpp[5];   
00193   unsigned short output_retrieve_ptr;   
00194   unsigned short output_store_ptr;      
00195   unsigned char  output_buffer_hpp[5];  
00196   unsigned short receiver_win_size;     
00197   unsigned short sender_win_size;       
00198   unsigned short receiver_mss;          
00199   unsigned short sock;                  
00200   unsigned long  last_ack_received;     
00201   unsigned short output_ack_ptr;        
00202   unsigned char  reload_retry_min;      
00203   unsigned char  retry_timer[2];        
00204   unsigned char  retry_flags;           
00205   unsigned char  retry_count;           
00206   unsigned char  retry_timer_reload;    
00207   unsigned short death_timer;           
00208   unsigned char  options;               
00209   unsigned char  unacked_segs;          
00210   unsigned char  max_unacked_segs;      
00211   unsigned char  persist_timer;         
00212   unsigned char  persist_timer_cap;     
00213   unsigned short send_mss;              
00214 } netstat_tcp_socket;
00215 
00216 #define NETSTAT_TCP_OUTPUT_NEEDED_MASK        2 
00217 
00218 #define NETSTAT_TCP_ACK_NEEDED_MASK           4 
00219 
00220 #define NETSTAT_TCP_SERVER_MASK               8 
00221 
00222 #define NETSTAT_TCP_RESERVED_MASK            16 
00223 
00224 #define NETSTAT_TCP_HAVE_OUTPUT_DATA_MASK    32 
00225 
00226 #define NETSTAT_TCP_HAVE_FIN_MASK            64 
00227 
00228 #define NETSTAT_TCP_SEND_FIN_MASK           128 
00229 
00230 // ----
00231 
00232 #define NETSTAT_TCP_OPTION_NAGLE_ENABLED_MASK 1 
00233 
00234 #define NETSTAT_TCP_OPTION_IPV6_MASK          2 
00235 
00236 #define NETSTAT_TCP_OPTION_SOCKET_ASSIGNED    4 
00237 
00238 // ----
00239 
00240 #define NETSTAT_TCP_STATE_CLOSED              0 
00241 
00242 #define NETSTAT_TCP_STATE_LISTEN              1 
00243 
00244 #define NETSTAT_TCP_STATE_SYN_SENT            2 
00245 
00246 #define NETSTAT_TCP_STATE_SYN_RECEIVED        3 
00247 
00248 #define NETSTAT_TCP_STATE_ESTABLISHED         4 
00249 
00250 #define NETSTAT_TCP_STATE_FIN_WAIT_1          5 
00251 
00252 #define NETSTAT_TCP_STATE_FIN_WAIT_2          6 
00253 
00254 #define NETSTAT_TCP_STATE_CLOSE_WAIT          7 
00255 
00256 #define NETSTAT_TCP_STATE_LAST_ACK            8 
00257 
00258 #define NETSTAT_TCP_STATE_CLOSING             9 
00259 
00260 #define NETSTAT_TCP_STATE_TIME_WAIT          10 
00261 
00262 
00279 //---------------------------------------------------------------------------
00280 netstat_tcp_socket far *netstat_get_tcp_socket(unsigned int conn);
00281 
00289 //---------------------------------------------------------------------------
00290 unsigned int netstat_num_tcp_sockets(void);
00291 
00292 
00293 #endif

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