Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ AC_CONFIG_FILES(dcwapd.linuxjsonstatic/Makefile)

AC_CONFIG_MACRO_DIR([m4])

AX_CXX_COMPILE_STDCXX_11()

AC_ENABLE_STATIC
AC_DISABLE_SHARED
LT_INIT
Expand Down
8 changes: 4 additions & 4 deletions dcw/controller.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace {
struct UnhandledMessageTypeException : public std::exception {
virtual const char* what() const throw() {
const char* what() const noexcept override {
return "Unhandled message type";
}
};
Expand Down Expand Up @@ -193,7 +193,7 @@ void Controller::OnStationUnjoin(const MacAddress& primaryMacAddr, const Message
//remove any channel bondings matching the provided data channel mac addresses
for (unsigned i = 0; i < m.data_macaddr_count; i++) {
const ::dcw::MacAddress dcaddr(m.data_macaddrs[i]);
::dcw::TrafficPolicy::DataChannelMap::iterator dcmEntry = state.policy.dataChannels.find(dcaddr);
auto dcmEntry = state.policy.dataChannels.find(dcaddr);
if (dcmEntry == state.policy.dataChannels.end()) continue;
if (dcmEntry->second == NULL) {
dcwlogwarnf("Data channel MAC address %s on client %s is not currently bonded\n", dcaddr.ToString().c_str(), primaryMacAddr.ToString().c_str());
Expand All @@ -204,7 +204,7 @@ void Controller::OnStationUnjoin(const MacAddress& primaryMacAddr, const Message
}

//does this client have any more bonded channels?
for (::dcw::TrafficPolicy::DataChannelMap::iterator dcmIter = state.policy.dataChannels.begin();
for (auto dcmIter = state.policy.dataChannels.begin();
dcmIter != state.policy.dataChannels.end(); dcmIter++) {
if (dcmIter->second != NULL) {
//yup... the client is still bonded to something...
Expand Down Expand Up @@ -236,7 +236,7 @@ void Controller::OnStationAck(const MacAddress& primaryMacAddr, const Message& m
dcwlogdbgf("Got a station ACK from %s\n", primaryMacAddr.ToString().c_str());

// first make sure this client has actually sent a join first...
ClientStateMap::iterator client = _clients.find(primaryMacAddr);
auto client = _clients.find(primaryMacAddr);
if (client == _clients.end()) {
dcwlogerrf("Got a client ACK without a station join from %s\n", primaryMacAddr.ToString().c_str());
Message reply(DCWMSG_AP_REJECT_STA);
Expand Down
4 changes: 2 additions & 2 deletions dcw/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Controller : private EventReactor::IOSubscriber {

public:
Controller(const DevicePolicy& devicePolicy, TrafficSorter& trafficSorter, const BasicNetwork& network, EventReactor& eventReactor, MessageSocket& msgSocket);
virtual ~Controller();
~Controller() override;

void SetTelemetryCollector(TelemetryCollector * const telemetryCollector);

Expand All @@ -40,7 +40,7 @@ class Controller : private EventReactor::IOSubscriber {
ClientStateMap _clients;
TelemetryCollector * _telemetryCollector;

virtual void OnIOReady(EventReactor::IOProvider& iop);
void OnIOReady(EventReactor::IOProvider& iop) override;
void OnMessage(const MacAddress& source, const Message& msg);
void OnStationJoin(const MacAddress& primaryMacAddr, const Message& msg);
void OnStationUnjoin(const MacAddress& primaryMacAddr, const Message& msg);
Expand Down
4 changes: 2 additions & 2 deletions dcw/filetrafficfilterprofile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ struct FOpenFailedException : public std::exception {
_msg(GenMsg(filename)) {
//
}
virtual ~FOpenFailedException() throw() {}
virtual const char* what() const throw() {
~FOpenFailedException() noexcept override = default;
const char* what() const noexcept override {
return _msg.c_str();
}
};
Expand Down
4 changes: 2 additions & 2 deletions dcw/filetrafficfilterprofile.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ namespace dcw {
class FileTrafficFilterProfile : public CFileTrafficFilterProfile {
public:
FileTrafficFilterProfile(const char * const name, const char * const filename);
virtual ~FileTrafficFilterProfile();
~FileTrafficFilterProfile() override;
FileTrafficFilterProfile(const FileTrafficFilterProfile& rhv); //no reason this cant be copied

const char *GetFilename() const;
virtual FILE *fopen() const;
FILE *fopen() const override;

private:
const std::string _filename;
Expand Down
2 changes: 1 addition & 1 deletion dcw/macaddress.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace {
struct MacAddressParseException : public std::exception {
virtual const char* what() const throw() {
const char* what() const noexcept override {
return "MAC Address Parse Exception";
}
};
Expand Down
4 changes: 2 additions & 2 deletions dcw/message.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

namespace {
struct MessageMarshallException : public std::exception {
virtual const char* what() const throw() {
const char* what() const noexcept override {
return "Failed to marshall DCW message from buffer!";
}
};
struct MessageSerializeException : public std::exception {
virtual const char* what() const throw() {
const char* what() const noexcept override {
return "Failed to serialize DCW message from buffer!";
}
};
Expand Down
2 changes: 1 addition & 1 deletion dcw/simplenetwork.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const BasicChannel& SimpleNetwork::GetPrimaryChannel() const {
}

void SimpleNetwork::GetDataChannels(ChannelSet& output) const {
for (std::list<SimpleChannel>::const_iterator i = _dataChannels.begin(); i != _dataChannels.end(); i++) {
for (auto i = _dataChannels.begin(); i != _dataChannels.end(); i++) {
output.insert(&(*i));
}
}
Expand Down
10 changes: 5 additions & 5 deletions dcw/simplenetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class SimpleChannel : public BasicChannel {
SimpleChannel(const char * const ssidName);
SimpleChannel(const SimpleChannel& rhv);
explicit SimpleChannel(const BasicChannel& bc);
virtual ~SimpleChannel();
~SimpleChannel() override;

virtual const char *GetSsidName() const;
const char *GetSsidName() const override;
};

//SimpleNetwork -- Simple text-only (ssid) implementation of a network
Expand All @@ -30,9 +30,9 @@ class SimpleNetwork : public BasicNetwork {

public:
explicit SimpleNetwork(const char * const primarySsidName);
virtual ~SimpleNetwork();
virtual const BasicChannel& GetPrimaryChannel() const;
virtual void GetDataChannels(ChannelSet& output) const;
~SimpleNetwork() override;
const BasicChannel& GetPrimaryChannel() const override;
void GetDataChannels(ChannelSet& output) const override;
void InsertDataChannel(const char * const ssidName);
};

Expand Down
4 changes: 2 additions & 2 deletions dcw/stringtrafficfilterprofile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ struct FMemOpenFailedException : public std::exception {
_msg(GenMsg()) {
//
}
virtual ~FMemOpenFailedException() throw() {}
virtual const char* what() const throw() {
~FMemOpenFailedException() noexcept override = default;
const char* what() const noexcept override {
return _msg.c_str();
}
};
Expand Down
4 changes: 2 additions & 2 deletions dcw/stringtrafficfilterprofile.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ namespace dcw {
class StringTrafficFilterProfile : public CFileTrafficFilterProfile {
public:
StringTrafficFilterProfile(const char * const name, const char * const contents);
virtual ~StringTrafficFilterProfile();
~StringTrafficFilterProfile() override;
StringTrafficFilterProfile(const StringTrafficFilterProfile& rhv); //no reason this cant be copied

const char *GetContents() const;
virtual FILE *fopen() const;
FILE *fopen() const override;

private:
const std::string _contents;
Expand Down
2 changes: 1 addition & 1 deletion dcwapd.arrisxb3/arrisxb3_datachan_provisioner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace {
struct ActivateDataChannelFailedException : public std::exception {
virtual const char* what() const throw() {
virtual const char* what() const noexcept {
return "Failed to activate data channel";
}
};
Expand Down
2 changes: 1 addition & 1 deletion dcwapd.arrisxb3/arrisxb3_dcw.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace {
struct BridgeResoveFailedException : public std::exception {
virtual const char* what() const throw() {
const char* what() const noexcept override {
return "Failed to resolv bridge interface name";
}
};
Expand Down
36 changes: 18 additions & 18 deletions dcwlinux/ap_configuration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace {
struct ReloadRunningConfigurationNotImplementedException : public std::exception {
virtual const char* what() const throw() {
const char* what() const noexcept override {
return "ReloadRunningConfiguration() Not Yet Implemented";
}
};
struct ValidationFailureException : public std::exception {
virtual const char* what() const throw() {
const char* what() const noexcept override {
return "Failed to validate configuration!";
}
};
Expand Down Expand Up @@ -44,13 +44,13 @@ APConfiguration::~APConfiguration() {

void APConfiguration::Apply(MacRemapperDriver& driver, VAPManager& vapman, ::dcw::EventReactor& eventReactor) const {
//load the traffic filter profiles into the driver...
for (CFTFPMap::const_iterator i = _trafficFilterProfiles.begin(); i != _trafficFilterProfiles.end(); i++) {
for (auto i = _trafficFilterProfiles.begin(); i != _trafficFilterProfiles.end(); i++) {
driver.ParseAndLoadFilter(*i->second); //XXX defensive check for NULL?
}


//instanciate all the virtual APs... (one per primary SSID)
for (PrimaryDataMap::const_iterator i = _primaryDataMap.begin(); i != _primaryDataMap.end(); i++) {
for (auto i = _primaryDataMap.begin(); i != _primaryDataMap.end(); i++) {
const char * const pssidName = i->first.c_str();
const SsidIfnameMap::const_iterator ifnameIter = _ssidIfnameMap.find(pssidName);
if (ifnameIter == _ssidIfnameMap.end()) {
Expand All @@ -70,7 +70,7 @@ void APConfiguration::Apply(MacRemapperDriver& driver, VAPManager& vapman, ::dcw
);

//give it its data channels...
for (SsidSet::const_iterator j = i->second.begin(); j != i->second.end(); j++) {
for (auto j = i->second.begin(); j != i->second.end(); j++) {
const char * const dssidName = j->c_str();

//determine the data channel interface name (if any)
Expand All @@ -93,32 +93,32 @@ void APConfiguration::Dump() const {
dcwlogdbgf("%s\n", "AP Configuration Dump:");

dcwlogdbgf("%s\n", " Traffic Filter Profiles:");
for (CFTFPMap::const_iterator i = _trafficFilterProfiles.begin(); i != _trafficFilterProfiles.end(); i++) {
for (auto i = _trafficFilterProfiles.begin(); i != _trafficFilterProfiles.end(); i++) {
dcwlogdbgf(" %s\n", i->second->GetName());
}

dcwlogdbgf("%s\n", " SSIDs:");
for (PrimaryDataMap::const_iterator i = _primaryDataMap.begin(); i != _primaryDataMap.end(); i++) {
for (auto i = _primaryDataMap.begin(); i != _primaryDataMap.end(); i++) {
dcwlogdbgf(" Primary '%s'\n", i->first.c_str());
for(SsidSet::const_iterator j = i->second.begin(); j != i->second.end(); j++) {
for(auto j = i->second.begin(); j != i->second.end(); j++) {
dcwlogdbgf(" Data '%s'\n", j->c_str());
}
}

dcwlogdbgf("%s\n", " SSID Interfaces:");
for (SsidIfnameMap::const_iterator i = _ssidIfnameMap.begin(); i != _ssidIfnameMap.end(); i++) {
for (auto i = _ssidIfnameMap.begin(); i != _ssidIfnameMap.end(); i++) {
dcwlogdbgf(" '%s' -> '%s'\n", i->first.c_str(), i->second.c_str());
}

dcwlogdbgf("%s\n", " Station Traffic Filter Profiles:");
for (StationCFTFPMap::const_iterator i = _stationFilterProfiles.begin(); i != _stationFilterProfiles.end(); i++) {
for (auto i = _stationFilterProfiles.begin(); i != _stationFilterProfiles.end(); i++) {
dcwlogdbgf(" '%s' -> '%s'\n", i->first.ToString().c_str(), i->second->GetName());
}
}

const dcw::TrafficFilterProfile& APConfiguration::GetTrafficFilterProfile(const dcw::MacAddress& device) const {
//first lookup the TFP name we intend to use for this device...
StationCFTFPMap::const_iterator stationTfp = _stationFilterProfiles.find(device);
auto stationTfp = _stationFilterProfiles.find(device);
if (stationTfp == _stationFilterProfiles.end()) {
//lookup failed... use the default traffic filter profile for this device...
dcwlogdbgf("Defaulting device %s to default profile\n", device.ToString().c_str());
Expand Down Expand Up @@ -183,7 +183,7 @@ void APConfiguration::LoadConfiguration(const APConfigurationProvider& conf) {
conf.GetPrimarySsids(primarySsids); //XXX... is it a good idea to load directly here? (as opposed to a seperate set declared here on the stack)

//load each primary SSID's configuration...
for (SsidSet::const_iterator pssidIter = primarySsids.begin(); pssidIter != primarySsids.end(); pssidIter++) {
for (auto pssidIter = primarySsids.begin(); pssidIter != primarySsids.end(); pssidIter++) {
const char * const pssidName = pssidIter->c_str();

//create an entry in the primary data map...
Expand All @@ -207,7 +207,7 @@ void APConfiguration::LoadConfiguration(const APConfigurationProvider& conf) {
//get the associated data channels for this primary ssid...
SsidSet dataSsids;
conf.GetDataSsids(dataSsids, pssidName);
for (SsidSet::const_iterator dssidIter = dataSsids.begin(); dssidIter != dataSsids.end(); dssidIter++) {
for (auto dssidIter = dataSsids.begin(); dssidIter != dataSsids.end(); dssidIter++) {
const char * const dssidName = dssidIter->c_str();

//get the data channel's interface name (if any)
Expand Down Expand Up @@ -249,7 +249,7 @@ void APConfiguration::Cleanup() {

void APConfiguration::SelfValidate() const {

for (PrimaryDataMap::const_iterator pdcIter = _primaryDataMap.begin(); pdcIter != _primaryDataMap.end(); pdcIter++) {
for (auto pdcIter = _primaryDataMap.begin(); pdcIter != _primaryDataMap.end(); pdcIter++) {
const char * const pssidName = pdcIter->first.c_str();

//ensure each primary SSID has at least one data channel
Expand All @@ -259,7 +259,7 @@ void APConfiguration::SelfValidate() const {
}

//validate the associated data channels:
for (SsidSet::const_iterator dssidIter = pdcIter->second.begin(); dssidIter != pdcIter->second.end(); dssidIter++) {
for (auto dssidIter = pdcIter->second.begin(); dssidIter != pdcIter->second.end(); dssidIter++) {
const char * const dssidName = dssidIter->c_str();

//ensure the data ssid name is NOT used as a primary...
Expand All @@ -269,15 +269,15 @@ void APConfiguration::SelfValidate() const {
}

//warn for each data SSID that does not have an associated network interface
SsidIfnameMap::const_iterator sifnIter = _ssidIfnameMap.find(dssidName);
auto sifnIter = _ssidIfnameMap.find(dssidName);
if (sifnIter == _ssidIfnameMap.end()) {
dcwlogwarnf("Configured data SSID \"%s\" for primary SSID \"%s\" has no associated network interface. Will use the primary interface.\n", dssidName, pssidName);
}
}


//ensure each primary SSID has an associated network interface
SsidIfnameMap::const_iterator sifnIter = _ssidIfnameMap.find(pssidName);
auto sifnIter = _ssidIfnameMap.find(pssidName);
if (sifnIter == _ssidIfnameMap.end()) {
dcwlogerrf("Configured primary SSID \"%s\" has no associated network interface\n", pssidName);
throw ValidationFailureException();
Expand All @@ -291,7 +291,7 @@ void APConfiguration::SelfValidate() const {
}

//ensure we have a default traffic filter profile
CFTFPMap::const_iterator tfpIter = _trafficFilterProfiles.find(_defaultProfileName);
auto tfpIter = _trafficFilterProfiles.find(_defaultProfileName);
if (tfpIter == _trafficFilterProfiles.end()) {
dcwlogerrf("We don't have a default traffic profile (\"%s\")!\n", _defaultProfileName);
throw ValidationFailureException();
Expand Down
6 changes: 3 additions & 3 deletions dcwlinux/ap_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ class APConfiguration : public dcw::DevicePolicy {

public:
explicit APConfiguration(const APConfigurationProvider& initialConfiguration);
virtual ~APConfiguration();
~APConfiguration() override;

void Apply(MacRemapperDriver& driver, VAPManager& vapman, ::dcw::EventReactor& eventReactor) const;

static void ReloadRunningConfiguration(const APConfigurationProvider& newConfiguration);

void Dump() const;

virtual const dcw::TrafficFilterProfile& GetTrafficFilterProfile(const dcw::MacAddress& device) const;
virtual void FilterPermittedDataChannels(const dcw::MacAddress& device, const unsigned deviceTotalCapableDataChannels, dcw::BasicNetwork::ChannelSet& allowedDataChannels) const;
const dcw::TrafficFilterProfile& GetTrafficFilterProfile(const dcw::MacAddress& device) const override;
void FilterPermittedDataChannels(const dcw::MacAddress& device, const unsigned deviceTotalCapableDataChannels, dcw::BasicNetwork::ChannelSet& allowedDataChannels) const override;


private:
Expand Down
4 changes: 2 additions & 2 deletions dcwlinux/brctlnetwork.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace {
struct BadWiFiChannelInterfaceException : public std::exception {
virtual const char* what() const throw() {
const char* what() const noexcept override {
return "Bad WiFi Channel Interface Exception";
}
};
Expand Down Expand Up @@ -95,7 +95,7 @@ const ::dcw::BasicChannel& BrctlNetwork::GetPrimaryChannel() const {
}

void BrctlNetwork::GetDataChannels(ChannelSet& output) const {
for (std::list<BrctlChannel>::const_iterator i = _dataChannels.begin(); i != _dataChannels.end(); i++) {
for (auto i = _dataChannels.begin(); i != _dataChannels.end(); i++) {
output.insert(&(*i));
}
}
Expand Down
12 changes: 6 additions & 6 deletions dcwlinux/brctlnetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class BrctlChannel : public ::dcw::BasicChannel {
BrctlChannel(const char * const ssidName, const char * const brifName);
BrctlChannel(const BrctlChannel& rhv);
BrctlChannel(const BasicChannel& bc);
virtual ~BrctlChannel();
~BrctlChannel() override;

virtual const char *GetSsidName() const;
virtual const char *GetIfName() const;
const char *GetSsidName() const override;
const char *GetIfName() const;

private:
void ValidateBrifName() const;
Expand All @@ -37,9 +37,9 @@ class BrctlNetwork : public ::dcw::BasicNetwork {

public:
BrctlNetwork(const char * const primarySsidName, const char * const primaryBrifName);
virtual ~BrctlNetwork();
virtual const ::dcw::BasicChannel& GetPrimaryChannel() const;
virtual void GetDataChannels(ChannelSet& output) const;
~BrctlNetwork() override;
const ::dcw::BasicChannel& GetPrimaryChannel() const override;
void GetDataChannels(ChannelSet& output) const override;
void InsertDataChannel(const char * const ssidName, const char *brifName = NULL); //NULL = no interface remap...

};
Expand Down
Loading