WSF
wsf::cyber::Protect Class Reference

#include <WsfCyberProtect.hpp>

Inheritance diagram for wsf::cyber::Protect:
Collaboration diagram for wsf::cyber::Protect:

Classes

class  ProtectedAttack

Public Member Functions

 Protect (WsfScenario &aScenario)
 ~Protect () override=default
Protectoperator= (const Protect &aRhs)=delete
 Assignment operator deleted to prevent use.
Public Member Functions inherited from WsfObject
 WsfObject ()
 This is the constructor for the WsfObject class.
 ~WsfObject () override
 This is the destructor for the WsfObject class.
const char * GetScriptClassName () const override
const std::string & GetType () const
WsfStringId GetTypeId () const
 Get the string ID of the 'type' of the object.
void SetType (WsfStringId aType)
const std::string & GetBaseType () const
WsfStringId GetBaseTypeId () const
const TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (const WsfObject &aRhs)
 Assignment operator.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)
Public Member Functions inherited from WsfSimpleComponentT< WsfPlatformComponent >
 WsfSimpleComponentT ()=default
 Empty constructor for serialization.
 WsfSimpleComponentT (int aRole, WsfStringId aName)
 WsfSimpleComponentT (int aRole)
 WsfSimpleComponentT (WsfStringId aName)
 WsfSimpleComponentT (const WsfSimpleComponentT &aSrc)
WsfSimpleComponentToperator= (const WsfSimpleComponentT &aRhs)
 ~WsfSimpleComponentT () override=default
WsfStringId GetComponentName () const override
const int * GetComponentRoles () const override
Public Member Functions inherited from WsfComponentT< WsfPlatform >
 WsfComponentT ()
 WsfComponentT (const WsfComponentT &) noexcept
WsfComponentToperator= (const WsfComponentT &) noexcept
 ~WsfComponentT () override=default
ParentTypeGetComponentParent () const
void SetComponentParent (ParentType *aParentPtr)
Public Member Functions inherited from WsfComponent
virtual ~WsfComponent ()=default
virtual int GetComponentInitializationOrder () const
template<typename T>
bool QueryInterfaceT (T *&aRolePtr)
bool ComponentHasRole (int aRole)
 Returns true if the component has the specified role.
virtual bool PreInitialize (double aSimTime)
virtual bool Initialize2 (double aSimTime)
virtual void PreInput ()
Public Member Functions inherited from WsfNamed
 WsfNamed ()
 WsfNamed (WsfStringId aName)
 WsfNamed (const WsfNamed &)=default
WsfNamedoperator= (const WsfNamed &)=default
virtual ~WsfNamed ()=default
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)

Static Public Member Functions

static ProtectFind (const WsfPlatform &aPlatform)
static void RegisterComponentFactory (WsfScenario &aScenario)

Definitions to support internal ProtectedAttack container usage

using ProtectedAttackList = std::vector<ProtectedAttack>
using ProtectedAttackListIt = std::vector<ProtectedAttack>::const_iterator
using ProtectedAttackListNonConstIt = std::vector<ProtectedAttack>::iterator

Component infrastructure methods

WsfComponentCloneComponent () const override
void * QueryInterface (int aRole) override
void ComponentParentChanged (WsfPlatform *aPlatformPtr) override

Common infrastructure methods.

ProtectClone () const override
bool Initialize (double aSimTime) override
bool ProcessInput (UtInput &aInput) override

DefaultExists method

Returns true if the cyber protect object has a default defined

bool DefaultExists () const

ProtectionExists method

Returns true if a specific named attack provided in the argument has a corresponding protection entry in the object

bool ProtectionExists (const std::string &aAttackName) const

Cyber Protect query/inspection methods

double GetProbabilityOfScanDetection (const std::string &aAttackName) const
double GetProbabilityOfScanAttribution (const std::string &aAttackName) const
double GetProbabilityOfAttackSuccess (const std::string &aAttackName) const
double GetProbabilityOfStatusReport (const std::string &aAttackName) const
double GetProbabilityOfAttackDetection (const std::string &aAttackName) const
double GetProbabilityOfAttackAttribution (const std::string &aAttackName) const
double GetProbabilityOfFutureImmunity (const std::string &aAttackName) const
double DetectionDelayTime (const std::string &aAttackName) const
double RecoveryDelayTime (const std::string &aAttackName) const
double LastDetectionDelayTime (const std::string &aAttackName) const
double LastRecoveryDelayTime (const std::string &aAttackName) const
bool DoRestore (const std::string &aAttackName) const
bool IsImmune (const std::string &aAttackName) const

User-defined script method execution

void ExecuteOnAttackDetection (Engagement &aEngagement, double aSimTime)
void ExecuteOnAttackRecovery (Engagement &aEngagement, double aSimTime)
void ExecuteOnScanDetection (Engagement &aEngagement, double aSimTime)
bool ExecuteIsVulnerable (Engagement &aEngagement, double aSimTime, bool &aWasRun)

Immunity Mutator

Set the immunity for this component

void SetImmune (const std::string &aNamedAttack)
WsfScriptContextGetScriptContext ()
UtScriptContext * GetScriptAccessibleContext () const override
 Protect (const Protect &aSrc)

Additional Inherited Members

Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.
Public Types inherited from WsfComponentT< WsfPlatform >
typedef WsfPlatform ParentType
 This is needed to support the WsfComponentList template.
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).
int mRoles [2]

Detailed Description

Platform component for cyber warfare.

This defines a platform component that implements the modeling of cyber warfare against the platform.

Member Typedef Documentation

◆ ProtectedAttackList

◆ ProtectedAttackListIt

using wsf::cyber::Protect::ProtectedAttackListIt = std::vector<ProtectedAttack>::const_iterator
protected

◆ ProtectedAttackListNonConstIt

using wsf::cyber::Protect::ProtectedAttackListNonConstIt = std::vector<ProtectedAttack>::iterator
protected

Constructor & Destructor Documentation

◆ Protect() [1/2]

wsf::cyber::Protect::Protect ( WsfScenario & aScenario)

◆ ~Protect()

wsf::cyber::Protect::~Protect ( )
overridedefault

◆ Protect() [2/2]

wsf::cyber::Protect::Protect ( const Protect & aSrc)
protected

Member Function Documentation

◆ Clone()

Protect * wsf::cyber::Protect::Clone ( ) const
overridevirtual

Return a copy of this object. Must be implemented by all derived types. If cloning is impossible, a WsfUncloneableException should be thrown.

Implements WsfObject.

References Protect().

Referenced by CloneComponent().

◆ CloneComponent()

WsfComponent * wsf::cyber::Protect::CloneComponent ( ) const
inlineoverridevirtual

Clones a component. May return null if component does not support clone.

Implements WsfComponent.

References Clone().

◆ ComponentParentChanged()

void wsf::cyber::Protect::ComponentParentChanged ( WsfPlatform * aParentPtr)
inlineoverridevirtual

The parent to which the component is attached has been updated. This virtual method is called whenever the components parent attachment has been changed. This is provided so derived class receives notification of the change.

Parameters
aParentPtrPointer to the new parent. The new parent may be null if the attachment was severed.

Reimplemented from WsfComponentT< WsfPlatform >.

◆ DefaultExists()

bool wsf::cyber::Protect::DefaultExists ( ) const
inline

◆ DetectionDelayTime()

double wsf::cyber::Protect::DetectionDelayTime ( const std::string & aAttackName) const

◆ DoRestore()

bool wsf::cyber::Protect::DoRestore ( const std::string & aAttackName) const

◆ ExecuteIsVulnerable()

bool wsf::cyber::Protect::ExecuteIsVulnerable ( Engagement & aEngagement,
double aSimTime,
bool & aWasRun )

◆ ExecuteOnAttackDetection()

void wsf::cyber::Protect::ExecuteOnAttackDetection ( Engagement & aEngagement,
double aSimTime )

◆ ExecuteOnAttackRecovery()

void wsf::cyber::Protect::ExecuteOnAttackRecovery ( Engagement & aEngagement,
double aSimTime )

◆ ExecuteOnScanDetection()

void wsf::cyber::Protect::ExecuteOnScanDetection ( Engagement & aEngagement,
double aSimTime )

◆ Find()

Protect * wsf::cyber::Protect::Find ( const WsfPlatform & aPlatform)
static

◆ GetProbabilityOfAttackAttribution()

double wsf::cyber::Protect::GetProbabilityOfAttackAttribution ( const std::string & aAttackName) const

◆ GetProbabilityOfAttackDetection()

double wsf::cyber::Protect::GetProbabilityOfAttackDetection ( const std::string & aAttackName) const

◆ GetProbabilityOfAttackSuccess()

double wsf::cyber::Protect::GetProbabilityOfAttackSuccess ( const std::string & aAttackName) const

◆ GetProbabilityOfFutureImmunity()

double wsf::cyber::Protect::GetProbabilityOfFutureImmunity ( const std::string & aAttackName) const

◆ GetProbabilityOfScanAttribution()

double wsf::cyber::Protect::GetProbabilityOfScanAttribution ( const std::string & aAttackName) const

◆ GetProbabilityOfScanDetection()

double wsf::cyber::Protect::GetProbabilityOfScanDetection ( const std::string & aAttackName) const

◆ GetProbabilityOfStatusReport()

double wsf::cyber::Protect::GetProbabilityOfStatusReport ( const std::string & aAttackName) const

◆ GetScriptAccessibleContext()

UtScriptContext * wsf::cyber::Protect::GetScriptAccessibleContext ( ) const
inlineoverride

◆ GetScriptContext()

WsfScriptContext & wsf::cyber::Protect::GetScriptContext ( )
inline

Referenced by Protect().

◆ Initialize()

bool wsf::cyber::Protect::Initialize ( double aSimTime)
overridevirtual

Perform phase 1 initialization. This is called by WsfPlatform::Initialize() during phase 1 initialization of the platform. The component should complete validation of input data that could not be done by ProcessInput, as well as any other functions to prepare for simulation use (subject to the next paragraph).

The order in which components are initialized is defined by GetComponentInitializationOrder. In general a component implementation of this method should not be dependent on the state of another component, i.e.: it should not assume that the other components Initialize() method has been called. If such a dependency exists one should use Initialize2() if possible, or specify a value GetComponentInitializationOrder to force things to initialize in a particular order.

Parameters
aSimTimeThe current simulation time.
Returns
true if successful or false if unsuccessful (bad input data, etc.)
Note
This method should NOT add any other components to the platform. This MUST be done in PreInitialize().

Reimplemented from WsfComponent.

References ok.

◆ IsImmune()

bool wsf::cyber::Protect::IsImmune ( const std::string & aAttackName) const

◆ LastDetectionDelayTime()

double wsf::cyber::Protect::LastDetectionDelayTime ( const std::string & aAttackName) const

◆ LastRecoveryDelayTime()

double wsf::cyber::Protect::LastRecoveryDelayTime ( const std::string & aAttackName) const

◆ operator=()

Protect & wsf::cyber::Protect::operator= ( const Protect & aRhs)
delete

Assignment operator deleted to prevent use.

References Protect().

◆ ProcessInput()

bool wsf::cyber::Protect::ProcessInput ( UtInput & aInput)
overridevirtual

Process input from a generic source.

Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.

Parameters
aInputa reference to a UtInput object.
Returns
'true' if the command was one recognized by the class or 'false' if not.
Exceptions
UtInput::ExceptionBase(or an object derived from it) if the command was recognized but contains some sort of error.
Note
If a derived class does not recognize the command (i.e.: the return value is false) then it should call the base class ProcessInput method. This chain should continue until either the command is recognized or the top-level base class is encountered.

Reimplemented from WsfObject.

References WsfNamed::GetName(), wsf::cyber::Protect::ProtectedAttack::ProcessInput(), and WsfObject::ProcessInput().

◆ ProtectionExists()

bool wsf::cyber::Protect::ProtectionExists ( const std::string & aAttackName) const

◆ QueryInterface()

void * wsf::cyber::Protect::QueryInterface ( int aRole)
inlineoverridevirtual

Requests a component's role interface. A component can support one or more roles.

Parameters
aRoleThe role whose interface is to be returned.
Returns
A pointer to the object if it supports the indicated role, or 'null' if it does not. Usage: WsfProcessor* procPtrOrNull = (WsfProcessor*)componentPtr->QueryComponentInterface(cWSF_COMPONENT_PROCESSOR);

Implements WsfComponent.

References WsfSimpleComponentT< WsfPlatformComponent >::mRoles.

◆ RecoveryDelayTime()

double wsf::cyber::Protect::RecoveryDelayTime ( const std::string & aAttackName) const

◆ RegisterComponentFactory()

void wsf::cyber::Protect::RegisterComponentFactory ( WsfScenario & aScenario)
static

◆ SetImmune()

void wsf::cyber::Protect::SetImmune ( const std::string & aNamedAttack)
inline

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved