30 rxMode_(rxMode), mmapMode_(mmapMode)
45 handle_pkt = std::bind(&senf::emu::EthernetAnnotator::handle_pkt_dummy,
this, std::placeholders::_1);
62 if (rxMode_ and !pvid_) {
64 handle_pkt = std::bind(&senf::emu::EthernetAnnotator::handle_pkt_dummy_annotate,
this, std::placeholders::_1);
66 handle_pkt = std::bind(&senf::emu::EthernetAnnotator::handle_pkt_dummy,
this, std::placeholders::_1);
78 if (rxMode_ and mmapMode_) {
88 std::uint32_t tmp (vlanMismatch_);
105 prefix_ void senf::emu::EthernetAnnotator::requestRx()
109 netemu_annotations(eth);
115 prefix_ void senf::emu::EthernetAnnotator::requestRxMMAP()
119 netemu_annotations(eth);
125 prefix_ void senf::emu::EthernetAnnotator::requestRxMMAPpromisc()
129 netemu_annotations(eth);
138 EthVLanSPacket vlan (EthVLanSPacket::createInsertBefore(eth.next()));
139 vlan->vlanId() << *vlanId;
140 vlan->type_length() << eth->type_length();
144 EthVLanCPacket vlan (EthVLanCPacket::createInsertBefore(eth.next()));
145 vlan->vlanId() << *vlanId;
146 vlan->type_length() << eth->type_length();
156 prefix_ void senf::emu::EthernetAnnotator::requestTx()
166 handle_pkt = std::bind(&senf::emu::EthernetAnnotator::handle_pkt_insert_tag,
this, std::placeholders::_1);
172 handle_pkt = std::bind(&senf::emu::EthernetAnnotator::handle_pkt_remove_tag,
this, std::placeholders::_1);
178 handle_pkt = std::bind(&senf::emu::EthernetAnnotator::handle_pkt_dummy,
this, std::placeholders::_1);
201 std::uint16_t tl (vlan->type_length());
204 vlan.data().begin() + senf::EthVLanPacketParser::fixed_bytes,
205 vlan.size() - senf::EthVLanPacketParser::fixed_bytes);
208 tmp.data().resize( tmp.size() - senf::EthVLanPacketParser::fixed_bytes);
209 tmp->type_length() = tl;
219 std::uint16_t tl (vlan->type_length());
222 vlan.data().begin() + senf::EthVLanPacketParser::fixed_bytes,
223 vlan.size() - senf::EthVLanPacketParser::fixed_bytes);
226 tmp.data().resize( tmp.size() - senf::EthVLanPacketParser::fixed_bytes);
227 tmp->type_length() = tl;
258 std::uint16_t tl (eth->type_length());
263 vtmp->vlanId() = pvid_.
id();
264 vtmp->type_length() = tl;
268 vtmp->vlanId() = pvid_.
id();
269 vtmp->type_length() = tl;
275 vtmp->vlanId() = pvid_.
id();
276 vtmp->type_length() = tl;
280 vtmp->vlanId() = pvid_.
id();
281 vtmp->type_length() = tl;
EthernetAnnotator(bool rxMode, bool mmapMode, senf::MACAddress const &id_=senf::MACAddress::None)
Route< connector::InputConnector, connector::OutputConnector > & route(connector::InputConnector &input, connector::OutputConnector &output)
Incoming or outgoing interface.
ppi::connector::ActiveOutput< senf::EthernetPacket > output
QueueReadPolicy::Buffer const * value
ConcretePacket< EthVLanSPacketType > EthVLanSPacket
static const EtherTypes::key_t etherType
Annotations public header.
HardwareEthernetInterface internal header.
EthernetPacket prependAnnotationsPacket(Packet const &pkt, MACAddress const &src_=senf::MACAddress::None, MACAddress const &dst_=senf::MACAddress::Broadcast)
std::uint32_t vlanMismatch()
static const EtherTypes::key_t etherType
void insertTag(VLanId const &pvid)
MACAddress const & id() const
ppi::connector::PassiveInput< senf::EthernetPacket > input
Incoming packet timestamp.
void removeTag(VLanId const &pvid)
ConcretePacket< EthVLanCPacketType > EthVLanCPacket
void onRequest(Handler handler)
boost::optional< unsigned > vlan() const
ConcretePacket< EthernetPacketType > EthernetPacket
AnnotationsPacket public header.