// $Id: ULEdec.cc 355 2007-07-26 14:17:02Z tho $
//
-// Copyright (C) 2006
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-// Stefan Bund <stefan.bund@fokus.fraunhofer.de>
+// Copyright (C) 2007
+// 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
// Definition of non-inline non-template functions
-#include <string>
-#include <iostream>
-#include <iomanip>
-#include <sys/ioctl.h>
-#include <linux/sockios.h>
-#include <linux/dvb/dmx.h>
-
-#include "Scheduler/Scheduler.hh"
-#include "Packets/DefaultBundle/EthernetPacket.hh"
-#include "Packets/MPEGDVBBundle/TransportPacket.hh"
-#include "Packets/MPEGDVBBundle/SNDUPacket.hh"
-#include "Utils/membind.hh"
-#include "Socket/Protocols/DVB/DVBDemuxHandles.hh"
-#include "Packets/ParseInt.hh"
-#include "Packets/Packet.hh"
-#include "Packets/PacketData.hh"
-#include "Packets/ParseInt.hh"
+#include <senf/Scheduler/Scheduler.hh>
+#include <senf/Packets/MPEGDVBBundle/TransportPacket.hh>
+#include <senf/Packets/MPEGDVBBundle/SNDUPacket.hh>
+#include <senf/Socket/Protocols/DVB.hh>
class ULEdec
{
public:
- ULEdec();
+ ULEdec(unsigned short adapter=0, unsigned short device=0);
private:
typedef senf::PacketData::iterator iterator;
-
- enum ReciverState {
+
+ enum ReceiverState {
Idle,
Reassembly
};
-
+
senf::DVBDemuxPESHandle demuxHandle;
senf::DVBDvrHandle dvrHandle;
-
+
senf::SNDUPacket snduPacket;
-
- ReciverState receiver_state;
+
+ ReceiverState receiver_state;
unsigned char priv_tscc;
bool priv_sndu_type_1;
iterator snduPacketData_iter;
- static const unsigned BLOCK_SIZE = 16;
-
- template <class Iterator>
- void hexdump(Iterator i, Iterator const & i_end, std::ostream& stream);
-
- void handleEvent(senf::FileHandle, senf::Scheduler::EventId event);
-
+ void handleEvent(senf::Scheduler::EventId event);
void handleTSPacket(senf::TransportPacket tsPacket);
-
- iterator readNewSNDUPacket(iterator i_start, iterator i_end);
- iterator readContSNDUPacket(iterator i_start, iterator i_end);
- iterator readRawSNDUPacketData(iterator i_start, iterator i_end);
-
+ void handleSNDUPacket();
+
+ iterator readNewSNDUPacket(iterator i, const iterator i_end);
+ iterator readContSNDUPacket(iterator i, const iterator i_end);
+ iterator readRawSNDUPacketData(iterator i, iterator const i_end);
+
+ inline bool isSDNUPacketComplete();
+ inline iterator::difference_type snduPacketBytesLeft();
+
+};
+
+
+struct ULEdecException : public senf::Exception
+{
+ ULEdecException(std::string const & what)
+ : senf::Exception(what) {}
};
+
\f
// Local Variables:
// mode: c++
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
-// compile-command: "scons -u test"
+// compile-command: "scons -u"
// comment-column: 40
// End: