Manage all tracker records. More...
#include "Tracker.hpp"
Public Member Functions | |
| EPS::TrackerData & | add_inactive_entry (const UUID &uuid, const IPv4 &address_eps) |
| Add an entry but don't activate it. For example, when the cache file is read from disk. More... | |
| EPS::TrackerData & | add_active_entry (const UUID &uuid, const IPv4 &address_eps, const EPS::TConnPtr &connection) |
| Add (or update) a new tracker entry. More... | |
| EPS::TrackerData & | activate_entry (const EPS::TConnPtr &connection) |
| Activate an entry by setting the TCP connection pointer. More... | |
| EPS::TrackerData & | update_entry (const UUID &uuid) |
| Update the timestamp for an entry so it doesn't get deleted. More... | |
| EPS::TConnPtr | create_shared_pointer (EPS::TCPConnection *connection) |
| Create a new shared pointer for the given connection. More... | |
| EPS::TConnPtr | get_shared_pointer (EPS::TCPConnection *connection) |
| Look through all the shared pointers that Tracker knows about and see if we can find one matching the given raw pointer. More... | |
| void | deactivate_old_entries (void) |
| Disable entries that haven't been recently updated. More... | |
| bool | empty (void) const |
| Determine if the tracker cache is empty. More... | |
| const EPS::TrackerMap & | get_all_entries (void) const |
| Get all data entries in the tracker map. More... | |
| EPS::UUID | uuid_for_destination (const IPv4 &ipv4) const |
| Get the UUID which corresponds to the given destination IPv4 address. More... | |
| EPS::UUIDSet | get_all_uuids (void) const |
| Return the set of all UUIDs. More... | |
| EPS::UUIDSet | get_all_active_uuids (void) const |
| Return the set of active UUIDs. More... | |
| void | export_to_cache (const IPv4 &network) const |
| Export the tracker information, so we remember which IP address was assigned to which client computer. More... | |
| void | import_from_cache (const IPv4 &network) |
| Import the tracker information (if any). More... | |
| EPS::TrackerData & | deactivate_entry (const EPS::TConnPtr &connection) |
| De-activate an entry by closing the TCP connection pointer and removing references to it in eps_address_map. More... | |
| EPS::TrackerData & | deactivate_entry (const UUID &uuid) |
| De-activate an entry by closing the TCP connection pointer and removing references to it in eps_address_map. More... | |
| bool | exists (const UUID &uuid) const |
| Quickly determine if a tracker entry exists for the given information. More... | |
| bool | exists (const IPv4 &ipv4) const |
| Quickly determine if a tracker entry exists for the given information. More... | |
| bool | exists (const TConnPtr &connection) const |
| Quickly determine if a tracker entry exists for the given information. More... | |
| bool | does_not_exist (const UUID &uuid) const |
| Quickly determine if a tracker entry exists for the given information. More... | |
| bool | does_not_exist (const IPv4 &ipv4) const |
| Quickly determine if a tracker entry exists for the given information. More... | |
| bool | does_not_exist (const TConnPtr &connection) const |
| Quickly determine if a tracker entry exists for the given information. More... | |
| EPS::TrackerData & | get (const UUID &uuid) |
| Get a tracker record (create one if it doesn't already exist). More... | |
| EPS::TrackerData & | get (const IPv4 &eps_ipv4) |
| Get a tracker record (create one if it doesn't already exist). More... | |
| EPS::TrackerData & | get (const TConnPtr &connection) |
| Get a tracker record (create one if it doesn't already exist). More... | |
| EPS::TCPConns | get_all_connections (void) const |
| Return the set of enabled/valid connections. More... | |
| EPS::TCPConns | get_all_connections_other_than (const TConnPtr &connection) const |
| Return the set of enabled/valid connections. More... | |
Private Attributes | |
| EPS::TrackerMap | trk_map |
| Map of all known connections, both active and inactive. Maps UUIDs to TrackerData entries. More... | |
| EPS::DestinationMap | eps_address_map |
| Map of all known active EPS IPv4 addresses. Maps EPS IPs to UUIDs. Does not map non-EPS addresses. More... | |
Manage all tracker records.
| EPS::TrackerData & EPS::Tracker::activate_entry | ( | const EPS::TConnPtr & | connection | ) |
Activate an entry by setting the TCP connection pointer.
| EPS::TrackerData & EPS::Tracker::add_active_entry | ( | const UUID & | uuid, |
| const IPv4 & | address_eps, | ||
| const EPS::TConnPtr & | connection | ||
| ) |
Add (or update) a new tracker entry.
| EPS::TrackerData & EPS::Tracker::add_inactive_entry | ( | const UUID & | uuid, |
| const IPv4 & | address_eps | ||
| ) |
Add an entry but don't activate it. For example, when the cache file is read from disk.
| EPS::TConnPtr EPS::Tracker::create_shared_pointer | ( | EPS::TCPConnection * | connection | ) |
Create a new shared pointer for the given connection.
If a shared pointer already exists, then this will return the existing shared pointer, similar to get_shared_pointer().
| EPS::TrackerData & EPS::Tracker::deactivate_entry | ( | const EPS::TConnPtr & | connection | ) |
De-activate an entry by closing the TCP connection pointer and removing references to it in eps_address_map.
| EPS::TrackerData & EPS::Tracker::deactivate_entry | ( | const UUID & | uuid | ) |
De-activate an entry by closing the TCP connection pointer and removing references to it in eps_address_map.
| void EPS::Tracker::deactivate_old_entries | ( | void | ) |
Disable entries that haven't been recently updated.
|
inline |
Quickly determine if a tracker entry exists for the given information.
|
inline |
Quickly determine if a tracker entry exists for the given information.
|
inline |
Quickly determine if a tracker entry exists for the given information.
|
inline |
Determine if the tracker cache is empty.
| bool EPS::Tracker::exists | ( | const UUID & | uuid | ) | const |
Quickly determine if a tracker entry exists for the given information.
| bool EPS::Tracker::exists | ( | const IPv4 & | ipv4 | ) | const |
Quickly determine if a tracker entry exists for the given information.
| bool EPS::Tracker::exists | ( | const TConnPtr & | connection | ) | const |
Quickly determine if a tracker entry exists for the given information.
| void EPS::Tracker::export_to_cache | ( | const IPv4 & | network | ) | const |
Export the tracker information, so we remember which IP address was assigned to which client computer.
| EPS::TrackerData & EPS::Tracker::get | ( | const UUID & | uuid | ) |
Get a tracker record (create one if it doesn't already exist).
| EPS::TrackerData & EPS::Tracker::get | ( | const IPv4 & | eps_ipv4 | ) |
Get a tracker record (create one if it doesn't already exist).
| EPS::TrackerData & EPS::Tracker::get | ( | const TConnPtr & | connection | ) |
Get a tracker record (create one if it doesn't already exist).
| EPS::UUIDSet EPS::Tracker::get_all_active_uuids | ( | void | ) | const |
Return the set of active UUIDs.
| EPS::TCPConns EPS::Tracker::get_all_connections | ( | void | ) | const |
Return the set of enabled/valid connections.
| EPS::TCPConns EPS::Tracker::get_all_connections_other_than | ( | const TConnPtr & | connection | ) | const |
Return the set of enabled/valid connections.
|
inline |
Get all data entries in the tracker map.
| EPS::UUIDSet EPS::Tracker::get_all_uuids | ( | void | ) | const |
Return the set of all UUIDs.
| EPS::TConnPtr EPS::Tracker::get_shared_pointer | ( | EPS::TCPConnection * | connection | ) |
Look through all the shared pointers that Tracker knows about and see if we can find one matching the given raw pointer.
If one doesn't exist, then throw an exception.
| void EPS::Tracker::import_from_cache | ( | const IPv4 & | network | ) |
Import the tracker information (if any).
| EPS::TrackerData & EPS::Tracker::update_entry | ( | const UUID & | uuid | ) |
Update the timestamp for an entry so it doesn't get deleted.
Get the UUID which corresponds to the given destination IPv4 address.
|
private |
|
private |
Map of all known connections, both active and inactive. Maps UUIDs to TrackerData entries.