4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Thorsten Horstmann <tho@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief MIH protocol public header */
26 #ifndef HH_SENF_Packets_80221Bundle_MIHPacket_
27 #define HH_SENF_Packets_80221Bundle_MIHPacket_ 1
30 #include "../../Packets/Packets.hh"
31 #include "TLVPacket.hh"
33 //#include "MIHPacket.mpp"
34 ///////////////////////////////hh.p////////////////////////////////////////
38 struct MIHF_IdParser : public senf::PacketParserBase
40 # include SENF_FIXED_PARSER()
42 SENF_PARSER_FINALIZE ( MIHF_IdParser );
45 struct MIHPacketParser : public senf::PacketParserBase
47 # include SENF_PARSER()
49 SENF_PARSER_BITFIELD_RO ( version, 4, unsigned );
50 SENF_PARSER_BITFIELD ( ackRequest, 1, bool );
51 SENF_PARSER_BITFIELD ( ackResponse, 1, bool );
52 SENF_PARSER_BITFIELD ( uir, 1, bool );
53 SENF_PARSER_BITFIELD ( moreFragment, 1, bool );
54 SENF_PARSER_BITFIELD ( fragmentNr, 7, unsigned );
55 SENF_PARSER_SKIP_BITS ( 1 );
57 // MIH message ID (MID)
58 SENF_PARSER_BITFIELD ( sid, 4, unsigned );
59 SENF_PARSER_BITFIELD ( opcode, 2, unsigned );
60 SENF_PARSER_BITFIELD ( aid, 10, unsigned );
62 SENF_PARSER_SKIP_BITS ( 4 );
63 SENF_PARSER_BITFIELD ( transactionId, 12, unsigned );
64 SENF_PARSER_FIELD_RO ( payloadLength, UInt16Parser );
67 SENF_PARSER_PRIVATE_FIELD ( source_type, UInt8Parser );
68 SENF_PARSER_PRIVATE_FIELD ( source_length, DynamicTLVLengthParser );
69 SENF_PARSER_FIELD ( source_mihf_id, MIHF_IdParser );
71 // Destination MIHF Id
72 SENF_PARSER_PRIVATE_FIELD ( destination_type, UInt8Parser );
73 SENF_PARSER_PRIVATE_FIELD ( destination_length, DynamicTLVLengthParser );
74 SENF_PARSER_FIELD ( destination_mihf_id, MIHF_IdParser );
76 SENF_PARSER_FINALIZE ( MIHPacketParser );
81 destination_type() = 2;
84 friend class MIHPacketType;
89 : public PacketTypeBase,
90 public PacketTypeMixin<MIHPacketType>
92 typedef PacketTypeMixin<MIHPacketType> mixin;
93 typedef ConcretePacket<MIHPacketType> packet;
94 typedef MIHPacketParser parser;
96 using mixin::nextPacketRange;
98 using mixin::initSize;
100 static void dump(packet p, std::ostream &os);
101 static void finalize(packet p);
104 typedef ConcretePacket<MIHPacketType> MIHPacket;
108 ///////////////////////////////hh.e////////////////////////////////////////
110 #ifndef SENF_PACKETS_DECL_ONLY
111 //#include "MIHPacket.cci"
112 //#include "MIHPacket.ct"
113 //#include "MIHPacket.cti"
120 // c-file-style: "senf"
121 // indent-tabs-mode: nil
122 // ispell-local-dictionary: "american"
123 // compile-command: "scons -u test"
124 // comment-column: 40