about summary refs log tree commit diff
path: root/src/utils.h
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2021-10-09 11:07:32 +0100
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2021-10-09 11:07:32 +0100
commit7d7ef42995aee8c14cdc2b7c93e7f60c85e69f48 (patch)
tree3da6360fb34c2f33ee54cc10f880cd7e6caafab4 /src/utils.h
downloadOSCDRP-7d7ef42995aee8c14cdc2b7c93e7f60c85e69f48.tar.gz
OSCDRP-7d7ef42995aee8c14cdc2b7c93e7f60c85e69f48.tar.bz2
OSCDRP-7d7ef42995aee8c14cdc2b7c93e7f60c85e69f48.zip
Release HEAD master
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h32
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