summaryrefslogtreecommitdiff
path: root/network.h
diff options
context:
space:
mode:
Diffstat (limited to 'network.h')
-rw-r--r--network.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/network.h b/network.h
index c4d168c..930a842 100644
--- a/network.h
+++ b/network.h
@@ -34,9 +34,18 @@
#include <netdb.h>
#include <openssl/ssl.h>
+typedef struct {
+ int commfd;
+ SSL* ssl;
+} clifd;
+
int ip_listen(const char *host, const char *serv, socklen_t *addrlenp, const char *type); /* socket, bind, listen... */
int ip_connect(const char *host, const char *serv, const char *type); /* socket, connect... */
char* sock_ntop(const struct sockaddr* sa, socklen_t salen); /* return the hostname of connected user */
+
+int send_message(char type, clifd fd, unsigned char* buf, int amount);
+int get_message(char type, clifd fd, unsigned char* buf, int amount);
+
int SSL_writen(SSL* fd, unsigned char* buf, int amount);
int SSL_readn(SSL* fd, unsigned char* buf, int amount);
int writen(int fd, unsigned char* buf, int amount);