082a39cf | 07-May-2020 |
Patrick Venture <venture@google.com> |
include: oemrouter: add std:: namespace
Add the std:: namespace to oemrouter header integers and include cstddef for size_t. This is due to issues hit building in a different environment.
Signed-o
include: oemrouter: add std:: namespace
Add the std:: namespace to oemrouter header integers and include cstddef for size_t. This is due to issues hit building in a different environment.
Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ic1b99377a42a447409cd3ae099298fe1dd0cee02
show more ...
|
e7e8b816 | 28-Oct-2019 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
rewrite Get Session Info to use new yielding D-Bus API
The new yielding API does not use try/catch, and has slightly different parameters which makes the change look bigger than it is.
Tested: Ru
rewrite Get Session Info to use new yielding D-Bus API
The new yielding API does not use try/catch, and has slightly different parameters which makes the change look bigger than it is.
Tested: Run ipmitool session info active session handle : 1 slot count : 45 active sessions : 1 user id : 1 privilege level : ADMINISTRATOR session type : IPMIv2/RMCP+ channel number : 0x01 console ip : 0.0.0.0 console mac : 00:00:00:00:00:00 console port : 54884
Console ip is reported as all zero due to a current netipmid bug.
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com> Change-Id: Ia6574568c7f8863b3acffcf22e403c8be01d312a
show more ...
|
fe39ec9c | 02-Mar-2020 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
Incorrect function declaration for getManagedObjects
The implementation was correct but the declaration had the out parameter as the second parameter instead of the last.
Change-Id: Ib0f1c23ad6617d
Incorrect function declaration for getManagedObjects
The implementation was correct but the declaration had the out parameter as the second parameter instead of the last.
Change-Id: Ib0f1c23ad6617d637c17d9175bb7a93f8f481e0d Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
eeb0f983 | 29-May-2019 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
Add yielding utility calls
utils.hpp provides a bunch of blocking D-Bus calls that are used liberally in the ipmi handlers. By adding a yielding option that takes the ipmi::Context::ptr, this can ea
Add yielding utility calls
utils.hpp provides a bunch of blocking D-Bus calls that are used liberally in the ipmi handlers. By adding a yielding option that takes the ipmi::Context::ptr, this can easily turn all the blocking calls into yielding calls as the handlers get rewritten.
Tested: Used the upcoming modification of XYZ call: Before: ipmitool get session info After: ipmitool get session info
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com> Change-Id: Ia537eeda060ea8e56b94b99ccb46b05f18372589
show more ...
|
4d22640a | 13-Nov-2019 |
Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com> |
Added sessionId context in host-ipmid, used by GetSessionInfo
SessionId is now passed to host-ipmid context along with userid and privilege information. This will enable certain commands to know the
Added sessionId context in host-ipmid, used by GetSessionInfo
SessionId is now passed to host-ipmid context along with userid and privilege information. This will enable certain commands to know the current sessionid
Added option to get current session info in get session info command.
With this change, we can get the current session info by passing sessionIndex as zero in get session info command via lan interface and the same via host interface will return an error, beacuse no session will be created for host interface.
Tested:
ipmitool -I lanplus -U <user> -P <password> -H <lan1_ip> raw 6 0x3d <Zero> Response : gives currents session info
ipmitool -I lanplus -U <user> -P <password> -H <lan2_ip> raw 6 0x3d <Zero> Response : gives currents session info
//host interface ipmitool raw 6 0x3d 0 Response: 0xCC // invalid field in the request
//This command shows info of all sessions, which includes current session info as well. ipmitool -I lanplus -U <user> -P <password> -H <lan1_ip> session info all session handle : 129 slot count : 45 active sessions : 1 user id : 1 privilege level : ADMINISTRATOR session type : IPMIv1.5 channel number : 0x03 console ip : 0.0.0.0 console mac : 00:00:00:00:00:00 console port : 52670
session handle : 0 slot count : 45 active sessions : 1
//This command shows info of all sessions, which includes current session info as well. ipmitool -I lanplus -U <user> -P <password> -H <lan2_ip> session info all session handle : 0 slot count : 45 active sessions : 1
session handle : 1 slot count : 45 active sessions : 1 user id : 1 privilege level : ADMINISTRATOR session type : IPMIv1.5 channel number : 0x01 console ip : 0.0.0.0 console mac : 00:00:00:00:00:00 console port : 57622
//host interface ipmitool session info all session handle : 0 slot count : 45 active sessions : 0
session handle : 0 slot count : 45 active sessions : 0
Tested other postive and negative test cases for get session info command in Lan1, Lan2 and host interfaces. All are working fine.
Signed-off-by: Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com> Change-Id: I9fb1ef12693e4c0da3661ffdf21eec248b48b5b4
show more ...
|
4cc42556 | 11-Sep-2019 |
Sui Chen <suichen@google.com> |
Refactor ipmi::sensor::GetSensorResponse away from std::array
This change refactors GetSensorResponse from std::array to struct. This change depends on change #23544.
GetSensorResponse is an intern
Refactor ipmi::sensor::GetSensorResponse away from std::array
This change refactors GetSensorResponse from std::array to struct. This change depends on change #23544.
GetSensorResponse is an internal, intermediate structure, an unpacked form of a Get Sensor Reading response, providing direct access to its fields. Its life time is: GetReadingResponse -> GetSensorResponse -> ipmi::RspType.
It is written to in 5 functions in the ipmi::sensor::get namespace, by four setter functions (setOffset, setReading, setAssertionBytes, enableScanning). It is currently read from by 1 function (ipmiSensorGetSensorReading) for transforming to an ipmi::RspType.
Originally, the setter functions assumed bitwise equivalence between GetSensorResponse and GetReadingResponse, and the setter functions used reinterpret_cast to assign to a GetSensorResponse as if it were a GetReadingResponse.
With this change, the reinterpret_cast's are removed, and the set functions now accept GetSensorResponse instead of GetReadingResponse, so the code gets a bit easier to read.
Tested: Tested using a server with a BMC; sensor readings obtained through `ipmitool` appear to be correct (the reading might change within a small range): # ipmitool raw 0x04 0x2d 0x16 9B 40 00 00
Signed-off-by: Sui Chen <suichen@google.com> Change-Id: I5d454d6249f5431fb98169e6ef7c585c34024004
show more ...
|
f71444da | 25-Jul-2019 |
Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com> |
Implemented get session info cmd in host interface
This command can get info of any session
Tested all positive and negative test cases
Tested:
Get active session info by valid session handle ipm
Implemented get session info cmd in host interface
This command can get info of any session
Tested all positive and negative test cases
Tested:
Get active session info by valid session handle ipmitool raw 0x6 0x3d <sesssion index = search session by handle> <valid session handle> Response : successfully gets the session info as per IPMI spec
Get active session info by valid session id ipmitool raw 0x6 0x3d <sesssion index = search session by id> <valid session id> Response : successfully gets the session info as per IPMI spec
Get inactive session info by valid session handle ipmitool raw 0x6 0x3d <sesssion index = search session by handle> <valid session handle> Response : successfully gets the session info as per IPMI spec
Get inactive session info by valid session id ipmitool raw 0x6 0x3d <sesssion index = search session by id> <valid session id> Response : successfully gets the session info as per IPMI spec
Get session info by invalid session handle ipmitool raw 0x6 0x3d <sesssion index = search session by handle> <invalid session handle> Response : 0x88 // Inavlid Session Handle
Get session info by invalid session id ipmitool raw 0x6 0x3d <sesssion index = search session by id> <invalid session id> Response : 0x87 // Inavlid Session Id
Signed-off-by: Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com> Change-Id: Ib36a9fe5eac58d15011cc9379ceed480ba0be96d
show more ...
|
c514d874 | 06-Apr-2019 |
William A. Kennington III <wak@google.com> |
transporthandler: Rewrite + New Handler
This rewrites the old transport handler to use the new ipmi handler registration functions. It attempts to clean up the old code, by refactoring any business
transporthandler: Rewrite + New Handler
This rewrites the old transport handler to use the new ipmi handler registration functions. It attempts to clean up the old code, by refactoring any business logic out of the code that parses the IPMI messages. This makes the code paths easier to understand and allows for better code re-use.
This also gets rid of the concept of the settings change timer. Clients expect to see their settings take effect as soon as they are set, regardless of the "Set In Progress" flag. This means we no longer need a cache for our network settings that are about to be set by the daemon, and a client can hold the BMC in "Set In Progress" while it verifies settings like other BMC implementations.
Change-Id: I5406a674f087600afdfc2c0b3adeacde10986abc Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
e7023926 | 10-Jul-2019 |
Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com> |
Implemented close session cmd in host interface
This command can close any session via host interface.
Tested:
Close the existing valid session by session id ipmitool raw 0x6 0x3c <valid sesssion
Implemented close session cmd in host interface
This command can close any session via host interface.
Tested:
Close the existing valid session by session id ipmitool raw 0x6 0x3c <valid sesssion id > Response : 00 // success
Close the existing valid session by session handle ipmitool raw 0x6 0x3c <zero session id> <valid session handle> Response : 00 // success
Close the session by zero session id ipmitool raw 0x6 0x3c <zero session id> Response : 0x87 // inavlid session id
Close the session by zero session handle ipmitool raw 0x6 0x3c <zero session id> <zero session handle> Response : 0x88 // inavlid session handle
Close an inactive session. ipmitool raw 0x6 0x3c <valid session id> Response : 0xcc // invalid data field in request
Close an inactive session. ipmitool raw 0x6 0x3c <zero session id> <valid session hnadle> Response : 0xcc // invalid data field in request
Signed-off-by: Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com> Change-Id: I8af290001d8effbbcdbbe2dd93aabf1b015e7a88
show more ...
|
caabc36b | 23-Jul-2019 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
fix logic error for unpack vector of tuple
Unpacking a vector of tuples is failing if the correct number of bytes does not match an integral number of bytes needed to fully unpack all the tuples.
U
fix logic error for unpack vector of tuple
Unpacking a vector of tuples is failing if the correct number of bytes does not match an integral number of bytes needed to fully unpack all the tuples.
Unpacking a tuple should return an error if it does not fully unpack all the items. This will signal the vector unpack to bail and return however many items it has unpacked to that point.
A vector unpack should always return success because no matter how many items it has unpacked, it is fine, because a vector can have any number of items.
Tested: Unit tests updated to check for proper unpacking of vectors and tuples (and optionals) as well as new unit tests added for more targetted testing.
Change-Id: I4b45198f8bc4a49913beb923d10079983179402a Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
cb09aa00 | 06-Sep-2019 |
James Feist <james.feist@linux.intel.com> |
Change yield from ptr to object
The ptr makes for ugly code: i.e. *(ctx->yield) all over the place.
Change it to copy as it is just 4 pointers.
Tested: ipmitool mc info still works
Change-Id: I30
Change yield from ptr to object
The ptr makes for ugly code: i.e. *(ctx->yield) all over the place.
Change it to copy as it is just 4 pointers.
Tested: ipmitool mc info still works
Change-Id: I30c5bc395849875cd58925fac99bb23c1804cd5b Signed-off-by: James Feist <james.feist@linux.intel.com>
show more ...
|
7dc4ac02 | 23-Aug-2019 |
Yong Li <yong.b.li@linux.intel.com> |
Move i2c WR api into libipmid
Move the low-level i2c write-read api into libipmid, to allow provider libraries access to i2c without duplicating this code.
Tested: I2c master write read command sti
Move i2c WR api into libipmid
Move the low-level i2c write-read api into libipmid, to allow provider libraries access to i2c without duplicating this code.
Tested: I2c master write read command still works: ipmitool i2c bus=2 0x9c 8 0
Signed-off-by: Yong Li <yong.b.li@linux.intel.com> Change-Id: I0d5f82cf46ecf871eebb47aae25537b5da1f2e6a
show more ...
|
48408b6d | 22-Aug-2019 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
legacy handlers need a bigger buffer
In the original ipmi execution queue, handlers were passed a larger buffer. The current code was only passing in the configured channel size, or 64 if no size wa
legacy handlers need a bigger buffer
In the original ipmi execution queue, handlers were passed a larger buffer. The current code was only passing in the configured channel size, or 64 if no size was configured. This is too small and leads to buffer overflows for responses greater than 64 bytes.
This brings the buffer sizes up to a point that matches the legacy code and to a size that is larger than any of IPMI standard transport sizes.
Tested: used a bogus handler to create a large response and found that the entire response was returned.
Change-Id: I91b359812247ae5fdef105c7b7a9dfe003548494 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
23d06441 | 13-Mar-2019 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
Use boost::asio::post() instead of io->post()
According to the documentation io->post is deprecated, saying that boost::asio::post() should be used instead.
Tested: ipmid runs the same as it did be
Use boost::asio::post() instead of io->post()
According to the documentation io->post is deprecated, saying that boost::asio::post() should be used instead.
Tested: ipmid runs the same as it did before.
Change-Id: I552c7cb5cb8ad8f9f6e2bcffa61ce5135e2faad2 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
1a4beed9 | 12-Jun-2019 |
Suryakanth Sekar <suryakanth.sekar@linux.intel.com> |
Defining session const for multi net session mgmt
This session const will be used in multi session management and session commands and replace the existing session const used into lowercamel case
Defining session const for multi net session mgmt
This session const will be used in multi session management and session commands and replace the existing session const used into lowercamel case
Signed-off-by: Suryakanth Sekar <suryakanth.sekar@linux.intel.com> Change-Id: I76725acdf5d3d002f82a1076509ed37d668d01d3
show more ...
|
a3dd7661 | 30-May-2019 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
unpack static assert on unsupported types
Unsupported types might not cause compile time errors but can result in SIGILL errors at runtime when compiler warnings are ignored.
This was found when co
unpack static assert on unsupported types
Unsupported types might not cause compile time errors but can result in SIGILL errors at runtime when compiler warnings are ignored.
This was found when compiling an intel-ipmi-oem handler that attempted to unpack an enum class type. The code compiles down to an empty function (no return statement or value), which can result in all sorts of undefined behavior. This change forces the unsupported types to emit a static assert and fail to compile.
Tested: Created a handler that requests an enum class as an input and saw that the build fails with a static assert.
Change-Id: I123da15cb001756f07761cf7a60b799469926a2a Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
33298af1 | 13-May-2019 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
Add sdbusplus::asio::connection pointer to ipmi::Context
This adds a std::shared_ptr<sdbusplus::asio::connection> to every ipmi::Context in order to facilitate easy transition to yield_method_call o
Add sdbusplus::asio::connection pointer to ipmi::Context
This adds a std::shared_ptr<sdbusplus::asio::connection> to every ipmi::Context in order to facilitate easy transition to yield_method_call over other D-Bus interfaces. This means that a getDbusObjects call could just pass in the ipmi::Context and it will get a yielding call. ipmi::Context is a natural fit because one is created for each of the boost::asio::coroutine contexts. And because a yielding call needs both an async D-Bus connection and a yield_context, this means that we now have one object to rule them all.
Tested: Created a handler that uses the new shared_ptr in the context to see the API in action.
Change-Id: I429a324180a38bf17845f7fd0544df2226d0300a Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
16b8693d | 01-May-2019 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
remove usage of sdbusplus::message::variant
sdbusplus has had its alias of std::variant in place for long enough. This changes all ipmid references to use std::variant directly instead of the sdbusp
remove usage of sdbusplus::message::variant
sdbusplus has had its alias of std::variant in place for long enough. This changes all ipmid references to use std::variant directly instead of the sdbusplus alias.
Tested-by: building and running ipmid
Change-Id: Id5b4136d4589aa598815edd3ef4202e64a7698e2 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
f865dea9 | 03-May-2019 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
Return invalid data length (0xc7) for commands not properly unpacked
The correct value for commands that unpacked but did not consume all the data was already returned (0xc7), but if all the expecte
Return invalid data length (0xc7) for commands not properly unpacked
The correct value for commands that unpacked but did not consume all the data was already returned (0xc7), but if all the expected data was not present, the return code was the response of the unpack command, which is not an IPMI value. This changes the unpack response to always return 0xc7 if it is too short or too long for the command.
Tested-by: run ipmitool with correct and incorrect byte counts (get channel access command expects 2 bytes of data) # ipmitool raw 6 0x41 Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x41 rsp=0xc7): Request data length invalid # ipmitool raw 6 0x41 1 Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x41 rsp=0xc7): Request data length invalid # ipmitool raw 6 0x41 1 0x80 40 40 # ipmitool raw 6 0x41 1 0x80 1 Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x41 rsp=0xc7): Request data length invalid
Change-Id: Ic72c1f2050f7bdcdcc8a5b808d11f80fac4e9813 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
5d06cc6d | 25-Apr-2019 |
William A. Kennington III <wak@google.com> |
handler: Fix request passing for legacy commands
Legacy OEM commands didn't handle the IANA numbers themselves as part of their handler body, and expect the request buffer to not contain them. We ca
handler: Fix request passing for legacy commands
Legacy OEM commands didn't handle the IANA numbers themselves as part of their handler body, and expect the request buffer to not contain them. We can't pass the raw buffer without removing the already extracted prefixes.
This should make legacy OEM commands work again.
Also reworks group handling to become consistent with OEM handling. This happens to fix cases where groupIds were not being returned with error codes.
Change-Id: I10efe8004f2c2b262f48980852b46317035ca367 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
92476a84 | 25-Apr-2019 |
William A. Kennington III <wak@google.com> |
message: Support prepending payloads
Needed solely so that we can support adding the necessary bits for oem and group commands. We shouldn't be using this anywhere else, which is why it is not gener
message: Support prepending payloads
Needed solely so that we can support adding the necessary bits for oem and group commands. We shouldn't be using this anywhere else, which is why it is not generalized to non-payload types.
Change-Id: I6573f981fbe68cebb89abcdfb3de5de5d139e1e0 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
e15e53eb | 24-Apr-2019 |
William A. Kennington III <wak@google.com> |
message/pack: Allow packing payloads
Some IPMI handlers need the ability to support variable return types. The easiest way to do that is to be able to return payloads and pack them into the final pa
message/pack: Allow packing payloads
Some IPMI handlers need the ability to support variable return types. The easiest way to do that is to be able to return payloads and pack them into the final payload.
Change-Id: I5098a1ab0998ada712096929eae40a3c88a6dea0 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
e2aec26c | 24-Apr-2019 |
William A. Kennington III <wak@google.com> |
message/pack: Support packing string_views
Now we don't need to make an intermediate copy of our data into an array before packing it into a payload.
Change-Id: Iac79a79e0ae95835cb67d617a966a92ce8d
message/pack: Support packing string_views
Now we don't need to make an intermediate copy of our data into an array before packing it into a payload.
Change-Id: Iac79a79e0ae95835cb67d617a966a92ce8dcd5f8 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
906e0f80 | 24-Apr-2019 |
William A. Kennington III <wak@google.com> |
message/pack: Check for outstanding bits
Currently, if you pack a non-byte aligned member into a message and then pack an array, it will do the wrong thing and treat the unaligned data as being appe
message/pack: Check for outstanding bits
Currently, if you pack a non-byte aligned member into a message and then pack an array, it will do the wrong thing and treat the unaligned data as being appended to the end of the message. Allowing for this behavior is convoluted and probably not useful, so just return an error.
Change-Id: I6f200dbea96c41f49a110ba7536ccfd37115d277 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
f2fd17a4 | 24-Apr-2019 |
William A. Kennington III <wak@google.com> |
message/payload: Ignore unchecked unpack warning during unwind
If we are caught in an exception unwind we don't care that the payload is not be fully checked. Otherwise, this encourages the pattern
message/payload: Ignore unchecked unpack warning during unwind
If we are caught in an exception unwind we don't care that the payload is not be fully checked. Otherwise, this encourages the pattern of wrapping all handler code in try catch blocks that set trailingOk as it is not required to read the entire payload when throwing an exception.
Change-Id: I35149eedd33bd9fd41968e89d5a8614df7436872 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|