/* Protocol is elaborated in math_server.cpp */ /* Standard way of making sure we don't include this header twice */ #ifndef MATHLIB_H #define MATHLIB_H /* Using constants is more reliable than memorizing these */ #define CLIENT_ADD 1 #define CLIENT_MULTIPLY 2 #define SERVER_ADD 20 #define SERVER_MULTIPLY 21 struct client_message { uint8_t type; double operand_1; double operand_2; } __attribute__((packed)); struct server_message { uint8_t type; double operand_1; double operand_2; double result; } __attribute__((packed)); #endif