iPXE
Functions
ipstat.c File Reference

IP statistics. More...

#include <stdio.h>
#include <ipxe/ipstat.h>
#include <usr/ipstat.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
void ipstat (void)
 Print IP statistics.

Detailed Description

IP statistics.

Definition in file ipstat.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
void ipstat ( void  )

Print IP statistics.

Definition at line 40 of file ipstat.c.

References for_each_table_entry, ip_statistics::in_addr_errors, ip_statistics::in_bcast_pkts, ip_statistics::in_delivers, ip_statistics::in_hdr_errors, ip_statistics::in_mcast_pkts, ip_statistics::in_octets, ip_statistics::in_receives, ip_statistics::in_truncated_pkts, ip_statistics::in_unknown_protos, IP_STATISTICS_FAMILIES, ip_statistics::out_bcast_pkts, ip_statistics::out_mcast_pkts, ip_statistics::out_no_routes, ip_statistics::out_octets, ip_statistics::out_requests, ip_statistics::out_transmits, printf(), ip_statistics::reasm_fails, ip_statistics::reasm_oks, ip_statistics::reasm_reqds, ip_statistics_family::stats, and ip_statistics_family::version.

Referenced by ipstat_exec().

                     {
        struct ip_statistics_family *family;
        struct ip_statistics *stats;

        for_each_table_entry ( family, IP_STATISTICS_FAMILIES ) {
                stats = family->stats;
                printf ( "IP version %d:\n", family->version );
                printf ( "  InReceives:%ld InMcastPkts:%ld InBcastPkts:%ld "
                         "InOctets:%ld\n", stats->in_receives,
                         stats->in_mcast_pkts, stats->in_bcast_pkts,
                         stats->in_octets );
                printf ( "  InHdrErrors:%ld InAddrErrors:%ld "
                         "InUnknownProtos:%ld InTruncatedPkts:%ld\n",
                         stats->in_hdr_errors, stats->in_addr_errors,
                         stats->in_unknown_protos, stats->in_truncated_pkts );
                printf ( "  ReasmReqds:%ld ReasmOKs:%ld ReasmFails:%ld\n",
                         stats->reasm_reqds, stats->reasm_oks,
                         stats->reasm_fails );
                printf ( "  InDelivers:%ld OutRequests:%ld OutNoRoutes:%ld\n",
                         stats->in_delivers, stats->out_requests,
                         stats->out_no_routes );
                printf ( "  OutTransmits:%ld OutMcastPkts:%ld OutBcastPkts:%ld "
                         "OutOctets:%ld\n", stats->out_transmits,
                         stats->out_mcast_pkts, stats->out_bcast_pkts,
                         stats->out_octets );
        }
}