support expr offset match

This commit is contained in:
liuwentan
2023-02-09 22:13:15 +08:00
parent c1902f8deb
commit d5e6808e1f
41 changed files with 3046 additions and 711 deletions

View File

@@ -0,0 +1,56 @@
/*
**********************************************************************************************
* File: maat_bool_plugin.h
* Description:
* Authors: Liu WenTan <liuwentan@geedgenetworks.com>
* Date: 2022-10-31
* Copyright: (c) 2018-2022 Geedge Networks, Inc. All rights reserved.
***********************************************************************************************
*/
#ifndef _MAAT_BOOL_PLUGIN_H_
#define _MAAT_BOOL_PLUGIN_H_
#ifdef __cpluscplus
extern "C"
{
#endif
#include "log/log.h"
#include "maat/maat.h"
#include "cJSON/cJSON.h"
struct bool_plugin_runtime;
/* bool plugin schema API */
void *bool_plugin_schema_new(cJSON *json, struct table_manager *tbl_mgr,
const char *table_name, struct log_handle *logger);
void bool_plugin_schema_free(void *bool_plugin_schema);
/* ip plugin table ex data API */
struct ex_data_schema *bool_plugin_table_get_ex_data_schema(void *bool_plugin_schema);
int bool_plugin_table_set_ex_data_schema(void *bool_plugin_schema,
maat_plugin_ex_new_func_t *new_func,
maat_plugin_ex_free_func_t *free_func,
maat_plugin_ex_dup_func_t *dup_func,
long argl, void *argp,
struct log_handle *logger);
/* ip plugin runtime API */
void *bool_plugin_runtime_new(void *bool_plugin_schema, int max_thread_num,
struct maat_garbage_bin *garbage_bin,
struct log_handle *logger);
void bool_plugin_runtime_free(void *bool_plugin_runtime);
int bool_plugin_runtime_update(void *bool_plugin_runtime, void *bool_plugin_schema,
const char *line, int valid_column);
int bool_plugin_runtime_commit(void *bool_plugin_runtime, const char *table_name);
struct ex_data_runtime *bool_plugin_runtime_get_ex_data_rt(void *bool_plugin_runtime);
#ifdef __cpluscplus
}
#endif
#endif

View File

@@ -49,8 +49,7 @@ int compile_table_set_rule_ex_data_schema(struct compile_schema *compile_schema,
maat_rule_ex_dup_func_t *dup_func,
long argl, void *argp,
struct log_handle *logger);
struct compile_ex_data_schema *
compile_table_get_rule_ex_data_schema(struct compile_schema *compile_schema, size_t idx);
void *compile_table_get_rule_ex_data(struct compile_schema *compile_schema, int compile_id, size_t idx);
size_t compile_table_rule_ex_data_schema_count(struct compile_schema *compile_schema);
@@ -62,7 +61,7 @@ void compile_runtime_free(void *compile_runtime);
int compile_runtime_update(void *compile_runtime, void *compile_schema,
const char *line, int valid_column);
int compile_runtime_commit(void *compile_runtime);
int compile_runtime_commit(void *compile_runtime, const char *table_name);
int compile_runtime_match(struct compile_runtime *compile_rt, int *compile_ids,
size_t compile_ids_size, struct maat_state *state);

View File

@@ -33,7 +33,7 @@ void expr_runtime_free(void *expr_runtime);
int expr_runtime_update(void *expr_runtime, void *expr_schema,
const char *line, int valid_column);
int expr_runtime_commit(void *expr_runtime);
int expr_runtime_commit(void *expr_runtime, const char *table_name);
/* expr runtime scan API */
/**

View File

@@ -35,7 +35,7 @@ void flag_runtime_free(void *flag_runtime);
int flag_runtime_update(void *flag_runtime, void *flag_schema,
const char *line, int valid_column);
int flag_runtime_commit(void *flag_runtime);
int flag_runtime_commit(void *flag_runtime, const char *table_name);
/* flag runtime scan API */
/**

View File

@@ -0,0 +1,56 @@
/*
**********************************************************************************************
* File: maat_fqdn_plugin.h
* Description:
* Authors: Liu WenTan <liuwentan@geedgenetworks.com>
* Date: 2022-10-31
* Copyright: (c) 2018-2022 Geedge Networks, Inc. All rights reserved.
***********************************************************************************************
*/
#ifndef _MAAT_FQDN_PLUGIN_H_
#define _MAAT_FQDN_PLUGIN_H_
#ifdef __cpluscplus
extern "C"
{
#endif
#include "log/log.h"
#include "maat/maat.h"
#include "cJSON/cJSON.h"
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 */
struct ex_data_schema *fqdn_plugin_table_get_ex_data_schema(void *fqdn_plugin_schema);
int fqdn_plugin_table_set_ex_data_schema(void *fqdn_plugin_schema,
maat_plugin_ex_new_func_t *new_func,
maat_plugin_ex_free_func_t *free_func,
maat_plugin_ex_dup_func_t *dup_func,
long argl, void *argp,
struct log_handle *logger);
/* fqdn plugin runtime API */
void *fqdn_plugin_runtime_new(void *fqdn_plugin_schema, int max_thread_num,
struct maat_garbage_bin *garbage_bin,
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 *line, int valid_column);
int fqdn_plugin_runtime_commit(void *fqdn_plugin_runtime, const char *table_name);
struct ex_data_runtime *fqdn_plugin_runtime_get_ex_data_rt(void *fqdn_plugin_runtime);
#ifdef __cpluscplus
}
#endif
#endif

View File

@@ -47,7 +47,7 @@ int group2group_runtime_get_top_groups(void *g2g_runtime, int *group_ids,
int group2group_runtime_update(void *g2g_runtime, void *g2g_schema,
const char *line, int valid_column);
int group2group_runtime_commit(void *g2g_runtime);
int group2group_runtime_commit(void *g2g_runtime, const char *table_name);
#ifdef __cpluscplus
}

View File

@@ -35,7 +35,7 @@ void interval_runtime_free(void *interval_runtime);
int interval_runtime_update(void *interval_runtime, void *interval_schema,
const char *line, int valid_column);
int interval_runtime_commit(void *interval_runtime);
int interval_runtime_commit(void *interval_runtime, const char *table_name);
/* interval runtime scan API */
/**

View File

@@ -30,7 +30,7 @@ void ip_runtime_free(void *ip_runtime);
int ip_runtime_update(void *ip_runtime, void *ip_schema,
const char *line, int valid_column);
int ip_runtime_commit(void *ip_runtime);
int ip_runtime_commit(void *ip_runtime, const char *table_name);
struct ex_data_runtime *ip_runtime_get_ex_data_rt(struct ip_runtime *ip_rt);

View File

@@ -45,7 +45,7 @@ void ip_plugin_runtime_free(void *ip_plugin_runtime);
int ip_plugin_runtime_update(void *ip_plugin_runtime, void *ip_plugin_schema,
const char *line, int valid_column);
int ip_plugin_runtime_commit(void *ip_plugin_runtime);
int ip_plugin_runtime_commit(void *ip_plugin_runtime, const char *table_name);
struct ex_data_runtime *ip_plugin_runtime_get_ex_data_rt(void *ip_plugin_runtime);

View File

@@ -55,7 +55,7 @@ void plugin_runtime_free(void *plugin_runtime);
int plugin_runtime_update(void *plugin_runtime, void *plugin_schema,
const char *line, int valid_column);
int plugin_runtime_commit(void *plugin_runtime);
int plugin_runtime_commit(void *plugin_runtime, const char *table_name);
struct ex_data_runtime *plugin_runtime_get_ex_data_rt(void *plugin_runtime);