#include // Provides uint8_t, int8_t, etc. // client to server messages (commands) struct Hello { uint8_t commandType; // 0 uint16_t udpPort; } __attribute__((packed)); struct SetStation { uint8_t commandType; // 1 uint16_t stationNumber; } __attribute__((packed)); struct ListStations { uint8_t commandType; // 5 } __attribute__((packed)); // server to client message (replies) struct Welcome { uint8_t replyType; // 2 uint16_t numStations; } __attribute__((packed)); struct Announce { uint8_t replyType; // 3 uint8_t songnameSize; char *songname; } __attribute__((packed)); struct InvalidCommand { uint8_t replyType; // 4 uint8_t replyStringSize; char *replyString; } __attribute__((packed)); struct StationInfo { uint8_t replyType; // 6 uint32_t infoStringSize; char *infoString; } __attribute__((packed)); struct StationShutdown { uint8_t replyType; // 7 } __attribute__((packed)); struct NewStation { uint8_t replyType; // 8 uint16_t stationNumber; } __attribute__((packed)); int send_all(int sock, char *buf, int *len); int recv_all(int sock, char *buf, int *len);