1 /*********************************************************************
2 Copyright 2013 Karl Jones
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
8 1. Redistributions of source code must retain the above copyright notice, this
9 list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright notice,
11 this list of conditions and the following disclaimer in the documentation
12 and/or other materials provided with the distribution.
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 For Further Information Please Contact me at
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
30 /********************************************************************
32 DIS: (6) 1278.1a - 1998
36 purpose: Header for all PDU's from the Live Entity (LE) Family.
38 size: 128 bits / 16 octets
39 *********************************************************************/
43 #include "./../Header.h"
44 #include "./../../DataTypes/LE_EntityIdentifier.h"
49 class KDIS_EXPORT LE_Header
: public Header
53 KDIS::DATA_TYPE::LE_EntityIdentifier m_EntID
;
57 static const KUINT16 LE_HEADER_SIZE
= 16;
61 explicit LE_Header( const Header
& H
);
63 LE_Header( KDataStream
& stream
) ;
65 LE_Header( const Header
& H
, KDataStream
& stream
) ;
69 //************************************
70 // FullName: KDIS::PDU::LE_Header::SetLiveEntityID
71 // KDIS::PDU::LE_Header::GetLiveEntityID
72 // Description: Identifies the entity issuing the PDU.
73 // Parameter: const LE_EntityIdentifier & ID
74 //************************************
75 void SetLiveEntityID( const KDIS::DATA_TYPE::LE_EntityIdentifier
& ID
);
76 const KDIS::DATA_TYPE::LE_EntityIdentifier
& GetLiveEntityID() const;
77 KDIS::DATA_TYPE::LE_EntityIdentifier
& GetLiveEntityID();
79 //************************************
80 // FullName: KDIS::PDU::LE_Header::SetSubprotocol
81 // KDIS::PDU::LE_Header::GetSubprotocol
82 // Description: This field shall specify the sub protocol to be used to decode the PDU.
83 // The value of zero is reserved for PDUs complying to the published standard.
84 // Parameter: KUINT8 S
85 //************************************
86 void SetSubprotocol( KUINT8 S
);
87 KUINT8
GetSubprotocol() const;
89 //************************************
90 // FullName: KDIS::PDU::LE_Header::GetAsString
91 // Description: Returns a string representation of the PDU
92 //************************************
93 virtual KString
GetAsString() const;
95 //************************************
96 // FullName: KDIS::PDU::LE_Header::Decode
97 // Description: Convert From Network Data.
98 // Parameter: KDataStream & stream
99 // Parameter: bool ignoreHeader = false - Decode the header from the stream?
100 //************************************
101 virtual void Decode( KDataStream
& stream
, bool ignoreHeader
= false ) ;
103 //************************************
104 // FullName: KDIS::PDU::LE_Header::Encode
105 // Description: Convert To Network Data.
106 // Parameter: KDataStream & stream
107 //************************************
108 virtual KDataStream
Encode() const;
109 virtual void Encode( KDataStream
& stream
) const;
111 KBOOL
operator == ( const LE_Header
& Value
) const;
112 KBOOL
operator != ( const LE_Header
& Value
) const;
115 } // END namespace PDU
116 } // END namespace KDIS