Add tuple2 & tuple4 & tuple5 & tuple6
This commit is contained in:
@@ -7,7 +7,8 @@ extern "C"
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "tuple.h"
|
||||
|
||||
enum session_state
|
||||
{
|
||||
@@ -39,31 +40,6 @@ enum session_event
|
||||
SESSION_EVENT_MAX,
|
||||
};
|
||||
|
||||
union ip_address
|
||||
{
|
||||
struct in_addr v4; /* network order */
|
||||
struct in6_addr v6; /* network order */
|
||||
};
|
||||
|
||||
enum ip_type
|
||||
{
|
||||
IP_TYPE_V4,
|
||||
IP_TYPE_V6,
|
||||
};
|
||||
|
||||
struct session_key
|
||||
{
|
||||
enum ip_type ip_type;
|
||||
|
||||
// six tuple
|
||||
union ip_address src_addr; /* network order */
|
||||
union ip_address dst_addr; /* network order */
|
||||
uint16_t src_port; /* network order */
|
||||
uint16_t dst_port; /* network order */
|
||||
uint16_t ip_proto; /* network order */
|
||||
uint64_t security_zone;
|
||||
};
|
||||
|
||||
enum session_dir
|
||||
{
|
||||
SESSION_DIR_C2S = 0,
|
||||
@@ -78,15 +54,6 @@ struct metadata
|
||||
|
||||
struct session;
|
||||
|
||||
/******************************************************************************
|
||||
* session key
|
||||
******************************************************************************/
|
||||
|
||||
uint32_t session_key_hash(const struct session_key *key);
|
||||
int session_key_cmp(const struct session_key *key1, const struct session_key *key2);
|
||||
void session_key_reverse(const struct session_key *in, struct session_key *out);
|
||||
void session_key_tostring(const struct session_key *key, char *buf, uint32_t buf_len);
|
||||
|
||||
/******************************************************************************
|
||||
* session base info
|
||||
******************************************************************************/
|
||||
@@ -98,8 +65,8 @@ void session_set_id(struct session *sess, uint64_t id);
|
||||
uint64_t session_get_id(struct session *sess);
|
||||
|
||||
// session key
|
||||
void session_set_key(struct session *sess, struct session_key *key);
|
||||
struct session_key *session_get0_key(struct session *sess);
|
||||
void session_set_tuple6(struct session *sess, struct tuple6 *tuple);
|
||||
struct tuple6 *session_get0_tuple6(struct session *sess);
|
||||
|
||||
// session state
|
||||
void session_set_state(struct session *sess, enum session_state state);
|
||||
@@ -135,7 +102,7 @@ uint64_t session_get_last_time(struct session *sess);
|
||||
|
||||
// session current packet
|
||||
void session_set0_cur_pkt(struct session *sess, const struct packet *pkt);
|
||||
struct packet *session_get0_cur_pkt(struct session *sess);
|
||||
const struct packet *session_get0_cur_pkt(struct session *sess);
|
||||
|
||||
// session current dir
|
||||
void session_set_cur_dir(struct session *sess, enum session_dir dir);
|
||||
|
||||
Reference in New Issue
Block a user