|
My Project 2.4.4
C++ Distributed Hash Table
|


Public Member Functions | |
| DhtProxyClient (std::shared_ptr< crypto::Certificate > serverCA, crypto::Identity clientIdentity, std::function< void()> loopSignal, const std::string &serverHost, const std::string &pushClientId="", std::shared_ptr< Logger > logger={}) | |
| void | setHeaderFields (http::Request &request) |
| virtual void | setPushNotificationToken (const std::string &token) override |
| const InfoHash & | getNodeId () const override |
| NodeStatus | getStatus (sa_family_t af) const override |
| NodeStatus | getStatus () const override |
| void | shutdown (ShutdownCallback cb, bool) override |
| bool | isRunning (sa_family_t af=0) const override |
| virtual void | get (const InfoHash &key, GetCallback cb, DoneCallback donecb={}, Value::Filter &&f={}, Where &&w={}) override |
| virtual void | get (const InfoHash &key, GetCallback cb, DoneCallbackSimple donecb={}, Value::Filter &&f={}, Where &&w={}) override |
| virtual void | get (const InfoHash &key, GetCallbackSimple cb, DoneCallback donecb={}, Value::Filter &&f={}, Where &&w={}) override |
| virtual void | get (const InfoHash &key, GetCallbackSimple cb, DoneCallbackSimple donecb, Value::Filter &&f={}, Where &&w={}) override |
| void | put (const InfoHash &key, Sp< Value >, DoneCallback cb=nullptr, time_point created=time_point::max(), bool permanent=false) override |
| void | put (const InfoHash &key, const Sp< Value > &v, DoneCallbackSimple cb, time_point created=time_point::max(), bool permanent=false) override |
| void | put (const InfoHash &key, Value &&v, DoneCallback cb=nullptr, time_point created=time_point::max(), bool permanent=false) override |
| void | put (const InfoHash &key, Value &&v, DoneCallbackSimple cb, time_point created=time_point::max(), bool permanent=false) override |
| NodeStats | getNodesStats (sa_family_t af) const override |
| std::vector< SockAddr > | getPublicAddress (sa_family_t family=0) override |
| virtual size_t | listen (const InfoHash &, ValueCallback, Value::Filter={}, Where={}) override |
| virtual size_t | listen (const InfoHash &key, GetCallback cb, Value::Filter f={}, Where w={}) override |
| virtual size_t | listen (const InfoHash &key, GetCallbackSimple cb, Value::Filter f={}, Where w={}) override |
| virtual bool | cancelListen (const InfoHash &key, size_t token) override |
| void | pushNotificationReceived (const std::map< std::string, std::string > ¬ification) override |
| time_point | periodic (const uint8_t *, size_t, SockAddr, const time_point &now) override |
| time_point | periodic (const uint8_t *buf, size_t buflen, const sockaddr *from, socklen_t fromlen, const time_point &now) override |
| virtual void | query (const InfoHash &, QueryCallback, DoneCallback={}, Query &&={}) override |
| virtual void | query (const InfoHash &key, QueryCallback cb, DoneCallbackSimple done_cb={}, Query &&q={}) override |
| std::vector< Sp< Value > > | getPut (const InfoHash &) const override |
| Sp< Value > | getPut (const InfoHash &, const Value::Id &) const override |
| bool | cancelPut (const InfoHash &, const Value::Id &) override |
| void | pingNode (SockAddr, DoneCallbackSimple &&={}) override |
| virtual void | registerType (const ValueType &type) override |
| const ValueType & | getType (ValueType::Id type_id) const override |
| std::vector< Sp< Value > > | getLocal (const InfoHash &k, const Value::Filter &filter) const override |
| Sp< Value > | getLocalById (const InfoHash &k, Value::Id id) const override |
| void | insertNode (const InfoHash &, const SockAddr &) override |
| void | insertNode (const NodeExport &) override |
| std::pair< size_t, size_t > | getStoreSize () const override |
| std::vector< NodeExport > | exportNodes () const override |
| std::vector< ValuesExport > | exportValues () const override |
| void | importValues (const std::vector< ValuesExport > &) override |
| std::string | getStorageLog () const override |
| std::string | getStorageLog (const InfoHash &) const override |
| std::string | getRoutingTablesLog (sa_family_t) const override |
| std::string | getSearchesLog (sa_family_t) const override |
| std::string | getSearchLog (const InfoHash &, sa_family_t) const override |
| void | dumpTables () const override |
| std::vector< unsigned > | getNodeMessageStats (bool) override |
| void | setStorageLimit (size_t) override |
| virtual size_t | getStorageLimit () const |
| void | connectivityChanged (sa_family_t) override |
| void | connectivityChanged () override |
Public Member Functions inherited from dht::DhtInterface | |
| DhtInterface (const Logger &l) | |
| DhtInterface (const std::shared_ptr< Logger > &l) | |
| virtual NodeStatus | updateStatus (sa_family_t af) |
| virtual NodeStatus | getStatus (sa_family_t af) const =0 |
| virtual NodeStatus | getStatus () const =0 |
| void | addOnConnectedCallback (std::function< void()> cb) |
| virtual net::DatagramSocket * | getSocket () const |
| virtual const InfoHash & | getNodeId () const =0 |
| virtual void | shutdown (ShutdownCallback cb, bool stop=false)=0 |
| virtual bool | isRunning (sa_family_t af=0) const =0 |
| virtual void | registerType (const ValueType &type)=0 |
| virtual const ValueType & | getType (ValueType::Id type_id) const =0 |
| virtual void | addBootstrap (const std::string &, const std::string &) |
| virtual void | clearBootstrap () |
| virtual void | insertNode (const InfoHash &id, const SockAddr &)=0 |
| virtual void | insertNode (const NodeExport &n)=0 |
| virtual void | pingNode (SockAddr, DoneCallbackSimple &&cb={})=0 |
| virtual time_point | periodic (const uint8_t *buf, size_t buflen, SockAddr, const time_point &now)=0 |
| virtual time_point | periodic (const uint8_t *buf, size_t buflen, const sockaddr *from, socklen_t fromlen, const time_point &now)=0 |
| virtual void | get (const InfoHash &key, GetCallback cb, DoneCallback donecb={}, Value::Filter &&f={}, Where &&w={})=0 |
| virtual void | get (const InfoHash &key, GetCallback cb, DoneCallbackSimple donecb={}, Value::Filter &&f={}, Where &&w={})=0 |
| virtual void | get (const InfoHash &key, GetCallbackSimple cb, DoneCallback donecb={}, Value::Filter &&f={}, Where &&w={})=0 |
| virtual void | get (const InfoHash &key, GetCallbackSimple cb, DoneCallbackSimple donecb, Value::Filter &&f={}, Where &&w={})=0 |
| virtual void | query (const InfoHash &key, QueryCallback cb, DoneCallback done_cb={}, Query &&q={})=0 |
| virtual void | query (const InfoHash &key, QueryCallback cb, DoneCallbackSimple done_cb={}, Query &&q={})=0 |
| virtual std::vector< Sp< Value > > | getLocal (const InfoHash &key, const Value::Filter &f={}) const =0 |
| virtual Sp< Value > | getLocalById (const InfoHash &key, Value::Id vid) const =0 |
| virtual void | put (const InfoHash &key, Sp< Value >, DoneCallback cb=nullptr, time_point created=time_point::max(), bool permanent=false)=0 |
| virtual void | put (const InfoHash &key, const Sp< Value > &v, DoneCallbackSimple cb, time_point created=time_point::max(), bool permanent=false)=0 |
| virtual void | put (const InfoHash &key, Value &&v, DoneCallback cb=nullptr, time_point created=time_point::max(), bool permanent=false)=0 |
| virtual void | put (const InfoHash &key, Value &&v, DoneCallbackSimple cb, time_point created=time_point::max(), bool permanent=false)=0 |
| virtual std::vector< Sp< Value > > | getPut (const InfoHash &) const =0 |
| virtual Sp< Value > | getPut (const InfoHash &, const Value::Id &) const =0 |
| virtual bool | cancelPut (const InfoHash &, const Value::Id &)=0 |
| virtual size_t | listen (const InfoHash &, GetCallback, Value::Filter={}, Where w={})=0 |
| virtual size_t | listen (const InfoHash &key, GetCallbackSimple cb, Value::Filter f={}, Where w={})=0 |
| virtual size_t | listen (const InfoHash &, ValueCallback, Value::Filter={}, Where w={})=0 |
| virtual bool | cancelListen (const InfoHash &, size_t token)=0 |
| virtual void | connectivityChanged (sa_family_t)=0 |
| virtual void | connectivityChanged ()=0 |
| virtual std::vector< NodeExport > | exportNodes () const =0 |
| virtual std::vector< ValuesExport > | exportValues () const =0 |
| virtual void | importValues (const std::vector< ValuesExport > &)=0 |
| virtual NodeStats | getNodesStats (sa_family_t af) const =0 |
| virtual std::string | getStorageLog () const =0 |
| virtual std::string | getStorageLog (const InfoHash &) const =0 |
| virtual std::string | getRoutingTablesLog (sa_family_t) const =0 |
| virtual std::string | getSearchesLog (sa_family_t) const =0 |
| virtual std::string | getSearchLog (const InfoHash &, sa_family_t af=AF_UNSPEC) const =0 |
| virtual void | dumpTables () const =0 |
| virtual std::vector< unsigned > | getNodeMessageStats (bool in=false)=0 |
| virtual void | setStorageLimit (size_t limit=DEFAULT_STORAGE_LIMIT)=0 |
| virtual size_t | getStorageLimit () const =0 |
| virtual std::pair< size_t, size_t > | getStoreSize () const =0 |
| virtual std::vector< SockAddr > | getPublicAddress (sa_family_t family=0)=0 |
| virtual void | setLoggers (LogMethod error={}, LogMethod warn={}, LogMethod debug={}) |
| virtual void | setLogger (const Logger &l) |
| virtual void | setLogger (const std::shared_ptr< Logger > &l) |
| virtual void | setLogFilter (const InfoHash &f) |
| virtual void | setPushNotificationToken (const std::string &) |
| virtual void | pushNotificationReceived (const std::map< std::string, std::string > &data)=0 |
Additional Inherited Members | |
Public Types inherited from dht::DhtInterface | |
| using | Status = NodeStatus |
| using | NodeExport = dht::NodeExport |
Protected Attributes inherited from dht::DhtInterface | |
| std::shared_ptr< Logger > | logger_ {} |
| std::queue< std::function< void()> > | onConnectCallbacks_ {} |
Definition at line 50 of file dht_proxy_client.h.
|
overridevirtual |
Implements dht::DhtInterface.
|
overridevirtual |
Stop any put/announce operation at the given location, for the value with the given id.
Implements dht::DhtInterface.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 270 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Inform the DHT of lower-layer connectivity changes. This will cause the DHT to assume a public IP address change. The DHT will recontact neighbor nodes, re-register for listen ops etc.
Implements dht::DhtInterface.
Definition at line 267 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 263 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Get the list of good nodes for local storage saving purposes The list is ordered to minimize the back-to-work delay.
Implements dht::DhtInterface.
Definition at line 255 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 256 of file dht_proxy_client.h.
|
overridevirtual |
Get a value by asking the proxy and call the provided get callback when values are found at key. The operation will start as soon as the node is connected to the network.
| cb | a function called when new values are found on the network. It should return false to stop the operation. |
| donecb | a function called when the operation is complete. cb and donecb won't be called again afterward. |
| f | a filter function used to prefilter values. |
Implements dht::DhtInterface.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 109 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 112 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 115 of file dht_proxy_client.h.
|
overridevirtual |
Get locally stored data for the given hash.
Implements dht::DhtInterface.
|
overridevirtual |
Get locally stored data for the given key and value id.
Implements dht::DhtInterface.
|
inlineoverridevirtual |
Get the ID of the node.
Implements dht::DhtInterface.
Definition at line 75 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 264 of file dht_proxy_client.h.
|
overridevirtual |
|
overridevirtual |
Get data currently being put at the given hash.
Implements dht::DhtInterface.
|
overridevirtual |
Get data currently being put at the given hash with the given id.
Implements dht::DhtInterface.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 260 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 261 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 262 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 81 of file dht_proxy_client.h.
|
overridevirtual |
Get the current status of the node for the given family.
Implements dht::DhtInterface.
|
inlinevirtual |
Implements dht::DhtInterface.
Definition at line 266 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 258 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 259 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Returns the total memory usage of stored values and the number of stored values.
Implements dht::DhtInterface.
Definition at line 254 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 241 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 257 of file dht_proxy_client.h.
NOTE: The following methods will not be implemented because the DhtProxyClient doesn't have any storage nor synchronization process
Implements dht::DhtInterface.
Definition at line 252 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 253 of file dht_proxy_client.h.
|
overridevirtual |
Returns true if the node is running (have access to an open socket).
af: address family. If non-zero, will return true if the node is running for the provided family.
Implements dht::DhtInterface.
|
overridevirtual |
Listen on the network for any changes involving a specified hash. The node will register to receive updates from relevent nodes when new values are added or removed.
Implements dht::DhtInterface.
|
inlineoverridevirtual |
Listen on the network for any changes involving a specified hash. The node will register to receive updates from relevent nodes when new values are added or removed.
Implements dht::DhtInterface.
Definition at line 178 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 185 of file dht_proxy_client.h.
|
overridevirtual |
Implements dht::DhtInterface.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 201 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 236 of file dht_proxy_client.h.
|
overridevirtual |
Call linked callback with a push notification
| notification | to process |
Implements dht::DhtInterface.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 131 of file dht_proxy_client.h.
|
overridevirtual |
Announce a value on all available protocols (IPv4, IPv6).
The operation will start as soon as the node is connected to the network. The done callback will be called once, when the first announce succeeds, or fails. NOTE: For now, created parameter is ignored.
Implements dht::DhtInterface.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 140 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 148 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Similar to Dht::get, but sends a Query to filter data remotely.
| key | the key for which to query data for. |
| cb | a function called when new values are found on the network. It should return false to stop the operation. |
| done_cb | a function called when the operation is complete. cb and done_cb won't be called again afterward. |
| q | a query used to filter values on the remotes before they send a response. |
Implements dht::DhtInterface.
Definition at line 215 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 216 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Implements dht::DhtInterface.
Definition at line 238 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Reimplemented from dht::DhtInterface.
Definition at line 62 of file dht_proxy_client.h.
|
inlineoverridevirtual |
Set the in-memory storage limit in bytes
Implements dht::DhtInterface.
Definition at line 265 of file dht_proxy_client.h.
|
overridevirtual |
Performs final operations before quitting.
Implements dht::DhtInterface.