#include "Connectors.ih"
// Custom includes
-#include "Route.hh"
-#include "Module.hh"
#include "ModuleManager.hh"
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/ParsedCommand.hh>
//#include "Connectors.mpp"
#define prefix_
#include <senf/Scheduler/Scheduler.hh>
#include <senf/Utils/membind.hh>
#include "Module.hh"
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/ParsedCommand.hh>
+#include <senf/Utils/Console/Sysdir.hh>
//#include "ModuleManager.mpp"
#define prefix_
//#include "QueueingSocketSink.ih"
// Custom includes
+#include <senf/Utils/Console/Variables.hh>
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
//#include "QueueingSocketSink.ih"
// Custom includes
+#include <senf/Utils/Console/ParsedCommand.hh>
#define prefix_
///////////////////////////////ct.p////////////////////////////////////////
}
template <class Writer>
+prefix_ void senf::ppi::module::PassiveQueueingSocketSink<Writer>::handle(Handle const & handle)
+{
+ handle_ = handle;
+ event_.set( handle_, IOEvent::Write);
+ qAlgo_->clear();
+ checkThrottle();
+}
+
+template <class Writer>
prefix_ void senf::ppi::module::PassiveQueueingSocketSink<Writer>::write()
{
PacketType p ( input());
}
template <class Writer>
-prefix_ void senf::ppi::module::PassiveQueueingSocketSink<Writer>::handle(Handle const & handle)
-{
- handle_ = handle;
- event_.set( handle_, IOEvent::Write);
- qAlgo_->clear();
- checkThrottle();
-}
-
-template <class Writer>
prefix_ senf::ppi::QueueingAlgorithm & senf::ppi::module::PassiveQueueingSocketSink<Writer>::qAlgorithm()
{
return *qAlgo_;
// Custom includes
#include <queue>
#include "SocketSink.hh"
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/ScopedDirectory.hh>
//#include "QueueingSocketSink.mpp"
///////////////////////////////hh.p////////////////////////////////////////
// Custom includes
#include <boost/regex.hpp>
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/Traits.hh>
//#include "ClockService.mpp"
#define prefix_
// Custom includes
#include <boost/format.hpp>
#include <senf/Utils/membind.hh>
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/ScopedDirectory.hh>
+#include <senf/Utils/Console/ParsedCommand.hh>
+#include <senf/Utils/Console/Sysdir.hh>
#include "FIFORunner.hh"
//#include "EventManager.mpp"
\brief TimerEventProxy non-inline template implementation */
// Custom includes
+#include <senf/Utils/membind.hh>
#define prefix_
///////////////////////////////ct.p////////////////////////////////////////
#include <senf/Scheduler/ClockService.hh>
#include <senf/Scheduler/TimerEvent.hh>
-#include <senf/Utils/Console/Console.hh>
///////////////////////////////hh.p////////////////////////////////////////
namespace senf {
/** \brief Create uninitialized socket variable
- This special constructor is called when passing
- ProtocolClientSocketHandle::Uninitialized as only argument to the constructor. This will
- create an in-\ref valid() socket handle which can however be assigned later with another
- socket instance.
+ This special constructor is called when passing \c senf::noinit as only argument to
+ the constructor. This will create an in-\ref valid() socket handle which can however
+ be assigned later with another socket instance.
\implementation The socket handle will have no \c body allocated.
*/
///@}
///////////////////////////////////////////////////////////////////////////
- Protocol & protocol(); ///< Access the protocol interface
+ Protocol & protocol(); ///< Access the protocol interface
/**< The returned protocol class reference gives access to
- the complete protocol interface as defined by that
- class. See the respective protocol class documentation.
- \returns \a Protocol class reference */
+ the complete protocol interface as defined by that
+ class. See the respective protocol class documentation.
+ \returns \a Protocol class reference */
static ProtocolClientSocketHandle cast_static(FileHandle handle);
static ProtocolClientSocketHandle cast_dynamic(FileHandle handle);
#include "DVBProtocolWrapper.hh"
// Custom includes
+#include <senf/Utils/Console/ParsedCommand.hh>
+#include <senf/Utils/Console/Utility.hh>
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
#define HH_SENF_Socket_Protocols_DVB_DVBProtocolWrapper_ 1
// Custom includes
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/ScopedDirectory.hh>
+#include <senf/Utils/Console/Traits.hh>
#include "DVBDemuxHandles.hh"
///////////////////////////////hh.p////////////////////////////////////////
#include <senf/Utils/Exception.hh>
#include <senf/Utils/Logger/Logger.hh>
#include <senf/Utils/membind.hh>
+#include <senf/Utils/Console/ParsedCommand.hh>
#include <boost/shared_ptr.hpp>
+#include "DVBProtocolWrapper.hh"
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-using namespace std;
-
unsigned int senf::DVBSocketController::controllerNr(0);
senf::DVBSocketController::DVBSocketController(DVBFrontendHandle frontendHandle_,
pesNr++;
}
-prefix_ void senf::DVBSocketController::tuneToCMD(const string & input, const string & mode)
+prefix_ void senf::DVBSocketController::tuneToCMD(std::string const & input, std::string const & mode)
{
struct dvb_frontend_parameters frontend;
// no valid configline, so it will be treaten like a channel name
- if (input.find(":")==string::npos)
+ if (input.find(":") == std::string::npos)
{
if (mode.c_str()[0]=='a')
tuneTo(input);
}
}
-prefix_ void senf::DVBSocketController::tuneTo(const string & channel)
+prefix_ void senf::DVBSocketController::tuneTo(std::string const & channel)
{
struct dvb_frontend_parameters frontend;
- string configLine = parser.getConfigLine(channel);
+ std::string configLine = parser.getConfigLine(channel);
frontend = parser.getFrontendParam(configLine);
switch (type) {
frontendHandle.protocol().tuneDVB_C(frequency, inversion, symbol_rate, fec_inner, modulation);
}
-prefix_ dvb_frontend_event senf::DVBSocketController::tuneTo_sync(const string & channel)
+prefix_ dvb_frontend_event senf::DVBSocketController::tuneTo_sync(std::string const & channel)
{
struct dvb_frontend_parameters frontend;
dvb_frontend_event ev;
- string configLine = parser.getConfigLine(channel);
+ std::string configLine = parser.getConfigLine(channel);
frontend = parser.getFrontendParam(configLine);
switch (type) {
}
-prefix_ string senf::DVBSocketController::getTypeString()
+prefix_ std::string senf::DVBSocketController::getTypeString()
{
switch (type) {
case FE_QPSK:
return frontendHandle.protocol().signalStrength();
}
-prefix_ string senf::DVBSocketController::getTuneInfo(const string & conf)
+prefix_ std::string senf::DVBSocketController::getTuneInfo(std::string const & conf)
{
const char* cConf = conf.c_str();
- stringstream info;
+ std::stringstream info;
fe_status_t status;
frontendHandle.protocol().setNonBlock(false);
ber = frontendHandle.protocol().bitErrorRate();
uncorrected_blocks = frontendHandle.protocol().uncorrectedBlocks();
- info << hex;
+ info << std::hex;
for (unsigned int i = 0; i < conf.size(); ++i) {
if (i>0)
return info.str();
}
-prefix_ string senf::DVBSocketController::status2String(fe_status_t status)
+prefix_ std::string senf::DVBSocketController::status2String(fe_status_t status)
{
- string s("");
+ std::string s("");
if (status & FE_HAS_LOCK)
return s += "HAS LOCK";
if (status & FE_HAS_CARRIER)
return s;
}
-
-
prefix_ fe_type_t senf::DVBSocketController::getType()
{
return type;
#include "DVBFrontendHandle.hh"
#include "DVBDemuxHandles.hh"
#include "DVBConfigParser.hh"
-#include "DVBProtocolWrapper.hh"
-#include <senf/Scheduler/Scheduler.hh>
-#include <senf/Utils/Console/Console.hh>
-
-#define MPE_TABLEID 62
+#include <senf/Scheduler/FdEvent.hh>
+#include <senf/Utils/Console/ScopedDirectory.hh>
+///////////////////////////////hh.p////////////////////////////////////////
namespace senf {
+#define MPE_TABLEID 62
+
/** \brief Helperclass for configuration and controlling DVB devices.
The DVB API provides two methods for tuning. The first method is
You have to find out which parts of these functionality are implemented by your preferred
device driver by your own.
*/
-
-
-
class DVBSocketController : boost::noncopyable
{
public:
- senf::console::ScopedDirectory<DVBSocketController> dir;
+ console::ScopedDirectory<DVBSocketController> dir;
typedef boost::function<void (const struct dvb_frontend_event & )> Callback;
///< Callback which is called when an asynchronous tuning succeeds.
DVBSocketController(DVBFrontendHandle frontendHandle_ = DVBFrontendHandle(0,0), const Callback & cb = NULL);
~DVBSocketController();
- senf::DVBDemuxSectionHandle createDVBDemuxSectionHandle( int adapternumber=0, int demuxnumber=0, bool addToConsole=false );
- senf::DVBDemuxPESHandle createDVBDemuxPESHandle( int adapternumber=0, int demuxnumber=0, bool addToConsole=false );
+ DVBDemuxSectionHandle createDVBDemuxSectionHandle( int adapternumber=0, int demuxnumber=0, bool addToConsole=false );
+ DVBDemuxPESHandle createDVBDemuxPESHandle( int adapternumber=0, int demuxnumber=0, bool addToConsole=false );
- void addToConsole(senf::DVBDemuxSectionHandle sh);
+ void addToConsole(DVBDemuxSectionHandle sh);
///< Adds an DVBDemuxSectionHandle to the console
/**< Allocates the functionality of DVBDemuxSectionProtocol
into the folder of the DVBSocketController. If the
console support will automatically removed.
\param[in] sh handle of a protocol*/
- void addToConsole(senf::DVBDemuxPESHandle sh);
+ void addToConsole(DVBDemuxPESHandle sh);
///< Adds an DVBDemuxPESHandle to the console
/**< Allocates the functionality of DVBDemuxPESProtocol into
the folder of the DVBSocketController. If the protocol
support will automatically removed.
\param[in] sh handle of a protocol*/
- void tuneToCMD( const std::string & input, const std::string & mode = "async");
+ void tuneToCMD(std::string const & input, std::string const & mode = "async");
///< Tunes a DVB device given by the type of the DVBFrontendHandle
/**< Tunes a DVB device by a channel name or complete
configuration line. This method was created for use
it would be searched in the config file.
\param[in] mode The mode in which it will tune
"sync" or "async"*/
- void tuneTo(const std::string & channel);
+ void tuneTo(std::string const & channel);
///< Tunes a DVB device to a channel
/**< Tunes a DVB device to a channel whose parameters
are stored in a config file. The method determines
/**< Tunes a DVB-C device in asynchronous mode and calls
the callback if existing. Needs full configuration. */
- dvb_frontend_event tuneTo_sync( const std::string & channel );
+ dvb_frontend_event tuneTo_sync(std::string const & channel );
///< Tunes a DVB device given by the type of the DVBFrontendHandle
/**< Tunes a DVB device, given by the type of the
DVBFrontendHandle, by a channel name in synchronous mode
\note The member "dvb_frontend_event.status" should be
correct by the most device driver implementations.
But "dvb_frontend_event.parameters" maybe not and is
- definitly not set by: Cinergy T� (2.6.27),
+ definitely not set by: Cinergy T� (2.6.27),
Terratec Cinergy DT USB XS Diversity (2.6.27) */
dvb_frontend_event tuneDVB_S_sync(unsigned int frequency, fe_spectral_inversion_t inversion, unsigned int symbole_rate, fe_code_rate_t code_rate);
\note The member "dvb_frontend_event.status" should be
correct by the most device driver implementations.
But "dvb_frontend_event.parameters" maybe not and is
- definitly not set by: Cinergy T� (2.6.27),
+ definitely not set by: Cinergy T� (2.6.27),
Terratec Cinergy DT USB XS Diversity (2.6.27) */
dvb_frontend_event tuneDVB_T_sync(unsigned int frequency,
\note The member "dvb_frontend_event.status" should be
correct by the most device driver implementations.
But "dvb_frontend_event.parameters" maybe not and is
- definitly not set by: Cinergy T� (2.6.27),
+ definitely not set by: Cinergy T� (2.6.27),
Terratec Cinergy DT USB XS Diversity (2.6.27) */
dvb_frontend_event tuneDVB_C_sync(unsigned int frequency,
\note The member "dvb_frontend_event.status" should be
correct by the most device driver implementations.
But "dvb_frontend_event.parameters" maybe not and is
- definitly not set by: Cinergy T� (2.6.27),
+ definitely not set by: Cinergy T� (2.6.27),
Terratec Cinergy DT USB XS Diversity (2.6.27) */
fe_type_t getType(); ///< Returns the type of the card. The type is defined in frontend.h
std::string getTuneInfo(const std::string & conf ="Ssbuf");
///< Returns a string which shows actual tuning status
/**< <br>"S" prints signal strength (in hex)
- <br>"s" prints singal to noise ration (in hex)
+ <br>"s" prints signal to noise ration (in hex)
<br>"b" prints bit error rate (in hex)
<br>"u" prints uncorrected blocks (in hex)
- <br>"f" prints readable overal status e.g. "Has Lock"<br>
+ <br>"f" prints readable overall status e.g. "Has Lock"<br>
These characters can be used to form the output. Be
aware, some features may not be supported be your
current driver implementation and could end in throwing
static unsigned int controllerNr;
unsigned int sectionNr;
unsigned int pesNr;
- senf::scheduler::FdEvent event;
+ scheduler::FdEvent event;
void readEvent(int i);
void initConsole();
};
}
+
+///////////////////////////////hh.e////////////////////////////////////////
+//#include "DVBSocketController.cci"
+//#include "DVBSocketController.ct"
+//#include "DVBSocketController.cti"
#endif
#include <netdb.h>
#include <boost/lexical_cast.hpp>
#include <senf/Socket/Protocols/AddressExceptions.hh>
+#include <senf/Socket/Protocols/Raw/MACAddress.hh>
+#include <senf/Socket/Protocols/Raw/EUI64.hh>
//#include "INet6Address.mpp"
#define prefix_
return ina;
}
+prefix_ senf::INet6Address senf::INet6Address::from_mac(MACAddress const & mac)
+{
+ INet6Address addr;
+ addr[0] = 0xfe;
+ addr[1] = 0x80;
+ addr[8] = mac[0] ^ 0x2; // invert the "u" (universal/local) bit; see RFC 4291 Appx. A
+ addr[9] = mac[1];
+ addr[10] = mac[2];
+ addr[11] = 0xff;
+ addr[12] = 0xfe;
+ addr[13] = mac[3];
+ addr[14] = mac[4];
+ addr[15] = mac[5];
+ return addr;
+}
+
+prefix_ senf::INet6Address senf::INet6Address::from_eui64(EUI64 const & eui)
+{
+ INet6Address addr;
+ addr[0] = 0xfe;
+ addr[1] = 0x80;
+ addr[8] = eui[0] ^ 0x2; // invert the "u" (universal/local) bit; see RFC 4291 Appx. A
+ std::copy(eui.begin()+1, eui.end(), addr.begin()+9);
+ return addr;
+}
+
+prefix_ senf::EUI64 senf::INet6Address::id()
+ const
+{
+ return EUI64::from_data(begin()+8);
+}
+
prefix_ std::ostream & senf::operator<<(std::ostream & os, INet6Address const & addr)
{
::in6_addr ina;
return addr;
}
-prefix_ senf::INet6Address senf::INet6Address::from_mac(senf::MACAddress const & mac)
-{
- INet6Address addr;
- addr[0] = 0xfe;
- addr[1] = 0x80;
- addr[8] = mac[0] ^ 0x2; // invert the "u" (universal/local) bit; see RFC 4291 Appx. A
- addr[9] = mac[1];
- addr[10] = mac[2];
- addr[11] = 0xff;
- addr[12] = 0xfe;
- addr[13] = mac[3];
- addr[14] = mac[4];
- addr[15] = mac[5];
- return addr;
-}
-
-prefix_ senf::INet6Address senf::INet6Address::from_eui64(senf::EUI64 const & eui)
-{
- INet6Address addr;
- addr[0] = 0xfe;
- addr[1] = 0x80;
- addr[8] = eui[0] ^ 0x2; // invert the "u" (universal/local) bit; see RFC 4291 Appx. A
- std::copy(eui.begin()+1, eui.end(), addr.begin()+9);
- return addr;
-}
-
prefix_ senf::INet6Network senf::INet6Address::network()
const
{
return senf::INet6Network(*this, 64);
}
-prefix_ senf::EUI64 senf::INet6Address::id()
- const
-{
- return senf::EUI64::from_data(begin()+8);
-}
-
prefix_ bool senf::INet6Address::universalId()
const
{
#include <senf/Utils/safe_bool.hh>
#include <senf/Utils/Tags.hh>
#include "INet4Address.hh"
-#include <senf/Socket/Protocols/Raw/MACAddress.hh>
-#include <senf/Socket/Protocols/Raw/EUI64.hh>
//#include "INet6Address.mpp"
#include "INet6Address.ih"
namespace senf {
+ class EUI64;
+ class MACAddress;
class INet6Network;
/** \brief INet6 network address
\par
INet4 compatible INet6 addresses are not directly
supported, they are deprecated in the RFC. */
- static INet6Address from_mac(senf::MACAddress const & mac);
+ static INet6Address from_mac(MACAddress const & mac);
///< Construct a link-local INet6 address
/**< This will construct a link local address of the form
<tt>fe80::xxxx:xxff:fexx:xxxx</tt>. */
- static INet6Address from_eui64(senf::EUI64 const & eui);
+ static INet6Address from_eui64(EUI64 const & eui);
///< Construct link-local INet6 address
/**< This will construct a link local address of the form
<tt>fe80::xxxx:xxxx:xxxx:xxxx</tt>. */
#include "INet6Address.hh"
#include <senf/Utils/String.hh>
#include <senf/Socket/Protocols/AddressExceptions.hh>
+#include <senf/Socket/Protocols/Raw/EUI64.hh>
+#include <senf/Socket/Protocols/Raw/MACAddress.hh>
#include <senf/Utils/auto_unit_test.hh>
#include <boost/test/test_tools.hpp>
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ void senf::LLSocketAddress::address(MACAddress const & addr)
-{
- std::copy(addr.begin(), addr.end(),&addr_.sll_addr[0]);
-}
-
prefix_ senf::LLSocketAddress::LLSocketAddress()
: BSDSocketAddress (sizeof(sockaddr_ll), AF_PACKET)
{}
-prefix_ void senf::LLSocketAddress::protocol(unsigned prot)
-{
- addr_.sll_protocol = htons(prot);
-}
-
prefix_ senf::LLSocketAddress::LLSocketAddress(unsigned prot, std::string const & iface)
: BSDSocketAddress (sizeof(sockaddr_ll), AF_PACKET)
{
return ntohs(addr_.sll_protocol);
}
+prefix_ void senf::LLSocketAddress::protocol(unsigned prot)
+{
+ addr_.sll_protocol = htons(prot);
+}
+
prefix_ unsigned senf::LLSocketAddress::arptype()
const
{
return MACAddress::from_data(&addr_.sll_addr[0]);
}
+prefix_ void senf::LLSocketAddress::address(MACAddress const & addr)
+{
+ std::copy(addr.begin(), addr.end(), &addr_.sll_addr[0]);
+}
+
///////////////////////////////cci.e///////////////////////////////////////
#undef prefix_
\throws UnknownInterfaceException if \a iface is not
a valid interface name. */
- LLSocketAddress(const LLSocketAddress& other);
- LLSocketAddress& operator=(const LLSocketAddress& other);
+ LLSocketAddress(LLSocketAddress const & other);
+ LLSocketAddress& operator=(LLSocketAddress const & other);
///@}
///////////////////////////////////////////////////////////////////////////
//#include "FileTarget.ih"
// Custom includes
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/ParsedCommand.hh>
+#include <senf/Utils/Console/Variables.hh>
+#include <senf/Utils/Console/ScopedDirectory.hh>
#include <senf/Utils/Exception.hh>
#include <boost/filesystem/path.hpp>
#include <locale>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <senf/Scheduler/ClockService.hh>
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/ScopedDirectory.hh>
+#include <senf/Utils/Console/ParsedCommand.hh>
//#include "LogFormat.mpp"
#define prefix_
// Custom includes
#include <sstream>
-#include "Target.hh"
+#include "TimeSource.hh"
#include <senf/Utils/Console/LazyDirectory.hh>
//#include "LogFormat.mpp"
//#include "SyslogTarget.ih"
// Custom includes
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/ParsedCommand.hh>
+#include <senf/Utils/Console/Traits.hh>
+#include <senf/Utils/Console/ScopedDirectory.hh>
//#include "SyslogTarget.mpp"
#define prefix_
#include <sstream>
#include <boost/algorithm/string/trim.hpp>
#include <boost/tokenizer.hpp>
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/ParsedCommand.hh>
+#include <senf/Utils/Console/Traits.hh>
+#include <senf/Utils/Console/ScopedDirectory.hh>
//#include "SyslogUDPTarget.mpp"
#define prefix_
#include <boost/format.hpp>
#include "ConsoleTarget.hh"
#include <senf/Utils/Console/Console.hh>
-#include <senf/Utils/Console/Sysdir.hh>
-#include <senf/Utils/membind.hh>
//#include "Target.mpp"
#define prefix_
#include <cmath>
#include <cstdlib>
#include <sstream>
-#include <senf/Utils/Console/Console.hh>
#include <senf/Utils/Format.hh>
#include "StatisticsTargets.hh"
// Custom includes
#include <boost/bind.hpp>
-#include <senf/Utils/Console/Console.hh>
+#include <senf/Utils/Console/ParsedCommand.hh>
#include "Statistics.hh"
//#include "StatisticsTargets.mpp"