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: