From d3a1a6ba8332b68b8792a6b775ed345ff43948e7 Mon Sep 17 00:00:00 2001 From: Ritchie Cunningham Date: Fri, 22 Nov 2024 23:54:56 +0000 Subject: [PATCH] [Add] Setting build structure up and preparing to make SSL plugin --- Makefile | 7 +++++++ base/Makefile | 6 ++++++ base/config/Makefile | 0 base/network.c | 10 ++++++++++ base/network_ssl/Makefile | 3 +++ 5 files changed, 26 insertions(+) create mode 100644 Makefile create mode 100644 base/config/Makefile create mode 100644 base/network_ssl/Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a9ce293 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +default: + mkdir -p bin + mkdir -p bin/base + cd base && make clean +clean: + rm -Rf bin/ + cd base && make clean diff --git a/base/Makefile b/base/Makefile index e69de29..d39f963 100644 --- a/base/Makefile +++ b/base/Makefile @@ -0,0 +1,6 @@ +default: + cd network_plain && make + cd network_ssl && make +clean: + cd network_plain && make clean + cd network_ssl && make clean diff --git a/base/config/Makefile b/base/config/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/base/network.c b/base/network.c index 40481b9..6995240 100644 --- a/base/network.c +++ b/base/network.c @@ -5,6 +5,10 @@ unsigned int pluginType() { return PLUGIN_TYPE_NETWORK; } +const char* pluginName() { + return* "plain"; +} + void* pluginConnect(const char* host, int port) { NETWORK_PLAIN* connection; struct sockaddr_in address; @@ -52,3 +56,9 @@ int pluginReadData(NETWORK_PLAIN* connection, char* buffer, int buffer_len) { int pluginSendData(NETWORK_PLAI* connection, char* buffer, int buffer_len) { return send(connection->socket, buffer, buffer_len, 0); } + +void* pluginSocketDone(NETWORK_PLAIN* connection) { + close(connection->socket); + free(connection); + return NULL; +} diff --git a/base/network_ssl/Makefile b/base/network_ssl/Makefile new file mode 100644 index 0000000..fce69a1 --- /dev/null +++ b/base/network_ssl/Makefile @@ -0,0 +1,3 @@ +default: + +clean: