From 5e8fc20355e139d4fd81ab1faad7e564e55fef29 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 4 Dec 2006 20:41:02 +0000 Subject: Header for md5 request classes git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5849 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_md5.h | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/modules/m_md5.h (limited to 'src/modules/m_md5.h') diff --git a/src/modules/m_md5.h b/src/modules/m_md5.h new file mode 100644 index 000000000..2e80c00e2 --- /dev/null +++ b/src/modules/m_md5.h @@ -0,0 +1,75 @@ +#ifndef __MD5_H__ +#define __MD5_H__ + +#include "modules.h" + +class MD5Request : public Request +{ + unsigned int* keys; + const char* outputs; + std::string tohash; + public: + MD5Request(Module* Me, Module* Target) : Request(Me, Target, "MD5_RESET") + { + } + + MD5Request(Module* Me, Module* Target, const std::string &hashable) : Request(Me, Target, "MD5_SUM"), keys(NULL), outputs(NULL), tohash(hashable) + { + } + + MD5Request(Module* Me, Module* Target, unsigned int* k) : Request(Me, Target, "MD5_KEY"), keys(k), outputs(NULL), tohash("") + { + } + + MD5Request(Module* Me, Module* Target, const char* out) : Request(Me, Target, "MD5_HEX"), keys(NULL), outputs(out), tohash("") + { + } + + const char* GetHashData() + { + return tohash.c_str(); + } + + unsigned int* GetKeyData() + { + return keys; + } + + const char* GetOutputs() + { + return outputs; + } +}; + +class MD5ResetRequest : public MD5Request +{ + public: + MD5ResetRequest(Module* Me, Module* Target) : MD5Request(Me, Target) + { + } +}; + +class MD5SumRequest : public MD5Request +{ + public: + MD5SumRequest(Module* Me, Module* Target, const std::string &data) : MD5Request(Me, Target, data) + { + } +}; + +class MD5KeyRequest : public MD5Request +{ + MD5KeyRequest(Module* Me, Module* Target, unsigned int* data) : MD5Request(Me, Target, data) + { + } +}; + +class MD5HexRequest : public MD5Request +{ + MD5HexRequest(Module* Me, Module* Target, const char* data) : MD5Request(Me, Target, data) + { + } +}; + +#endif + -- cgit v1.2.3