KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IO_Report_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_Report_PDU
33  DIS: (7) 1278.1-2012
34  created: 20/01/2011
35  author: Karl Jones
36 
37  purpose: The information operations status of an entity shall be
38  conveyed using the Information Operations Report PDU.
39  This includes reporting the status of any entities
40  and their associated equipment that are susceptible to
41  an IO attack.
42  Size: 320 bits / 40 octets - min size not including standard variables
43 *********************************************************************/
44 
45 #pragma once
46 
47 #include "./IO_Header.h"
48 
49 // Standard Variable Records
50 #include "./../../DataTypes/IOCommunicationsNode.h"
51 #include "./../../DataTypes/IOEffect.h"
52 
53 namespace KDIS {
54 namespace PDU {
55 
57 {
58 protected:
59 
61 
63 
65 
67 
68  KUINT32 m_ui32Padding; // 2 * KUINT16 padding in 1278.1-2012 standard.
69 
71 
72  std::vector<KDIS::DATA_TYPE::StdVarPtr> m_vStdVarRecs;
73 
74 public:
75 
76  static const KUINT16 IO_REPORT_PDU_SIZE = 40;
77 
78  IO_Report_PDU();
79 
80  IO_Report_PDU( KDataStream & stream ) throw( KException );
81 
82  IO_Report_PDU( const Header & H, KDataStream & stream ) throw( KException );
83 
86 
87  virtual ~IO_Report_PDU();
88 
89  //************************************
90  // FullName: KDIS::PDU::IO_Report_PDU::SetSimulationSource
91  // KDIS::PDU::IO_Report_PDU::GetSimulationSource
92  //!Description: Identifies the name of the simulation model issuing this PDU.
93  //! 0 No statement.
94  //! 1-200 Reserved for future Io simulation sources.
95  //! 201-255 Reserved for United States IO Simulation Sources �
96  //! See applicable agreement or the organizers of the event
97  //! (training, exercise, etc) in which information operations
98  //! is included.
99  // Parameter: KUINT16 SS
100  //************************************
101  void SetSimulationSource( KUINT16 SS );
102  KUINT16 GetSimulationSource() const;
103 
104  //************************************
105  // FullName: KDIS::PDU::IO_Report_PDU::SetReportType
106  // KDIS::PDU::IO_Report_PDU::GetReportType
107  //!Description: The type of report this PDU represents.
108  // Parameter: IOReportType RT
109  //************************************
110  void SetReportType( KDIS::DATA_TYPE::ENUMS::IOReportType RT );
111  KDIS::DATA_TYPE::ENUMS::IOReportType GetReportType() const;
112 
113  //************************************
114  // FullName: KDIS::PDU::IO_Report_PDU::SetAttackerEntityID
115  // KDIS::PDU::IO_Report_PDU::GetAttackerEntityID
116  //!Description: Identifies the IO Attacker Entity ID.
117  // Parameter: const EntityIdentifier & ID
118  //************************************
119  void SetAttackerEntityID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
120  const KDIS::DATA_TYPE::EntityIdentifier & GetAttackerEntityID() const;
121  KDIS::DATA_TYPE::EntityIdentifier & GetAttackerEntityID();
122 
123  //************************************
124  // FullName: KDIS::PDU::IO_Report_PDU::SetPrimaryTargetEntityID
125  // KDIS::PDU::IO_Report_PDU::GetPrimaryTargetEntityID
126  //!Description: Identifies the IO Primary Target Entity ID.
127  // Parameter: const EntityIdentifier & ID
128  //************************************
129  void SetPrimaryTargetEntityID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
130  const KDIS::DATA_TYPE::EntityIdentifier & GetPrimaryTargetEntityID() const;
131  KDIS::DATA_TYPE::EntityIdentifier & GetPrimaryTargetEntityID();
132 
133  //************************************
134  // FullName: KDIS::PDU::IO_Report_PDU::GetNumberOfIORecords
135  //!Description: Indicates the number of IO standard variable records included.
136  //************************************
137  KUINT16 GetNumberOfIORecords() const;
138 
139  //************************************
140  // FullName: KDIS::PDU::IO_Report_PDU::AddStandardVariableRecord
141  // KDIS::PDU::IO_Report_PDU::SetStandardVariableRecords
142  // KDIS::PDU::IO_Report_PDU::GetStandardVariableRecords
143  // KDIS::PDU::IO_Report_PDU::ClearStandardVariableRecords
144  //!Description: The following Standard Records currently exist:
145  //! - IOCommunicationsNode
146  //! - IOEffect
147  // Parameter: StdVarPtr SVR, const vector<StdVarPtr> & SVR
148  //************************************
149  void AddStandardVariableRecord( KDIS::DATA_TYPE::StdVarPtr SVR );
150  void SetStandardVariableRecords( const std::vector<KDIS::DATA_TYPE::StdVarPtr> & SVR );
151  const std::vector<KDIS::DATA_TYPE::StdVarPtr> & GetStandardVariableRecords() const;
152  void ClearStandardVariableRecords();
153 
154  //************************************
155  // FullName: KDIS::PDU::IO_Report_PDU::GetAsString
156  //!Description: Returns a string representation of the PDU.
157  //************************************
158  virtual KString GetAsString() const;
159 
160  //************************************
161  // FullName: KDIS::PDU::IO_Report_PDU::Decode
162  //!Description: Convert From Network Data.
163  // Parameter: KDataStream & stream
164  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
165  //************************************
166  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
167 
168  //************************************
169  // FullName: KDIS::PDU::IO_Report_PDU::Encode
170  //!Description: Convert To Network Data.
171  // Parameter: KDataStream & stream
172  //************************************
173  virtual KDataStream Encode() const;
174  virtual void Encode( KDataStream & stream ) const;
175 
176  KBOOL operator == ( const IO_Report_PDU & Value ) const;
177  KBOOL operator != ( const IO_Report_PDU & Value ) const;
178 };
179 
180 } // END namespace PDU
181 } // END namespace KDIS
unsigned int KUINT32
Definition: KDefines.h:103
Definition: IO_Report_PDU.h:56
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT16 m_ui16NumStdVarRec
Definition: IO_Report_PDU.h:70
std::vector< KDIS::DATA_TYPE::StdVarPtr > m_vStdVarRecs
Definition: IO_Report_PDU.h:72
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: IO_Header.h:58
bool KBOOL
Definition: KDefines.h:119
KUINT8 m_ui8RptTyp
Definition: IO_Report_PDU.h:62
KDIS::DATA_TYPE::EntityIdentifier m_TgtEntityID
Definition: IO_Report_PDU.h:66
std::string KString
Definition: KDefines.h:116
Definition: EntityIdentifier.h:49
KDIS::DATA_TYPE::EntityIdentifier m_AtkEntityID
Definition: IO_Report_PDU.h:64
Definition: Header7.h:142
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT16 m_ui16SimSrc
Definition: IO_Report_PDU.h:60
Definition: KRef_Ptr.h:73
IOReportType
Definition: EnumInformationOperations.h:227
KUINT32 m_ui32Padding
Definition: IO_Report_PDU.h:68