EPS Conduits  v0.0.2-2411
networking over networking
EPS::Tracker Class Referencefinal

Manage all tracker records. More...

#include "Tracker.hpp"

Collaboration diagram for EPS::Tracker:

Public Member Functions

EPS::TrackerDataadd_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::TrackerDataadd_active_entry (const UUID &uuid, const IPv4 &address_eps, const EPS::TConnPtr &connection)
 Add (or update) a new tracker entry. More...
 
EPS::TrackerDataactivate_entry (const EPS::TConnPtr &connection)
 Activate an entry by setting the TCP connection pointer. More...
 
EPS::TrackerDataupdate_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::TrackerMapget_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::TrackerDatadeactivate_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::TrackerDatadeactivate_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::TrackerDataget (const UUID &uuid)
 Get a tracker record (create one if it doesn't already exist). More...
 
EPS::TrackerDataget (const IPv4 &eps_ipv4)
 Get a tracker record (create one if it doesn't already exist). More...
 
EPS::TrackerDataget (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...
 

Detailed Description

Manage all tracker records.

Member Function Documentation

◆ activate_entry()

EPS::TrackerData & EPS::Tracker::activate_entry ( const EPS::TConnPtr connection)

Activate an entry by setting the TCP connection pointer.

Here is the call graph for this function:

◆ add_active_entry()

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.

Here is the caller graph for this function:

◆ add_inactive_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.

Here is the caller graph for this function:

◆ create_shared_pointer()

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().

◆ deactivate_entry() [1/2]

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.

Here is the caller graph for this function:

◆ deactivate_entry() [2/2]

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.

◆ deactivate_old_entries()

void EPS::Tracker::deactivate_old_entries ( void  )

Disable entries that haven't been recently updated.

Here is the caller graph for this function:

◆ does_not_exist() [1/3]

bool EPS::Tracker::does_not_exist ( const UUID uuid) const
inline

Quickly determine if a tracker entry exists for the given information.

Here is the caller graph for this function:

◆ does_not_exist() [2/3]

bool EPS::Tracker::does_not_exist ( const IPv4 ipv4) const
inline

Quickly determine if a tracker entry exists for the given information.

◆ does_not_exist() [3/3]

bool EPS::Tracker::does_not_exist ( const TConnPtr connection) const
inline

Quickly determine if a tracker entry exists for the given information.

◆ empty()

bool EPS::Tracker::empty ( void  ) const
inline

Determine if the tracker cache is empty.

Here is the caller graph for this function:

◆ exists() [1/3]

bool EPS::Tracker::exists ( const UUID uuid) const

Quickly determine if a tracker entry exists for the given information.

Here is the caller graph for this function:

◆ exists() [2/3]

bool EPS::Tracker::exists ( const IPv4 ipv4) const

Quickly determine if a tracker entry exists for the given information.

◆ exists() [3/3]

bool EPS::Tracker::exists ( const TConnPtr connection) const

Quickly determine if a tracker entry exists for the given information.

◆ export_to_cache()

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.

See also
EPS::Tracker::import_from_cache()
Here is the caller graph for this function:

◆ get() [1/3]

EPS::TrackerData & EPS::Tracker::get ( const UUID uuid)

Get a tracker record (create one if it doesn't already exist).

Here is the caller graph for this function:

◆ get() [2/3]

EPS::TrackerData & EPS::Tracker::get ( const IPv4 eps_ipv4)

Get a tracker record (create one if it doesn't already exist).

◆ get() [3/3]

EPS::TrackerData & EPS::Tracker::get ( const TConnPtr connection)

Get a tracker record (create one if it doesn't already exist).

◆ get_all_active_uuids()

EPS::UUIDSet EPS::Tracker::get_all_active_uuids ( void  ) const

Return the set of active UUIDs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_all_connections()

EPS::TCPConns EPS::Tracker::get_all_connections ( void  ) const

Return the set of enabled/valid connections.

Here is the caller graph for this function:

◆ get_all_connections_other_than()

EPS::TCPConns EPS::Tracker::get_all_connections_other_than ( const TConnPtr connection) const

Return the set of enabled/valid connections.

Here is the caller graph for this function:

◆ get_all_entries()

const EPS::TrackerMap& EPS::Tracker::get_all_entries ( void  ) const
inline

Get all data entries in the tracker map.

Here is the caller graph for this function:

◆ get_all_uuids()

EPS::UUIDSet EPS::Tracker::get_all_uuids ( void  ) const

Return the set of all UUIDs.

Here is the caller graph for this function:

◆ get_shared_pointer()

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.

See also
create_shared_pointer()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ import_from_cache()

void EPS::Tracker::import_from_cache ( const IPv4 network)

Import the tracker information (if any).

See also
EPS::Tracker::export_to_cache()
Here is the caller graph for this function:

◆ update_entry()

EPS::TrackerData & EPS::Tracker::update_entry ( const UUID uuid)

Update the timestamp for an entry so it doesn't get deleted.

Here is the caller graph for this function:

◆ uuid_for_destination()

EPS::UUID EPS::Tracker::uuid_for_destination ( const IPv4 ipv4) const

Get the UUID which corresponds to the given destination IPv4 address.

Returns
nil UUID if the destination IPv4 address is unknown
UUID corresponding to the destination EPS IP address
Here is the caller graph for this function:

Member Data Documentation

◆ eps_address_map

EPS::DestinationMap EPS::Tracker::eps_address_map
private

Map of all known active EPS IPv4 addresses. Maps EPS IPs to UUIDs. Does not map non-EPS addresses.

◆ trk_map

EPS::TrackerMap EPS::Tracker::trk_map
private

Map of all known connections, both active and inactive. Maps UUIDs to TrackerData entries.


The documentation for this class was generated from the following files: