\section senfutil_overview Building Projects using SENF
When building projects using %senf, SENFSCons has a very simple helper module
- \ref senf_senfutil to make the building of libraries utilizing %senf simpler.
+ \ref senf_senfutil "senfutil.py" to make the building of libraries utilizing %senf simpler.
\see \ref senf_senfutil
*/
The \c senfutil.Doxygen utility autogenerates a \c Doxyfile.
- The utility will search for a SENF documentation in the \c senfdoc and \c senf subdirectories as
- well as via the senfutil module directory and some other standard locations. If SENF
- documentation is found, the SENF tagfiles will automatically be added. Links will be resolved to
- the documentation found.
+ The utility will search for a SENF documentation in the \c senfdoc and \c %senf subdirectories
+ as well as via the senfutil module directory and some other standard locations. If SENF
+ documentation is found, the SENF tagfiles will automatically be added. Links will be resolved
+ to the documentation found.
\c senfutil.Doxygen takes some additional optional keyword arguments:
\li \c doxyheader: Path of an alternative HTML header
\li The \c xsltproc XSLT processor (http://xmlsoft.org/XSLT/xsltproc2.html)
\li The \c graphviz library (http://www.graphviz.org)
-
The library is only tested with gcc-3.4 and 4.0 on Linux. On other POSIX platforms with a BSD
Socket API, the library should be usable, possibly with some tweaking (except for the Scheduler,
which relies on \c epoll)
<div id="footer">
<span>
<a href="mailto:senf-dev@lists.berlios.de">Contact: senf-dev@lists.berlios.de</a> |
- Copyright © 2006 Fraunhofer Gesellschaft, SatCom, Stefan Bund
+ © 2006-2009 <a href="http://www.fokus.fraunhofer.de/en/net/index.html">
+ Fraunhofer Institute for Open Communication Systems, Network Research</a>
</span>
</div>
</body></html>"""
prefix_ std::string senf::MIHFId_TLVParser::asString()
const
{
- return std::string( i(1+length_bytes()), i(1+length_bytes()+length()) );
+ return std::string( i(1+length_().bytes()), i(1+length_().bytes()+length()) );
}
prefix_ senf::MACAddress senf::MIHFId_TLVParser::asMACAddress()
const
{
return MACAddress::from_data(
- getNAIDecodedIterator( i(1+length_bytes()), i(1+length_bytes()+12) ));
+ getNAIDecodedIterator( i(1+length_().bytes()), i(1+length_().bytes()+12) ));
}
prefix_ senf::INet4Address senf::MIHFId_TLVParser::asINet4Address()
const
{
return INet4Address::from_data(
- getNAIDecodedIterator( i(1+length_bytes()), i(1+length_bytes()+8) ));
+ getNAIDecodedIterator( i(1+length_().bytes()), i(1+length_().bytes()+8) ));
}
prefix_ senf::INet6Address senf::MIHFId_TLVParser::asINet6Address()
const
{
return INet6Address::from_data(
- getNAIDecodedIterator( i(1+length_bytes()), i(1+length_bytes()+32) ));
+ getNAIDecodedIterator( i(1+length_().bytes()), i(1+length_().bytes()+32) ));
}
prefix_ senf::EUI64 senf::MIHFId_TLVParser::asEUI64()
const
{
return EUI64::from_data(
- getNAIDecodedIterator( i(1+length_bytes()), i(1+length_bytes()+16) ));
+ getNAIDecodedIterator( i(1+length_().bytes()), i(1+length_().bytes()+16) ));
}
///////////////////////////////cci.e////////////////////////////////////////
DynamicTLVLengthParser::value_type size)
{
DynamicTLVLengthParser::value_type current_length ( length());
- length( size);
+ length_() << size;
- safe_data_iterator si (data(), boost::next(i(), 1 + length_bytes() ));
+ safe_data_iterator si (data(), boost::next(i(), 1 + length_().bytes() ));
if (current_length > size)
data().erase( si, boost::next(si, current_length-size));
else
prefix_ senf::PacketInterpreterBase::range senf::GenericTLVPacketParser::value()
const
{
- senf::PacketData::iterator begin (boost::next(data().begin(), 1 + length_bytes() ));
+ senf::PacketData::iterator begin (boost::next(data().begin(), 1 + length_().bytes() ));
return PacketInterpreterBase::range(
begin, boost::next( begin, length()) );
}
}
-prefix_ void senf::GenericTLVPacketType::finalize(packet p)
-{
- p->finalizeLength();
-}
-
-
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
return 1 + ( length_field()<=128 ? 0 : fixed_length_field());
}
+prefix_ void senf::GenericTLVPacketType::finalize(packet p)
+{
+ p->finalizeLength();
+}
+
///////////////////////////////cci.e////////////////////////////////////////
#undef prefix_
};
protected:
- /// return size of length field
- size_type length_bytes() const { return length_().bytes(); };
- /// set length field to given value
- void length(DynamicTLVLengthParser::value_type &v) { length_() = v; };
- /// resize the Packet after the length field to given size
+ /// resize the packet after the length field to given size
senf::safe_data_iterator resizeValueField(DynamicTLVLengthParser::value_type size);
};
-// $Id: DVBSocketController.cc 1119 2009-02-16 13:36:59Z tho $
+// $Id$
//
// Copyright (C) 2007
// Fraunhofer Institute for Open Communication Systems (FOKUS)
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
+prefix_ senf::DVBSectionProtocolWrapper::DVBSectionProtocolWrapper(senf::DVBDemuxSectionHandle sh)
+ : protocol(sh.protocol()), dir(this)
+{
+ namespace kw = senf::console::kw;
+ dir.add("buffersize", &DVBSectionProtocolWrapper::setBufferSize)
+ .doc("Set the size of the circular buffer used for filtered data.")
+ .arg("size", "in byte");
+
+ dir.add("start", &DVBSectionProtocolWrapper::startFiltering)
+ .doc("Starts filtering");
+
+ dir.add("stop", &DVBSectionProtocolWrapper::setBufferSize)
+ .doc("Stops filtering");
+
+ dir.node().add("filter", boost::function<void (unsigned short int, unsigned, senf::console::FlagCollection<Flags>, unsigned, unsigned, unsigned)>(senf::membind(&DVBSectionProtocolWrapper::setSectionFilter, this)))
+ .arg("pid", "pid to filter")
+ .arg("filter", "filter", kw::default_value = 62, kw::default_doc = "0x3e")
+ .arg("flags", "or-able: CHECK_CRC, ONESHOT, IMMEDIATE_START, KERNEL_CLIENT", kw::default_value = DMX_IMMEDIATE_START | DMX_CHECK_CRC, kw::default_doc = "(IMMEDIATE_START CHECK_CRC)")
+ .arg("mask", "mask", kw::default_value = 0xff, kw::default_doc = "0xff")
+ .arg("mode", "mode", kw::default_value = 0, kw::default_doc = "0x00")
+ .arg("timeout", "timeout", kw::default_value = 0, kw::default_doc = "0x00")
+ .doc("Sets parameters for section filter.");
+
+ dir.add("stop", &DVBSectionProtocolWrapper::setBufferSize)
+ .doc("Stops filtering");
+}
+
+
+prefix_ senf::DVBPESProtocolWrapper::DVBPESProtocolWrapper(senf::DVBDemuxPESHandle sh)
+ : protocol(sh.protocol()), dir(this)
+{
+ namespace kw = senf::console::kw;
+
+ dir.node().add("filter", boost::function<void ( unsigned short int, dmx_input_t, dmx_output_t, dmx_pes_type_t, senf::console::FlagCollection<Flags>)>(senf::membind(&DVBPESProtocolWrapper::setPESFilter, this)))
+ .arg("pid", "pid to filter")
+ .arg("input", "input-filter: DMX_IN_FRONTEND DMX_IN_DVR ")
+ .arg("output", "output-filter: DMX_OUT_DECODER DMX_OUT_TAP DMX_OUT_TS_TAP ")
+ .arg("pesType", "PES type: DMX_PES_AUDIO[0-3] DMX_PES_VIDEO[0-3] DMX_PES_TELETEXT[0-3], DMX_PES_SUBTITLE[0-3], DMX_PES_PCR[0-3], DMX_PES_OTHER")
+ .arg("flags", "or-able: CHECK_CRC, ONESHOT, IMMEDIATE_START, KERNEL_CLIENT", kw::default_value = DMX_IMMEDIATE_START | DMX_CHECK_CRC, kw::default_doc = "(IMMEDIATE_START CHECK_CRC)")
+ .doc("Sets parameters for PES filter.");
+
+ dir.add("start", &DVBPESProtocolWrapper::startFiltering)
+ .doc("Starts filtering");
+
+ dir.add("stop", &DVBPESProtocolWrapper::stopFiltering)
+ .doc("Stops filtering");
+}
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
--- /dev/null
+// $Id$
+//
+// Copyright (C) 2007
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Anton Gillert <atx@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
+// 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 DVBSocketController inline non-template implementation */
+
+// Custom includes
+
+#define prefix_ inline
+///////////////////////////////cci.p////////////////////////////////////////
+
+prefix_ void senf::DVBSectionProtocolWrapper::setSectionFilter(
+ unsigned short int pid, u_int8_t filter, unsigned int flags, u_int8_t mask,
+ u_int8_t mode, unsigned int timeout)
+{
+ protocol.setSectionFilter(pid, timeout, flags, filter, mask, mode);
+}
+
+prefix_ void senf::DVBSectionProtocolWrapper::setBufferSize(unsigned long size)
+{
+ protocol.setBufferSize(size);
+}
+
+prefix_ void senf::DVBSectionProtocolWrapper::startFiltering()
+{
+ protocol.startFiltering();
+}
+
+prefix_ void senf::DVBSectionProtocolWrapper::stopFiltering()
+{
+ protocol.stopFiltering();
+}
+
+
+prefix_ void senf::DVBPESProtocolWrapper::setPESFilter(unsigned short int pid, dmx_input_t input,
+ dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags)
+{
+ protocol.setPESFilter(pid, input, output, pesType, flags);
+}
+
+prefix_ void senf::DVBPESProtocolWrapper::startFiltering()
+{
+ protocol.startFiltering();
+}
+
+prefix_ void senf::DVBPESProtocolWrapper::stopFiltering()
+{
+ protocol.stopFiltering();
+}
+
+
+///////////////////////////////cci.e////////////////////////////////////////
+#undef prefix_
-// $Id: DVBSocketController.hh 1119 2009-02-16 13:36:59Z tho $
+// $Id$
//
// Copyright (C) 2007
// Fraunhofer Institute for Open Communication Systems (FOKUS)
#ifndef HH_SENF_Socket_Protocols_DVB_DVBProtocolWrapper_
#define HH_SENF_Socket_Protocols_DVB_DVBProtocolWrapper_ 1
-#include <senf/Utils/Console/Console.hh>
+
+// Custom includes
#include <senf/Utils/Console/Console.hh>
#include "DVBDemuxHandles.hh"
-// Custom includes
-SENF_CONSOLE_REGISTER_ENUM( dmx_input_t, (DMX_IN_FRONTEND)(DMX_IN_DVR) )
-;
-SENF_CONSOLE_REGISTER_ENUM( dmx_output_t, (DMX_OUT_DECODER)(DMX_OUT_TAP)(DMX_OUT_TS_TAP) )
-;
+///////////////////////////////hh.p////////////////////////////////////////
+
+SENF_CONSOLE_REGISTER_ENUM( dmx_input_t, (DMX_IN_FRONTEND)(DMX_IN_DVR) );
+SENF_CONSOLE_REGISTER_ENUM( dmx_output_t, (DMX_OUT_DECODER)(DMX_OUT_TAP)(DMX_OUT_TS_TAP) );
SENF_CONSOLE_REGISTER_ENUM( dmx_pes_type_t, (DMX_PES_AUDIO0)(DMX_PES_VIDEO0)(DMX_PES_TELETEXT0)(DMX_PES_SUBTITLE0)(DMX_PES_PCR0)
(DMX_PES_AUDIO1)(DMX_PES_VIDEO1)(DMX_PES_TELETEXT1)(DMX_PES_SUBTITLE1)(DMX_PES_PCR1)
(DMX_PES_AUDIO2)(DMX_PES_VIDEO2)(DMX_PES_TELETEXT2)(DMX_PES_SUBTITLE2)(DMX_PES_PCR2)
(DMX_PES_AUDIO3)(DMX_PES_VIDEO3)(DMX_PES_TELETEXT3)(DMX_PES_SUBTITLE3)(DMX_PES_PCR3)
- (DMX_PES_OTHER))
-;
+ (DMX_PES_OTHER));
namespace senf {
- /** \brief Helperclass for configuration and controlling DVB protokoll handles.
-
+ /** \brief Helperclass for configuration and controlling DVB protocol handles.
*/
+ class DVBSectionProtocolWrapper : public DVBProtocolWrapper
+ {
+ private:
+ const DVBDemuxSectionSocketProtocol& protocol;
- class DVBSectionProtocolWrapper : public senf::DVBProtocolWrapper {
-
-public:
+ public:
enum Flags {CHECK_CRC = DMX_CHECK_CRC,
ONESHOT = DMX_ONESHOT,
IMMEDIATE_START = DMX_IMMEDIATE_START,
KERNEL_CLIENT = DMX_KERNEL_CLIENT};
senf::console::ScopedDirectory<DVBSectionProtocolWrapper> dir;
-private:
- const senf::DVBDemuxSectionSocketProtocol& protocol;
-public:
- DVBSectionProtocolWrapper(senf::DVBDemuxSectionHandle sh) :
- dir(this), protocol(sh.protocol()) {
-
- namespace kw = senf::console::kw;
- dir.add("buffersize", &DVBSectionProtocolWrapper::setBufferSize)
- .doc("Set the size of the circular buffer used for filtered data.")
- .arg("size", "in byte");
-
- dir.add("start", &DVBSectionProtocolWrapper::startFiltering)
- .doc("Starts filtering");
-
- dir.add("stop", &DVBSectionProtocolWrapper::setBufferSize)
- .doc("Stops filtering");
-
- dir.node().add("filter", boost::function<void (unsigned short int, unsigned, senf::console::FlagCollection<Flags>, unsigned, unsigned, unsigned)>(senf::membind(&DVBSectionProtocolWrapper::setSectionFilter, this)))
- .arg("pid", "pid to filter")
- .arg("filter", "filter", kw::default_value = 62, kw::default_doc = "0x3e")
- .arg("flags", "or-able: CHECK_CRC, ONESHOT, IMMEDIATE_START, KERNEL_CLIENT", kw::default_value = DMX_IMMEDIATE_START | DMX_CHECK_CRC, kw::default_doc = "(IMMEDIATE_START CHECK_CRC)")
- .arg("mask", "mask", kw::default_value = 0xff, kw::default_doc = "0xff")
- .arg("mode", "mode", kw::default_value = 0, kw::default_doc = "0x00")
- .arg("timeout", "timeout", kw::default_value = 0, kw::default_doc = "0x00")
- .doc("Sets parameters for section filter.");
-
- dir.add("stop", &DVBSectionProtocolWrapper::setBufferSize)
- .doc("Stops filtering");
- }
- ~DVBSectionProtocolWrapper() {
- }
- void setSectionFilter(unsigned short int pid, u_int8_t filter,
- unsigned int flags, u_int8_t mask, u_int8_t mode,
- unsigned int timeout) {
- protocol.setSectionFilter(pid, timeout, flags, filter, mask, mode);
-
- }
-
- ///< Set the size of the circular buffer used for filtered data.
- /**< The default size is two maximum sized sections, i.e. if
- this function is not called a buffer size of 2 * 4096
- bytes will be used.
- \param[in] size Size of circular buffer. */
- void setBufferSize(unsigned long size) {
- protocol.setBufferSize(size);
- }
-
- void startFiltering() ///< Starts filtering
- {
- protocol.startFiltering();
- }
-
- void stopFiltering() ///< Stops filtering
- {
- protocol.stopFiltering();
- }
+ DVBSectionProtocolWrapper(senf::DVBDemuxSectionHandle sh);
+ ~DVBSectionProtocolWrapper() { }
+
+ void setSectionFilter(unsigned short int pid, u_int8_t filter,
+ unsigned int flags, u_int8_t mask, u_int8_t mode, unsigned int timeout);
+
+ void setBufferSize(unsigned long size);
+ ///< Set the size of the circular buffer used for filtered data.
+ /**< The default size is two maximum sized sections, i.e. if
+ this function is not called a buffer size of 2 * 4096 bytes
+ will be used.
+ \param[in] size Size of circular buffer. */
+ void startFiltering(); ///< Starts filtering
+ void stopFiltering(); ///< Stops filtering
};
+
SENF_CONSOLE_REGISTER_ENUM_MEMBER(DVBSectionProtocolWrapper, Flags,
- (CHECK_CRC)(ONESHOT)(IMMEDIATE_START)(KERNEL_CLIENT))
- ;
-
- class DVBPESProtocolWrapper : public senf::DVBProtocolWrapper {
+ (CHECK_CRC)(ONESHOT)(IMMEDIATE_START)(KERNEL_CLIENT));
-public:
+
+ class DVBPESProtocolWrapper : public senf::DVBProtocolWrapper
+ {
+ private:
+ const senf::DVBDemuxPESSocketProtocol& protocol;
+
+ public:
enum Flags {CHECK_CRC = DMX_CHECK_CRC,
ONESHOT = DMX_ONESHOT,
IMMEDIATE_START = DMX_IMMEDIATE_START,
KERNEL_CLIENT = DMX_KERNEL_CLIENT};
senf::console::ScopedDirectory<DVBPESProtocolWrapper> dir;
-private:
- const senf::DVBDemuxPESSocketProtocol& protocol;
-public:
- DVBPESProtocolWrapper(senf::DVBDemuxPESHandle sh) :
- dir(this), protocol(sh.protocol()) {
- namespace kw = senf::console::kw;
-
- dir.node().add("filter", boost::function<void ( unsigned short int, dmx_input_t, dmx_output_t, dmx_pes_type_t, senf::console::FlagCollection<Flags>)>(senf::membind(&DVBPESProtocolWrapper::setPESFilter, this)))
- .arg("pid", "pid to filter")
- .arg("input", "input-filter: DMX_IN_FRONTEND DMX_IN_DVR ")
- .arg("output", "output-filter: DMX_OUT_DECODER DMX_OUT_TAP DMX_OUT_TS_TAP ")
- .arg("pesType", "PES type: DMX_PES_AUDIO[0-3] DMX_PES_VIDEO[0-3] DMX_PES_TELETEXT[0-3], DMX_PES_SUBTITLE[0-3], DMX_PES_PCR[0-3], DMX_PES_OTHER")
- .arg("flags", "or-able: CHECK_CRC, ONESHOT, IMMEDIATE_START, KERNEL_CLIENT", kw::default_value = DMX_IMMEDIATE_START | DMX_CHECK_CRC, kw::default_doc = "(IMMEDIATE_START CHECK_CRC)")
- .doc("Sets parameters for PES filter.");
- dir.add("start", &DVBPESProtocolWrapper::startFiltering)
- .doc("Starts filtering");
-
- dir.add("stop", &DVBPESProtocolWrapper::stopFiltering)
- .doc("Stops filtering");
- }
- ~DVBPESProtocolWrapper() {
- }
- ;
+
+ DVBPESProtocolWrapper(senf::DVBDemuxPESHandle sh);
+ ~DVBPESProtocolWrapper() { };
void setPESFilter(unsigned short int pid, dmx_input_t input,
- dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags) {
- protocol.setPESFilter(pid, input, output, pesType, flags);
- }
- void startFiltering() ///< Starts filtering
- {
- protocol.startFiltering();
- }
-
- void stopFiltering() ///< Stops filtering
- {
- protocol.stopFiltering();
- }
+ dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags);
+ void startFiltering(); ///< Starts filtering
+ void stopFiltering(); ///< Stops filtering
};
+
SENF_CONSOLE_REGISTER_ENUM_MEMBER(DVBPESProtocolWrapper, Flags,
- (CHECK_CRC)(ONESHOT)(IMMEDIATE_START)(KERNEL_CLIENT))
- ;
+ (CHECK_CRC)(ONESHOT)(IMMEDIATE_START)(KERNEL_CLIENT));
}
+///////////////////////////////hh.e////////////////////////////////////////
+#include "DVBProtocolWrapper.cci"
+//#include "DVBProtocolWrapper.ct"
+//#include "DVBProtocolWrapper.cti"
#endif
senf::DVBDemuxPESHandle createDVBDemuxPESHandle( int adapternumber=0, int demuxnumber=0, bool addToConsole=false );
void addToConsole(senf::DVBDemuxSectionHandle sh);
- ///< Adds an DVBDemuxSectionHandle to the console
- /**< Allocates the functionality of DVBDemuxSectionProtocol into the folder
- of the DVBSocketController. If the protocol is closed, or all handles are
- discarded the console support will automatically removed.
- \param[in] handle of a protocol*/
+ ///< Adds an DVBDemuxSectionHandle to the console
+ /**< Allocates the functionality of DVBDemuxSectionProtocol
+ into the folder of the DVBSocketController. If the
+ protocol is closed, or all handles are discarded the
+ console support will automatically removed.
+ \param[in] sh handle of a protocol*/
+
void addToConsole(senf::DVBDemuxPESHandle sh);
- ///< Adds an DVBDemuxPESHandle to the console
- /**< Allocates the functionality of DVBDemuxPESProtocol into the folder
- of the DVBSocketController. If the protocol is closed, or all handles are
- discarded the console support will automatically removed.
- \param[in] handle of a protocol*/
+ ///< Adds an DVBDemuxPESHandle to the console
+ /**< Allocates the functionality of DVBDemuxPESProtocol into
+ the folder of the DVBSocketController. If the protocol
+ is closed, or all handles are discarded the console
+ support will automatically removed.
+ \param[in] sh handle of a protocol*/
void tuneToCMD( const std::string & input, const std::string & mode = "async");
///< Tunes a DVB device given by the type of the DVBFrontendHandle
-// $Id: main.test.cc 1087 2009-01-28 13:27:42Z g0dil $
+// $Id$
//
// Copyright (C) 2006
// Fraunhofer Institute for Open Communication Systems (FOKUS)
Accessing a non-existent argument or failing to parse all arguments will raise a
senf::console::SyntaxErrorException.
- \see \link console_args_custom Example customer parser \endlink
+ \see \ref console_args_custom "Example customer parser"
*/
class CheckedArgumentIteratorWrapper
: boost::noncopyable,
statslog.route<senf::StatisticsStream>();
\endcode
- We use a StatisticsLogger to send the log messages to the senf::StatisticsStream log
- stream. The stream, area an level to send the statistics log messages to may be configured
+ We use a StatisticsLogger to send the %log messages to the senf::StatisticsStream %log
+ stream. The stream, area an level to send the statistics %log messages to may be configured
using template arguments to StatisticsLogger.
It is also possible to skip sending the output to any target or send one output to several