|
|
|
@ -24,6 +24,12 @@ namespace i2p
@@ -24,6 +24,12 @@ namespace i2p
|
|
|
|
|
eRouterStatusError = 3 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
enum RouterError |
|
|
|
|
{ |
|
|
|
|
eRouterErrorNone = 0, |
|
|
|
|
eRouterErrorClockSkew = 1 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class RouterContext: public i2p::garlic::GarlicDestination |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
@ -50,6 +56,8 @@ namespace i2p
@@ -50,6 +56,8 @@ namespace i2p
|
|
|
|
|
uint64_t GetBandwidthLimit () const { return m_BandwidthLimit; }; |
|
|
|
|
RouterStatus GetStatus () const { return m_Status; }; |
|
|
|
|
void SetStatus (RouterStatus status); |
|
|
|
|
RouterError GetError () const { return m_Error; }; |
|
|
|
|
void SetError (RouterError error) { m_Status = eRouterStatusError; m_Error = error; }; |
|
|
|
|
|
|
|
|
|
void UpdatePort (int port); // called from Daemon
|
|
|
|
|
void UpdateAddress (const boost::asio::ip::address& host); // called from SSU or Daemon
|
|
|
|
@ -108,6 +116,7 @@ namespace i2p
@@ -108,6 +116,7 @@ namespace i2p
|
|
|
|
|
uint64_t m_StartupTime; // in seconds since epoch
|
|
|
|
|
uint32_t m_BandwidthLimit; // allowed bandwidth
|
|
|
|
|
RouterStatus m_Status; |
|
|
|
|
RouterError m_Error; |
|
|
|
|
std::mutex m_GarlicMutex; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|