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

48 lines
942 B
C
Raw Normal View History

#ifndef _SESSION_TRANSITION_H
#define _SESSION_TRANSITION_H
2024-04-21 11:30:41 +08:00
#ifdef __cplusplus
extern "C"
{
#endif
#include "log.h"
#include "session_priv.h"
2024-03-27 17:11:38 +08:00
#define SESSION_TRANSITION_LOG_INFO(format, ...) LOG_INFO("session transition", format, ##__VA_ARGS__)
enum session_inputs
{
NONE = 0,
// packet
TCP_SYN = 1 << 0,
TCP_SYN_ACK = 1 << 1,
TCP_FIN = 1 << 2, // Only Fist FIN
TCP_RST = 1 << 3,
TCP_DATA = 1 << 4,
UDP_DATA = 1 << 5,
// session timeout
TIMEOUT = 1 << 6,
// session table full evict
LRU_EVICT = 1 << 7,
2024-03-15 15:36:26 +08:00
// port reuse evict
PORT_REUSE_EVICT = 1 << 8,
2024-03-15 15:36:26 +08:00
// user close
USER_CLOSE = 1 << 9,
};
void session_transition_init();
enum session_state session_transition_run(enum session_state curr_state, int inputs);
void session_transition_log(struct session *sess, enum session_state curr_state, enum session_state next_state, int inputs);
2024-04-21 11:30:41 +08:00
#ifdef __cplusplus
}
#endif
#endif