Network statistics access
Overview
// typedefs typedef struct tapi_cfg_if_stats tapi_cfg_if_stats; typedef struct tapi_cfg_net_stats_ipv4 tapi_cfg_net_stats_ipv4; typedef struct tapi_cfg_net_stats_icmp tapi_cfg_net_stats_icmp; typedef struct tapi_cfg_net_stats tapi_cfg_net_stats; // structs struct tapi_cfg_if_stats; struct tapi_cfg_net_stats; struct tapi_cfg_net_stats_icmp; struct tapi_cfg_net_stats_ipv4; // global functions te_errno tapi_cfg_stats_if_stats_get(const char* ta, const char* ifname, tapi_cfg_if_stats* stats); te_errno tapi_cfg_stats_if_stats_print(const char* ta, const char* ifname, tapi_cfg_if_stats* stats); te_errno tapi_cfg_stats_if_stats_print_diff(const tapi_cfg_if_stats* stats, const tapi_cfg_if_stats* prev, const char* descr_fmt, ...); te_errno te_errno tapi_cfg_stats_net_stats_get(const char* ta, tapi_cfg_net_stats* stats); te_errno tapi_cfg_stats_net_stats_print(const char* ta, tapi_cfg_net_stats* stats); te_errno tapi_cfg_stats_net_stats_print_diff(const tapi_cfg_net_stats* stats, const tapi_cfg_net_stats* prev, const char* descr_fmt, ...);
Detailed Documentation
Global Functions
te_errno tapi_cfg_stats_if_stats_get(const char* ta, const char* ifname, tapi_cfg_if_stats* stats)
Get IfTable statistics for the certain network interface.
Parameters:
ta |
Test Agent to gather statistics on |
ifname |
Network interface to gather statistics of |
stats |
Resulted interface statistics structure |
Returns:
Status code
te_errno tapi_cfg_stats_if_stats_print(const char* ta, const char* ifname, tapi_cfg_if_stats* stats)
Print IfTable statistics for the certain network interface.
Parameters:
ta |
Test Agent to gather statistics on |
ifname |
Network interface to gather statistics of |
stats |
Gathered interface statistics structure to print |
Returns:
Status code
te_errno tapi_cfg_stats_if_stats_print_diff(const tapi_cfg_if_stats* stats, const tapi_cfg_if_stats* prev, const char* descr_fmt, ...)
Print IfTable statistics difference with provided description.
Parameters:
stats |
Interface statistics. |
prev |
Previous interface statistics or |
descr_fmt |
Description format string with arguments. |
Returns:
Status code.
te_errno te_errno tapi_cfg_stats_net_stats_get(const char* ta, tapi_cfg_net_stats* stats)
Get /proc/net/snmp like statistics for the host, where Test Agent is running.
Parameters:
ta |
Test Agent to gather statistics on |
stats |
Resulted host statistics structure |
Returns:
Status code
te_errno tapi_cfg_stats_net_stats_print(const char* ta, tapi_cfg_net_stats* stats)
Print /proc/net/snmp like statistics for the host, where Test Agent is running.
Parameters:
ta |
Test Agent to gether statistics on |
stats |
Gathered host statistics structure to print |
Returns:
Status code
te_errno tapi_cfg_stats_net_stats_print_diff(const tapi_cfg_net_stats* stats, const tapi_cfg_net_stats* prev, const char* descr_fmt, ...)
Print /proc/net/snmp like statistics difference with provided description.
Parameters:
stats |
Network statistics. |
prev |
Previous network statistics or |
descr_fmt |
Description format string with arguments. |
Returns:
Status code.