|
WSF
|
#include <WsfCommNetworkManager.hpp>


Classes | |
| struct | CommHash |
Public Types | |
| enum class | NetworkTopology { cPOINT_TO_POINT , cMESH , cSTAR , cRING , cDIRECTED_RING } |
| using | CommMap = std::unordered_map<Address, Comm*> |
| Definitions of commonly used container types. | |
| using | AddressMap = std::unordered_map<Comm*, Address, CommHash> |
| using | AddressSet = std::unordered_set<Address> |
| using | NetworkSet = std::set<Address> |
| using | AddressNetworkMap = std::unordered_map<Address, std::string> |
| using | NetworkMap = std::unordered_map<std::string, std::unique_ptr<Network>> |
| using | AddressVector = std::vector<Address> |
| using | MultiAddressMap = std::unordered_map<Address, AddressVector> |
| using | CommVector = std::vector<Comm*> |
| using | RouterVector = std::vector<router::Router*> |
Public Member Functions | |
| NetworkManager (WsfSimulation *aSimPtr) | |
| Constructors and Operator Overloads. | |
| ~NetworkManager () override=default | |
| NetworkManager (const NetworkManager &aSrc)=delete | |
| NetworkManager & | operator= (const NetworkManager &aSrc)=delete |
| NetworkManager (NetworkManager &&aSrc)=delete | |
| NetworkManager & | operator= (NetworkManager &&aSrc)=delete |
| Public Member Functions inherited from WsfSimulationExtension | |
| WsfSimulationExtension () | |
| ~WsfSimulationExtension () override=default | |
| WsfSimulation & | GetSimulation () const |
| const WsfScenario & | GetScenario () const |
| virtual void | AddedToSimulation () |
| virtual bool | PrepareExtension () |
| virtual void | Start () |
| virtual void | Complete (double aSimTime) |
| Public Member Functions inherited from WsfExtension | |
| virtual | ~WsfExtension ()=default |
| const std::string & | GetExtensionName () const |
Static Public Member Functions | |
| static NetworkManager * | Find (const WsfSimulation &aSimulation) |
| static void | __private_SetSim (WsfSimulationExtension &aExtension, WsfSimulation *aSimPtr) |
Callback lists. | |
Other objects may register callbacks that are to be invoked during network manager network graph state changes. NOTE: Be aware that these objects are called as processed by the network manager. It should not be assumed that they are called in a logical order (such as adding a comm before enabling a link to it), so any use of these must be robust enough to accommodate potential information that has not yet propagated. | |
| UtCallbackListN< void(double, Comm *)> | CommAdded {} |
| UtCallbackListN< void(double, Comm *)> | CommRemoved {} |
| UtCallbackListN< void(double, Network *)> | NetworkAdded {} |
| UtCallbackListN< void(double, Network *)> | NetworkRemoved {} |
| UtCallbackListN< void(double, Comm *)> | CommEnabled {} |
| UtCallbackListN< void(double, Comm *)> | CommDisabled {} |
| UtCallbackListN< void(double, const Address &, const Address &)> | ConnectionAdded {} |
| UtCallbackListN< void(double, const Address &, const Address &)> | ConnectionRemoved {} |
| UtCallbackListN< void(double, const Address &, const Address &)> | ConnectionEnabled {} |
| UtCallbackListN< void(double, const Address &, const Address &)> | ConnectionDisabled {} |
| UtCallbackListN< void()> | CommFrameworkPendingStart {} |
| Allows indication that the comm framework is fully set up. | |
| UtCallbackListN< void(double, WsfPlatform *)> | CommFrameworkPlatformInitialized {} |
| Filtered PlatformInitialized event, called after the comm framework has processed this platform. | |
| UtCallbackListN< void(double, WsfPlatform *)> | CommFrameworkPlatformDeleted {} |
| Filtered PlatformDeleted event, called prior to the comm framework removing this platform. | |
Notifications from the simulation. | |
These are called in the order they are listed. | |
| bool | Initialize () override |
| bool | PlatformsInitialized () override |
| void | PendingStart () override |
| const Address * | GetAddress (Comm *aCommPtr) const |
| Accessors. | |
| Comm * | GetComm (const Address &aAddress) const |
| Provides Comm object for an Address. | |
| Network * | GetNetwork (const std::string &aNetworkName) const |
| Provides Network object for a network name. | |
| bool | IsCommManaged (Comm *aCommPtr) const |
| True if Comm object present. | |
| bool | IsAddressManaged (const Address &aAddress) const |
| True if Address object present. | |
| bool | IsNetworkManaged (const std::string &aNetworkName) const |
| True if network with name provided present. | |
| std::vector< std::string > | GetManagedNetworks () const |
| Returns the names of all managed networks. | |
| const Address * | GetManagingNetworkAddress (const Address &aAddress) const |
| Returns the address of the network that the provided address belongs to. | |
| bool | IsNetworkAddressManaged (const Address &aAddress) const |
| True if network address provided overlaps with a currently assigned network address. | |
| std::string | GetNetworkNameFromAddress (const Address &aAddress) const |
| Get name of network associated with an Address. | |
| AddressSet | GetAddressesInNetwork (const std::string &aNetworkName) const |
| Get a list of all addresses associated with a network. | |
| AddressSet | GetComms () const |
| Returns all registered comms in the simulation. | |
| graph::Graph & | GetGraph () |
| Get the graph representation of all comm networks in AFSIM (perfect knowledge). | |
| bool | PathExists (const Address &aSourceAddress, const Address &aDestinationAddress) const |
| Simple check of pathing from source to destination. | |
| bool | HasMulticastMember (const Address &aMulticastAddress, const std::string &aNetworkName) const |
| Returns true if the network has a comm subscribed to the provided multicast address. | |
| AddressSet | GetMulticastMembers (const Address &aMulticastAddress, const std::string &aNetworkName) const |
| Returns the members of a network subscribed to a multicast address. | |
| AddressSet | GetMulticastMembers (const Address &aMulticastAddress) const |
| Returns ALL members of a multicast address. | |
| bool | IsMulticastManaged (const Address &aMulticastAddress) const |
| True if a multicast address being utilized/managed. | |
AddManagedComm | |
Adds a comm (during its initialization routine) to a container of interfaces that are processed during the PlatformsInitialized() call. Required for ALL comm implementations being managed by the network manager via scenario input. | |
| void | AddManagedComm (Comm *aCommPtr) |
AddManagedRouter | |
Adds a router (during its initialization routine) to a container that is processed during the PlatformsInitialized() call. Required for ALL router implementations being managed by the network manager. | |
| void | AddManagedRouter (router::Router *aRouterPtr) |
AddComm | |
Adds a comm device to the network manager. The first version of this method will look for an existing network, if the value was provided, and add the comm device to that network with an appropriate address, if possible. If no network was specified, a new address will be assigned, with a new network created containing only this comm device. The assigned address of the comm device is returned, with an address of 0.0.0.0 provided upon failure to add the device. The second version checks the user provided address to see if it belongs to an existing network. If so, the device is added to that network with the user specified address. If the address does not belong to a current network assignment, a new network is created to which this device is assigned. The second version returns the name of the network that the comm was assigned to, or a empty string ("") on failure. | |
| Address | AddComm (double aSimTime, Comm *aCommPtr, std::string &aNetworkName, bool aNotifyObserver=true) |
| std::string | AddComm (double aSimTime, Comm *aCommPtr, const Address &aAddress, bool aNotifyObserver=true) |
RemoveComm | |
Removes the comm device and all applicable mappings from the network manager. Can be performed by providing either a pointer to the comm device, or an address. | |
| void | RemoveComm (double aSimTIme, Comm *aCommPtr, bool aNotifyObserver=true) |
| void | RemoveComm (double aSimTime, const Address &aAddress, bool aNotifyObserver=true) |
AddNetwork | |
Adds a network to the network manager. The passed boolean value indicates whether reserved addressing is enforced, as this needs to be disabled during initial setup. | |
| bool | AddNetwork (double aSimTime, std::unique_ptr< Network > aNetwork, bool aSuppressReservedCheck=false) |
RemoveNetwork | |
Removes a network from the network manager.
| |
| void | RemoveNetwork (double aSimTime, const std::string &aNetworkName) |
EnableComm | |
Given a comm device or an address, enables the object (node) within the graph. | |
| bool | EnableComm (double aSimTime, Comm *aCommPtr) |
| bool | EnableComm (double aSimTime, const Address &aAddress) |
DisableComm | |
Given a comm device or an address, disables the object (node) within the graph. | |
| bool | DisableComm (double aSimTime, Comm *aCommPtr) |
| bool | DisableComm (double aSimTime, const Address &aAddress) |
AddConnection | |
Given two comm devices, create a connection (edge) on the graph. | |
| bool | AddConnection (double aSimTime, Comm *aSourceCommPtr, Comm *aDestinationCommPtr, bool aNotifyObserver=true) |
| bool | AddConnection (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress, bool aNotifyObserver=true) |
RemoveConnection | |
Given two comm devices, remove a connection (edge) on the graph. | |
| bool | RemoveConnection (double aSimTime, Comm *aSourceCommPtr, Comm *aDestinationCommPtr, bool aNotifyObserver=true) |
| bool | RemoveConnection (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress, bool aNotifyObserver=true) |
EnableConnection | |
Given two comm devices, enable a connection (edge) on the graph. | |
| bool | EnableConnection (double aSimTime, Comm *aSourceCommPtr, Comm *aDestinationCommPtr, bool aNotifyObserver=true) |
| bool | EnableConnection (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress, bool aNotifyObserver=true) |
DisableConnection | |
Given two comm devices, disable a connection (edge) on the graph. | |
| bool | DisableConnection (double aSimTime, Comm *aSourceCommPtr, Comm *aDestinaationCommPtr, bool aNotifyObserver=true) |
| bool | DisableConnection (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress, bool aNotifyObserver=true) |
| bool | AddMulticastMember (double aSimTime, const Address &aMulticastAddress, const Address &aJoiningMember) |
| bool | RemoveMulticastMember (double aSimTime, const Address &aMulticastAddress, const Address &aLeavingMember) |
RemoveNetworkConnections | |
Given a network name, remove all connections between members of the network. | |
| bool | RemoveNetworkConnections (double aSimTime, const std::string &aNetworkName, bool aNotifyObserver=true) |
ManageComm | |
Based on input to the comm interface (or lack thereof), this method determines the appropriate call to AddComm to correctly assigned addressing to the interface. and then assigned the Comm to its network and assign linkage (via AddComm) | |
| void | ManageComm (double aSimTime, Comm *aCommPtr, const std::string &aNetworkName, const Address &aAddress, const Address &aNetworkAddress) |
InitializeUserLinks | |
For any passed comm object, creates linkage based on the user input for that comm. Cannot be called until all comms in the simulation have been assigned addresses and assigned to networks due to reliance on some linkage being address based. | |
| void | InitializeUserLinks (double aSimTime, Comm *aCommPtr) |
Clear | |
Removes all mappings and empties the graph object in the network manager. | |
| void | Clear () |
GetSimulation() | |
Provides an alternate point of entry for the simulation object for objects that may initially only have access to the Network Manager | |
| WsfSimulation * | GetSimulation () const |
Network Manager Callbacks | |
| void | PlatformDeleted (double aSimTime, WsfPlatform *aPlatform) |
| void | PlatformInitialized (double aSimTime, WsfPlatform *aPlatform) |
| const ReservedAddressing & | GetReservedAddresses () const |
| Accessor for reserved addressing object. | |
Additional Inherited Members | |
| Protected Member Functions inherited from WsfExtension | |
| void | InitializeExtensionName (const std::string &aName) |
| using wsf::comm::NetworkManager::AddressMap = std::unordered_map<Comm*, Address, CommHash> |
| using wsf::comm::NetworkManager::AddressNetworkMap = std::unordered_map<Address, std::string> |
| using wsf::comm::NetworkManager::AddressSet = std::unordered_set<Address> |
| using wsf::comm::NetworkManager::AddressVector = std::vector<Address> |
| using wsf::comm::NetworkManager::CommMap = std::unordered_map<Address, Comm*> |
Definitions of commonly used container types.
| using wsf::comm::NetworkManager::CommVector = std::vector<Comm*> |
| using wsf::comm::NetworkManager::MultiAddressMap = std::unordered_map<Address, AddressVector> |
| using wsf::comm::NetworkManager::NetworkMap = std::unordered_map<std::string, std::unique_ptr<Network>> |
| using wsf::comm::NetworkManager::NetworkSet = std::set<Address> |
| using wsf::comm::NetworkManager::RouterVector = std::vector<router::Router*> |
|
strong |
| wsf::comm::NetworkManager::NetworkManager | ( | WsfSimulation * | aSimPtr | ) |
Constructors and Operator Overloads.
References WsfSimulationExtension::WsfSimulation.
Referenced by Find(), NetworkManager(), NetworkManager(), operator=(), and operator=().
|
overridedefault |
|
delete |
References NetworkManager().
|
delete |
References NetworkManager().
| std::string wsf::comm::NetworkManager::AddComm | ( | double | aSimTime, |
| Comm * | aCommPtr, | ||
| const Address & | aAddress, | ||
| bool | aNotifyObserver = true ) |
Find the network the user provided address belongs to, if it exists.
A managing network was found for the user address. Add the comm device to this network.
Set the comm's address and network name
We can't undo this earlier, due to the network needing these objects populated for for potential linking on success, so we have to undo them here on failure.
Notify the observer that a node was added to the manager
Notify callback
No current managing network for this address. Create one for this address.
The default network type is a mesh network.
New network created. Add this address to indicate its being managed.
We can't undo this earlier, due to the network needing these objects populated for for potential linking on success, so we have to undo them here on failure.
Notify the observer that a node was added to the manager
Notify callback
References AddNetwork(), CommAdded, wsf::comm::Comm::GetFullName(), GetManagingNetworkAddress(), GetNetwork(), GetNetworkNameFromAddress(), wsf::comm::Address::GetRoutingPrefix(), GetSimulation(), wsf::comm::Address::GetSubnetMaskBitLength(), IsAddressManaged(), IsCommManaged(), IsNetworkManaged(), wsf::comm::Address::IsNull(), RemoveNetwork(), wsf::comm::Comm::SetAddress(), and wsf::comm::Comm::SetNetwork().
| Address wsf::comm::NetworkManager::AddComm | ( | double | aSimTime, |
| Comm * | aCommPtr, | ||
| std::string & | aNetworkName, | ||
| bool | aNotifyObserver = true ) |
If the network name is not provided, set a network name using the device name. The network is defined with the comm name with a dot and an integer value, as it is possible that the defining network comm device may leave a network and re-establish a new one during the simulation, in which a network using that name would already be established. e.g. If the comm is named "platform.blue_comm", the initial typical network name would be "platform.blue_comm.1". If that comm device left that network, but later re-established a new network with an auto-generated name, that new network would be "platform.blue_comm.2". As such, names of networks should never assume inclusion of a comm device of the same name, and are only identifiers used to identify a particular network.
The user defined a network name. If this network already exists, set a flag so we don't create that network later. Also match the CIDR value for address creation to any existing network specification.
If the above conditional determined that a network needed to be created, do so now.
Get an address that isn't already maintained (used) and that isn't reserved.
Add a default network object. Note that all default networks in AFSIM are mesh based.
Now, regardless of case above, we have a network to add this comm device to. Use that network to generate an appropriate address for this device.
Create an address that is only the base routing prefix of the network address. This represents the lowest available address assignable to this particular domain.
The initial address in an invalid *.0 address. Increment to start at the first available value, a *.001 address.
Check the address for current assignment in the simulation, incrementing the address until an available address is found. If we exhaust all available host addresses, return a failure.
Address exists. Increment address;
Address does not exist in manager, use it for this device.
Set the comm's address and network name
Add the comm to the network object. This may result in linkage.
We can't undo this earlier, due to the network needing these objects populated for for potential linking on success, so we have to undo them here on failure.
If we created a network for this failed add, remove it too.
Notify the observer that a node was added to the manager
Notify callbacks
If we reach this point, it means that the network no longer had any assignable addresses within its subnet. Return the non-assigned address of 0.0.0.0 to indicate inability to assign this comm device to this network.
References AddNetwork(), CommAdded, wsf::comm::Address::GenerateAddress(), wsf::comm::Network::GetAddress(), wsf::comm::Comm::GetFullName(), GetNetwork(), GetSimulation(), wsf::comm::Address::GetSubnetMaskBitLength(), IsAddressManaged(), IsCommManaged(), IsNetworkAddressManaged(), IsNetworkManaged(), RemoveNetwork(), wsf::comm::Comm::SetAddress(), and wsf::comm::Comm::SetNetwork().
Referenced by ManageComm(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), and wsf::comm::UT_DEFINE_SCRIPT_METHOD().
| bool wsf::comm::NetworkManager::AddConnection | ( | double | aSimTime, |
| Comm * | aSourceCommPtr, | ||
| Comm * | aDestinationCommPtr, | ||
| bool | aNotifyObserver = true ) |
References AddConnection(), and GetAddress().
Referenced by AddConnection(), and InitializeUserLinks().
|
inline |
Referenced by wsf::comm::Comm::Initialize().
|
inline |
Referenced by wsf::comm::router::Router::Initialize().
| bool wsf::comm::NetworkManager::AddMulticastMember | ( | double | aSimTime, |
| const Address & | aMulticastAddress, | ||
| const Address & | aJoiningMember ) |
References wsf::comm::Address::IsNull().
Referenced by wsf::comm::router::OSPF_Area::ElectionDR().
| bool wsf::comm::NetworkManager::AddNetwork | ( | double | aSimTime, |
| std::unique_ptr< Network > | aNetwork, | ||
| bool | aSuppressReservedCheck = false ) |
If a network with this name already exists, return false for failure to add network.
Need copies of these, as std::move will invalidate aNetwork during processing.
Check for a user supplied address that is not the default
Specific address not provided. Generate one, but use current CIDR value in case the user specified one.
Add this network.
Initialize the network
Notify the observer of the new network.
Notify callback
References wsf::comm::Address::GenerateAddress(), wsf::comm::Address::GetAddress(), GetNetwork(), GetSimulation(), wsf::comm::Address::GetSubnetMaskBitLength(), IsNetworkAddressManaged(), IsNetworkManaged(), and NetworkAdded.
Referenced by AddComm(), AddComm(), Initialize(), ManageComm(), and PlatformsInitialized().
| void wsf::comm::NetworkManager::Clear | ( | ) |
References wsf::comm::graph::Graph::Clear().
Referenced by Initialize().
| bool wsf::comm::NetworkManager::DisableComm | ( | double | aSimTime, |
| Comm * | aCommPtr ) |
References DisableComm(), and GetAddress().
Referenced by DisableComm().
| bool wsf::comm::NetworkManager::DisableComm | ( | double | aSimTime, |
| const Address & | aAddress ) |
Notify Callback
References CommDisabled, and GetComm().
| bool wsf::comm::NetworkManager::DisableConnection | ( | double | aSimTime, |
| Comm * | aSourceCommPtr, | ||
| Comm * | aDestinaationCommPtr, | ||
| bool | aNotifyObserver = true ) |
References DisableConnection(), and GetAddress().
Referenced by DisableConnection().
| bool wsf::comm::NetworkManager::DisableConnection | ( | double | aSimTime, |
| const Address & | aSourceAddress, | ||
| const Address & | aDestinationAddress, | ||
| bool | aNotifyObserver = true ) |
Notify callback
References ConnectionDisabled, and GetComm().
| bool wsf::comm::NetworkManager::EnableComm | ( | double | aSimTime, |
| Comm * | aCommPtr ) |
References EnableComm(), and GetAddress().
Referenced by EnableComm().
| bool wsf::comm::NetworkManager::EnableComm | ( | double | aSimTime, |
| const Address & | aAddress ) |
Notify callback
References CommEnabled, and GetComm().
| bool wsf::comm::NetworkManager::EnableConnection | ( | double | aSimTime, |
| Comm * | aSourceCommPtr, | ||
| Comm * | aDestinationCommPtr, | ||
| bool | aNotifyObserver = true ) |
References EnableConnection(), and GetAddress().
Referenced by EnableConnection().
| bool wsf::comm::NetworkManager::EnableConnection | ( | double | aSimTime, |
| const Address & | aSourceAddress, | ||
| const Address & | aDestinationAddress, | ||
| bool | aNotifyObserver = true ) |
References ConnectionEnabled, and GetComm().
|
static |
Accessors.
Provides Address for a Comm object
Referenced by AddConnection(), DisableComm(), DisableConnection(), EnableComm(), EnableConnection(), operator=(), RemoveComm(), and RemoveConnection().
| NetworkManager::AddressSet wsf::comm::NetworkManager::GetAddressesInNetwork | ( | const std::string & | aNetworkName | ) | const |
Get a list of all addresses associated with a network.
References wsf::comm::Address::GetAddress(), GetNetwork(), and wsf::comm::Address::GetRoutingPrefix().
Referenced by GetMulticastMembers(), wsf::comm::ProtocolIGMP::GetQuerier(), HasMulticastMember(), wsf::comm::router::ProtocolAdHoc::InitializeState(), operator=(), RemoveNetwork(), RemoveNetworkConnections(), and WsfTaskManager::SendTaskMessage().
Provides Comm object for an Address.
Referenced by AddConnection(), wsf::comm::router::Router::AddInterface(), DisableComm(), DisableConnection(), EnableComm(), EnableConnection(), wsf::comm::medium::Guided::EndPropagation(), wsf::comm::medium::Unguided::EndPropagation(), wsf::comm::medium::Guided::EndTransmission(), wsf::comm::medium::Unguided::EndTransmission(), getLinkedAndReachablePlatformParts(), wsf::comm::Network::InitializeLinkage(), InitializeUserLinks(), WsfMessageProcessor::Selector::Matches(), operator=(), WsfJTIDS_Terminal::PrintDebugReception(), wsf::comm::NetworkLayer::ProcessLayerMessage(), wsf::comm::router::ProtocolMulticast::Receive(), wsf::comm::router::ProtocolOSPF::ReceiveDR_GraphAdd(), wsf::comm::router::ProtocolOSPF::ReceiveDR_GraphDrop(), wsf::comm::router::ProtocolOSPF::ReceiveHello(), WsfRIPRProcessor::ReceiveMessage(), RemoveComm(), RemoveConnection(), wsf::comm::router::Router::RemoveInterface(), RemoveNetworkConnections(), wsf::comm::router::ProtocolOSPF::RouteFromBackbone(), wsf::comm::router::ProtocolOSPF::RouteToBackbone(), wsf::comm::SlotGroupLayerJTIDS::Send(), wsf::comm::router::ProtocolOSPF::SendDR_GraphAdd(), wsf::comm::router::ProtocolOSPF::SendDR_GraphDrop(), WsfTaskManager::SendTaskMessage(), wsf::comm::NetworkAdHoc::Update(), wsf::comm::NetworkAdHoc::Update(), wsf::comm::NetworkAdHoc::Update(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), and wsf::comm::Comm::ValidateGateway().
| NetworkManager::AddressSet wsf::comm::NetworkManager::GetComms | ( | ) | const |
Returns all registered comms in the simulation.
Referenced by operator=().
| graph::Graph & wsf::comm::NetworkManager::GetGraph | ( | ) |
Get the graph representation of all comm networks in AFSIM (perfect knowledge).
Referenced by wsf::comm::router::ProtocolOSPF::GetGraph(), wsf::comm::router::ProtocolLegacy::Initialize(), wsf::comm::router::ProtocolMulticast::Initialize(), wsf::comm::router::ProtocolAdHoc::InitializeState(), operator=(), wsf::comm::router::ProtocolLegacy::Setup(), wsf::comm::router::ProtocolMulticast::Setup(), and wsf::comm::router::ProtocolOSPF::Setup().
| std::vector< std::string > wsf::comm::NetworkManager::GetManagedNetworks | ( | ) | const |
Returns the names of all managed networks.
Referenced by operator=().
| const Address * wsf::comm::NetworkManager::GetManagingNetworkAddress | ( | const Address & | aAddress | ) | const |
Returns the address of the network that the provided address belongs to.
References wsf::comm::Address::CheckInAddressRange().
Referenced by AddComm(), IsNetworkAddressManaged(), ManageComm(), and operator=().
| NetworkManager::AddressSet wsf::comm::NetworkManager::GetMulticastMembers | ( | const Address & | aMulticastAddress | ) | const |
Returns ALL members of a multicast address.
| NetworkManager::AddressSet wsf::comm::NetworkManager::GetMulticastMembers | ( | const Address & | aMulticastAddress, |
| const std::string & | aNetworkName ) const |
Returns the members of a network subscribed to a multicast address.
References GetAddressesInNetwork().
Referenced by operator=().
| Network * wsf::comm::NetworkManager::GetNetwork | ( | const std::string & | aNetworkName | ) | const |
Provides Network object for a network name.
Referenced by AddComm(), AddComm(), AddNetwork(), GetAddressesInNetwork(), InitializeUserLinks(), IsNetworkManaged(), operator=(), PlatformDeleted(), RemoveComm(), RemoveNetwork(), and wsf::comm::router::ProtocolAdHoc::ValidNetwork().
| std::string wsf::comm::NetworkManager::GetNetworkNameFromAddress | ( | const Address & | aAddress | ) | const |
Get name of network associated with an Address.
Referenced by AddComm(), ManageComm(), operator=(), and wsf::comm::UT_DEFINE_SCRIPT_METHOD().
|
inline |
Accessor for reserved addressing object.
|
inline |
References WsfSimulationExtension::WsfSimulation.
Referenced by AddComm(), AddComm(), AddNetwork(), Initialize(), InitializeUserLinks(), PlatformsInitialized(), and RemoveComm().
| bool wsf::comm::NetworkManager::HasMulticastMember | ( | const Address & | aMulticastAddress, |
| const std::string & | aNetworkName ) const |
Returns true if the network has a comm subscribed to the provided multicast address.
References GetAddressesInNetwork().
Referenced by operator=().
|
overridevirtual |
Called in response to WsfSimulation::Initialize. This is called to allow the extension to perform any initialization that is required.
Initialize reserved addressing
Reimplemented from WsfSimulationExtension.
References AddNetwork(), wsf::comm::reserved::cDEFAULT_INITIAL, Clear(), GetSimulation(), PlatformDeleted(), and WsfObserver::PlatformDeleted().
Referenced by operator=().
| void wsf::comm::NetworkManager::InitializeUserLinks | ( | double | aSimTime, |
| Comm * | aCommPtr ) |
If the link being added is between members of the same network, then the network will determine if the link is valid. Otherwise, this is a link between networks, and can be established directly. Note: Currently, this behavior affects all protocols. This could be changed to a protocol by protocol basis in the future, if the need exists.
Truth will be propagated via callback. Only push in the non-truth usage case, as these links are user directed.
Truth will be propagated via callback. Only push in the non-truth usage case, as these links are user directed.
We can use the network manager to find the correct address of the provided platform name + comm name pairs, as this data was already propagated to the network manager during Initialize() calls by the various WsfComm objects.
If the platform name is a null string, then this is a local connection. The name of the platform relevant to this link is the current platform owning this layer's comm.
If the link being added is between members of the same network, then the network will determine if the link is valid. Otherwise, this is a link between network members, and can be established directly.
Truth will be propagated via callback. Only push in the non-truth usage case, as these links are user directed.
Truth will be propagated via callback. Only push in the non-truth usage case, as these links are user directed.
References AddConnection(), wsf::comm::Network::AddLink(), wsf::comm::Address::GetAddress(), wsf::comm::Comm::GetAddress(), GetComm(), wsf::comm::Comm::GetFullName(), wsf::comm::Comm::GetLinkAddresses(), wsf::comm::Comm::GetLinkPairs(), WsfObject::GetName(), wsf::comm::Comm::GetNetwork(), GetNetwork(), WsfPlatformPart::GetPlatform(), WsfSimulation::GetPlatformByName(), wsf::comm::Comm::GetRouter(), GetSimulation(), and platformPtr.
Referenced by PlatformInitialized(), and PlatformsInitialized().
| bool wsf::comm::NetworkManager::IsAddressManaged | ( | const Address & | aAddress | ) | const |
True if Address object present.
Referenced by AddComm(), AddComm(), and operator=().
| bool wsf::comm::NetworkManager::IsCommManaged | ( | Comm * | aCommPtr | ) | const |
True if Comm object present.
Referenced by AddComm(), AddComm(), operator=(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), and wsf::comm::UT_DEFINE_SCRIPT_METHOD().
| bool wsf::comm::NetworkManager::IsMulticastManaged | ( | const Address & | aMulticastAddress | ) | const |
True if a multicast address being utilized/managed.
Referenced by operator=().
| bool wsf::comm::NetworkManager::IsNetworkAddressManaged | ( | const Address & | aAddress | ) | const |
True if network address provided overlaps with a currently assigned network address.
References GetManagingNetworkAddress().
Referenced by AddComm(), AddNetwork(), and operator=().
| bool wsf::comm::NetworkManager::IsNetworkManaged | ( | const std::string & | aNetworkName | ) | const |
True if network with name provided present.
References GetNetwork().
Referenced by AddComm(), AddComm(), AddNetwork(), operator=(), and RemoveNetworkConnections().
| void wsf::comm::NetworkManager::ManageComm | ( | double | aSimTime, |
| Comm * | aCommPtr, | ||
| const std::string & | aNetworkName, | ||
| const Address & | aAddress, | ||
| const Address & | aNetworkAddress ) |
The user didn't specify any addressing or network usage parameters. This comm device will be automatically assigned an address within the "default" network.
Note: We should never reach this branch during normal operating conditions. If this occurs, we need to re-evaluate the number of default comm objects allowed in AFSIM, and perhaps allow it to be defined.
LEGACY SUPPORT Check if the network name is specified to local:master or local:slave and update the value accordingly.
The network name (string) was set. Provide appropriate addressing based on network information.
The network address was set. Create or join a network with that address and assign an appropriate address.
The network associated with this address doesn't exist. Attempt to create it.
Network creation failed.
Network exists. Join it and assign an address.
Address was set. Attempt to assign the comm device to that address, with the resulting network inclusion. If no network exists, one will be made using the address values.
The user defined multiple values for network and/or network assignment, resulting in ambiguous usage. Inform the user and return failure.
References AddComm(), AddNetwork(), wsf::comm::Comm::GetFullName(), GetManagingNetworkAddress(), WsfObject::GetName(), GetNetworkNameFromAddress(), wsf::comm::Address::IsNull(), wsf::comm::util::LocalMasterNetworkName(), and wsf::comm::util::LocalSlaveNetworkName().
Referenced by PlatformInitialized(), and PlatformsInitialized().
|
delete |
References NetworkManager().
|
delete |
References GetAddress(), GetAddressesInNetwork(), GetComm(), GetComms(), GetGraph(), GetManagedNetworks(), GetManagingNetworkAddress(), GetMulticastMembers(), GetNetwork(), GetNetworkNameFromAddress(), HasMulticastMember(), Initialize(), IsAddressManaged(), IsCommManaged(), IsMulticastManaged(), IsNetworkAddressManaged(), IsNetworkManaged(), NetworkManager(), PathExists(), PendingStart(), and PlatformsInitialized().
| bool wsf::comm::NetworkManager::PathExists | ( | const Address & | aSourceAddress, |
| const Address & | aDestinationAddress ) const |
Simple check of pathing from source to destination.
Referenced by getLinkedAndReachablePlatformParts(), and operator=().
|
overridevirtual |
Called in response to a call to WsfSimulation::Initialize complete and pending start state. PendingStart is typically called immediately after the simulation is initialized in the main event loop. The simulation is in its pending start state, although the extension may also add additional platforms. using WsfSimulation::AddPlatform.
Notify callbacks
Reimplemented from WsfSimulationExtension.
References CommFrameworkPendingStart, PlatformInitialized(), and WsfObserver::PlatformInitialized().
Referenced by operator=().
| void wsf::comm::NetworkManager::PlatformDeleted | ( | double | aSimTime, |
| WsfPlatform * | aPlatform ) |
Notify the observer BEFORE any action is taken.
Inform the router of the interface removal
Find the owning network, and remove the node, if possible.
References WsfComponentList::RoleIterator< T >::AtEnd(), CommFrameworkPlatformDeleted, WsfObserver::CommRemovedFromManager(), WsfPlatform::GetComponents(), and GetNetwork().
Referenced by Initialize().
| void wsf::comm::NetworkManager::PlatformInitialized | ( | double | aSimTime, |
| WsfPlatform * | aPlatform ) |
Notify callbacks
References WsfComponentList::RoleIterator< T >::AtEnd(), CommFrameworkPlatformInitialized, WsfComponentList::GetComponent(), WsfPlatform::GetComponents(), WsfObject::GetName(), InitializeUserLinks(), and ManageComm().
Referenced by PendingStart().
|
overridevirtual |
Called during WsfSimulation::Initialize, via WsfSimulation::AddInputPlatforms(), after all platforms have undergone Initialize() calls. This is called to allow any extension to perform processing that may be predicated on platforms being added to the simulation, with all platforms and components having undergone calls to Initialize(), but prior to calls to Initialize2() having been performed.
Set the router for this comm
Reimplemented from WsfSimulationExtension.
References AddNetwork(), wsf::comm::NetworkTypes::Get(), WsfObjectTypeList< T >::GetCurrentUserTypes(), WsfSimulationExtension::GetScenario(), GetSimulation(), InitializeUserLinks(), ManageComm(), wsf::comm::Network::NamedComm::mCommName, and wsf::comm::Network::NamedComm::mPlatformName.
Referenced by operator=().
| void wsf::comm::NetworkManager::RemoveComm | ( | double | aSimTIme, |
| Comm * | aCommPtr, | ||
| bool | aNotifyObserver = true ) |
References GetAddress(), and RemoveComm().
Referenced by RemoveComm(), RemoveNetwork(), wsf::comm::UT_DEFINE_SCRIPT_METHOD(), and wsf::comm::UT_DEFINE_SCRIPT_METHOD().
| void wsf::comm::NetworkManager::RemoveComm | ( | double | aSimTime, |
| const Address & | aAddress, | ||
| bool | aNotifyObserver = true ) |
Notify the observer that a node is being removed from the manager
Notify callback
Update the affected comm.
Notify the network losing the comm for internal management.
References CommRemoved, wsf::comm::Address::GetAddress(), GetComm(), GetNetwork(), GetSimulation(), RemoveConnection(), and wsf::comm::Network::RemoveMember().
| bool wsf::comm::NetworkManager::RemoveConnection | ( | double | aSimTime, |
| Comm * | aSourceCommPtr, | ||
| Comm * | aDestinationCommPtr, | ||
| bool | aNotifyObserver = true ) |
References GetAddress(), and RemoveConnection().
Referenced by RemoveComm(), and RemoveConnection().
| bool wsf::comm::NetworkManager::RemoveConnection | ( | double | aSimTime, |
| const Address & | aSourceAddress, | ||
| const Address & | aDestinationAddress, | ||
| bool | aNotifyObserver = true ) |
References ConnectionRemoved, and GetComm().
| bool wsf::comm::NetworkManager::RemoveMulticastMember | ( | double | aSimTime, |
| const Address & | aMulticastAddress, | ||
| const Address & | aLeavingMember ) |
References wsf::comm::Address::IsNull().
| void wsf::comm::NetworkManager::RemoveNetwork | ( | double | aSimTime, |
| const std::string & | aNetworkName ) |
Notify the observer of the removed network.
Notify the callback.
References GetAddressesInNetwork(), GetNetwork(), NetworkRemoved, and RemoveComm().
| bool wsf::comm::NetworkManager::RemoveNetworkConnections | ( | double | aSimTime, |
| const std::string & | aNetworkName, | ||
| bool | aNotifyObserver = true ) |
References GetAddressesInNetwork(), GetComm(), IsNetworkManaged(), and ok.
| UtCallbackListN<void(double, Comm*)> wsf::comm::NetworkManager::CommAdded {} |
| UtCallbackListN<void(double, Comm*)> wsf::comm::NetworkManager::CommDisabled {} |
Referenced by DisableComm().
| UtCallbackListN<void(double, Comm*)> wsf::comm::NetworkManager::CommEnabled {} |
Referenced by EnableComm().
| UtCallbackListN<void()> wsf::comm::NetworkManager::CommFrameworkPendingStart {} |
Allows indication that the comm framework is fully set up.
Referenced by PendingStart().
| UtCallbackListN<void(double, WsfPlatform*)> wsf::comm::NetworkManager::CommFrameworkPlatformDeleted {} |
Filtered PlatformDeleted event, called prior to the comm framework removing this platform.
Referenced by wsf::comm::router::OSPF_Area::InitializeCallbacks(), and PlatformDeleted().
| UtCallbackListN<void(double, WsfPlatform*)> wsf::comm::NetworkManager::CommFrameworkPlatformInitialized {} |
Filtered PlatformInitialized event, called after the comm framework has processed this platform.
Referenced by PlatformInitialized().
| UtCallbackListN<void(double, Comm*)> wsf::comm::NetworkManager::CommRemoved {} |
Referenced by RemoveComm().
| UtCallbackListN<void(double, const Address&, const Address&)> wsf::comm::NetworkManager::ConnectionAdded {} |
Referenced by AddConnection().
| UtCallbackListN<void(double, const Address&, const Address&)> wsf::comm::NetworkManager::ConnectionDisabled {} |
Referenced by DisableConnection().
| UtCallbackListN<void(double, const Address&, const Address&)> wsf::comm::NetworkManager::ConnectionEnabled {} |
Referenced by EnableConnection().
| UtCallbackListN<void(double, const Address&, const Address&)> wsf::comm::NetworkManager::ConnectionRemoved {} |
Referenced by RemoveConnection().
| UtCallbackListN<void(double, Network*)> wsf::comm::NetworkManager::NetworkAdded {} |
Referenced by AddNetwork().
| UtCallbackListN<void(double, Network*)> wsf::comm::NetworkManager::NetworkRemoved {} |
Referenced by RemoveNetwork().