about summary refs log tree commit diff
path: root/structs.hpp
diff options
context:
space:
mode:
authorUbuntu <baitinq@Peces.qluofd4gyjdubpy0ojfn3gxkic.bx.internal.cloudapp.net>2020-06-05 17:12:19 +0000
committerUbuntu <baitinq@Peces.qluofd4gyjdubpy0ojfn3gxkic.bx.internal.cloudapp.net>2020-06-05 17:12:19 +0000
commitc739aa0cf8fc885c8cad79d2d639d0ecd49bd5ae (patch)
tree66fb3ec1af228082fab674e9aa98ba17d6b9cb44 /structs.hpp
downloadencrypted-chat-c739aa0cf8fc885c8cad79d2d639d0ecd49bd5ae.tar.gz
encrypted-chat-c739aa0cf8fc885c8cad79d2d639d0ecd49bd5ae.tar.bz2
encrypted-chat-c739aa0cf8fc885c8cad79d2d639d0ecd49bd5ae.zip
Release HEAD master
Diffstat (limited to 'structs.hpp')
-rw-r--r--structs.hpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/structs.hpp b/structs.hpp
new file mode 100644
index 0000000..b94ad37
--- /dev/null
+++ b/structs.hpp
@@ -0,0 +1,60 @@
+struct Options
+{
+	bool server;
+	char name[20];
+	char ip[20];
+	char port[20];
+	bool encryption;
+	bool pass;
+	char password[20];
+	bool interactive;
+	int max_clients;
+	int sockfd;
+};
+
+
+enum class PacketType
+{
+	packet_connect,
+	packet_disconnect,
+	packet_message,
+	packet_ping
+};
+
+struct PacketConnect
+{
+	char name[20];
+	bool pass;
+	char password[20];
+};
+
+struct PacketDisconnect
+{
+	char name[20];
+};
+
+struct PacketMessage
+{
+	int client_fd;
+	bool server;
+	char name[20];
+	char message[200];//make it var length
+};
+
+struct PacketPing
+{
+	char name[20];
+};
+
+struct Packet
+{
+	PacketType type;
+	union
+	{
+		PacketConnect packet_connect;
+		PacketDisconnect packet_disconnect;
+		PacketMessage packet_message;
+		PacketPing packet_ping;
+	} data;
+	
+};