From 7d650d5d9bcba940ae312657d51e366e7401fd6b Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Mon, 17 Apr 2023 22:49:49 -0400 Subject: first --- src/client/binding.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/client/binding.h (limited to 'src/client/binding.h') diff --git a/src/client/binding.h b/src/client/binding.h new file mode 100644 index 0000000..ea02c98 --- /dev/null +++ b/src/client/binding.h @@ -0,0 +1,26 @@ +#pragma once + +#include "../packet/packet.h" +#include "addr.h" + +#include + +typedef enum { + UDP, + TCP +} BindingType; + +typedef struct { + BindingType type; + union { + struct { + UdpSocket udp; + SocketAddr clientaddr; + } udp; + TcpStream tcp; + } sock; +} Connection; + +bool create_request(BindingType type, SocketAddr* addr, Connection* request); +bool request_packet(Connection* request, Packet* in, Packet* out); +void free_request(Connection* connection); -- cgit v1.2.3-freya