1
This commit is contained in:
37
linux_service/msg.h
Normal file
37
linux_service/msg.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
#include "head.h"
|
||||
#define MSG_CHECK_SUM 1337
|
||||
|
||||
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 {
|
||||
unsigned long check_sum;
|
||||
int type;
|
||||
union {
|
||||
struct {
|
||||
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;
|
||||
};
|
||||
namespace client_msg {
|
||||
auto dispath_kernel_msg() -> void;
|
||||
auto block_ip(size_t ip_address, size_t time_sec) -> bool;
|
||||
auto init() -> bool;
|
||||
auto call_driver(client_msg_t msg) -> bool;
|
||||
auto uninstall() -> void;
|
||||
} // namespace client_msg
|
||||
Reference in New Issue
Block a user