Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
senf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wiback
senf
Commits
5b5ddeb8
Commit
5b5ddeb8
authored
17 years ago
by
jkaeber
Browse files
Options
Downloads
Patches
Plain Diff
First shot. Syntax Definition as per RFC2784.
parent
bd5636da
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Packets/MPEGDVBBundle/GREPacket.cc
+65
-0
65 additions, 0 deletions
Packets/MPEGDVBBundle/GREPacket.cc
Packets/MPEGDVBBundle/GREPacket.hh
+110
-0
110 additions, 0 deletions
Packets/MPEGDVBBundle/GREPacket.hh
with
175 additions
and
0 deletions
Packets/MPEGDVBBundle/GREPacket.cc
0 → 100644
+
65
−
0
View file @
5b5ddeb8
// $Id:DatagramSection.cc 327 2007-07-20 10:03:44Z tho $
//
// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Joachim Kaeber <joachim.kaeber@fokus.fraunhofer.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
\brief GREPacket non-inline non-template implementation */
#include
"GREPacket.hh"
//#include "GREPacket.ih"
// Custom includes
#include
<iomanip>
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
prefix_
void
senf
::
GREPacketType
::
dump
(
packet
p
,
std
::
ostream
&
os
)
{
/*
os << "GREPacket:\n"
<< std::hex
<< " syncByte: 0x" << unsigned(p->sync_byte()) << "\n"
<< " transport_error_indicator: 0x" << unsigned(p->transport_error_indicator()) << "\n"
<< " payload_unit_start_indicator (pusi): 0x" << unsigned(p->pusi()) << "\n"
<< " transport_priority: 0x" << unsigned(p->transport_priority()) << "\n"
<< std::dec
<< " pid: " << unsigned(p->pid()) << "\n"
<< std::hex
<< " transport_scrambling_control: 0x" << unsigned(p->transport_scrmbl_ctrl()) << "\n"
<< " adaptation_field_control: 0x" << unsigned(p->adaptation_field_ctrl()) << "\n"
<< " continuity_counter: 0x" << unsigned(p->continuity_counter()) << "\n";
*/
}
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
// Local Variables:
// mode: c++
// fill-column: 100
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
// comment-column: 40
// End:
This diff is collapsed.
Click to expand it.
Packets/MPEGDVBBundle/GREPacket.hh
0 → 100644
+
110
−
0
View file @
5b5ddeb8
// $Id:DatagramSection.hh 327 2007-07-20 10:03:44Z tho $
//
// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Joachim Kaeber <joachim.kaeber@fokus.fraunhofer.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
\brief GREPacket public header */
#ifndef HH_GREPacket
#define HH_GREPacket 1
// Custom includes
#include
<algorithm>
#include
"../../Packets/Packets.hh"
//#include "GREPacket.mpp"
///////////////////////////////hh.p////////////////////////////////////////
namespace
senf
{
/** \brief Parse a GRE packet
Parser implementing the header of a General Routing Encapsulation (GRE, RFC 2784) Packet
\see GREPacketType
*/
struct
Parse_GREPacket
:
public
PacketParserBase
{
#include SENF_PARSER()
SENF_PARSER_BITFIELD
(
checksum_present
,
1
,
bool
);
SENF_PARSER_PRIVATE_BITFIELD
(
reserved0_
,
12
,
unsigned
);
// TODO: SKIP !!
SENF_PARSER_BITFIELD_RO
(
version_number
,
3
,
unsigned
);
// TODO: Always Zero !!
SENF_PARSER_FIELD
(
protocol_type
,
Parse_UInt16
);
SENF_PARSER_PRIVATE_VARIANT
(
checksum_
,
checksum_present
,
(
VoidPacketParser
)
(
Parse_UInt16
)
);
SENF_PARSER_PRIVATE_VARIANT
(
reserved1_
,
checksum_present
,
(
VoidPacketParser
)
(
Parse_UInt16
)
);
SENF_PARSER_FINALIZE
(
Parse_GREPacket
);
private:
Parse_UInt16
checksum
()
const
/// only defined if checksum_present() == \c true
{
return
checksum_
().
get
<
1
>
();
}
};
/** \brief GRE packet
\par Packet type (typedef):
\ref GREPacket
\par Fields:
\ref Parse_GREPacket
\ingroup protocolbundle_mpegdvb
*/
struct
GREPacketType
:
public
PacketTypeBase
,
public
PacketTypeMixin
<
GREPacketType
>
{
typedef
PacketTypeMixin
<
GREPacketType
>
mixin
;
typedef
ConcretePacket
<
GREPacketType
>
packet
;
typedef
Parse_GREPacket
parser
;
using
mixin
::
nextPacketRange
;
using
mixin
::
init
;
using
mixin
::
initSize
;
static
void
dump
(
packet
p
,
std
::
ostream
&
os
);
};
/** \brief GRE packet typedef */
typedef
GREPacketType
::
packet
GREPacket
;
}
///////////////////////////////hh.e////////////////////////////////////////
//#include "TransportPacket.cci"
//#include "TransportPacket.ct"
//#include "TransportPacket.cti"
#endif
// Local Variables:
// mode: c++
// fill-column: 100
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
// comment-column: 40
// End:
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment