#
033f1e4d
|
| 15-Aug-2022 |
Ed Tanous <edtanous@google.com> |
Move ipv4VerifyIpAndGetBitcount into ip_utils
This is a minor reorganization of helper code from ethernet (which is redfish specific) into utils. This function is generic, and should be in ip utils
Move ipv4VerifyIpAndGetBitcount into ip_utils
This is a minor reorganization of helper code from ethernet (which is redfish specific) into utils. This function is generic, and should be in ip utils.
Tested: Code compiles. Code move only.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4aac5a98379c9844aea6c21d2294d1ed7ae2ea9b
show more ...
|
#
58283f41
|
| 15-Aug-2022 |
Johnathan Mantey <johnathanx.mantey@intel.com> |
Report MACAddress is read-only for a D-Bus Not Allowed response
The BMC Manager MACAddress ethernet property is a Read/Write property in the Redfish spec. There are OpenBMC users that configure the
Report MACAddress is read-only for a D-Bus Not Allowed response
The BMC Manager MACAddress ethernet property is a Read/Write property in the Redfish spec. There are OpenBMC users that configure the property to be Read Only. The phosphor-network build includes a 'persist-mac' configuration switch which controls MAC address assignment. An attempt to set a R/O MACAddress causes D-Bus to return an error. The exact error is available in a sdbus message.
The EthernetInterface XML indicates this is acceptable behavior: "If an assignable MAC address is not supported, this value is a read-only alias of the PermanentMACAddress."
As this condition is considered proper behavior it is incorrect to return an internalError(). It is better behavior to return a "Read-only" error message.
Tested: Performed a Redfish PATCH for the MACAddress property. The PATCH command returns a 403 error code, and a message body indicating that the MACAddress is not writable.
Change-Id: Ice97affe694f4bee15436293c9e5944bcae7f4cc Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
show more ...
|
#
11ba3979
|
| 11-Jul-2022 |
Ed Tanous <edtanous@google.com> |
Remove usages of boost::starts/ends_with
Per the coding standard, now that C++ supports std::string::starts_with and std::string::ends_with, we should be using them over the boost alternatives. Thi
Remove usages of boost::starts/ends_with
Per the coding standard, now that C++ supports std::string::starts_with and std::string::ends_with, we should be using them over the boost alternatives. This commit goes through and updates all usages.
Arguably some of these are incorrect, and instances of common error 13, but because this is mostly a mechanical it intentionally doesn't try to handle it.
Tested: Unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic4c6e5d0da90f7442693199dc691a47d2240fa4f
show more ...
|
#
bc20089a
|
| 30-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Fix redundant store
mtu = mtu has no effect. Fix it.
Tested: Syntax only change. Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I8bae9ef83ae9809787f82dd27e95ebdb5e0a0e9c
|
#
02cad96e
|
| 30-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Fix const correctness issues
cppcheck correctly notes that a lot of variables in the new code can be const. Make most of them const.
Tested: WIP
Signed-off-by: Ed Tanous <edtanous@google.com> Cha
Fix const correctness issues
cppcheck correctly notes that a lot of variables in the new code can be const. Make most of them const.
Tested: WIP
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I8f37b6353fd707923f533e1d61c5b5419282bf23
show more ...
|
#
3ba00073
|
| 06-Jun-2022 |
Carson Labrado <clabrado@google.com> |
Expose AsyncResp shared_ptr when handling response
For Redfish Aggregation, we need a common point to check the D-Bus for satellite configs. If they are available then we perform the aggregation op
Expose AsyncResp shared_ptr when handling response
For Redfish Aggregation, we need a common point to check the D-Bus for satellite configs. If they are available then we perform the aggregation operations. The functions in query.hpp are used by all endpoints making them the logical location. The aggregation code requires a shared_ptr to the AsyncResp so these functions need to be able to supply that.
This patch is broken out of a future patch for routing Redfish Aggregation requests https://gerrit.openbmc.org/c/openbmc/bmcweb/+/53310
The follow commands can be used to perform most of the replacements: find . -type f | xargs sed -i 's/setUpRedfishRoute(app, req, asyncResp->res/setUpRedfishRoute(app, req, asyncResp/g' find . -type f | xargs sed -i 's/setUpRedfishRouteWithDelegation(app, req, asyncResp->res/setUpRedfishRouteWithDelegation(app, req, asyncResp/g'
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I4f4f9f22cdcfb14a3bd94b9a8f3d64aae34e57bc
show more ...
|
#
002d39b4
|
| 31-May-2022 |
Ed Tanous <edtanous@google.com> |
Try to fix the lambda formatting issue
clang-tidy has a setting, LambdaBodyIndentation, which it says: "For callback-heavy code, it may improve readability to have the signature indented two levels
Try to fix the lambda formatting issue
clang-tidy has a setting, LambdaBodyIndentation, which it says: "For callback-heavy code, it may improve readability to have the signature indented two levels and to use OuterScope."
bmcweb is very callback heavy code. Try to enable it and see if that improves things. There are many cases where the length of a lambda call will change, and reindent the entire lambda function. This is really bad for code reviews, as it's difficult to see the lines changed. This commit should resolve it. This does have the downside of reindenting a lot of functions, which is unfortunate, but probably worth it in the long run.
All changes except for the .clang-format file were made by the robot.
Tested: Code compiles, whitespace changes only.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib4aa2f1391fada981febd25b67dcdb9143827f43
show more ...
|
#
3927e13e
|
| 14-Apr-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
ethernet: Remove PATCH VLANId support
phosphor-networkd does not support changing VLAN ID of an existing VLAN interface. Though the DBus property can be updated, the change never takes effect. This
ethernet: Remove PATCH VLANId support
phosphor-networkd does not support changing VLAN ID of an existing VLAN interface. Though the DBus property can be updated, the change never takes effect. This patch disallows PATCH VLANId requests.
Tested: PATCH {"VLANId": 3} /redfish/v1/Managers/bmc/EthernetInterfaces/eth0 /VLANs/eth0_1 returns PropertyNotWritable error.
Change-Id: Ice43064de761d63aa3cfde8019e5d4db138fcf02 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
show more ...
|
#
17e22024
|
| 14-Apr-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
ethernet: Use std::optional<uint32> for VLAN ID
According to Redfish EthernetInterface and VLanNetworkInterface schema, VLANId is "The ID for this VLAN", meaning that each interface can only have at
ethernet: Use std::optional<uint32> for VLAN ID
According to Redfish EthernetInterface and VLanNetworkInterface schema, VLANId is "The ID for this VLAN", meaning that each interface can only have at most one VLAN ID. (Though EthernetInterface schema says "If this interface supports more than one VLAN, the VLAN collection link shall be present", the collection link is depracated in 1.7.0 and the spec suggests "using individual EthernetInterface resources to show VLAN information".)
OpenBMC network stack implementation uses linux's virtual interface to represent a VLAN (named as <interface-name>.<vlan-id>, e.g. eth0.100). In both design and implementation, an interface can have either zero or one VLAN ID. This patch replaces the std::vector for VLAN ID with std::optional to match the design. It has no impact on the Redfish response.
Tested: Verified GET /redfish/v1/Managers/bmc/EthernetInterfaces/eth0 can list all VLANs on eth0, and GET, PATCH and DELETE /redfish/v1/Managers/bmc /EthernetInterfaces/eth0/VLANs/eth0_1 works.
Change-Id: Iab05e859d76639b2e60546cd5549efd34effafb7 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
show more ...
|
#
1476687d
|
| 15-Mar-2022 |
Ed Tanous <edtanous@google.com> |
Remove brace initialization of json objects
Brace initialization of json objects, while quite interesting from an academic sense, are very difficult for people to grok, and lead to inconsistencies.
Remove brace initialization of json objects
Brace initialization of json objects, while quite interesting from an academic sense, are very difficult for people to grok, and lead to inconsistencies. This patchset aims to remove a majority of them in lieu of operator[]. Interestingly, this saves about 1% of the binary size of bmcweb.
This also has an added benefit that as a design pattern, we're never constructing a new object, then moving it into place, we're always adding to the existing object, which in the future _could_ make things like OEM schemas or properties easier, as there's no case where we're completely replacing the response object.
Tested: Ran redfish service validator. No new failures.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iae409b0a40ddd3ae6112cb2d52c6f6ab388595fe
show more ...
|
#
3d768a16
|
| 31-Jul-2021 |
Abhishek Patel <Abhishek.Patel@ibm.com> |
Fix Ethernet privileges
Post method: 1) /redfish/v1/Managers/bmc/EthernetInterfaces/<str>/VLANs/ ConfigureComponents -> ConfigureManager
Patch method: 1) /redfish/v1/Managers/bmc/EthernetI
Fix Ethernet privileges
Post method: 1) /redfish/v1/Managers/bmc/EthernetInterfaces/<str>/VLANs/ ConfigureComponents -> ConfigureManager
Patch method: 1) /redfish/v1/Managers/bmc/EthernetInterfaces/<str>/VLANs/<str>/ ConfigureComponents -> ConfigureManager
2) /redfish/v1/Managers/bmc/EthernetInterfaces/<str>/ ConfigureComponents -> ConfigureManager (SubordinateOverrides)
Delete method: 1) /redfish/v1/Managers/bmc/EthernetInterfaces/<str>/VLANs/<str>/ ConfigureComponents -> ConfigureManager
This change allows only Admin user to post, patch, and delete on VLAN Network Interface Collection and restrict Operator user. Same for the EthernetInterfaces patch method.
Tested: Ran curl test with admin and operator privileged user for all methods (post, patch, and delete). one test failing.
Error: curl -k -H "X-Auth-Token: $bmc_token" -X PATCH -d '{"VLANId" :30 , "VLANEnable" : true}' https://${BMC_IP}/redfish/v1/Managers/bmc/EthernetInterfaces/ eth0/VLANs/eth0_50
This command is unable to update the VLANId value. instead, it deletes VLAN
Email sent to openbmc list: https://lists.ozlabs.org/pipermail/openbmc/2021-August/027232.html
Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com> Change-Id: I4101c429db6fa788909982b66445b191ccacaec7
show more ...
|
#
82695a5b
|
| 14-Apr-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
ethernet: Fix naming conventions
Some variable names in ethernet.hpp does not match naming conventions, fix'em all.
Tested: Only variable name changes, build pass.
Change-Id: If275a77364e5ed827a50
ethernet: Fix naming conventions
Some variable names in ethernet.hpp does not match naming conventions, fix'em all.
Tested: Only variable name changes, build pass.
Change-Id: If275a77364e5ed827a5088342f44548274b059e1 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
show more ...
|
#
2bf0e923
|
| 14-Apr-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
ethernet: Remove unused SendHostNameEnabled property
Remove EthernetInterfaceData.SendHostNameEnabled as it is defined but never used excepting reading it from DBus.
Tested: Build pass.
Change-Id:
ethernet: Remove unused SendHostNameEnabled property
Remove EthernetInterfaceData.SendHostNameEnabled as it is defined but never used excepting reading it from DBus.
Tested: Build pass.
Change-Id: Ib64792b5842a1e8fb95e3a38d40f11797cfb5641 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
show more ...
|
#
82818b92
|
| 13-Apr-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
ethernet: Remove unused changeVlanId() function
In ethernet.hpp, changeVlanId() is defined but never used, and VLAN ID is not a writable property in phosphor-networkd. Remove it.
Tested: Build pass
ethernet: Remove unused changeVlanId() function
In ethernet.hpp, changeVlanId() is defined but never used, and VLAN ID is not a writable property in phosphor-networkd. Remove it.
Tested: Build pass.
Change-Id: I1770e777529cca9d9a56831f62e0833c3f7de9df Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
show more ...
|
#
45ca1b86
|
| 25-Mar-2022 |
Ed Tanous <edtanous@google.com> |
Add setUpRedfishRoute to all nodes in redfish
For better or worse, the series ahead of this is making use of setUpRedfishRoute to do the common "redfish specified" things that need to be done for a
Add setUpRedfishRoute to all nodes in redfish
For better or worse, the series ahead of this is making use of setUpRedfishRoute to do the common "redfish specified" things that need to be done for a connection, like header checking, filtering, and other things. In the current model, where BMCWEB_ROUTE is a common function for all HTTP routes, this means we need to propagate this injection call into the whole tree ahead of the requests being handled.
In a perfect world, we would invent something like a REDFISH_ROUTE macro, but because macros are discouraged, the routes take a variadic template of parameters, and each call to the route has a .privileges() call in the middle, there's no good way to effect this change in a less costly manner. This was messaged both in the prior reviews, and on discord sourcing improvements on this pattern, to which none arose.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id29cc799e214edad41e48fc7ce6eed0521f90ecb
show more ...
|
#
b9d36b47
|
| 26-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Consitently use dbus::utility types
This saves about 4k on the binary size
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I9546227a19c691b1aecb
Consitently use dbus::utility types
This saves about 4k on the binary size
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I9546227a19c691b1aecb80e80307889548c0293f
show more ...
|
#
15ed6780
|
| 14-Dec-2021 |
Willy Tu <wltu@google.com> |
json_utils: Add support jsonRead Patch/Action
Added support for readJson for Patch and Action. The only difference is that Patch does not allow empty json input while Action does. Action with empty
json_utils: Add support jsonRead Patch/Action
Added support for readJson for Patch and Action. The only difference is that Patch does not allow empty json input while Action does. Action with empty input will use the default value based on the implementation and return 200 OK response code.
readJsonPatch will replace the existing readJson and be used for path requests. It will not allow empty json input and all requested keys are required in the json input.
readJsonAction will be used for Action requests where it is possible for all of the properties to be optional and allow empty request. The optional properties are determined by the requested values type.
All current Action readJson are replaced with readJsonAction. It does not change the existing behavior since it needs `std::optional`. This will have to be updated later as we define the default behavior.
Tested: Added unit tests and readJsonAction allows empty empty json object.
No Change to Redfish Tree.
Change-Id: Ia5e1f81695c528a20f1dc985aee19c920d8adaea Signed-off-by: Willy Tu <wltu@google.com>
show more ...
|
#
f5b191a6
|
| 15-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Prepare for clang-tidy-14
clang-tidy 14 now detects some more stuff that it couldn't before. These are all pretty reasonable and things that we enforce today.
All changes were made by the robot.
T
Prepare for clang-tidy-14
clang-tidy 14 now detects some more stuff that it couldn't before. These are all pretty reasonable and things that we enforce today.
All changes were made by the robot.
Tested: Code compiles and unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I880d714c97adc38a190472766fb922fbfb30e82a
show more ...
|
#
dbb59d4d
|
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-uppercase-literal-suffix
We only had a few violations of this; Fix them and enable the check.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I159e774fd0169a91a092218e
Enable readability-uppercase-literal-suffix
We only had a few violations of this; Fix them and enable the check.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I159e774fd0169a91a092218ec8dc896ba9edebf4
show more ...
|
#
e662eae8
|
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-implicit-bool-conversion checks
These checks ensure that we're not implicitly converting ints or pointers into bools, which makes the code easier to read.
Tested: Ran series thro
Enable readability-implicit-bool-conversion checks
These checks ensure that we're not implicitly converting ints or pointers into bools, which makes the code easier to read.
Tested: Ran series through redfish service validator. No changes observed. UUID failing in Qemu both before and after.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I1ca0be980d136bd4e5474341f4fd62f2f6bbdbae
show more ...
|
#
e05aec50
|
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Add readability-redundant-* checks
There's a number of redundancies in our code that clang can sanitize out. Fix the existing problems, and enable the checks.
Signed-off-by: Ed Tanous <edtanous@go
Add readability-redundant-* checks
There's a number of redundancies in our code that clang can sanitize out. Fix the existing problems, and enable the checks.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie63d7b7f0777b702fbf1b23a24e1bed7b4f5183b
show more ...
|
#
9eb808c1
|
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-avoid-const-params-in-decls
This check involves explicitly declaring variables const when they're declared auto, which helps in readability, and makes it more clear that the varia
Enable readability-avoid-const-params-in-decls
This check involves explicitly declaring variables const when they're declared auto, which helps in readability, and makes it more clear that the variables are const.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I71198ea03850384a389a56ad26f2c4a48c75b148
show more ...
|
#
dcf2ebc0
|
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-redundant-control-flow checks
These checks are a nice addition to our static analysis, as they simplify code quite a bit, as can be seen by this diff being negative lines.
Signed
Enable readability-redundant-control-flow checks
These checks are a nice addition to our static analysis, as they simplify code quite a bit, as can be seen by this diff being negative lines.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I60ede4ad23d7e5337e811d70ddcab24bf8986891
show more ...
|
#
26f6976f
|
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-container-size-empty tests
This one is a little trivial, but it does help in readability.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I5366d4eec8af2f781b3bad804131a
Enable readability-container-size-empty tests
This one is a little trivial, but it does help in readability.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I5366d4eec8af2f781b3bad804131ae2eb806e3aa
show more ...
|
#
35fb5311
|
| 20-Sep-2021 |
Tejas Patil <tejaspp@ami.com> |
EthernetInterfaces:GET & PATCH support for MTUSize
This commit add support for MTUSize property with GET and PATCH methods under Redfish URI "/redfish/v1/Managers/bmc/EthernetInterfaces/<id>".
This
EthernetInterfaces:GET & PATCH support for MTUSize
This commit add support for MTUSize property with GET and PATCH methods under Redfish URI "/redfish/v1/Managers/bmc/EthernetInterfaces/<id>".
This property shows the maximum size of the Protocol Data Uint (PDU) in bytes, that can be passed in an Ethernet frame on the network interface.
User can GET and SET the MTU Size of any available network interface.
The backend implementation for this is committed to below link https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-networkd/+/455591
Testing: - Redfish Validator Test Passed.
- curl -k -H "X-Auth-Token: $token" -X PATCH -d '{"MTUSize" : 1280}' https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth3
- curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth3 { "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth3", "@odata.type": "#EthernetInterface.v1_4_1.EthernetInterface", "DHCPv4": { "DHCPEnabled": true, "UseDNSServers": true, "UseDomainName": true, "UseNTPServers": true }, "DHCPv6": { "OperatingMode": "Stateful", "UseDNSServers": true, "UseDomainName": true, "UseNTPServers": true }, "Description": "Management Network Interface", "FQDN": "evb-ast2600", "HostName": "evb-ast2600", "IPv4Addresses": [ { "Address": "10.0.126.64", "AddressOrigin": "DHCP", "Gateway": "10.0.120.1", "SubnetMask": "255.255.248.0" } ], "IPv4StaticAddresses": [], "IPv6AddressPolicyTable": [], "IPv6Addresses": [ { "Address": "4001:df24:df25:df26:a069:c2ff:fe62:1c52", "AddressOrigin": "DHCPv6", "AddressState": null, "PrefixLength": 64 }, { "Address": "fe80::a069:c2ff:fe62:1c52", "AddressOrigin": "LinkLocal", "AddressState": null, "PrefixLength": 64 }, { "Address": "1001:7:7:7:a069:c2ff:fe62:1c52", "AddressOrigin": "DHCPv6", "AddressState": null, "PrefixLength": 64 } ], "IPv6DefaultGateway": "0:0:0:0:0:0:0:0", "IPv6StaticAddresses": [], "Id": "eth3", "InterfaceEnabled": true, "LinkStatus": "LinkUp", "MACAddress": "a2:69:c2:62:1c:52", "MTUSize": 1280, "Name": "Manager Ethernet Interface", "NameServers": [ "10.0.0.31", "10.0.0.32" ], "SpeedMbps": 0, "StaticNameServers": [], "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" }, "VLANs": { "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth3/VLANs" } }
Signed-off-by: Tejas Patil <tejaspp@ami.com> Change-Id: I8f55b3b5016503baecb7b85784d1a8bece69a258
show more ...
|