refactor: change session key from address list to six tuple

This commit is contained in:
luwenpeng
2023-12-14 15:23:13 +08:00
parent 5620ac211b
commit a232045764
14 changed files with 773 additions and 563 deletions

View File

@@ -17,11 +17,9 @@ typedef void (*session_free_cb)(struct session *sess, void *arg);
void session_table_set_freecb(struct session_table *table, session_free_cb free_cb, void *arg);
// return 0: success
// return -1: failed
int session_table_add_session(struct session_table *table, struct session *sess);
void session_table_delete_session_by_id(struct session_table *table, uint64_t id);
void session_table_delete_session_by_addr(struct session_table *table, struct session_address *addr);
struct session *session_table_find_session_by_id(struct session_table *table, uint64_t id);
struct session *session_table_find_session_by_addr(struct session_table *table, struct session_address *addr);
int session_table_add_session(struct session_table *table, const struct session_key *key, struct session *sess);
void session_table_delete_session(struct session_table *table, const struct session_key *key);
struct session *session_table_find_session(struct session_table *table, const struct session_key *key);
struct session *session_table_find_oldest_session(struct session_table *table);
struct session *session_table_find_newest_session(struct session_table *table);