-// $Id:DatagramSection.cc 327 2007-07-20 10:03:44Z tho $
+// $Id$
//
// Copyright (C) 2007
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-// Stefan Bund <stefan.bund@fokus.fraunhofer.de>
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Thorsten Horstmann <tho@berlios.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
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// Definition of non-inline non-template functions
+/** \file
+ \brief TransportPacket non-inline non-template implementation */
#include "TransportPacket.hh"
//#include "TransportPacket.ih"
// Custom includes
#include <iomanip>
+#include <boost/io/ios_state.hpp>
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
+prefix_ void senf::TransportPacketParser::init_fields()
+ const
+{
+ sync_byte() = TransportPacketType::SYNC_BYTE;
+ transport_error_indicator() = 0;
+ transport_scrmbl_ctrl() = 0;
+ adaptation_field_ctrl() = 0x1u;
+}
+
+prefix_ senf::UInt8Parser senf::TransportPacketParser::pointer_field()
+ const
+{
+ return pointer_field_().get<1>();
+}
+
+prefix_ void senf::TransportPacketParser::setPUSI(bool pusi)
+ const
+{
+ if (pusi) pointer_field_().init<1>();
+ else pointer_field_().init<0>();
+}
+
prefix_ void senf::TransportPacketType::dump(packet p, std::ostream & os)
{
+ boost::io::ios_all_saver ias(os);
os << "TransportPacket:\n"
<< std::hex
- << " syncByte: 0x" << unsigned(p->syncByte()) << "\n"
+ << " 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"
<< " 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";
+ if (p->pusi())
+ os << " pointer_field: 0x" << unsigned(p->pointer_field()) << "\n";
}
///////////////////////////////cc.e////////////////////////////////////////