]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/socket.h
Add proper support for "munging" of ipv6 addresses when ::ffff:addr is used (this...
[user/henk/code/inspircd.git] / include / socket.h
index b7b2b3d40009f82f8194859fc5a7e44e762e8b0c..f9a39ded5df1792e2263ebe0dc5fa180d63b9ebd 100644 (file)
 #ifndef INSPIRCD_SOCKET_H
 #define INSPIRCD_SOCKET_H
 
-/* This is where we'll define wrappers for socket IO stuff, for neat winsock compatability */
-
+#include <arpa/inet.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/stat.h>
 #include <netinet/in.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <poll.h>
+#include <netdb.h>
+#include <errno.h>
 
 #include "inspircd_config.h"
 
 
 typedef struct sockaddr_in6 insp_sockaddr;
 typedef struct in6_addr     insp_inaddr;
+#define AF_FAMILY AF_INET6
+#define PF_PROTOCOL PF_INET6
 
 #else
 
 typedef struct sockaddr_in  insp_sockaddr;
 typedef struct in_addr      insp_inaddr;
+#define AF_FAMILY AF_INET
+#define PF_PROTOCOL PF_INET
 
 #endif
 
+const char* insp_ntoa(insp_inaddr n);
+int insp_aton(const char* a, insp_inaddr* n);
+
 int OpenTCPSocket(); 
 bool BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr);
 int BindPorts(bool bail);