21 #include <boost/lexical_cast.hpp> 23 #include <senf/PPI.hh> 50 std::uint8_t accessCategory;
58 static WMMParameter defaultHtWMM[] = {
78 route( input, output).autoThrottling(
false);
96 route(input, output).autoThrottling(
false);
98 input.
onRequest( &TransmitGroup::request);
107 class EthernetInterface
111 EthernetInterface(std::string
const & iface)
120 WLANInterface(std::string
const & phy)
131 std::pair<std::string,std::string> initInterfaces(std::string
const & dev)
147 std::string ifname (adhocInterfaceName(wnlc.
phyIndex()));
150 return std::make_pair(ifname,monInterfaceName(wnlc.
phyIndex()));
153 std::string adhocInterfaceName(
int phyIndex)
155 return (boost::format(
"wiback-wlan%d") % phyIndex).str();
158 std::string monInterfaceName(
int phyIndex)
160 return (boost::format(
"wiback-mon%d") % phyIndex).str();
163 void join(
unsigned freq,
unsigned bwidth,
unsigned netId)
167 ssid =
"WiBACK-" + std::to_string(netId) +
"-" + std::to_string(freq);
168 std::uint64_t tmp ((std::uint64_t(netId) << 32) + freq);
170 sprintf( buf,
"00:%x:%x:%x:%x:%x", std::uint32_t((tmp >> 32) & 0xff), std::uint32_t((tmp >> 24) & 0xff),
171 std::uint32_t((tmp >> 16) & 0xff), std::uint32_t((tmp >> 8) & 0xff),
172 std::uint32_t((tmp >> 0) & 0xff));
175 joinAdhocNetwork( ssid, freq*1000, bwidth*1000)
177 ->beaconInterval(125)
181 modulation(senf::emu::WLANModulationParameter::MCS, 7);
182 txPower(txPowers().back().upper);
189 for (
unsigned i = 0; i < 4; i++){
190 wnlc.
set_txQueueParameters( defaultHtWMM[i].accessCategory, defaultHtWMM[i].cwMin, defaultHtWMM[i].cwMax, defaultHtWMM[i].aifs, defaultHtWMM[i].txOp);
void add_adhocInterface(std::string const &name)
IfaceNameSet all_interfaces() const
WirelessExtController public header.
void del_interface(std::string const &name)
void id(MACAddress const &eui)
Change interface MAC.
static MACAddress from_string(std::string const &s)
void add_monInterface(std::string const &name, int flags=MonitorFlags::None)
Apply additional modules to an interface.
void set_txQueueParameters(boost::uint8_t queue, boost::uint16_t cwMin, boost::uint16_t cwMax, boost::uint8_t aifs, boost::uint16_t txop)
Hardware Ethernet Interface.
#define SENF_PPI_MODULE(name)
void onRequest(Handler handler)
void set_retryLimit(boost::uint8_t shortLimit, boost::uint8_t longLimit)
HardwareEthernetInterface public header.
HardwareWLANInterface public header.