|
|
|
@ -26,6 +26,7 @@ namespace client
@@ -26,6 +26,7 @@ namespace client
|
|
|
|
|
const char I2P_CONTROL_METHOD_ECHO[] = "Echo"; |
|
|
|
|
const char I2P_CONTROL_METHOD_ROUTER_INFO[] = "RouterInfo"; |
|
|
|
|
const char I2P_CONTROL_METHOD_ROUTER_MANAGER[] = "RouterManager"; |
|
|
|
|
const char I2P_CONTROL_METHOD_NETWORK_SETTING[] = "NetworkSetting"; |
|
|
|
|
|
|
|
|
|
// params
|
|
|
|
|
const char I2P_CONTROL_PARAM_API[] = "API"; |
|
|
|
@ -75,6 +76,7 @@ namespace client
@@ -75,6 +76,7 @@ namespace client
|
|
|
|
|
void EchoHandler (const std::map<std::string, std::string>& params, std::map<std::string, std::string>& results); |
|
|
|
|
void RouterInfoHandler (const std::map<std::string, std::string>& params, std::map<std::string, std::string>& results); |
|
|
|
|
void RouterManagerHandler (const std::map<std::string, std::string>& params, std::map<std::string, std::string>& results); |
|
|
|
|
void NetworkSettingHandler (const std::map<std::string, std::string>& params, std::map<std::string, std::string>& results); |
|
|
|
|
|
|
|
|
|
// RouterInfo
|
|
|
|
|
typedef void (I2PControlService::*RouterInfoRequestHandler)(std::map<std::string, std::string>& results); |
|
|
|
@ -86,6 +88,9 @@ namespace client
@@ -86,6 +88,9 @@ namespace client
|
|
|
|
|
void ShutdownHandler (std::map<std::string, std::string>& results); |
|
|
|
|
void ShutdownGracefulHandler (std::map<std::string, std::string>& results); |
|
|
|
|
|
|
|
|
|
// NetworkSetting
|
|
|
|
|
typedef void (I2PControlService::*NetworkSettingRequestHandler)(const std::string& value, std::map<std::string, std::string>& results); |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
|
|
|
|
|
bool m_IsRunning; |
|
|
|
@ -95,10 +100,10 @@ namespace client
@@ -95,10 +100,10 @@ namespace client
|
|
|
|
|
boost::asio::ip::tcp::acceptor m_Acceptor; |
|
|
|
|
boost::asio::deadline_timer m_ShutdownTimer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::map<std::string, MethodHandler> m_MethodHandlers; |
|
|
|
|
std::map<std::string, RouterInfoRequestHandler> m_RouterInfoHandlers; |
|
|
|
|
std::map<std::string, RouterManagerRequestHandler> m_RouterManagerHandlers; |
|
|
|
|
std::map<std::string, NetworkSettingRequestHandler> m_NetworkSettingHandlers; |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|