]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/socket.h
Introduce Server class
[user/henk/code/inspircd.git] / include / socket.h
index e868af93e7ee14f2a23804eab1fdd3224c6a7f14..c54517a76c9f8eb68a7d9d141ef415d1d62e3b9f 100644 (file)
  */
 
 
-#ifndef INSPIRCD_SOCKET_H
-#define INSPIRCD_SOCKET_H
+#pragma once
 
-#ifndef WIN32
+#ifndef _WIN32
 
 #include <arpa/inet.h>
 #include <sys/time.h>
@@ -110,9 +109,6 @@ namespace irc
                 */
                CoreExport bool MatchCIDR(const std::string &address, const std::string &cidr_mask, bool match_with_username);
 
-               /** Return the size of the structure for syscall passing */
-               inline int sa_size(const irc::sockets::sockaddrs& sa) { return sa.sa_size(); }
-
                /** Convert an address-port pair into a binary sockaddr
                 * @param addr The IP address, IPv4 or IPv6
                 * @param port The port, 0 for unspecified
@@ -128,13 +124,6 @@ namespace irc
                 * @return true if the conversion was successful, false if unknown address family
                 */
                CoreExport bool satoap(const irc::sockets::sockaddrs& sa, std::string& addr, int &port);
-
-               /** Convert a binary sockaddr to a user-readable string.
-                * This means IPv6 addresses are written as [::1]:6667, and *:6668 is used for 0.0.0.0:6668
-                * @param sa The structure to convert
-                * @return The string; "<unknown>" if not a valid address
-                */
-               inline std::string satouser(const irc::sockets::sockaddrs& sa) { return sa.str(); }
        }
 }
 
@@ -165,6 +154,3 @@ class CoreExport ListenSocket : public EventHandler
         */
        void AcceptInternal();
 };
-
-#endif
-