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
stellar-stellar/src/session/session_table.h

31 lines
1.0 KiB
C
Raw Normal View History

2023-12-11 16:35:26 +08:00
#ifndef _SESSION_TABLE_H
#define _SESSION_TABLE_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include "session.h"
struct session_table;
struct session_table *session_table_create();
void session_table_destroy(struct session_table *table);
uint64_t session_table_get_count(struct session_table *table);
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
2023-12-15 16:34:53 +08:00
int session_table_add_session(struct session_table *table, const struct tuple6 *tuple, struct session *sess);
void session_table_del_session(struct session_table *table, const struct tuple6 *tuple);
2023-12-15 16:34:53 +08:00
struct session *session_table_find_session(struct session_table *table, const struct tuple6 *tuple);
2023-12-19 10:47:26 +08:00
struct session *session_table_find_least_recently_unused_session(struct session_table *table);
struct session *session_table_find_least_recently_used_session(struct session_table *table);
2023-12-11 16:35:26 +08:00
#ifdef __cpluscplus
}
#endif
#endif