Migrate redfish-core/lib part 4

this migration include:

- redfish_core/include/utils/systemd_utils(needed by manager)
- redfish-core/lib/manager_diagnostic_data
- redfish-core/lib/managers
- redfish-core/lib/memory
- redfish-core/lib/message_registries
- redfish-core/lib/sensors
- redfish-core/lib/metric_report_definition
- redfish-core/lib/network_adapter
- redfish-core/lib/network_protocol

redfish-core/lib/task (2176 linter issues solved && all libs compiled with blaze)
beside normal migration work (implement copybara transform, resolve linter issues, header replacement, add blaze rule to build new code as library, format code, etc), this CL also does the following:
1.memory.h: Use absl::SimpleAtoi instead of strtol for safer string to int base 10 conversion. strtol is deprecated in g3.
```
  int64_t index_value = 0;
  if (!absl::SimpleAtoi(index, &index_value)) {
...
  }
```
2. Add support for meson options and their preprocessor/macro, configure it for defines of build in blaze
- stateful_bmcweb(BMCWEB_ENABLE_STATEFUL_BMCWEB): default to True (for `manager_diagnostic_data`)
- bmcweb_vm_nbdproxy(BMCWEB_ENABLE_VM_NBDPROXY): default to False (for `managers`
- kvm(BMCWEB_ENABLE_KVM): default to True
- redfish_oem_manager_fan_data(BMCWEB_ENABLE_REDFISH_OEM_MANAGER_FAN_DATA): default to False (for `managers`)
- efficient_expand_memory(EFFICIENT_EXPAND_MEMORY_ENABLED): default to True ( for `memory`)
- redfish_boot_time(BMCWEB_ENABLE_REDFISH_BOOT_TIME): default to False (for `managers`, `boottime`)
- redfish_new_powersubsystem_thermalsubsystem(BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM): default to False ( for `sensors`)
- efficient_expand_sensors(EFFICIENT_EXPAND_SENSORS_ENABLED): default to True (for `sensors`)
- health_populate(HEALTH_POPULATE): default to True (for `managers`)

3. manager_diagnostic_data.h: change global `const std::string` to constexpr c style string, e.g.
```
constexpr const char healthMon[] = "xyz.openbmc_project.HealthMon";
```

reverse workflow tested with: https://gbmc-review.git.corp.google.com/c/gbmcweb/+/47934 -> cl/784442672

#gbmcweb-g3

PiperOrigin-RevId: 820505721
Change-Id: I02ce2cbcece3f2e5d61b0a557f2edded5bbb502a
10 files changed
tree: 11ad9de9ddfc0cf94330691b39a8fff101238668
  1. .github/
  2. config/
  3. g3/
  4. http/
  5. include/
  6. install/
  7. plugins/
  8. redfish-core/
  9. redfish_authorization/
  10. scripts/
  11. src/
  12. static/
  13. subprojects/
  14. test/
  15. tlbmc/
  16. .clang-format
  17. .clang-tidy
  18. .clang-tidy-ignore
  19. .dockerignore
  20. .gitignore
  21. .markdownlint.yaml
  22. .openbmc-enforce-gitlint
  23. .openbmc-no-clang
  24. .openbmc-no-sanitize
  25. .prettierignore
  26. .shellcheck
  27. AGGREGATION.md
  28. CLIENTS.md
  29. COMMON_ERRORS.md
  30. copy.bara.sky
  31. DBUS_USAGE.md
  32. DEVELOPING.md
  33. gcovr.cfg
  34. HEADERS.md
  35. LICENSE
  36. meson.build
  37. meson_options.txt
  38. OEM_SCHEMAS.md
  39. OWNERS
  40. PLUGINS.md
  41. README.md
  42. README_GOOGLE.md
  43. Redfish.md
  44. run-ci
  45. setup.cfg
  46. TESTING.md
  47. UNIT_TESTING.md
README.md

OpenBMC webserver

This project is Google's version of BMCWeb.

See Readme Google for Google added features. The following is the original README of OpenBMC/BMCWeb.

==============================================================================

This component attempts to be a “do everything” embedded webserver for OpenBMC.

Features

The webserver implements a few distinct interfaces:

  • DBus event websocket. Allows registering on changes to specific dbus paths, properties, and will send an event from the websocket if those filters match.
  • OpenBMC DBus REST api. Allows direct, low interference, high fidelity access to dbus and the objects it represents.
  • Serial: A serial websocket for interacting with the host serial console through websockets.
  • Redfish: A protocol compliant, DBus to Redfish translator.
  • KVM: A websocket based implementation of the RFB (VNC) frame buffer protocol intended to mate to webui-vue to provide a complete KVM implementation.

Protocols

bmcweb at a protocol level supports http and https. TLS is supported through OpenSSL.

AuthX

Authentication

Bmcweb supports multiple authentication protocols:

  • Basic authentication per RFC7617
  • Cookie based authentication for authenticating against webui-vue
  • Mutual TLS authentication based on OpenSSL
  • Session authentication through webui-vue
  • XToken based authentication conformant to Redfish DSP0266

Each of these types of authentication is able to be enabled or disabled both via runtime policy changes (through the relevant Redfish APIs) or via configure time options. All authentication mechanisms supporting username/password are routed to libpam, to allow for customization in authentication implementations.

Authorization

All authorization in bmcweb is determined at routing time, and per route, and conform to the Redfish PrivilegeRegistry.

*Note: Non-Redfish functions are mapped to the closest equivalent Redfish privilege level.

Configuration

bmcweb is configured per the meson build files. Available options are documented in meson_options.txt

Compile bmcweb with default options

meson builddir
ninja -C builddir

If any of the dependencies are not found on the host system during configuration, meson will automatically download them via its wrap dependencies mentioned in bmcweb/subprojects.

Use of persistent data

bmcweb relies on some on-system data for storage of persistent data that is internal to the process. Details on the exact data stored and when it is read/written can seen from the persistent_data namespace.

TLS certificate generation

When SSL support is enabled and a usable certificate is not found, bmcweb will generate a self-signed a certificate before launching the server. Please see the bmcweb source code for details on the parameters this certificate is built with.

Redfish Aggregation

bmcweb is capable of aggregating resources from satellite BMCs. Refer to AGGREGATION.md for more information on how to enable and use this feature.