28 prefix_ senf::emu::detail::EmulatedEthernetInterfaceNet::
29 EmulatedEthernetInterfaceNet()
30 : receiveFilter_ (self()), transmitFilter_ (self()),
31 receiveInput (receiveFilter_.input),
32 receiveOutput (receiveFilter_.output), transmitInput (transmitFilter_.input),
33 transmitOutput (transmitFilter_.output)
42 boost::uint32_t
const ethernetMagic (0x657468);
46 :
Base(receiveOutput, transmitInput), vlanGroupRange_ (
"239.203.0.0/16"),
47 portbase_(11264), vlanId_(0), dev_(
"NetEMU-Ethernet")
49 ppi::connect(receiverJack, receiveInput);
50 ppi::connect(transmitOutput, transmitterJack);
63 namespace kw = console::kw;
64 namespace fty = console::factory;
68 vlan, (boost::uint16_t) ))
69 .arg(
"vlan",
"VLAN id")
70 .doc(
"Get/set the VLAN id of the ethernet interface")
78 UDPClientHandle::Address addr (vlanGroupRange_.
host(vlanId_),portbase_+vlanId_);
79 emulationAddress(addr);
102 UDPClientHandle::Address addr (vlanGroupRange_.
host(vlanId_),portbase_+vlanId_);
103 emulationAddress(addr);
116 prefix_ senf::emu::detail::EmulatedEthernetReceiveFilter::
120 route(input, output);
121 input.onRequest(&EmulatedEthernetReceiveFilter::request);
124 prefix_ void senf::emu::detail::EmulatedEthernetReceiveFilter::request()
137 if (iface_.annotationMode())
148 prefix_ senf::emu::detail::EmulatedEthernetTransmitFilter::
152 route(input, output);
153 input.onRequest(&EmulatedEthernetTransmitFilter::request);
156 prefix_ void senf::emu::detail::EmulatedEthernetTransmitFilter::request()
159 e->source() = iface_.id();
EmulatedEthernetInterface()
#define SENF_MEMBINDFNP(ret, cls, fn, args)
static ConcretePacket createBefore(Packet const &packet)
Emulated Ethernet Interface.
Incoming or outgoing interface.
EthernetPacket prependAnnotationsPacket(Packet const &pkt, MACAddress const &src_=senf::MACAddress::None, MACAddress const &dst_=senf::MACAddress::Broadcast)
std::string const & v_device() const override
boost::uint16_t vlan() const
console::ScopedDirectory & consoleDir()
EmulatedEthernetInterface public header.
INet4Address host(boost::uint32_t number)
MACAddress uniqueMAC(boost::uint32_t magic)
Get pseudo-random but unique MACAddress.
ConcretePacket< EthernetPacketType > EthernetPacket
AnnotationsPacket public header.