Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef RBL_H
- #define RBL_H
- class RBL
- {
- public:
- bool check(const char* ip);
- private:
- struct IP2TYPE
- {
- const char* type;
- const IP4_ADDRESS ip;
- };
- struct RBLINFO
- {
- const IP2TYPE* types;
- unsigned int numberOfTypes;
- const char* domain;
- };
- /*
- \brief Returns a RBL server to do the lookup on - for now only SpamHaus ZEN
- */
- void get_RBL_info(RBLINFO* info);
- /*
- \brief This function does the actual lookup.
- \param name The domain to lookup.
- \param result The resulting IP
- \return True if the domain could be resolved to a IP - in that case the result needs to be checked further.
- If it returns false the IP isn't blacklisted
- */
- bool lookup(const char* name, PIP4_ADDRESS result);
- /*
- \brief The RBL server expects the IP reversed. This function builds the lookup domain
- \param ip The IP which shall be looked up
- \param end What shall be appended to build the final lookup domain
- \param result Output param.
- */
- void build_request_domain(const std::string& ip, const std::string& end, std::string& result);
- };
- #endif // RBL_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement