This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-tfe/common/include/tfe_packet_io_fs.h
2023-05-15 16:41:59 +08:00

68 lines
2.0 KiB
C

#ifndef _TFE_PACKET_IO_FS_H
#define _TFE_PACKET_IO_FS_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include "tfe_utils.h"
#include <MESA/field_stat2.h>
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 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 session_num; // 瞬时值
uint64_t session_log; // 瞬时值
screen_stat_handle_t 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 throughput_metrics_inc(struct throughput_metrics *iterm, uint64_t n_pkts, uint64_t n_bytes);
#ifdef __cpluscplus
}
#endif
#endif