Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

SRC/pcstat.h

Go to the documentation of this file.
00001 00003 #ifndef _w32_PCSTAT_H 00004 #define _w32_PCSTAT_H 00005 00006 #ifndef ICMP_MAXTYPE 00007 #define ICMP_MAXTYPE 18 00008 #endif 00009 00010 /* 00011 * tcc <= 2.01 lacks proper bit-field support. 00012 * Don't define USE_BSD_API/USE_STATISTICS with this compiler. 00013 */ 00014 00015 #if !defined(OLD_TURBOC) 00016 #include <sys/socket.h> 00017 #include <net/if.h> 00018 #include <net/if_dl.h> 00019 #include <net/if_ether.h> 00020 #include <net/route.h> 00021 #include <netinet/in.h> 00022 #include <netinet/in_systm.h> 00023 #include <netinet/in_var.h> 00024 #include <netinet/ip.h> 00025 #include <netinet/ip_var.h> 00026 #include <netinet/in_pcb.h> 00027 #include <netinet/tcp.h> 00028 #include <netinet/tcp_time.h> 00029 #include <netinet/tcpip.h> 00030 #include <netinet/udp.h> 00031 #include <netinet/udp_var.h> 00032 #include <netinet/tcp_var.h> 00033 #include <netinet/icmp_var.h> 00034 #include <netinet/igmp_var.h> 00035 #include <netinet/icmp6.h> 00036 #include <netinet6/ip6_var.h> 00037 #endif 00038 00039 00044 struct macstat { 00045 DWORD non_ip_recv; /* # of non-IP packets received */ 00046 DWORD non_ip_sent; /* sent */ 00047 DWORD num_tx_err; /* # of transmission errors */ 00048 DWORD num_tx_retry; /* # of transmission retries */ 00049 DWORD num_tx_timeout; /* # of async transmission timeouts */ 00050 DWORD num_unk_type; /* # of unhandled types */ 00051 DWORD num_llc_frames; /* # of LLC frames received */ 00052 DWORD num_wrong_handle; /* # upcalls with wrong handle */ 00053 DWORD num_bad_sync; /* # upcalls with different lengths */ 00054 DWORD num_too_large; /* # upcalls with > ETH_MAX pkts */ 00055 DWORD num_too_small; /* # upcalls with < ETH_MIN pkts */ 00056 DWORD num_mac_loop; /* # of pkts looped by NDIS */ 00057 DWORD num_ip_recurse; /* # of IP-pkts blocked due to recursion */ 00058 00060 struct { 00061 DWORD request_recv; /* # of ARP requests received */ 00062 DWORD request_sent; /* sent */ 00063 DWORD reply_recv; /* # of ARP replies received */ 00064 DWORD reply_sent; /* sent */ 00065 } arp; 00066 00068 struct { 00069 DWORD request_recv; /* # of RARP requests received */ 00070 DWORD request_sent; /* sent */ 00071 DWORD reply_recv; /* # of RARP replies received */ 00072 DWORD reply_sent; /* sent */ 00073 } rarp; 00074 }; 00075 00080 struct pppoestat { 00081 DWORD num_disc_sent; 00082 DWORD num_disc_recv; 00083 DWORD num_sess_sent; 00084 DWORD num_sess_recv; 00085 }; 00086 00087 /* 00088 * IP statistics for all in/out messages, <netinet/ip_var.h> 00089 * 00090 * ips_total; - total packets received 00091 * ips_badsum; - checksum bad 00092 * ips_tooshort; - packet too short 00093 * ips_toosmall; - not enough data 00094 * ips_badhlen; - ip header length < data size 00095 * ips_badlen; - ip length < ip header length 00096 * ips_fragments; - fragments received 00097 * ips_fragdropped; - frags dropped (dups, out of space) 00098 * ips_fragtimeout; - fragments timed out 00099 * ips_forward; - packets forwarded 00100 * ips_cantforward; - packets rcvd for unreachable dest 00101 * ips_redirectsent; - packets forwarded on same net 00102 * ips_noproto; - unknown or unsupported protocol 00103 * ips_delivered; - datagrams delivered to upper level 00104 * ips_localout; - total ip packets generated here 00105 * ips_odropped; - lost out packets due to nobufs, etc. 00106 * ips_idropped; - lost in packets due to nobufs, etc. !! added 00107 * ips_reassembled; - total packets reassembled ok 00108 * ips_fragmented; - datagrams successfully fragmented 00109 * ips_ofragments; - output fragments created 00110 * ips_cantfrag; - don't fragment flag was set, etc. 00111 * ips_badoptions; - error in option processing 00112 * ips_noroute; - packets discarded due to no route 00113 * ips_badvers; - ip version != 4 00114 * ips_rawout; - total raw ip packets generated 00115 * ips_toolong; - ip length > max ip packet size 00116 * 00117 * 00118 * UDP statistics, <netinet/udp_var.h> 00119 * 00120 * udps_ipackets - total input packets 00121 * udps_hdrops - packet shorter than header 00122 * udps_badsum - checksum error 00123 * udps_badlen - data length larger than packet 00124 * udps_noport - no socket on port 00125 * udps_noportbcast - as above, arrived as broadcast 00126 * udps_fullsock - not delivered, input socket full 00127 * udpps_pcbcachemiss - input packets missing pcb cache 00128 * udpps_pcbhashmiss - input packets not for hashed pcb 00129 * udps_opackets - total output packets 00130 * 00131 * 00132 * TCP statistics for all connections, <netinet/tcp_var.h> 00133 * 00134 * tcps_connattempt - connections initiated (output) 00135 * tcps_accepts - connections accepted (input) 00136 * tcps_connects - connections established (input) 00137 * tcps_drops - connections dropped (output) 00138 * tcps_conndrops - embryonic connections dropped (output) 00139 * tcps_closed - conn. closed (includes drops) 00140 * tcps_segstimed - segs where we tried to get rtt 00141 * tcps_rttupdated - times we succeeded 00142 * tcps_delack - delayed acks sent 00143 * tcps_timeoutdrop - conn. dropped in rxmt timeout 00144 * tcps_rexmttimeo - retransmit timeouts 00145 * tcps_persisttimeo - persist timeouts 00146 * tcps_keeptimeo - keepalive timeouts 00147 * tcps_keepprobe - keepalive probes sent 00148 * tcps_keepdrops - connections dropped in keepalive 00149 * 00150 * tcps_sndtotal - total packets sent 00151 * tcps_sndpack - data packets sent 00152 * tcps_sndbyte - data bytes sent 00153 * tcps_sndrexmitpack - data packets retransmitted 00154 * tcps_sndrexmitbyte - data bytes retransmitted 00155 * tcps_sndacks - ack-only packets sent 00156 * tcps_sndprobe - window probes sent 00157 * tcps_sndurg - packets sent with URG only 00158 * tcps_sndwinup - window update -only packets sent 00159 * tcps_sndctrl - control (SYN|FIN|RST) packets sent 00160 * 00161 * tcps_rcvtotal - total packets received 00162 * tcps_rcvpack - packets received in sequence 00163 * tcps_rcvbyte - bytes received in sequence 00164 * tcps_rcvbadsum - packets received with ccksum errs 00165 * tcps_rcvbadoff - packets received with bad offset 00166 * tcps_rcvshort - packets received too short 00167 * tcps_rcvduppack - duplicate-only packets received 00168 * tcps_rcvdupbyte - duplicate-only bytes received 00169 * tcps_rcvpartduppack - packets with some duplicate data 00170 * tcps_rcvpartdupbyte - dup. bytes in part-dup. packets 00171 * tcps_rcvoopack - out-of-order packets received 00172 * tcps_rcvoobyte - out-of-order bytes received 00173 * tcps_rcvpackafterwin - packets with data after window 00174 * tcps_rcvbyteafterwin - bytes rcvd after window 00175 * tcps_rcvafterclose - packets rcvd after "close" 00176 * tcps_rcvwinprobe - rcvd window probe packets 00177 * tcps_rcvdupack - rcvd duplicate acks 00178 * tcps_rcvacktoomuch - rcvd acks for unsent data 00179 * tcps_rcvackpack - rcvd ack packets 00180 * tcps_rcvackbyte - bytes acked by rcvd acks 00181 * tcps_rcvwinupd - rcvd window update packets 00182 * tcps_pawsdrop - segments dropped due to PAWS (protected against wrapped segments) 00183 * tcps_predack - times hdr predict ok for acks 00184 * tcps_preddat - times hdr predict ok for data pkts 00185 * tcps_pcbcachemiss - times missed cache for input segment 00186 * tcps_cachedrtt - times cached RTT in route updated 00187 * tcps_cachedrttvar - times cached rttvar updated 00188 * tcps_cachedssthresh - times cached ssthresh updated 00189 * tcps_usedrtt - times RTT initialized from route 00190 * tcps_usedrttvar - times RTTVAR initialized from rt 00191 * tcps_usedssthresh - times ssthresh initialized from rt 00192 * tcps_persistdrop - timeout in persist state 00193 * tcps_badsyn - bogus SYN, e.g. premature ACK 00194 * tcps_mturesent - resends due to MTU discovery 00195 * tcps_listendrop - listen queue overflows 00196 * #ifdef TCP_FACK 00197 * tcps_fack_recovery; - recovery episodes 00198 * tcps_fack_sndpack; - data packets sent 00199 * tcps_fack_sndbyte; - data bytes sent 00200 * tcps_fack_sndrexmitpack - data packets retransmitted 00201 * tcps_fack_sndrexmitbyte - data bytes retransmitted 00202 * #endif 00203 * 00204 * 00205 * ICMP statistics, in <netinet/icmp_var.h> 00206 * 00207 * icps_error - # of calls to icmp_error 00208 * icps_oldshort - no error 'cuz old ip too short 00209 * icps_oldicmp - no error 'cuz old was icmp 00210 * icps_outhist[18+1] - output counters for ICMP_xx 00211 * icps_badcode - icmp_code out of range 00212 * icps_tooshort - packet < ICMP_MINLEN 00213 * icps_checksum - bad checksum 00214 * icps_badlen - calculated bound mismatch 00215 * icps_reflect - number of responses 00216 * icps_inhist[18+1] - input counters for ICMP_xx 00217 * 00218 * 00219 * IGMP statistics, <netinet/igmp_var.h> 00220 * 00221 * igps_rcv_total - total IGMP messages received 00222 * igps_rcv_tooshort - received with too few bytes 00223 * igps_rcv_badsum - received with bad checksum 00224 * igps_rcv_queries - received membership queries 00225 * igps_rcv_badqueries - received invalid queries 00226 * igps_rcv_reports - received membership reports 00227 * igps_rcv_badreports - received invalid reports 00228 * igps_rcv_ourreports - received reports for our groups 00229 * igps_snd_reports - sent membership reports 00230 */ 00231 00232 extern int sock_stats (sock_type *sock, DWORD *days, WORD *inactive, 00233 WORD *cwindow, DWORD *avg, DWORD *sd); 00234 00235 extern void print_mac_stats (void); 00236 extern void print_arp_stats (void); 00237 extern void print_pkt_stats (void); 00238 extern void print_vjc_stats (void); 00239 extern void print_pppoe_stats(void); 00240 extern void print_ip4_stats (void); 00241 extern void print_ip6_stats (void); 00242 extern void print_icmp_stats (void); 00243 extern void print_icmp6_stats(void); 00244 extern void print_igmp_stats (void); 00245 extern void print_udp_stats (void); 00246 extern void print_tcp_stats (void); 00247 extern void print_all_stats (void); 00248 extern void reset_stats (void); 00249 00250 00251 #if defined(USE_STATISTICS) 00252 #define macstats NAMESPACE (macstats) 00253 #define ip4stats NAMESPACE (ip4stats) 00254 #define ip6stats NAMESPACE (ip6stats) 00255 #define udpstats NAMESPACE (udpstats) 00256 #define tcpstats NAMESPACE (tcpstats) 00257 #define icmpstats NAMESPACE (icmpstats) 00258 #define icmp6stats NAMESPACE (icmp6stats) 00259 #define igmpstats NAMESPACE (igmpstats) 00260 #define pppoestats NAMESPACE (pppoestats) 00261 00262 #define STAT(x) x 00263 00264 extern struct macstat macstats; 00265 extern struct ipstat ip4stats; 00266 extern struct ip6stat ip6stats; 00267 extern struct udpstat udpstats; 00268 extern struct tcpstat tcpstats; 00269 extern struct icmpstat icmpstats; 00270 extern struct icmp6stat icmp6stats; 00271 extern struct igmpstat igmpstats; 00272 extern struct pppoestat pppoestats; 00273 00274 extern void update_in_stat (void); 00275 extern void update_out_stat (void); 00276 00277 #else 00278 #define STAT(x) ((void)0) 00279 #endif 00280 00281 #endif /* !_w32_PCSTAT_H */ 00282

Generated on Wed Aug 4 08:55:52 2010 for Watt-32 tcp/ip by doxygen 1.3.8