/* * svc_common.h * Shared types and helpers for honeypot TCP service handlers. */ #pragma once #include #include #include #include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "lwip/sockets.h" #include "utils.h" #include "event_format.h" #include "hp_config.h" #define MAX_CLIENT_BUF 256 /* Service runtime descriptor (owned by hp_tcp_services.c) */ typedef struct { const char *name; uint16_t port; volatile bool running; volatile bool stop_req; TaskHandle_t task; uint32_t connections; uint32_t auth_attempts; } hp_svc_desc_t; /* Client handler signature */ typedef void (*hp_client_handler_t)(int client_fd, const char *client_ip, uint16_t client_port, hp_svc_desc_t *svc); /* Per-service handlers (implemented in svc_*.c) */ void handle_ssh_client(int fd, const char *ip, uint16_t port, hp_svc_desc_t *svc); void handle_telnet_client(int fd, const char *ip, uint16_t port, hp_svc_desc_t *svc); void handle_http_client(int fd, const char *ip, uint16_t port, hp_svc_desc_t *svc); void handle_ftp_client(int fd, const char *ip, uint16_t port, hp_svc_desc_t *svc);