1 /*********************************************************************
3 Copyright 2013 Karl Jones
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
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.
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.
26 For Further Information Please Contact me at
28 http://p.sf.net/kdis/UserGuide
29 *********************************************************************/
31 /********************************************************************
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
42 Size: 320 bits / 40 octets - min size not including standard variables
43 *********************************************************************/
47 #include "./IO_Header.h"
49 // Standard Variable Records
50 #include "./../../DataTypes/IOCommunicationsNode.h"
51 #include "./../../DataTypes/IOEffect.h"
56 class KDIS_EXPORT IO_Report_PDU
: public IO_Header
66 KDIS::DATA_TYPE::EntityIdentifier m_AtkEntityID
;
68 KDIS::DATA_TYPE::EntityIdentifier m_TgtEntityID
;
70 KUINT32 m_ui32Padding
; // 2 * KUINT16 padding in 1278.1-2012 standard.
72 KUINT16 m_ui16NumStdVarRec
;
74 std::vector
<KDIS::DATA_TYPE::StdVarPtr
> m_vStdVarRecs
;
78 static const KUINT16 IO_REPORT_PDU_SIZE
= 40;
82 IO_Report_PDU( KDataStream
& stream
) ;
84 IO_Report_PDU( const Header
& H
, KDataStream
& stream
) ;
86 IO_Report_PDU( const KDIS::DATA_TYPE::EntityIdentifier
& OrigID
, KUINT16 SimSrc
, KDIS::DATA_TYPE::ENUMS::IOReportType RT
,
87 const KDIS::DATA_TYPE::EntityIdentifier
& AtkID
, const KDIS::DATA_TYPE::EntityIdentifier
& TgtID
);
89 virtual ~IO_Report_PDU();
91 //************************************
92 // FullName: KDIS::PDU::IO_Report_PDU::SetSimulationSource
93 // KDIS::PDU::IO_Report_PDU::GetSimulationSource
94 // Description: Identifies the name of the simulation model issuing this PDU.
96 // 1-200 Reserved for future Io simulation sources.
97 // 201-255 Reserved for United States IO Simulation Sources –
98 // See applicable agreement or the organizers of the event
99 // (training, exercise, etc) in which information operations
101 // Parameter: KUINT16 SS
102 //************************************
103 void SetSimulationSource( KUINT16 SS
);
104 KUINT16
GetSimulationSource() const;
106 //************************************
107 // FullName: KDIS::PDU::IO_Report_PDU::SetReportType
108 // KDIS::PDU::IO_Report_PDU::GetReportType
109 // Description: The type of report this PDU represents.
110 // Parameter: IOReportType RT
111 //************************************
112 void SetReportType( KDIS::DATA_TYPE::ENUMS::IOReportType RT
);
113 KDIS::DATA_TYPE::ENUMS::IOReportType
GetReportType() const;
115 //************************************
116 // FullName: KDIS::PDU::IO_Report_PDU::SetAttackerEntityID
117 // KDIS::PDU::IO_Report_PDU::GetAttackerEntityID
118 // Description: Identifies the IO Attacker Entity ID.
119 // Parameter: const EntityIdentifier & ID
120 //************************************
121 void SetAttackerEntityID( const KDIS::DATA_TYPE::EntityIdentifier
& ID
);
122 const KDIS::DATA_TYPE::EntityIdentifier
& GetAttackerEntityID() const;
123 KDIS::DATA_TYPE::EntityIdentifier
& GetAttackerEntityID();
125 //************************************
126 // FullName: KDIS::PDU::IO_Report_PDU::SetPrimaryTargetEntityID
127 // KDIS::PDU::IO_Report_PDU::GetPrimaryTargetEntityID
128 // Description: Identifies the IO Primary Target Entity ID.
129 // Parameter: const EntityIdentifier & ID
130 //************************************
131 void SetPrimaryTargetEntityID( const KDIS::DATA_TYPE::EntityIdentifier
& ID
);
132 const KDIS::DATA_TYPE::EntityIdentifier
& GetPrimaryTargetEntityID() const;
133 KDIS::DATA_TYPE::EntityIdentifier
& GetPrimaryTargetEntityID();
135 //************************************
136 // FullName: KDIS::PDU::IO_Report_PDU::GetNumberOfIORecords
137 // Description: Indicates the number of IO standard variable records included.
138 //************************************
139 KUINT16
GetNumberOfIORecords() const;
141 //************************************
142 // FullName: KDIS::PDU::IO_Report_PDU::AddStandardVariableRecord
143 // KDIS::PDU::IO_Report_PDU::SetStandardVariableRecords
144 // KDIS::PDU::IO_Report_PDU::GetStandardVariableRecords
145 // KDIS::PDU::IO_Report_PDU::ClearStandardVariableRecords
146 // Description: The following Standard Records currently exist:
147 // - IOCommunicationsNode
149 // Parameter: StdVarPtr SVR, const vector<StdVarPtr> & SVR
150 //************************************
151 void AddStandardVariableRecord( KDIS::DATA_TYPE::StdVarPtr SVR
);
152 void SetStandardVariableRecords( const std::vector
<KDIS::DATA_TYPE::StdVarPtr
> & SVR
);
153 const std::vector
<KDIS::DATA_TYPE::StdVarPtr
> & GetStandardVariableRecords() const;
154 void ClearStandardVariableRecords();
156 //************************************
157 // FullName: KDIS::PDU::IO_Report_PDU::GetAsString
158 // Description: Returns a string representation of the PDU.
159 //************************************
160 virtual KString
GetAsString() const;
162 //************************************
163 // FullName: KDIS::PDU::IO_Report_PDU::Decode
164 // Description: Convert From Network Data.
165 // Parameter: KDataStream & stream
166 // Parameter: bool ignoreHeader = false - Decode the header from the stream?
167 //************************************
168 virtual void Decode( KDataStream
& stream
, bool ignoreHeader
= false ) ;
170 //************************************
171 // FullName: KDIS::PDU::IO_Report_PDU::Encode
172 // Description: Convert To Network Data.
173 // Parameter: KDataStream & stream
174 //************************************
175 virtual KDataStream
Encode() const;
176 virtual void Encode( KDataStream
& stream
) const;
178 KBOOL
operator == ( const IO_Report_PDU
& Value
) const;
179 KBOOL
operator != ( const IO_Report_PDU
& Value
) const;
182 } // END namespace PDU
183 } // END namespace KDIS