|
|
@ -57,6 +57,7 @@ const char I2P_CONTROL_ROUTER_MANAGER_RESEED[] = "Reseed"; |
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* "Null" I2P control implementation, does not do actual networking. |
|
|
|
* "Null" I2P control implementation, does not do actual networking. |
|
|
|
* @note authentication tokens are per-session |
|
|
|
* @note authentication tokens are per-session |
|
|
|
|
|
|
|
* @warning an I2PControlSession must be destroyed before its io_service |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
class I2PControlSession { |
|
|
|
class I2PControlSession { |
|
|
|
|
|
|
|
|
|
|
@ -104,10 +105,19 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets up the appropriate handlers. |
|
|
|
* Sets up the appropriate handlers. |
|
|
|
* @param ios the parent io_service object |
|
|
|
* @param ios the parent io_service object, must remain valid throughout |
|
|
|
|
|
|
|
* the lifetime of this I2PControlSession. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
I2PControlSession(boost::asio::io_service& ios); |
|
|
|
I2PControlSession(boost::asio::io_service& ios); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
~I2PControlSession(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Cancels all operations that are waiting. |
|
|
|
|
|
|
|
* @note must not be called before destruction, destructor handles this |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
void stop(); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Handle a json string with I2PControl instructions. |
|
|
|
* Handle a json string with I2PControl instructions. |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -121,7 +131,6 @@ private: |
|
|
|
); |
|
|
|
); |
|
|
|
typedef void (I2PControlSession::*RequestHandler)(Response& results); |
|
|
|
typedef void (I2PControlSession::*RequestHandler)(Response& results); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Tries to authenticate by checking whether the given token is valid. |
|
|
|
* Tries to authenticate by checking whether the given token is valid. |
|
|
|
* Sets the appropriate error code in the given response. |
|
|
|
* Sets the appropriate error code in the given response. |
|
|
|