diff options
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h new file mode 100644 index 0000000..98f0387 --- /dev/null +++ b/src/utils.h @@ -0,0 +1,32 @@ +#ifndef _UTILS_H_ +#define _UTILS_H_ + +#include <protocol.h> + +#include <stdlib.h> +#include <stdint.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <time.h> +#include <pthread.h> +#include <assert.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <netdb.h> +#include <arpa/inet.h> +#include <sys/socket.h> + +typedef struct +{ + char address[20]; + int port; +} socket_info_t; + +int send_packet(const socket_info_t* socket_info, const void* packet, size_t packet_size); +Packet_t* wait_for_packet(const socket_info_t* socket_info); + +uint8_t* generate_random_data(size_t data_size); +void show_raw(const uint8_t* data, size_t data_size); + +#endif |