#ifndef _TFE_PACKET_IO_FS_H #define _TFE_PACKET_IO_FS_H #ifdef __cpluscplus extern "C" { #endif #include "tfe_utils.h" #include struct throughput_metrics { uint64_t n_pkts; uint64_t n_bytes; }; struct packet_io_fs { struct throughput_metrics raw_pkt_rx; // 累计值 struct throughput_metrics raw_pkt_tx; // 累计值 struct throughput_metrics decrypt_tx; // 累计值 struct throughput_metrics decrypt_rx; // 累计值 struct throughput_metrics dup_bypass; // 累计值 struct throughput_metrics raw_bypass; // 累计值 struct throughput_metrics decrypt_rxdrop; // 累计值 struct throughput_metrics ctrl_pkt_rx; // 累计值 struct throughput_metrics ctrl_pkt_tx; // 累计值 struct throughput_metrics keepalived_pkt_rx; // 累计值 struct throughput_metrics keepalived_pkt_tx; // 累计值 struct throughput_metrics tap_pkt_rx; // 累计值 struct throughput_metrics tap_pkt_tx; // 累计值 struct throughput_metrics tap_pkt_rxdrop; // 累计值 struct throughput_metrics tap_c_pkt_rx; // 累计值 struct throughput_metrics tap_c_pkt_tx; // 累计值 struct throughput_metrics tap_s_pkt_rx; // 累计值 struct throughput_metrics tap_s_pkt_tx; // 累计值 uint64_t ctrl_pkt_opening_num; // 累计值 uint64_t ctrl_pkt_active_num; // 累计值 uint64_t ctrl_pkt_closing_num; // 累计值 uint64_t ctrl_pkt_resetall_num; // 累计值 uint64_t ctrl_pkt_error_num; // 累计值 uint64_t hit_intercept_num; // 累计值 uint64_t hit_no_intercept_num; // 累计值 uint64_t can_intercept_num; // 累计值 uint64_t asymmetric_num; // 累计值 uint64_t tunnel_num; // 累计值 uint64_t tcp_pcy_inval_num; // 累计值 uint64_t session_num; // 瞬时值 uint64_t session_log; // 瞬时值 struct fieldstat_easy *fs_handle; int fs_id[128]; }; struct packet_io_fs *packet_io_fs_create(const char *profile); void packet_io_fs_destory(struct packet_io_fs *handle); void packet_io_fs_dump(struct packet_io_fs *handle); void inline throughput_metrics_inc(struct throughput_metrics *iterm, uint64_t n_pkts, uint64_t n_bytes) { iterm->n_bytes += n_bytes; iterm->n_pkts += n_pkts; } #ifdef __cpluscplus } #endif #endif