Files
safe_duck/linux_kernel/client_msg.c

21 lines
675 B
C
Raw Normal View History

2023-05-07 22:49:11 +08:00
#include "client_msg.h"
void dispath_client_msg(struct client_msg_t* msg) {
2023-11-17 04:19:50 +08:00
uint32_t target_ip_address;
size_t block_time;
2023-05-07 22:49:11 +08:00
switch (msg->type) {
case SD_MSG_TYPE_CLIENT_BLOCK_IP:
2023-11-17 04:19:50 +08:00
target_ip_address = msg->u.ip_address.src_ip;
block_time = msg->u.ip_address.block_time;
2023-05-07 22:49:11 +08:00
block_ip_address(target_ip_address, block_time);
break;
2023-11-17 04:19:50 +08:00
case SD_MSG_TYPE_CLIENT_UNBLOCK_IP:
target_ip_address = msg->u.ip_address.src_ip;
unblock_ip_address(target_ip_address);
break;
2023-05-07 22:49:11 +08:00
default:
printk(KERN_INFO "Unknown msg type: %d\n", msg->type);
break;
}
}