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_fieldstat.h

52 lines
1.1 KiB
C

#ifndef _TFE_FIELDSTAT_METRIC_H
#define _TFE_FIELDSTAT_METRIC_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include <tfe_utils.h>
#include "fieldstat/fieldstat_easy.h"
enum metric_columns_index
{
COLUMN_HIT_COUNT = 0,
COLUMN_IN_BYTES,
COLUMN_OUT_BYTES,
COLUMN_IN_PKTS,
COLUMN_OUT_PKTS,
COLUMN_MAX
};
enum metric_tags_index
{
TAG_VSYS_ID = 0,
TAG_RULE_ID,
TAG_ACTION,
TAG_SUB_ACTION,
TAG_PINNING_STATUS,
TAG_MAX
};
struct tfe_fieldstat_easy_t
{
int table_id;
int max_thread;
struct fieldstat_tag **tags;
int counter_array[COLUMN_MAX];
struct fieldstat_easy *fseasy;
};
struct tfe_fieldstat_easy_t *tfe_fieldstat_easy_create(char *app_name, char *outpath, int cycle, int max_thread, void *local_logger);
void tfe_set_intercept_metric(struct tfe_fieldstat_easy_t *fieldstat, struct session_ctx *s_ctx, int thread_id, int is_session_close);
void tfe_fieldstat_easy_destroy(struct tfe_fieldstat_easy_t *fieldstat);
int tfe_fieldstat_easy_incrby(struct tfe_fieldstat_easy_t *fieldstat, unsigned int counter_id, long long value, const struct fieldstat_tag tags[], int n_tags, int thread_id);
#ifdef __cpluscplus
}
#endif
#endif