37 lines
1.0 KiB
C
37 lines
1.0 KiB
C
#pragma once
|
|
|
|
#include "libprotoident/libprotoident.h"
|
|
|
|
typedef enum {
|
|
LPI_PROTO_EXTEND_FRIST = LPI_PROTO_LAST,
|
|
LPI_PROTO_IKE, //unsupport
|
|
LPI_PROTO_DOH, //unsupport
|
|
LPI_PROTO_MAIL, //unsupport
|
|
LPI_PROTO_ESNI, //unsupport
|
|
LPI_PROTP_FTPS,
|
|
LPI_PROTO_EXTEND_LAST
|
|
} extend_lpi_protocol_t;
|
|
|
|
struct ovpn_ctx
|
|
{
|
|
uint64_t local_session_id;
|
|
int contain_local_session_id_pkt_num;
|
|
int valid_opcode_cnt;
|
|
};
|
|
|
|
struct lpi_plus_detect_context
|
|
{
|
|
unsigned short detected_s2c_pkt;
|
|
unsigned short detected_c2s_pkt;
|
|
unsigned char current_is_c2s_flow;
|
|
lpi_data_t lpi_data; // lpi API
|
|
union
|
|
{
|
|
struct ovpn_ctx ovpn;
|
|
};
|
|
};
|
|
|
|
|
|
int lpi_plus_match_quic(int is_c2s_flow, const unsigned char *payload, size_t payload_sz);
|
|
int lpi_plus_match_openvpn(const unsigned char *payload, size_t payload_sz, int c2s_pkt_cnt, int s2c_pkt_cnt, struct ovpn_ctx *ovpn, unsigned char trans_proto, bool is_c2s_flow);
|
|
lpi_module_t* lpi_plus_extended_guess(struct lpi_plus_detect_context *ctx, lpi_protocol_t lpi_proto, const char *payload, size_t payload_sz); |