This commit is contained in:
huoji
2023-05-07 22:49:11 +08:00
parent e8a3b9fa98
commit b00e51fdc7
38 changed files with 860 additions and 954 deletions

View File

@@ -4,6 +4,9 @@
typedef enum _msg_type {
SD_MSG_TYPE_ERROR = -1,
SD_MSG_TYPE_NEW_IP_CONNECT = 0,
SD_MSG_TYPE_SYN_ATTACK = 1,
SD_MSG_TYPE_CLIENT_BLOCK_IP = 2,
SD_MSG_TYPE_SSH_BF_ATTACK = 3,
};
typedef struct kernel_msg_t {
@@ -11,8 +14,18 @@ typedef struct kernel_msg_t {
int type;
union {
struct {
unsigned int src_ip;
} poll_req;
unsigned long src_ip;
} ip_action;
} u;
};
typedef struct client_msg_t {
unsigned long check_sum;
int type;
union {
struct {
unsigned long src_ip;
unsigned long block_time;
} ip_address;
} u;
};
typedef struct msg_list {
@@ -25,3 +38,6 @@ extern struct kernel_msg_t *get_msg(void);
extern size_t get_msg_list_length(void);
extern void cleanup_msg(void);
extern void init_msg(void);
extern void push_msg_syn_attack(size_t ip_address);
extern void push_msg_new_ip_connect(size_t ip_address);
extern void push_msg_ssh_bf_attack(size_t ip_address);