#include #include #include #include #include #include #include #define JIM_IMPLEMENTATION #include "jim.h" #define JIMP_IMPLEMENTATION #include "jimp.h" #define SYSINFO_IMPLEMENTATION #include "sysinfo.h" #define PORT 7778 #define MAX_MESSAGE_SIZE 1024 enum Type { REQUEST = 1, RESPONSE = 2, }; enum Request_Type { NEW_SERVER_CLIENT = 1, NEW_DESKTOP_CLIENT = 2, DATA = 3, }; enum Response_Type { OK = 1, CREATED = 2, ERROR = 3, }; typedef struct { long timestamp; double cpu_usage_percentage; double memory_used_gb; double memory_total_gb; double swap_used_gb; double swap_total_gb; } Monitoring_Data; typedef struct { enum Type type; enum Request_Type request; enum Response_Type response; char *hostname; Monitoring_Data monitoring_data; } Data;