summaryrefslogtreecommitdiff
path: root/sockets.h
diff options
context:
space:
mode:
Diffstat (limited to 'sockets.h')
-rw-r--r--sockets.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/sockets.h b/sockets.h
new file mode 100644
index 0000000..3c8fcbf
--- /dev/null
+++ b/sockets.h
@@ -0,0 +1,29 @@
+#ifndef SOCKETS_H_INCLUDED
+#define SOCKETS_H_INCLUDED
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <netdb.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <sys/select.h>
+
+#define BACKLOG 10 // maximum length to which the queue of pending connections for sockfd may grow
+
+#define BOUNCERLISTENPORT "1234" // TODO: change this to a config option!
+
+// get sockaddr, IPv4 or IPv6:
+void *get_in_addr(struct sockaddr *sa);
+
+// Create socket to connect to real IRC server
+int createserversocket(char *host, char *port);
+
+// Create listening socket to listen for bouncer client connections
+int createclientsocket(char *listenport);
+
+#endif