1 // $Id:DatagramSection.hh 327 2007-07-20 10:03:44Z tho $
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 // Thorsten Horstmann <thorsten.horstmann@fokus.fraunhofer.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 \file DatagramSection public header */
26 #ifndef HH_DatagramSection_
27 #define HH_DatagramSection_ 1
31 #include "../../Packets/Packets.hh"
32 #include "DSMCCSection.hh"
35 //#include "DatagramSection.mpp"
36 ///////////////////////////////hh.p////////////////////////////////////////
40 /** \brief Parse a Datagram Section
42 Parser implementing the Datagram Section.
44 \see DatagramSectionType
46 struct Parse_DatagramSection : public Parse_DSMCCSection
48 # include SENF_FIXED_PARSER()
50 SENF_PARSER_INHERIT(Parse_DSMCCSection);
52 SENF_PARSE_FIELD( mac_addr_4, Parse_UInt8 );
53 SENF_PARSE_FIELD( mac_addr_3, Parse_UInt8 );
54 SENF_PARSE_FIELD( mac_addr_2, Parse_UInt8 );
55 SENF_PARSE_FIELD( mac_addr_1, Parse_UInt8 );
57 SENF_PARSER_FINALIZE(Parse_DatagramSection);
59 typedef Parse_UIntField < 2, 4 > Parse_payload_scrmbl_ctrl;
60 typedef Parse_UIntField < 4, 6 > Parse_addr_scrmbl_ctrl;
61 typedef Parse_Flag < 6 > Parse_llc_snap_flag;
63 Parse_UInt8 mac_addr_6() const { return parse<Parse_UInt8>( 3 ); }
64 Parse_UInt8 mac_addr_5() const { return parse<Parse_UInt8>( 4 ); }
66 Parse_payload_scrmbl_ctrl payload_scrmbl_ctrl() const {
67 return parse<Parse_payload_scrmbl_ctrl>( 5 );
70 Parse_addr_scrmbl_ctrl addr_scrmbl_ctrl() const {
71 return parse<Parse_addr_scrmbl_ctrl>( 5 );
74 Parse_llc_snap_flag llc_snap_flag() const {
75 return parse<Parse_llc_snap_flag>( 5 );
79 /** \brief Datagram Section
81 \par Packet type (typedef):
85 \ref Parse_DatagramSection
87 \ingroup protocolbundle_mpegdvb
89 struct DatagramSectionType
90 : public DSMCCSectionType,
91 public PacketTypeMixin<DatagramSectionType>
93 typedef PacketTypeMixin<DatagramSectionType> mixin;
94 typedef ConcretePacket<DatagramSectionType> packet;
95 typedef Parse_DatagramSection parser;
97 using mixin::nextPacketRange;
100 static void dump(packet p, std::ostream & os);
102 static PacketParserBase::size_type initSize();
103 static PacketParserBase::size_type initHeadSize();
106 typedef DatagramSectionType::packet DatagramSection;
110 ///////////////////////////////hh.e////////////////////////////////////////
111 //#include "DatagramSection.cci"
112 //#include "DatagramSection.ct"
113 //#include "DatagramSection.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