#include #include #include #include "logger.h" #include "common.h" using namespace isc::hooks; using namespace isc::data; std::map cm_map; std::map option122_map; std::string host; std::string database; std::string user; std::string password; extern "C" { int load(LibraryHandle& handle) { // seteo valores por defecto host = "mysql"; database = "fd3_dhcp"; user = "root"; password = "235r2342gtfsw"; ConstElementPtr hostPtr = handle.getParameter("host"); ConstElementPtr databasePtr = handle.getParameter("database"); ConstElementPtr userPtr = handle.getParameter("user"); ConstElementPtr passwordPtr = handle.getParameter("password"); if (hostPtr && hostPtr->getType() == Element::string) { host = hostPtr->stringValue(); } if (databasePtr && databasePtr->getType() == Element::string) { database = databasePtr->stringValue(); } if (userPtr && userPtr->getType() == Element::string) { user = userPtr->stringValue(); } if (passwordPtr && passwordPtr->getType() == Element::string) { password = passwordPtr->stringValue(); } return 0; } } // end extern "C"