mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-02 11:47:56 +00:00
Framework update.
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cstring>
|
||||||
#include "Poco/String.h"
|
#include "Poco/String.h"
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
@@ -428,6 +429,7 @@ namespace OpenWifi::uCentralProtocol {
|
|||||||
static const char *RADIUSACCT = "acct";
|
static const char *RADIUSACCT = "acct";
|
||||||
static const char *RADIUSAUTH = "auth";
|
static const char *RADIUSAUTH = "auth";
|
||||||
static const char *RADIUSDST = "dst";
|
static const char *RADIUSDST = "dst";
|
||||||
|
static const char *IES = "ies";
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace OpenWifi::uCentralProtocol::Events {
|
namespace OpenWifi::uCentralProtocol::Events {
|
||||||
@@ -458,7 +460,7 @@ namespace OpenWifi::uCentralProtocol::Events {
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline static EVENT_MSG EventFromString(const std::string & Method) {
|
inline static EVENT_MSG EventFromString(const std::string & Method) {
|
||||||
static std::vector<std::pair<const char *,EVENT_MSG>> Values{
|
static std::vector<std::pair<const char *,EVENT_MSG>> EventValues{
|
||||||
{ CFGPENDING , ET_CFGPENDING },
|
{ CFGPENDING , ET_CFGPENDING },
|
||||||
{ CONNECT, ET_CONNECT },
|
{ CONNECT, ET_CONNECT },
|
||||||
{ CRASHLOG, ET_CRASHLOG },
|
{ CRASHLOG, ET_CRASHLOG },
|
||||||
@@ -471,11 +473,12 @@ namespace OpenWifi::uCentralProtocol::Events {
|
|||||||
{ TELEMETRY, ET_TELEMETRY }
|
{ TELEMETRY, ET_TELEMETRY }
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string L = Poco::toLower(Method);
|
const auto l_method = Poco::toLower(Method);
|
||||||
auto hint = std::find_if(cbegin(Values),cend(Values),[&](const std::pair<const char *,EVENT_MSG> &v) ->bool { return strcmp(v.first,L.c_str())==0; });
|
for(const auto &[event_name,event_type]:EventValues) {
|
||||||
if(hint == cend(Values))
|
if(std::strcmp(event_name,Method.c_str())==0)
|
||||||
|
return event_type;
|
||||||
|
}
|
||||||
return ET_UNKNOWN;
|
return ET_UNKNOWN;
|
||||||
return hint->second;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user