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-maat/src/inc_internal/maat_fqdn_plugin.h

76 lines
2.8 KiB
C
Raw Normal View History

2023-02-09 22:13:15 +08:00
/*
**********************************************************************************************
* File: maat_fqdn_plugin.h
* Description:
* Authors: Liu WenTan <liuwentan@geedgenetworks.com>
* Date: 2022-10-31
2023-05-04 17:10:19 +08:00
* Copyright: (c) Since 2022 Geedge Networks, Ltd. All rights reserved.
2023-02-09 22:13:15 +08:00
***********************************************************************************************
*/
#ifndef _MAAT_FQDN_PLUGIN_H_
#define _MAAT_FQDN_PLUGIN_H_
#ifdef __cplusplus
2023-02-09 22:13:15 +08:00
extern "C"
{
#endif
#include "maat.h"
#include "maat_table.h"
#include "maat_ex_data.h"
2023-02-09 22:13:15 +08:00
#include "cJSON/cJSON.h"
#include "fqdn_engine.h"
2023-02-09 22:13:15 +08:00
struct fqdn_plugin_runtime;
/* fqdn plugin schema API */
void *fqdn_plugin_schema_new(cJSON *json, struct table_manager *tbl_mgr,
const char *table_name, struct log_handle *logger);
void fqdn_plugin_schema_free(void *fqdn_plugin_schema);
/* fqdn plugin table ex data API */
int fqdn_plugin_table_set_ex_container_schema(void *fqdn_plugin_schema, int table_id,
maat_ex_new_func_t *new_func,
maat_ex_free_func_t *free_func,
maat_ex_dup_func_t *dup_func,
void (*custom_data_free)(void *),
long argl, void *argp);
struct ex_container_schema *fqdn_plugin_table_get_ex_container_schema(void *fqdn_plugin_schema);
2023-02-09 22:13:15 +08:00
/* fqdn plugin runtime API */
2023-04-20 15:34:56 +08:00
void *fqdn_plugin_runtime_new(void *fqdn_plugin_schema, size_t max_thread_num,
struct maat_garbage_bin *garbage_bin,
2023-02-09 22:13:15 +08:00
struct log_handle *logger);
void fqdn_plugin_runtime_free(void *fqdn_plugin_runtime);
int fqdn_plugin_runtime_update(void *fqdn_plugin_runtime, void *fqdn_plugin_schema,
const char *table_name, const char *line, int valid_column);
2023-04-20 15:34:56 +08:00
int fqdn_plugin_runtime_commit(void *fqdn_plugin_runtime, const char *table_name,
long long maat_rt_version);
2023-02-09 22:13:15 +08:00
2023-04-12 19:20:05 +08:00
long long fqdn_plugin_runtime_rule_count(void *fqdn_plugin_runtime);
2023-02-09 22:13:15 +08:00
struct ex_data_runtime *fqdn_plugin_runtime_get_ex_data_rt(void *fqdn_plugin_runtime);
int fqdn_plugin_runtime_get_ex_data(void *fqdn_plugin_runtime, const char *fqdn,
void **ex_data_array, size_t n_ex_data);
void fqdn_rule_free(struct FQDN_rule *fqdn_rule);
2023-04-20 15:34:56 +08:00
void fqdn_plugin_runtime_perf_stat(void *fqdn_plugin_runtime, struct timespec *start,
struct timespec *end, int thread_id);
long long fqdn_plugin_runtime_scan_count(void *fqdn_plugin_runtime);
long long fqdn_plugin_runtime_scan_cpu_time(void *fqdn_plugin_runtime);
long long fqdn_plugin_runtime_update_err_count(void *fqdn_plugin_runtime);
#ifdef __cplusplus
2023-02-09 22:13:15 +08:00
}
#endif
#endif