diff options
author | Ed Tanous <ed@tanous.net> | 2020-07-18 22:03:51 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2021-01-07 23:38:52 +0300 |
commit | b0972a636efe64712fee75b4643f6a5ac61e3a0b (patch) | |
tree | 3bf9031be6305a0a2ac5dc6170e398e8cfdac337 /redfish-core/lib/network_protocol.hpp | |
parent | 32476386c35aa6282e8d9ea9bbed8b5217499ef4 (diff) | |
download | bmcweb-b0972a636efe64712fee75b4643f6a5ac61e3a0b.tar.xz |
Move network protocol to a constexpr struct
Another clang-tidy warning about global construction of things that
could throw. Considering we don't actually use this as a map anywhere,
move to a constexpr array of values.
Tested: Clang-tidy now passes cert-* check.
curl --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/Managers/bmc/NetworkProtocol
{
"@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol",
"@odata.type": "#ManagerNetworkProtocol.v1_5_0.ManagerNetworkProtocol",
"Description": "Manager Network Service",
"FQDN": "qemux86",
"HTTP": {
"Port": 0,
"ProtocolEnabled": false
},
"HTTPS": {
"Certificates": {
"@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates"
},
"Port": 443,
"ProtocolEnabled": true
},
"HostName": "qemux86",
"IPMI": {
"Port": null,
"ProtocolEnabled": false
},
"Id": "NetworkProtocol",
"NTP": {
"NTPServers": [],
"ProtocolEnabled": true
},
"Name": "Manager Network Protocol",
"SSH": {
"Port": 22,
"ProtocolEnabled": true
},
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
}
}%
Change-Id: I2bdae321fc1cbb418ed302453ec6109ee2ed32c1
Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'redfish-core/lib/network_protocol.hpp')
-rw-r--r-- | redfish-core/lib/network_protocol.hpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp index b82e697b78..65b90f7571 100644 --- a/redfish-core/lib/network_protocol.hpp +++ b/redfish-core/lib/network_protocol.hpp @@ -54,10 +54,8 @@ using UnitStruct = std::string, sdbusplus::message::object_path, uint32_t, std::string, sdbusplus::message::object_path>; -const static boost::container::flat_map<const char*, std::string> - protocolToDBus{{"SSH", "dropbear"}, - {"HTTPS", "bmcweb"}, - {"IPMI", "phosphor-ipmi-net"}}; +const static std::array<std::pair<const char*, const char*>, 3> protocolToDBus{ + {{"SSH", "dropbear"}, {"HTTPS", "bmcweb"}, {"IPMI", "phosphor-ipmi-net"}}}; inline void extractNTPServersAndDomainNamesData(const GetManagedObjects& dbusData, |