aboutsummaryrefslogtreecommitdiff
path: root/include/net.h
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2024-07-23 17:48:28 -0400
committerShav Kinderlehrer <[email protected]>2024-07-23 17:48:28 -0400
commitdc0f2ce9ba97ebb47e05b80a511da6eb29818b63 (patch)
treedc83035069f5a015047be1ca3da6f65781eb4695 /include/net.h
parentf638f4bd1e3a03bc2bdd5f9dcd57d4830fd3c553 (diff)
downloadmolehole-dc0f2ce9ba97ebb47e05b80a511da6eb29818b63.tar.gz
molehole-dc0f2ce9ba97ebb47e05b80a511da6eb29818b63.zip
Merge old-moleholencurses
Diffstat (limited to 'include/net.h')
-rwxr-xr-xinclude/net.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/net.h b/include/net.h
new file mode 100755
index 0000000..af6bf57
--- /dev/null
+++ b/include/net.h
@@ -0,0 +1,24 @@
+#ifndef _NET_H_
+#define _NET_H_
+#include "config.h"
+#include "request.h"
+#include "response.h"
+
+/**
+ * Sends a `struct request` to the current `struct connection` contained within
+ * `struct config *conf`.
+ */
+int send_request(struct config *conf, struct request *req);
+
+/**
+ * Reads a response from the current `struct connection` and parses it into
+ * `struct response *res`
+ */
+int read_response(struct config *conf, struct response *res);
+
+enum NetError {
+ SSL_SEND_ERROR = -1,
+ ALLOC_ERROR = -2,
+ RESPONSE_PARSE_ERROR = -3,
+};
+#endif