diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/configreader.h | 13 | ||||
-rw-r--r-- | include/inspircd.h | 16 | ||||
-rw-r--r-- | include/modules.h | 2 | ||||
-rw-r--r-- | include/socket.h | 14 |
4 files changed, 17 insertions, 28 deletions
diff --git a/include/configreader.h b/include/configreader.h index eefa359c9..db4c6d3d5 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -426,11 +426,6 @@ class ServerConfig : public Extensible */ char HideKillsServer[MAXBUF]; - /** A list of IP addresses the server is listening - * on. - */ - char addrs[MAXBUF][255]; - /** The MOTD file, cached in a file_cache type. */ file_cache MOTD; @@ -453,13 +448,9 @@ class ServerConfig : public Extensible */ std::vector<std::string> module_names; - /** A list of ports which the server is listening on - */ - int ports[255]; - - /** A list of the file descriptors for the listening client ports + /** A list of the classes for listening client ports */ - ListenSocket* openSockfd[255]; + std::vector<ListenSocket*> ports; /** Boolean sets of which modules implement which functions */ diff --git a/include/inspircd.h b/include/inspircd.h index d9918aa73..71a36f9b5 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -187,24 +187,17 @@ class serverstats : public classbase /** Total bytes of data received */ double statsRecv; - /** Number of bound listening ports - */ - unsigned long BoundPortCount; - /** Cpu usage at last sample */ timeval LastCPU; - /** Time last sample was read */ timeval LastSampled; - /** The constructor initializes all the counts to zero */ serverstats() : statsAccept(0), statsRefused(0), statsUnknown(0), statsCollisions(0), statsDns(0), - statsDnsGood(0), statsDnsBad(0), statsConnects(0), statsSent(0.0), statsRecv(0.0), - BoundPortCount(0) + statsDnsGood(0), statsDnsBad(0), statsConnects(0), statsSent(0.0), statsRecv(0.0) { } }; @@ -586,13 +579,6 @@ class InspIRCd : public classbase */ int BindPorts(bool bail, int &found_ports, FailedPortList &failed_ports); - /** Returns true if this server has the given port bound to the given address - * @param port The port number - * @param addr The address - * @return True if we have a port listening on this address - */ - bool HasPort(int port, char* addr); - /** Binds a socket on an already open file descriptor * @param sockfd A valid file descriptor of an open socket * @param port The port number to bind to diff --git a/include/modules.h b/include/modules.h index fe921a540..752479014 100644 --- a/include/modules.h +++ b/include/modules.h @@ -75,7 +75,7 @@ enum MessageType { * ipv4 servers, so this value will be ten times as * high on ipv6 servers. */ -#define NATIVE_API_VERSION 11022 +#define NATIVE_API_VERSION 11023 #ifdef IPV6 #define API_VERSION (NATIVE_API_VERSION * 10) #else diff --git a/include/socket.h b/include/socket.h index 4e7d89192..88478f2e3 100644 --- a/include/socket.h +++ b/include/socket.h @@ -152,10 +152,12 @@ class ListenSocket : public EventHandler InspIRCd* ServerInstance; std::string desc; int family; + std::string bind_addr; + int bind_port; public: /** Create a new listening socket */ - ListenSocket(InspIRCd* Instance, int sockfd, irc::sockets::insp_sockaddr client, irc::sockets::insp_sockaddr server, int port, char* addr); + ListenSocket(InspIRCd* Instance, int port, char* addr); /** Handle an I/O event */ void HandleEvent(EventType et, int errornum = 0); @@ -173,6 +175,16 @@ class ListenSocket : public EventHandler { return desc; } + + int GetPort() + { + return bind_port; + } + + std::string &GetIP() + { + return bind_addr; + } }; #endif |