diff options
author | Xiaochao Ma <maxiaochao@inspur.com> | 2020-03-23 04:46:27 +0300 |
---|---|---|
committer | Xiaochao Ma <maxiaochao@inspur.com> | 2020-04-24 13:23:02 +0300 |
commit | 6193231855a08068dc74c33ae95efd23782d4157 (patch) | |
tree | dc113655ba3950a13dc1c2bb275feab91f906c73 /redfish-core/lib/network_protocol.hpp | |
parent | c6a620f2e01ce5f1551ecc4455624654282d79c7 (diff) | |
download | bmcweb-6193231855a08068dc74c33ae95efd23782d4157.tar.xz |
BMCWeb: Add SNMPinfo in redfish-NetworkProtocol
Add SNMP infomation in NetworkProtocol, contains version information, etc.
Teseted:
Tested on fp5280g2 (meta-inspur/meta-fp5280g2).
Currently only the SNMPv2 version is supported in the community,
so only v2 is set to true.
Ran Redfish validator successfully.
Signed-off-by: Xiaochao Ma <maxiaochao@inspur.com>
Change-Id: I983add2e24f16ea362d413a4fd3577ccfc2911d2
Diffstat (limited to 'redfish-core/lib/network_protocol.hpp')
-rw-r--r-- | redfish-core/lib/network_protocol.hpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp index 3d61274a47..d3d9580f7e 100644 --- a/redfish-core/lib/network_protocol.hpp +++ b/redfish-core/lib/network_protocol.hpp @@ -190,7 +190,7 @@ class NetworkProtocol : public Node void getData(const std::shared_ptr<AsyncResp>& asyncResp) { asyncResp->res.jsonValue["@odata.type"] = - "#ManagerNetworkProtocol.v1_4_0.ManagerNetworkProtocol"; + "#ManagerNetworkProtocol.v1_5_0.ManagerNetworkProtocol"; asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Managers/bmc/NetworkProtocol"; asyncResp->res.jsonValue["Id"] = "NetworkProtocol"; @@ -199,8 +199,29 @@ class NetworkProtocol : public Node asyncResp->res.jsonValue["Status"]["Health"] = "OK"; asyncResp->res.jsonValue["Status"]["HealthRollup"] = "OK"; asyncResp->res.jsonValue["Status"]["State"] = "Enabled"; - - // HTTP is Mandatory attribute as per OCP Baseline Profile – v1.0.0, + asyncResp->res.jsonValue["SNMP"]["ProtocolEnabled"] = true; + asyncResp->res.jsonValue["SNMP"]["Port"] = 161; + asyncResp->res.jsonValue["SNMP"]["AuthenticationProtocol"] = + "CommunityString"; + asyncResp->res.jsonValue["SNMP"]["CommunityAccessMode"] = "Full"; + asyncResp->res.jsonValue["SNMP"]["HideCommunityStrings"] = true; + asyncResp->res + .jsonValue["SNMP"]["EngineId"]["EnterpriseSpecificMethod"] = + nullptr; + asyncResp->res.jsonValue["SNMP"]["EngineId"]["PrivateEnterpriseId"] = + nullptr; + asyncResp->res.jsonValue["SNMP"]["EnableSNMPv1"] = false; + asyncResp->res.jsonValue["SNMP"]["EnableSNMPv2c"] = true; + asyncResp->res.jsonValue["SNMP"]["EnableSNMPv3"] = false; + asyncResp->res.jsonValue["SNMP"]["EncryptionProtocol"] = "None"; + nlohmann::json& memberArray = + asyncResp->res.jsonValue["SNMP"]["CommunityStrings"]; + memberArray = nlohmann::json::array(); + memberArray.push_back({{"AccessMode", "Full"}}); + memberArray.push_back({{"CommunityString", ""}}); + memberArray.push_back({{"Name", ""}}); + + // HTTP is Mandatory attribute as per OCP Baseline Profile - v1.0.0, // but from security perspective it is not recommended to use. // Hence using protocolEnabled as false to make it OCP and security-wise // compliant |