diff options
author | Adam <Adam@anope.org> | 2012-02-14 15:13:27 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-02-14 15:13:27 -0500 |
commit | a9772cde21407c89abd161d51aff45267f87b1fb (patch) | |
tree | 9e57ba6c121d3843888917d968dd4f5d030b57cf /src/sockets.cpp | |
parent | 086790d6331357022f4da17c76b26b9fc6e2ad90 (diff) |
Clean up and reorganize our header files
Diffstat (limited to 'src/sockets.cpp')
-rw-r--r-- | src/sockets.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/sockets.cpp b/src/sockets.cpp index 9b985a504..ebaf8f5a3 100644 --- a/src/sockets.cpp +++ b/src/sockets.cpp @@ -1,17 +1,38 @@ +/* + * + * (C) 2003-2012 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + */ + #include "services.h" +#include "sockets.h" +#include "socketengine.h" +#include "logger.h" + +#include <arpa/inet.h> +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> std::map<int, Socket *> SocketEngine::Sockets; -int32_t TotalRead = 0; -int32_t TotalWritten = 0; +uint32_t TotalRead = 0; +uint32_t TotalWritten = 0; SocketIO normalSocketIO; /** Construct the object, sets everything to 0 */ -sockaddrs::sockaddrs() +sockaddrs::sockaddrs(const Anope::string &address) { this->clear(); + if (!address.empty()) + this->pton(address.find(':') != Anope::string::npos ? AF_INET6 : AF_INET, address); } /** Memset the object to 0 |