summaryrefslogtreecommitdiffstats
path: root/apphandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* apphandler: move set acpi power state to new api.Deepak Kumar Sahu2019-12-021-36/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite "set acpi power state" command to use the newly introduced ipmi provider API. Tested: verified ipmitool set/get acpi power state status is same both before and after the changes Command : ipmitool raw 0x06 0x07 // get acpi Response: 05 03 Command: ipmitool raw 0x06 0x06 0x87 0x82 //set acpi Response: Command: ipmitool raw 0x06 0x07 // get acpi Response: 07 02 Command: ipmitool raw 0x06 0x06 0x88 0x83 // set acpi Response: Command: ipmitool raw 0x06 0x07 // get acpi Response: 08 03 Signed-off-by: Deepak Kumar Sahu <deepakx.sahu@intel.com> Change-Id: I7dc6edf3d3fd3d0caa98d1b1604e09c6d06675b4
* Added sessionId context in host-ipmid, used by GetSessionInfoRajashekar Gade Reddy2019-11-191-6/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Updated privileges for IPMI commandsAppaRao Puli2019-11-131-5/+5
| | | | | | | | | | | | | | | Updated privilege restrictions for below IPMI commands as per IPMI spec. - Get Session Info: User - Get ACPI Power State: User - Get Watchdog Timer: User Tested: Tested above commands with different privileged users and validated. Change-Id: If98d3125eee2192ac3b0f9195d1a46d57310abbf Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
* Fix permissions on Get Channel Cipher Suites commandVernon Mauery2019-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The Get Channel Cipher Suites command should be available at any privilege level as well as pre-session. This changes it so that it can be used pre-session to determine the best cipher suite to use. As per section 22.15 of the IPMI 2.0 spec, "This command can be executed prior to establishing a session with the BMC." This means that it should be able to be executed at any privilege, including 'none'. Tested: run a new version of ipmitool that calls get channel cipher suite as part of session initialization before and after. This affects all commands, but raw is the shortest to run, so it is used here. (raw 6 1 is get device id). Before: $ ipmitool -I lanplus -H a.b.c.d -U root -P 0penBmc raw 6 1 Get Channel Cipher Suites failed: Insufficient privilege level 23 00 00 01 02 bf 57 01 00 7b 00 99 91 cd 13 After: $ ipmitool -I lanplus -H a.b.c.d -U root -P 0penBmc raw 6 1 23 00 00 01 02 bf 57 01 00 7b 00 99 91 cd 13 Change-Id: I59a3212f1ea5dc82c545e6ec1ee4a437ec5abfe1 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Implemented get session info cmd in host interfaceRajashekar Gade Reddy2019-10-251-0/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* add "set system info" commandJia, chunhui2019-10-111-15/+108
| | | | | | | | | | | | | | | | | | | | | | Set/get system info commands are pair commands that customer could use to save/restore system specified infomation like machine serial numbner/OS version/.. etc. One typical scenario is that customer could check current OS version even when tareget system is powered off. Current openbmc implements "Get system info" but "Set system info" is not available. This changes implements "Set system info" command. Tested: :~# ipmitool raw 0x6 0x58 0x1 0x0 0x0 0x2 0x30 0x31 :~# ipmitool raw 0x6 0x59 0x0 0x1 0x0 0x0 11 00 00 02 30 31 :~# ipmitool raw 0x6 0x59 0x0 0x1 0x1 0x0 Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x59 rsp=0xc9): Parameter out of range Change-Id: Iaa66e30bcec708e28a01c2e81d612e6ffdd36383 Signed-off-by: Jia, chunhui <chunhui.jia@linux.intel.com>
* transporthandler: Rewrite + New HandlerWilliam A. Kennington III2019-09-271-1/+0
| | | | | | | | | | | | | | | | | | 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>
* Implemented close session cmd in host interfaceRajashekar Gade Reddy2019-09-251-0/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix: refactor get channel cipher suite commandAyushi Smriti2019-09-251-2/+3
| | | | | | | | | | | | | | | Get channel cipher suites command updated as per new ipmi structure. Tested: ipmitool raw 0x06 0x54 0x01 0x00 0x80 01 c0 03 01 41 81 c0 11 03 44 81 //response Also verified by issuing cmd: ipmitool channel getciphers ipmi 0x01 which listed supported CIA algorithms as response Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Change-Id: Ibc942f5b197c72071cd35a138fbe244db7519824
* Update GetSystemInfo with new APIJia, chunhui2019-09-231-132/+61
| | | | | | | | | | | | | | | | | | | Tested: verified with ipmitool raw command ipmitool raw 0x6 0x59 0x0 0x0 0x0 0x0 11 00 ipmitool raw 0x6 0x59 0x80 0x0 0x0 0x0 11 ipmitool raw 0x6 0x59 0x81 0x0 0x0 0x0 11 ipmitool raw 0x6 0x59 0x82 0x0 0x0 0x0 11 ipmitool raw 0x6 0x59 0x0 0x2 0x0 0x0 11 00 00 0a 69 6e 74 65 6c 2d 6f 62 6d 63 00 00 00 00 Change-Id: I2e648faa43fb8405b3cdd2f021fc1a12a78b4752 Signed-off-by: Jia, chunhui <chunhui.jia@linux.intel.com>
* Watchdog: move get and set watchdog to new api.Deepak Kumar Sahu2019-09-101-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite "get and set watchdog" command to use the newly introduced ipmi api. Tested: Verified using ipmitool "get and set watchdog", timer behavior is same before and after the changes. Testing Procedure: default watchdog timer is 11.2 seconds. ipmitool raw 0x06 0x25 ---> Get Output: 00 00 00 00 70 17 70 17 Note: Here 70 count(hex value)->112 count(decimal value)->112*100=11200ms [100ms per count]->11.2sec (watchdog timer) watchdog timer set to 20 seconds. ipmitool raw 0x06 0x24 0x44 0x01 0x00 0x10 0xc8 0x00 ----> Set output: ipmitool raw 0x06 0x25 ---> Get output: 04 01 00 00 c8 00 c8 00 Note: Here 20sec->20000ms->200count->c8 (hex value) Signed-off-by: Deepak Kumar Sahu <deepakx.sahu@intel.com> Change-Id: Id8c096bc1635d1900ee842a9726c49fb690fa8bc
* Move i2c WR api into libipmidYong Li2019-08-301-42/+4
| | | | | | | | | | | | 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
* Add compile option to disable white list checking for I2C master WR commandYong Li2019-08-301-1/+14
| | | | | | | | | | | | | | | | By default this white list checking is enabled, we can disable it by using the below command, ./configure --disable-i2c-whitelist-check Tested: Without the --disable-i2c-whitelist-check compile option, the white list checking works as before "ipmitool i2c bus=2 0x9c 8 0" command will fail with error message: Unable to perform I2C Master Write-Read After adding the compile option, there is no such error. Signed-off-by: Yong Li <yong.b.li@linux.intel.com> Change-Id: I91ced8b0dfb1dbf51292a6b3dea6fd5c03bdbde7
* rewrite Get System GUID to use new provider APIVernon Mauery2019-06-201-58/+33
| | | | | | | | | | | | | | Modify to use the new provider API. One by one, change calls to remove any legacy API constructs. Tested-by: ipmitool raw 6 0x37 08 50 f3 d6 73 d5 98 b4 45 49 9a a6 24 76 f5 82 This is the same as the BMC web value as shown by: curl https://<bmcip>/redfish/v1/Systems/system "UUID": "82f57624-a69a-4945-b498-d573d6f35008" Change-Id: Ic3ea8c53266d5be07bc957fe7076b208b621f00b Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Modify Get Device ID to use Context::busVernon Mauery2019-06-051-17/+30
| | | | | | | | | | | | Now that a bus pointer is available via the Context for every IPMI command handler, make use of it for Get Device ID. Tested-by: run Get Device ID and verify results: ipmitool raw 6 1 23 00 00 00 02 bf 57 01 00 7b 00 00 00 00 00 Change-Id: I2ae5f59623767c7ae059340758a8d042acfb00e9 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* rewrite Get Device GUID to use new provider APIVernon Mauery2019-05-201-97/+53
| | | | | | | | | | | | | | | Modify to use the new provider API. One by one, change calls to remove any legacy API constructs. Tested-by: ipmitool 6 8 30 ba 05 cd 7e 9d ac 89 4a 4c 52 ef f3 24 2d 5f (with matching change from bmcweb:) curl https://<bmcip>/redfish/v1/Managers/bmc ... "UUID": "5f2d24f3-ef52-4c4a-89ac-9d7ecd05ba30" Change-Id: I4cd3b945f76b4fe6c4fcf31d8e1962aaa768828e Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* apphandler: move get ACPI power state to new APIDeepak Kumar Sahu2019-05-091-21/+21
| | | | | | | | | | | | | | Rewritten "Get ACPI power state" command to use the newly introduced IPMI provider API. Tested: Verified using ipmitool and it is giving same behaviour as before. ipmitool raw 0x06 0x07 05 03 Change-Id: I51f2d5bbb89e445230ffc1363cf413e716116996 Signed-off-by: Deepak Kumar Sahu <deepakx.sahu@intel.com> Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* apphandler: catch exceptions in getting bmc statePatrick Venture2019-05-071-1/+19
| | | | | | | | | | | | | | | | | | If the xyz.openbmc_project.State.BMC interface is not provided by anything in the inventory, provide a mechanism for specifying a default state with regards to the BMC state. The dev_id.json file now can have a boolean field, availability, that sets the default that the Get Device Id command should use in the event the interface is unavailable or that there is a dbus error. The default value for the state of the BMC is true. Currently, the service in OpenBMC providing the real value via the dbus interface simply checks that a systemd target is Active. The systemd target checked is the one that starts all the OpenBmc default services, including ipmid. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Iba2c8308544337490905b0b48ba95785e0d775d4
* apphandler: Master write read - whitelist filterRichard Marian Thomaiyar2019-05-071-0/+282
| | | | | | | | | | | | | | | Support added for master write read IPMI command with whitelist filter support. Allows commands which are listed in the whitelist filter. Tested: 1. Verified with filter list and able to execute whitelisted commands as per the mask 2. verified command throws invalid field in request for non whitelisted filters. Change-Id: I8f20808a8a2d9afc10747485a1303492329a6996 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* move variant to std namespaceVernon Mauery2019-04-181-13/+12
| | | | | | | | | | | sdbusplus::message::variant_ns has been std for a while now. This moves ipmid away from sdbusplus::message::variant_ns to directly use std::variant. Tested-by: built, compiles, and runs the same as before. Change-Id: I8caa945f31c926c2721319f001b9d7f83fd3f1b7 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* rewrite Reset Watchdog Timer command to use new provider APIVernon Mauery2019-04-111-2/+3
| | | | | | | | | | | | Modify to use the new provider API. One by one, change calls to remove any legacy API constructs. Tested-by: ipmitool mc watchdog get ipmitool mc watchdog off ipmitool mc watchdog reset Change-Id: If6cd1d921908dc7f5462e99b0098b4897e743ebb Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Fix up Get Device ID to use the new return helpersVernon Mauery2019-04-111-2/+2
| | | | | | | | | | The Get Device ID rewrite went in before some feedback had come along to add helper return functions for more readable error codes. Tested-by: Built and runs Get Device ID as before. Change-Id: I7e31ad3cff75acb11bda5ee06f60429552a61ed5 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Only include ipmid/api.hpp for the new APIVernon Mauery2019-04-081-2/+0
| | | | | | | | | | | | | | After some feedback from users of the new IPMI API, they wanted to see two things: 1) don't require ipmid/api.hpp and ipmid/registration.hpp to be able to write new handlers 2) only require including ipmid/api.hpp (instead of ipmid/api.h) So now, by simply including ipmid/api.hpp instead of ipmid/api.h (deprecated), handlers incorporating the new IPMI API can be written. Change-Id: I446dcce70cff03d4ecc28c658292d052485f77fc Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* remove app wildcard handlerVernon Mauery2019-04-051-21/+0
| | | | | | | | Tested-by: ipmitool raw 6 0x88 -> returns c1 Change-Id: I1f22a70d135ed0ab39c6b1fbacf41e8d5ff20b65 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* rewrite Get BT Capabilities using new provider APIVernon Mauery2019-04-051-21/+13
| | | | | | | | | | | Modify to use the new provider API. One by one, change calls to remove any legacy API constructs. Tested-by: ipmitool raw 6 0x36 01 3f 3f 0a 01 Change-Id: I9be3d21c041ba1d99f6672c4501faafcca117d11 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* rewrite Get Self Test Results to use new provider APIVernon Mauery2019-04-051-20/+7
| | | | | | | | | | | Modify to use the new provider API. One by one, change calls to remove any legacy API constructs. Tested-by: ipmitool raw 6 4 56 00 Change-Id: I3cf0a9bd93df6b12584861b4c60b272ff84b7dae Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* rewrite Get Device ID using new provider APIVernon Mauery2019-04-051-72/+70
| | | | | | | | | | | Modify to use the new provider API. One by one, change calls to remove any legacy API constructs. Tested-by: ipmitool raw 6 1 check for expected output Change-Id: I59688627eb32670559c1defad0b7af8abeb84c75 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* update apphandler #include to match styleVernon Mauery2019-04-011-7/+8
| | | | | | | Remove the "" style includes in preference of the <> style Change-Id: I74bfa4dcadeaca7fe2341d5a9221844ebe2653b8 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Remove old channel commandsVernon Mauery2019-04-011-19/+1
| | | | | | | | | New channel commands have been implemented in user_channel/channelcommands.cpp This removes the old, unused command implementation Change-Id: I054ea053d25865e0d4203f2ae294778d31817637 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* remove legacy ipmid.cpp and ipmid.hppVernon Mauery2019-04-011-1/+0
| | | | | | | These two files have now been replaced with newer APIs and can be removed. Change-Id: If60227b24188c6796211ca43379169f9a95c9cb3 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Remove experimental filesystem spliceVernon Mauery2019-03-281-13/+1
| | | | | | | | | | In order to be compatible with older versions of GCC that did not have the experimental filesystem moved over to the standard paths, the code would splice the experimental code into the std namespace. This is no longer necessary with yocto 2.6 and the latest versions of GCC. Change-Id: I2db13c52a91456318795819f2d45c3386b4c56d2 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* move types.hpp to ipmid/types.hpp for exportVernon Mauery2019-03-251-1/+1
| | | | | | | | | | types.hpp is required by utility.hpp, which is exported, so it needs to be exported as well. This moves it to the include/libipmid directory, changes the Makefile to export it, and changes all the files that include it so it can be found in the right place. Change-Id: I30ec365446e4de466c266ec4faa327478460ec05 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Move util.cpp/util.hpp to libipmidVernon Mauery2019-03-251-1/+1
| | | | | | | | | | | | | | | | These are functions that are used widely by ipmid providers, so it makes sense to put them in libipmi.so (the library that all providers must link against). Tested-by: use nm to inspect the binaries to see that the symbols are in the expected library. arm-openbmc-linux-gnueabi-nm libipmid.so.0.0.0 \ | grep getDbusObject 0001063c T _ZN4ipmi13getDbusObjectERN9sdbusplus.... Change-Id: I1221f807f2711c5301c5574623564ea1ae48a437 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Create libipmid and libipmid-hostWilliam A. Kennington III2019-02-071-1/+1
| | | | | | | | | | | | | | | | | | | This starts a transition to common ipmid libraries that providers can link against. It will allow for a cleaner separation between common ipmid functionality and daemon type specific code. This is needed so we can resolve all of the symbols in the providers at link time instead of discovering bad linkage by building and running a full ipmi daemon. In future commits libraries will be packaged for libipmid and libipmid-host which provide all of the symbols used by the current set of ipmid providers. This is the first step, it just separates and renames the headers. Legacy symlinks are still kept around for compatability. It also adds stub libraries so that external users can start linking as intended. Change-Id: I6bbd7a146362012d26812a7b039d1c4075862cbd Signed-off-by: William A. Kennington III <wak@google.com>
* libipmi: Decouple user commandsWilliam A. Kennington III2018-12-201-4/+0
| | | | | | | | | | | | | This makes them an optional, separate provider like the sysfs cmds. Tested: Ran on real hardware that included libusercmds.so in /usr/lib/host-ipmid and on a machine that did not include it. Ran ipmitool on the host to verify that the user commands were present when expected. Change-Id: I07b3af5ae603c3e5f1ea41f0afc309329f4e185d Signed-off-by: William A. Kennington III <wak@google.com>
* std::variant: Fix new instances of mapbox specific callsWilliam A. Kennington III2018-11-261-2/+2
| | | | | | | | Tested: Build and run through unit tests. Change-Id: I87f2d5441b2f029e1e96ee1b46c4c760b0d82aac Signed-off-by: William A. Kennington III <wak@google.com>
* IPMI Channel commands implementationAppaRao Puli2018-11-201-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IPMI Channel commands implemenation - squashed commit e9a75d8dd6e89d17381f0310c7930586c6b79996 Author: AppaRao Puli <apparao.puli@intel.com> Date: Thu Jul 5 14:47:22 2018 +0530 Channel layer separation De-coupling the channel management from ipmi channel commands implementation. This gives flexibility to load only needed stuff in different modules(host-ipmi or netipmid) Change-Id: Ib334562beb9325f7768ed6a15475cae15af17b19 Signed-off-by: AppaRao Puli <apparao.puli@intel.com> Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit 726ddf2af678ea6773f4b4b918fbd49be8c83e6a Author: AppaRao Puli <apparao.puli@intel.com> Date: Thu May 24 16:45:30 2018 +0530 IPMI Channel commands implementation Following IPMI channel commands are implemented. 1) Set channel access (0x40) 2) Get channel access (0x41) 3) Get channel info (0x42) Also added code supported for LAN configuration parameters 1) Authentication Type Support (selector #1) 2) Authentication Type Enables (selector #2) Change-Id: Ic4156378c7756eca383dc3da52114fd119346ca6 Signed-off-by: AppaRao Puli <apparao.puli@intel.com> Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Change-Id: Ic4156378c7756eca383dc3da52114fd119346ca6 Signed-off-by: AppaRao Puli <apparao.puli@intel.com> Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Implement IPMI ACPI set/get commandsYong Li2018-11-201-1/+263
| | | | | | | | | | | | | | | | | | | | | | | The IPMI ACPI set/get power state commands are provided to allow system software to tell a controller the present ACPI power state of the system. This is an independent setting that may not necessarily match the actual power state of the system. The commands are used to enable the reporting of the power state, it does not control or change the power state. The ACPI status will be saved into flash by settings manager. Tested By: Set ACPI: ipmitool -H <IP> -P 0penBmc -I lanplus raw 0x06 0x06 0x86 0x83 Get ACPI: ipmitool -H <IP> -P 0penBmc -I lanplus raw 0x06 0x07 Change-Id: I6d00c0aec931b98d6691d7c4a54698e08d317aa4 Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
* Basic IPMI User Management SupportRichard Marian Thomaiyar2018-11-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit containing Basic User Management implementation Unit Test: 1. Verified both Host & NetIpmid works fine. 2. Verified user related command responses commit b46b869c0a3958a572b976b3bbaf6b5f33673778 Author: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Date: Tue Aug 7 15:30:32 2018 +0530 Fix static objects to directly link user layer User layer library has to be directly linked with netipmid in order to be used in RAKP commands. Hence user layer library should not initialize the static bus objects in file scope, as ipmid_get_sd_bus_connection() won't be available during this time. Hence moved it under function scope and initialize it later. Unit test: Made sure, with this change it is loaded perfectly under phosphor-ipmi-host & phosphor-ipmi-net and responding to all user commands Change-Id: Id3f2e06580ca41b0347176ca33e011bf7b048c6a Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit dc60516c45234379a30ad8b03b1cbe53978faeae Author: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Date: Tue Aug 7 15:22:37 2018 +0530 Fix to use proper user index for set user name Fix to use proper user index, instead of bailing out on first empty index. If user creation is requested on random index with previous index empty, then signal handler updates the data in first empty index, instead of traversing the user list fully. Fix added to mark the first free index, and still search for match to skip if found. Unit Test: Verified that user added in random index shows in that index using ipmitool set user name command. Change-Id: I30d9b884a5bae98b243ccf8ba7da194ef81355e6 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit 0b9a81a1261b08ea13ad8777d0d80dad937e9972 Author: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Date: Fri Jul 6 15:57:02 2018 +0530 Converting json store to array for user config Addressed comments to convert to array instead of key value pair. Testing: Performed basic testing of user management commands in both host & netipmid, by repeatedly restarting the same. Change-Id: I2e51ded3e2299fa196d868213950d96c72886358 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit 182c945657b29acaeb13fc44129e0ed929013e59 Author: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Date: Sat Jun 30 00:07:28 2018 +0530 Fix D-Bus paths for user management Fix D-Bus path as per upstream code in user management Change-Id: Idb22bee4365520f3d58e70ff61b02d6f6512d707 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit cd5e22b16f8805dda396311b06994a9e021e97e9 Author: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Date: Thu Jun 28 06:22:27 2018 +0530 Json format to store user config & cleanup Code updated to use json format to store and read the user configuration data. Few basic cleanup's performed. Change-Id: I7005f4f2648ccb8214312982a755ddcc6c33e64d Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit 95ca9a67a4b84df603db0eb6a7024e9e0e5ad342 Author: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Date: Wed May 30 15:16:47 2018 +0530 Get & Set User Access command implementation Get & Set User access command implementation Change-Id: I4f7a86de95400387c47ae556127baa1f02a703b2 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit b2dea762362d06b70576dba5f45552d548792cb9 Author: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Date: Fri May 18 23:46:23 2018 +0530 User layer separation. Separated out user commands from the implementation details, by creating user layers. App Handler library and netipmid will directly rely on this user_layer.so Change-Id: Ie7d4b3a5a934e32da73e066a25da4c27485c59c8 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit 63e3113e522ecc7ce6e5aa1c85de4dc9b9a65a7b Author: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Date: Mon May 7 12:00:06 2018 +0530 Updated user management ipmi support 1. Relying on Object Manager & D-Bus properties signal (except user rename, for which still relying on user rename signal) 2. Minor clean-up. Change-Id: I594e7823a2c626bb7c88ec54a3ffa89a60b09c65 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit 3e7b774c842917743369569790612d74387c755e Author: AppaRao Puli <apparao.puli@intel.com> Date: Tue Apr 24 22:01:15 2018 +0530 Synchronize user manager data during ipmi startup Synchronizing the user information by reading all managed user objects from dbus and checking ipmi user data for any update/delete/add users. Change-Id: I9e1a62ec9dd186a7276d083a57e679606d635e05 Signed-off-by: AppaRao Puli <apparao.puli@intel.com> Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit 92298ac0f591d167b0e26b977316a2b136127778 Author: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Date: Tue Apr 24 21:34:08 2018 +0530 Minor fix: Read user enabled state in signals Fixed to read user enabled state in signal handlers. Change-Id: I0aa6c4687c16e08d8e304315e85cb65e9dbd346a Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit 8646d2683fc247ce02a0460f9577276eb6e0a581 Author: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Date: Wed Apr 11 22:18:44 2018 +0530 Signal handler update Support added to handle group, privilege user rename, enable / disable signal, and update the database accordingly. Change-Id: Ia33d063715a35814bbe1f9220e9609b800261e33 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> commit fa411b2c4bbef50175b084889a4829206263ebdb Author: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Date: Mon Mar 12 23:42:34 2018 +0530 Add Basic user manager support - IPMI Add basic user manager support in IPMI Creates user through D-Bus user interface and sets password using pam_chauthok(). Lock & File reload mechanism also implmeneted. UserUpdate signal handler support added to update user in IPMI, when users are updated through different interfaces. Change-Id: I1adc538562615109189d7c19dadae0b6a109f4a5 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> Change-Id: I1adc538562615109189d7c19dadae0b6a109f4a5 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Convert variant usage to std interfaceWilliam A. Kennington III2018-10-181-10/+14
| | | | | | | | | | | | | This is just a refactoring to use the c++17 std::variant interfaces instead of the mapbox::variant specific ones. We should be able to use mapbox::variant and std::variant interchangeably now. Tested: Built against sdbusplus with mapbox::variant and sbusplus using std::variant. Both variant compile and test out. Change-Id: I6fbaad3d12dd34968db6a10f3d74a65e07d0f0cc Signed-off-by: William A. Kennington III <wak@google.com>
* apphandler: Fix buffer underflow in ipmi_app_get_device_guidEmily Shaffer2018-10-011-0/+12
| | | | | Change-Id: I7e27130bbe8bfc847f81968d850abacb8914ad78 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* add std namespace prefix to common methodsPatrick Venture2018-09-251-8/+8
| | | | | | | | Standard clib methods should be explicitly grabbed from the standard namespace. Change-Id: I8bcfcb260a99180d535ec8102c1a24c318cbc209 Signed-off-by: Patrick Venture <venture@google.com>
* move filesystem inclusion to bottom of listPatrick Venture2018-09-251-15/+14
| | | | | Change-Id: I4aa3c984992236bb5b4a5c62c3d42a33c12d55de Signed-off-by: Patrick Venture <venture@google.com>
* replaced c headers with cpp where applicablePatrick Venture2018-09-251-2/+0
| | | | | Change-Id: I23a70eb540ccde5d2aba467426769feffb07b516 Signed-off-by: Patrick Venture <venture@google.com>
* rename headers to match stylePatrick Venture2018-09-251-3/+3
| | | | | | | | | | | | | | | | | | Moving headers from ".h" to ".hpp" Reworked the header inclusion a bit so that host-ipmid is treated as a library, and local headers aren't. renamed apphandler.h => apphandler.hpp renamed chassishandler.h => chassishandler.hpp renamed globalhandler.h => globalhandler.hpp renamed sensorhandler.h => sensorhandler.hpp renamed storageaddsel.h => storageaddsel.hpp renamed storagehandler.h => storagehandler.hpp renamed systemintfcmds.h => systemintfcmds.hpp Change-Id: I9d4ce3dd57e2e996800f9020a10cc10cdf2c3914 Signed-off-by: Patrick Venture <venture@google.com>
* apphandler: Add "System Name" System Info parameterXo Wang2018-09-251-0/+15
| | | | | | | | | Use the BMC's hostname to respond to requests for the "System Name" parameter. Signed-off-by: Xo Wang <xow@google.com> Change-Id: I23845aab6091a0d003b6f8370d2b67fc11e580e8 Signed-off-by: Patrick Venture <venture@google.com>
* apphandler: Implement Get/Set System Info ParameterXo Wang2018-09-251-8/+176
| | | | | | | | | | | | | | | | Implement Get System Info Parameter using the parameter storage code to back the string-type parameters. Supports up to 255 chunks (known as "sets" in the spec) for those parameters. Currently, iterated reads by chunk of a string parameter will repeatedly invoke that parameter's callback, which can result in chunks being incoherent with each other if the string changes between invocations. This is noted in a TODO comment. Stub out Set System Info Parameter. Full implementation for that is pending support for read-only flags in the parameter storage code. Change-Id: If0a9d807725ccf1f1f62e931010024841575469c Signed-off-by: Xo Wang <xow@google.com> Signed-off-by: Patrick Venture <venture@google.com>
* Get Device ID: Add handling of availability bitAlexander Amelkin2018-09-251-2/+32
| | | | | | | | | | | Make "Device available" bit in Firmware Version 1 field reflect the ready state of BMC as indicated in DBus by CurrentBMCState property of xyz.openbmc_project.State.BMC interface. Change-Id: Ic108507882c68d6cc70b40849668732f7b759ef6 Signed-off-by: Alexander Amelkin <a.amelkin@yadro.com> Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
* Implement Set Channel access commandTom Joseph2018-09-251-0/+4
| | | | | | | | The only option supported is the access mode for disabling or enabling the network IPMI. Change-Id: I2e6b20c317fec19e1e71b3adfc211e6fb847f737 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* add .clang-formatPatrick Venture2018-09-071-173/+147
| | | | | Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5 Signed-off-by: Patrick Venture <venture@google.com>
OpenPOWER on IntegriCloud