Function xn_interface_statistics

This function returns communication statistics of an interface.

typedef struct _iface_stats
{
/* DRIVER LAYER */
long interface_packets_in;
long interface_packets_out;
long interface_bytes_in;
long interface_bytes_out;
long interface_errors_in; /* pkts dropped by driver due to errors */
long interface_errors_out;
long interface_packets_lost; /* input packets lost (alloc fails etc) */
/* IP/PROTOCOL LAYER */
long rcv_packets;
long rcv_bytes;
long rcv_ucast;
long rcv_nucast;
long xmit_errors;
long xmit_packets;
long xmit_bytes;
long xmit_ucast;
long xmit_nucast;
long rcv_ip_packets;
long ip_fragments;
long ip_cksum;
long ip_dropped; /* not ours, drop the packet */
long ip_routed; /* pkts simple router rerouted */
long ip_options;
long ip_unknown; /* unknown protocol (not TCP, UDP or ICMP) */
long rcv_arp_packets;
long rcv_rarp_packets;
long unk_packets; /* not IP, RARP or BOOTP */
long rcv_tcp_packets;
long tcp_cksum;
long tcp_dropped; /* no ports found */
long tcp_retries; /* pkts retransmitted */
long tcp_window_probes;
long tcp_keepalives;
long tcp_keepalive_retries;
long tcp_duplicates;
long tcp_options;
long tcp_options_us; /* unsupported options (ignored) */
long rcv_udp_packets;
long udp_cksum;
long udp_dropped; /* no port found */
long udp_que_full; /* input queue is full */
long raw_que_full; /* input queue is full */
long udp_sends;
long udp_send_bytes;
long raw_sends;
long rcv_raw_packets;
long raw_send_bytes;
long icmp_ping_send;
long icmp_ping_answered;
long icmp_packets;
long icmp_cksum;
long icmp_unreach;
long icmp_quench;
long icmp_redir;
long icmp_echo_requests;
long icmp_time_exceeded;
long icmp_param_problem;
long icmp_not_handled;
} IFACE_STATS;
int xn_interface_statistics(int interface, IFACE_STATS * stats);