17 #ifndef HH_SENF_Ext_NetEmu_InterfaceAPI_ 18 #define HH_SENF_Ext_NetEmu_InterfaceAPI_ 1 21 #include <boost/noncopyable.hpp> 194 :
public detail::CommfaceAccess<Receiver,Transmitter>,
195 private boost::noncopyable
200 using detail::CommfaceAccess<Receiver,Transmitter>::receiver;
201 using detail::CommfaceAccess<Receiver,Transmitter>::transmitter;
212 unsigned index()
const;
219 static void nodeId(
unsigned id);
224 std::string
const &
device()
const;
236 template <
class Stat>
247 boost::optional<senf::Statistics &>
statistic(std::string
const & name);
253 boost::signals2::signal<void (ClockService::clock_type)>
startStatistics;
290 virtual std::string
const &
v_device()
const = 0;
293 typedef boost::ptr_map<std::string, senf::Statistics> Statistics;
294 Statistics statistics_;
298 static unsigned nodeId_;
308 :
public detail::InterfaceAccess<Interface>
315 bool annotationMode()
const;
316 void annotationMode(
bool a);
317 bool promisc()
const;
318 void promisc(
bool v);
321 void flushRxQueues();
335 virtual bool v_annotationMode()
const = 0;
336 virtual void v_annotationMode(
bool a) = 0;
337 virtual bool v_promisc()
const = 0;
338 virtual void v_promisc(
bool v) = 0;
343 virtual void v_flushRxQueues() {};
351 :
public detail::InterfaceAccess<Interface>
358 unsigned mtu()
const;
359 void mtu(
unsigned v);
360 void flushTxQueues();
374 virtual unsigned v_mtu()
const = 0;
375 virtual void v_mtu(
unsigned v) = 0;
376 virtual void v_flushTxQueues() {} ;
390 public detail::CommfaceAccess<WiredReceiver,WiredTransmitter>
395 using detail::CommfaceAccess<WiredReceiver,WiredTransmitter>::receiver;
396 using detail::CommfaceAccess<WiredReceiver,WiredTransmitter>::transmitter;
409 public detail::InterfaceAccess<WiredInterface>
420 using detail::InterfaceAccess<WiredInterface>::interface;
430 public detail::InterfaceAccess<WiredInterface>
441 using detail::InterfaceAccess<WiredInterface>::interface;
454 :
public detail::InterfaceAccess<Interface>
464 boost::uint16_t
perturb(boost::uint16_t value);
boost::uint16_t perturb(boost::uint16_t value)
config::time_type clock_type
void macIdSeed(boost::uint16_t seed)
Re-seed the MACAddress address generator.
InterfaceDecorator public header.
unsigned index() const
Get interface index.
virtual void v_enable()=0
Called to enable interface.
bool enabled() const
true, if interface enabled
senf::Statistics & registerStatistics(std::string name, Stat &stat)
Register statistics source.
bool canReceive() const
true, if interface is receive capable
virtual void v_disable()=0
Called to disable interface.
Wired interface base class.
boost::uint8_t linkTypeId() const
InterfaceDecorator Decorator
Interface base class specific decorator type
TypedInterfaceDecorator< WiredInterface, Interface::Decorator > Decorator
InterfaceDeviceId deviceId() const
Wired receiver base class.
virtual bool v_enabled() const =0
Return true if interface is enabled.
static unsigned nodeId()
Get unique node id.
void init()
Initialize interface.
console::DirectoryNode & consoleDir() const
Access interface console directory.
std::string const & device() const
InterfaceId public header.
MACAddress const & id() const
Get interface MAC Address.
Interface API base class for receive capable interfaces.
void startStatistics(ClockService::clock_type inverval)
Start statistics generation.
Interface API base class for transmit capable interfaces.
ppi::connector::PassiveInputJack< EthernetPacket > input
bool canTransmit() const
true, if interface is transmit capable
Hardware interface base class.
console::DirectoryNode & interfaceDir()
ppi::connector::ActiveOutputJack< EthernetPacket > output
virtual MACAddress v_id() const =0
Return the interface mac address.
MACAddress uniqueMAC(boost::uint32_t magic)
Get pseudo-random but unique MACAddress.
std::string interfaceTypeName() const
Specialized Interface decorator base-class.
console::DirectoryNode & statisticsDir() const
Access the interface statistics directory.
boost::signals2::signal< void(Interface &, MACAddress)> idChangedSignal
virtual std::string const & v_device() const =0
Wired transmitter base class.
Generic Interface decorator base-class.
boost::optional< senf::Statistics & > statistic(std::string const &name)
Get registered statistic.
void disable()
Disable interface (aka ifconfig down)
void enable()
Enable interface (aka ifconfig up)
virtual boost::uint8_t v_linkTypeId() const =0