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

54 lines
1.6 KiB
C
Raw Normal View History

2023-01-30 21:59:35 +08:00
/*
**********************************************************************************************
* File: maat_ip.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_H_
#define _MAAT_IP_H_
#ifdef __cplusplus
2023-01-30 21:59:35 +08:00
extern "C"
{
#endif
#include "cJSON/cJSON.h"
2023-02-03 17:28:14 +08:00
struct ip_runtime;
struct table_manager;
struct log_handle;
struct maat_garbage_bin;
2023-01-30 21:59:35 +08:00
2023-02-03 17:28:14 +08:00
void *ip_schema_new(cJSON *json, struct table_manager *tbl_mgr,
const char *table_name, struct log_handle *logger);
void ip_schema_free(void *ip_schema);
2023-01-30 21:59:35 +08:00
2023-02-03 17:28:14 +08:00
/* ip runtime API */
void *ip_runtime_new(void *ip_schema, int max_thread_num,
struct maat_garbage_bin *garbage_bin,
struct log_handle *logger);
void ip_runtime_free(void *ip_runtime);
2023-01-30 21:59:35 +08:00
2023-02-03 17:28:14 +08:00
int ip_runtime_update(void *ip_runtime, void *ip_schema,
const char *line, int valid_column);
2023-02-09 22:13:15 +08:00
int ip_runtime_commit(void *ip_runtime, const char *table_name);
2023-01-30 21:59:35 +08:00
2023-02-03 17:28:14 +08:00
struct ex_data_runtime *ip_runtime_get_ex_data_rt(struct ip_runtime *ip_rt);
2023-01-30 21:59:35 +08:00
/* ip runtime scan API */
int ip_runtime_scan(struct ip_runtime *ip_rt, int thread_id, int ip_type,
uint8_t *ip_addr, int vtable_id, struct maat_state *state);
2023-02-03 17:28:14 +08:00
void ip_runtime_scan_hit_inc(struct ip_runtime *ip_rt, int thread_id);
long long ip_runtime_scan_hit_sum(struct ip_runtime *ip_rt, int n_thread);
2023-01-30 21:59:35 +08:00
#ifdef __cplusplus
2023-01-30 21:59:35 +08:00
}
#endif
2023-02-03 17:28:14 +08:00
#endif