perf: rename addr_tuple4 to four_tuple

This commit is contained in:
luwenpeng
2023-11-08 10:20:27 +08:00
parent 3627addb85
commit 8fe574633b
13 changed files with 177 additions and 177 deletions

View File

@@ -10,7 +10,7 @@ extern "C"
#include <sys/types.h>
#include "uthash.h"
#include "addr_tuple4.h"
#include "four_tuple.h"
// Note: session_addr must be initialized by memset(0) before use !!!
@@ -19,7 +19,7 @@ typedef void fn_free_cb(void *args);
struct session_node
{
uint64_t session_id; /* first key */
struct addr_tuple4 session_addr; /* second key */
struct four_tuple session_addr; /* second key */
void *value;
fn_free_cb *value_free_cb;
@@ -39,17 +39,17 @@ uint64_t session_table_count(struct session_table *table);
// value : shallow copy (malloc by user, free by value_free_cb)
// return 0 : suceess
// return -1 : key exists
int session_table_insert(struct session_table *table, uint64_t session_id, const struct addr_tuple4 *session_addr, void *value, const fn_free_cb *value_free_cb);
int session_table_insert(struct session_table *table, uint64_t session_id, const struct four_tuple *session_addr, void *value, const fn_free_cb *value_free_cb);
// return 0 : success
// return -1 : key not exists
int session_table_delete_by_id(struct session_table *table, uint64_t session_id);
int session_table_delete_by_addr(struct session_table *table, const struct addr_tuple4 *session_addr);
int session_table_delete_by_addr(struct session_table *table, const struct four_tuple *session_addr);
// return NULL : key not exists
// return UnNULL : success
struct session_node *session_table_search_by_id(struct session_table *table, uint64_t session_id);
struct session_node *session_table_search_by_addr(struct session_table *table, const struct addr_tuple4 *session_addr);
struct session_node *session_table_search_by_addr(struct session_table *table, const struct four_tuple *session_addr);
#ifdef __cpluscplus
}