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

61 lines
2.1 KiB
C
Raw Normal View History

2023-01-30 21:59:35 +08:00
/*
**********************************************************************************************
* File: maat_ip_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_IP_PLUGIN_H_
#define _MAAT_IP_PLUGIN_H_
#ifdef __cplusplus
2023-01-30 21:59:35 +08:00
extern "C"
{
#endif
#include "maat.h"
2023-01-31 20:39:53 +08:00
#include "cJSON/cJSON.h"
2023-01-30 21:59:35 +08:00
struct ip_plugin_runtime;
struct table_manager;
struct log_handle;
struct maat_garbage_bin;
2023-01-30 21:59:35 +08:00
/* ip plugin schema API */
2023-02-03 17:28:14 +08:00
void *ip_plugin_schema_new(cJSON *json, struct table_manager *tbl_mgr,
const char *table_name, struct log_handle *logger);
2023-01-30 21:59:35 +08:00
void ip_plugin_schema_free(void *ip_plugin_schema);
/* ip plugin table ex data API */
struct ex_data_schema *ip_plugin_table_get_ex_data_schema(void *ip_plugin_schema);
void ip_plugin_table_set_ex_data_schema(void *ip_plugin_schema,
maat_ex_new_func_t *new_func,
maat_ex_free_func_t *free_func,
maat_ex_dup_func_t *dup_func,
2023-01-31 20:39:53 +08:00
long argl, void *argp,
struct log_handle *logger);
2023-01-30 21:59:35 +08:00
/* ip plugin runtime API */
2023-02-03 17:28:14 +08:00
void *ip_plugin_runtime_new(void *ip_plugin_schema, int max_thread_num,
struct maat_garbage_bin *garbage_bin,
2023-01-30 21:59:35 +08:00
struct log_handle *logger);
void ip_plugin_runtime_free(void *ip_plugin_runtime);
2023-02-03 17:28:14 +08:00
int ip_plugin_runtime_update(void *ip_plugin_runtime, void *ip_plugin_schema,
const char *line, int valid_column);
2023-02-09 22:13:15 +08:00
int ip_plugin_runtime_commit(void *ip_plugin_runtime, const char *table_name);
2023-01-30 21:59:35 +08:00
struct ex_data_runtime *ip_plugin_runtime_get_ex_data_rt(void *ip_plugin_runtime);
int ip_plugin_runtime_get_ex_data(void *ip_plugin_runtime, const struct ip_addr *ip_addr,
void **ex_data_array, size_t n_ex_data_array);
#ifdef __cplusplus
2023-01-30 21:59:35 +08:00
}
#endif
#endif