KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IO_Action_PDU.h
Go to the documentation of this file.
1 /*********************************************************************
2 
3 Copyright 2013 Karl Jones
4 All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8 
9 1. Redistributions of source code must retain the above copyright notice, this
10  list of conditions and the following disclaimer.
11 2. Redistributions in binary form must reproduce the above copyright notice,
12  this list of conditions and the following disclaimer in the documentation
13  and/or other materials provided with the distribution.
14 
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 For Further Information Please Contact me at
27 Karljj1@yahoo.com
28 http://p.sf.net/kdis/UserGuide
29 *********************************************************************/
30 
31 /********************************************************************
32  class: IO_Action_PDU
33  DIS: (7) 1278.1-2012
34  created: 12/11/2010
35  author: Karl Jones
36 
37  purpose: The information operations effects on a communications network
38  shall be conveyed using the Information Operations Action PDU.
39  This PDU may either be an order that affected IO simulations
40  are required to accept and process regarding the IO affect on
41  their system and communications network or may be a report of
42  an IO effect initiated or terminated, or may provide the sender's
43  perception of the effect of an IO attack.
44  An IO simulation modeling a system or communications network uses
45  the data in the IO Action PDU to affect the model's behavior.
46  Size: 448 bits / 56 octets - min size not including standard variables
47 *********************************************************************/
48 
49 #pragma once
50 
51 #include "./IO_Header.h"
52 
53 // Standard Variable Records
54 #include "./../../DataTypes/IOCommunicationsNode.h"
55 #include "./../../DataTypes/IOEffect.h"
56 
57 namespace KDIS {
58 namespace PDU {
59 
61 {
62 protected:
63 
65 
67 
69 
71 
73 
75 
77 
79 
81 
83 
85 
86  std::vector<KDIS::DATA_TYPE::StdVarPtr> m_vStdVarRecs;
87 
88 public:
89 
90  static const KUINT16 IO_ACTION_PDU_SIZE = 56;
91 
92  IO_Action_PDU();
93 
94  IO_Action_PDU( KDataStream & stream ) throw( KException );
95 
96  IO_Action_PDU( const Header & H, KDataStream & stream ) throw( KException );
97 
101 
102  virtual ~IO_Action_PDU();
103 
104  //************************************
105  // FullName: KDIS::PDU::IO_Action_PDU::SetReceivingEntityID
106  // KDIS::PDU::IO_Action_PDU::GetReceivingEntityID
107  //!Description: Receiving Entity ID.
108  //! The simulation to which this PDU is addressed,
109  //! if applicable.
110  // Parameter: const EntityIdentifier & ID
111  //************************************
112  void SetReceivingEntityID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
113  const KDIS::DATA_TYPE::EntityIdentifier & GetReceivingEntityID() const;
114  KDIS::DATA_TYPE::EntityIdentifier & GetReceivingEntityID();
115 
116  //************************************
117  // FullName: KDIS::PDU::IO_Action_PDU::SetRequestID
118  // KDIS::PDU::IO_Action_PDU::GetRequestID
119  //!Description: Request ID. The request number for this IO Action PDU.
120  // Parameter: KUINT32 ID
121  //************************************
122  void SetRequestID( KUINT32 ID );
123  KUINT32 GetRequestID() const;
124 
125  //************************************
126  // FullName: KDIS::PDU::IO_Action_PDU::SetWarfareType
127  // KDIS::PDU::IO_Action_PDU::GetWarfareType
128  //!Description: Identifies the type of IO warfare.
129  // Parameter: WarfareType WT
130  //************************************
131  void SetWarfareType( KDIS::DATA_TYPE::ENUMS::WarfareType WT );
132  KDIS::DATA_TYPE::ENUMS::WarfareType GetWarfareType() const;
133 
134  //************************************
135  // FullName: KDIS::PDU::IO_Action_PDU::SetSimulationSource
136  // KDIS::PDU::IO_Action_PDU::GetSimulationSource
137  //!Description: Identifies the name of the simulation model issuing this PDU.
138  //! 0 No statement.
139  //! 1-200 Reserved for future Io simulation sources.
140  //! 201-255 Reserved for United States IO Simulation Sources �
141  //! See applicable agreement or the organizers of the event
142  //! (training, exercise, etc) in which information operations
143  //! is included.
144  // Parameter: KUINT16 SS
145  //************************************
146  void SetSimulationSource( KUINT16 SS );
147  KUINT16 GetSimulationSource() const;
148 
149  //************************************
150  // FullName: KDIS::PDU::IO_Action_PDU::SetActionType
151  // KDIS::PDU::IO_Action_PDU::GetActionType
152  //!Description: Identifies the type of IO action.
153  // Parameter: ActionType AT
154  //************************************
155  void SetActionType( KDIS::DATA_TYPE::ENUMS::ActionType AT );
156  KDIS::DATA_TYPE::ENUMS::ActionType GetActionType() const;
157 
158  //************************************
159  // FullName: KDIS::PDU::IO_Action_PDU::SetActionPhase
160  // KDIS::PDU::IO_Action_PDU::GetActionPhase
161  //!Description: Identifies the Phase of IO action.
162  // Parameter: ActionPhase AP
163  //************************************
164  void SetActionPhase( KDIS::DATA_TYPE::ENUMS::ActionPhase AP );
165  KDIS::DATA_TYPE::ENUMS::ActionPhase GetActionPhase() const;
166 
167  //************************************
168  // FullName: KDIS::PDU::IO_Action_PDU::SetAttackerEntityID
169  // KDIS::PDU::IO_Action_PDU::GetAttackerEntityID
170  //!Description: Identifies the IO Attacker Entity ID.
171  // Parameter: const EntityIdentifier & ID
172  //************************************
173  void SetAttackerEntityID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
174  const KDIS::DATA_TYPE::EntityIdentifier & GetAttackerEntityID() const;
175  KDIS::DATA_TYPE::EntityIdentifier & GetAttackerEntityID();
176 
177  //************************************
178  // FullName: KDIS::PDU::IO_Action_PDU::SetPrimaryTargetEntityID
179  // KDIS::PDU::IO_Action_PDU::GetPrimaryTargetEntityID
180  //!Description: Identifies the IO Primary Target Entity ID.
181  // Parameter: const EntityIdentifier & ID
182  //************************************
183  void SetPrimaryTargetEntityID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
184  const KDIS::DATA_TYPE::EntityIdentifier & GetPrimaryTargetEntityID() const;
185  KDIS::DATA_TYPE::EntityIdentifier & GetPrimaryTargetEntityID();
186 
187  //************************************
188  // FullName: KDIS::PDU::IO_Action_PDU::GetNumberOfIORecords
189  //!Description: Indicates the number of IO standard variable records included.
190  //************************************
191  KUINT16 GetNumberOfIORecords() const;
192 
193  //************************************
194  // FullName: KDIS::PDU::IO_Action_PDU::AddStandardVariableRecord
195  // KDIS::PDU::IO_Action_PDU::SetStandardVariableRecords
196  // KDIS::PDU::IO_Action_PDU::GetStandardVariableRecords
197  // KDIS::PDU::IO_Action_PDU::ClearStandardVariableRecords
198  //!Description: The following Standard Records currently exist:
199  //! - IOCommunicationsNode
200  //! - IOEffect
201  // Parameter: StdVarPtr SVR, const vector<StdVarPtr> & SVR
202  //************************************
203  void AddStandardVariableRecord( KDIS::DATA_TYPE::StdVarPtr SVR );
204  void SetStandardVariableRecords( const std::vector<KDIS::DATA_TYPE::StdVarPtr> & SVR );
205  const std::vector<KDIS::DATA_TYPE::StdVarPtr> & GetStandardVariableRecords() const;
206  void ClearStandardVariableRecords();
207 
208  //************************************
209  // FullName: KDIS::PDU::IO_Action_PDU::GetAsString
210  //!Description: Returns a string representation of the PDU.
211  //************************************
212  virtual KString GetAsString() const;
213 
214  //************************************
215  // FullName: KDIS::PDU::IO_Action_PDU::Decode
216  //!Description: Convert From Network Data.
217  // Parameter: KDataStream & stream
218  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
219  //************************************
220  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
221 
222  //************************************
223  // FullName: KDIS::PDU::IO_Action_PDU::Encode
224  //!Description: Convert To Network Data.
225  // Parameter: KDataStream & stream
226  //************************************
227  virtual KDataStream Encode() const;
228  virtual void Encode( KDataStream & stream ) const;
229 
230  KBOOL operator == ( const IO_Action_PDU & Value ) const;
231  KBOOL operator != ( const IO_Action_PDU & Value ) const;
232 };
233 
234 } // END namespace PDU
235 } // END namespace KDIS
unsigned int KUINT32
Definition: KDefines.h:103
KUINT16 m_ui16WrTyp
Definition: IO_Action_PDU.h:68
KDIS::DATA_TYPE::EntityIdentifier m_AtkEntityID
Definition: IO_Action_PDU.h:78
KUINT32 m_ui32ReqId
Definition: IO_Action_PDU.h:66
KDIS::DATA_TYPE::EntityIdentifier m_TgtEntityID
Definition: IO_Action_PDU.h:80
KUINT32 m_ui32Padding
Definition: IO_Action_PDU.h:76
unsigned short int KUINT16
Definition: KDefines.h:101
WarfareType
Definition: EnumInformationOperations.h:53
KUINT16 m_ui16SimSrc
Definition: IO_Action_PDU.h:70
ActionType
Definition: EnumInformationOperations.h:76
KUINT16 m_ui16ActTyp
Definition: IO_Action_PDU.h:72
KUINT16 m_ui16ActPhs
Definition: IO_Action_PDU.h:74
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: IO_Header.h:58
KUINT16 m_ui16NumStdVarRec
Definition: IO_Action_PDU.h:84
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
Definition: IO_Action_PDU.h:60
Definition: EntityIdentifier.h:49
KUINT16 m_ui16Padding
Definition: IO_Action_PDU.h:82
std::vector< KDIS::DATA_TYPE::StdVarPtr > m_vStdVarRecs
Definition: IO_Action_PDU.h:86
Definition: Header7.h:142
KDIS::DATA_TYPE::EntityIdentifier m_RecEntityID
Definition: IO_Action_PDU.h:64
ActionPhase
Definition: EnumInformationOperations.h:95
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: KRef_Ptr.h:73