}
}
+prefix_ void senf::WLANPacket_MgtFrameParser::sequenceNumber(boost::uint16_t sn)
+{
+ seqNumber_2() = seqNumber_2() | (sn >> 4 ) ;
+ seqNumber_1() = seqNumber_1() | sn;
+}
+
prefix_ void senf::WLANPacket_MgtFrameType::dump(packet p, std::ostream &os)
{
boost::io::ios_all_saver ias(os);
os << senf::fieldName("source") << p->sourceAddress() << "\n";
}
+prefix_ void senf::WLANPacket_DataFrameParser::sequenceNumber(boost::uint16_t sn)
+{
+ seqNumber_2() = seqNumber_2() | (sn >> 4 ) ;
+ seqNumber_1() = seqNumber_1() | sn;
+}
+
+
prefix_ senf::MACAddressParser senf::WLANPacket_DataFrameParser::destinationAddress()
const
{
boost::uint16_t sequenceNumber() const {
return (uint16_t)(seqNumber_2()) << 4 | seqNumber_1();
};
+
+ void sequenceNumber(boost::uint16_t sn);
};
/** \brief WLAN Management frame packet
boost::uint16_t sequenceNumber() const {
return (uint16_t)(seqNumber_2()) << 4 | seqNumber_1();
};
+
+ void sequenceNumber(boost::uint16_t sn);
// TODO fourth address field in case of WDS
// SENF_PARSER_PRIVATE_VARIANT (wds_, dsBits,
senf::WLANPacket_DataFrame p (senf::WLANPacket_DataFrame::create());
SENF_CHECK_NO_THROW( p->bssid() = senf::MACAddress::from_string("00:1a:4d:3e:c7:5c") );
+ SENF_CHECK_NO_THROW(p->sequenceNumber(4095u));
+
BOOST_CHECK_EQUAL( p->type(), 2u );
+ BOOST_CHECK_EQUAL( p->sequenceNumber(), 4095u );
}
SENF_CHECK_NO_THROW(
p->bssid() = senf::MACAddress::from_string("00:1a:4d:3e:c7:5c")
);
+ SENF_CHECK_NO_THROW(
+ p->sequenceNumber(555u);
+ );
+
+ std::cout << p->sequenceNumber() << "\n";
BOOST_CHECK_EQUAL( p->type(), 0u );
+ BOOST_CHECK_EQUAL( p->sequenceNumber(), 555u );
}
senf::WLANPacket_CtrlFrame p (senf::WLANPacket_CtrlFrame::create()) ;
p->receiverAddress() = senf::MACAddress::from_string("00:1a:4d:3e:c7:5c");
p->set_ack();
+
BOOST_CHECK_EQUAL( p->type(), 1u);
BOOST_CHECK_EQUAL( p->subtype(), 13u);
}