aboutsummaryrefslogtreecommitdiff
path: root/networks/gnutls_buffered.h
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-06-19 03:41:14 -0400
committerTest_User <hax@andrewyu.org>2024-06-19 03:41:14 -0400
commit991d1d37474726ae5dc910da9705485f7b193e18 (patch)
treee6d01a7a65dd8f916f400f1b083909c58a304d71 /networks/gnutls_buffered.h
parent9c16070679fea6ac5625546d4ba5af0f638e6636 (diff)
downloadhaxircd-991d1d37474726ae5dc910da9705485f7b193e18.tar.gz
haxircd-991d1d37474726ae5dc910da9705485f7b193e18.zip
Some improvements and openssl send buffering
Diffstat (limited to 'networks/gnutls_buffered.h')
-rw-r--r--networks/gnutls_buffered.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/networks/gnutls_buffered.h b/networks/gnutls_buffered.h
new file mode 100644
index 0000000..a12d4cd
--- /dev/null
+++ b/networks/gnutls_buffered.h
@@ -0,0 +1,45 @@
+// One of the headers for HaxServ
+//
+// Written by: Test_User <hax@andrewyu.org>
+//
+// This is free and unencumbered software released into the public
+// domain.
+//
+// Anyone is free to copy, modify, publish, use, compile, sell, or
+// distribute this software, either in source code form or as a compiled
+// binary, for any purpose, commercial or non-commercial, and by any
+// means.
+//
+// In jurisdictions that recognize copyright laws, the author or authors
+// of this software dedicate any and all copyright interest in the
+// software to the public domain. We make this dedication for the benefit
+// of the public at large and to the detriment of our heirs and
+// successors. We intend this dedication to be an overt act of
+// relinquishment in perpetuity of all present and future rights to this
+// software under copyright law.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+
+#pragma once
+
+#include <stddef.h>
+
+#include "../haxstring.h"
+#include "../general_network.h"
+
+int init_gnutls_buffered_network(void);
+
+int gnutls_buffered_send(void *fd, struct string msg);
+size_t gnutls_buffered_recv(void *fd, char *data, size_t len, char *err);
+
+int gnutls_buffered_connect(void **handle, struct string address, struct string port, struct string *addr_out);
+int gnutls_buffered_accept(int listen_fd, void **handle, struct string *addr);
+
+void gnutls_buffered_shutdown(void *handle);
+void gnutls_buffered_close(int fd, void *handle);