summaryrefslogtreecommitdiffstats
path: root/transporthandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* make ipmid respond to SIGTERM and SIGINT for clean shutdownVernon Mauery2019-03-201-1/+2
| | | | | | | | | | | | | | | On some systems ipmid was not responding to SIGTERM so systemd could not shut it down in a clean manner, resorting to SIGKILL after a long timeout. This adds code to respond to SIGTERM and SIGINT and safely unwind all the provider libraries on exit. Tested-by: running ipmid; in another shell, and running 'killall -15 ipmid' or 'killall -2 ipmid' to send SIGTERM or SIGINT and watch that ipmid shuts down in a controlled and timely manner. Change-Id: I690846796523bebea1a08845c0d17e1df2a94fee 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>
* Acquire the NIC netmaskJohnathan Mantey2019-02-051-3/+3
| | | | | | | The netmask value was not being pulled from the correct DBus path. Change-Id: I4b163d5269737f7a9556d7b5ceafa25a5034d327 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
* IPMI channel to NIC device mapping modified within JSON config fileJohnathan Mantey2019-02-041-5/+5
| | | | | | | | | | | The IPMI to NIC channel mapping was done using a hard coded scheme. The scheme used generic channel names which were then mapped to specific device names. The hard coded generic to specific naming convention is removed, and the JSON file contains the device name directly. Change-Id: Ibc6821cae5a26f2666467aba5346d364053f2582 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
* transporthandler: LanParam enum -> enum classWilliam A. Kennington III2018-11-261-28/+29
| | | | | | | | | | | We should be using enum classes instead of enums to avoid poluting the global scope. Tested: Built and run through unit tests. Change-Id: Iec72f04b5cbf91814d0055c670bcc509eb30a821 Signed-off-by: William A. Kennington III <wak@google.com>
* transporthandler: Use switch when applicableWilliam A. Kennington III2018-11-261-77/+90
| | | | | | | | Tested: Build and run through unit tests. Change-Id: Id86f7f368f1c1e78b7f764d53231e8d0d51ad02f Signed-off-by: William A. Kennington III <wak@google.com>
* Convert variant usage to std interfaceWilliam A. Kennington III2018-10-181-17/+21
| | | | | | | | | | | | | 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>
* Use the common timer classVernon Mauery2018-10-181-5/+4
| | | | | | | | | The common timer class from sdbusplus offers all the timer goodness that we currently use. The unit test is also no longer needed (and has been added to sdbusplus's version of the timer.hpp implementation). Change-Id: I278817489433a29ca739f70fdacd8bb897797d66 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* add std namespace prefix to common methodsPatrick Venture2018-09-251-31/+32
| | | | | | | | 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-19/+17
| | | | | Change-Id: I4aa3c984992236bb5b4a5c62c3d42a33c12d55de Signed-off-by: Patrick Venture <venture@google.com>
* replaced c headers with cpp where applicablePatrick Venture2018-09-251-4/+3
| | | | | Change-Id: I23a70eb540ccde5d2aba467426769feffb07b516 Signed-off-by: Patrick Venture <venture@google.com>
* rename headers to match stylePatrick Venture2018-09-251-2/+2
| | | | | | | | | | | | | | | | | | 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>
* add .clang-formatPatrick Venture2018-09-071-271/+193
| | | | | Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5 Signed-off-by: Patrick Venture <venture@google.com>
* Standardize use of filesystemVernon Mauery2018-08-081-1/+11
| | | | | | | | | If <filesystem> exists, use that, if it doesn't, try <experimental/filesystem>. Either way, access it from std via a namespace splice. Change-Id: I5b35ee9f74b88e188cb3ca3fed9abaec64933697 Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
* Use s.c_str() in log messagesJoseph Reynolds2018-05-311-1/+1
| | | | | | | | | | Fixes issues with data passed to phosphor::logging::log(entry()). This is part of a series of commits that resolves openbmc 2905. Tested: static_assert only Change-Id: I9fac771f54e4acbec97ce1360c106b6e3eb4fe9d Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
* Grammar and spelling fixesGunnar Mills2018-04-181-8/+8
| | | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Some additional grammar and capitalization errors were fixed as well. Change-Id: I700db4e6d7ba52b02374c9c3e84be0af8bd91859 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Implement RMCP+ cipher parameters in Get LAN Config parametersTom Joseph2018-04-181-0/+72
| | | | | Change-Id: Ic78965be94b1ba31149a05a29c1a768f06b492e4 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Reducing IPMI logging footprintAditya Saripalli2018-04-181-4/+0
| | | | | | | | | | | | -host-ipmid is very noisy in terms of journal logging. A small step towards cleaning that up. -Also converted printfs to phosphor-logging. Partially Resolves openbmc/openbmc#2507 Change-Id: I749c19c18d1cabf6f0216830c8cb0a08ee43d6de Signed-off-by: Aditya Saripalli <aditya0124@gmail.com> Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* SetLan: Fix the IP address if partial data givenRatan Gupta2018-03-201-1/+1
| | | | | | | | | | | | Presently when partial lan data is given the code was not getting the correct IP object,it was getting the linklocal address. This defect was introduced due to this commit c7c1c3c. This commit fixes this problem. Change-Id: I8f6d915cd3e1757ba28394cd93f16396e087d4f7 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* SetLan: Apply the network changes once the timer expiresRatan Gupta2018-03-201-35/+52
| | | | | | | | | | | | Start the timer once the set in progress parameter set to set complete as part of Set LAN Configuration Parameters command. Resolves openbmc/openbmc#2932 Resolves openbmc/openbmc#2993 Change-Id: Ie6f3b331531da23c74fa44bb52fa1ddccffabd13 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* SetLan: Move the setChannel access functionRatan Gupta2018-03-201-0/+325
| | | | | | | | | | | | | | | Move the function from app/channel.cpp to the transporthandler.cpp setChannel access is disabled now as the functionality to apply the network changes would be done through timer based approach. In later commit we would create this function as callback when the network timer expires. Change-Id: Ic128a47237b2ecdbc56267227105909f8886a862 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* multiple channel configuration supportPatrick Venture2017-12-121-48/+82
| | | | | | | | | | | | | | Previously, the ipmi daemon only supported eth0 and hard-coded it to channel 1. This allows one to map via a configuration. The channel number provided is checked against a configuration to retrieve the ethernet device identifier, e.g. eth0. Tested: Ran on a quanta-q71l and was able to properly set MAC, IP, Netmask, Gateway IP, and then verified the data was set for the eth1 via `ip addr show eth1`. Change-Id: I92f63188297304e9454fd0d6fe32bc6cf84bb181 Signed-off-by: Patrick Venture <venture@google.com>
* Fix the getLan configRatan Gupta2017-11-281-6/+15
| | | | | | | | | | | | | | | We did the filtering during IPAddress parameter to avoid link local address but left it for subnetMask and vlan parameter. With the introduction of zeroconfig IP we have multiIPaddress can exist on the interface. This commit introduces the filtering for subnetmask and vlan parameter also. Resolves openbmc/openbmc#2664 Change-Id: I244bfe8b9d7efbf55fc1b7051489a8a204182906 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* transporthandler: lan_set_in_progress to per channelPatrick Venture2017-11-221-23/+15
| | | | | | | | | The IPMI specification indicates that this value is per channel, therefore goes in the channelconfig object. Change-Id: Iab5861651518ac80d797faa9d9f092933cc1886e Signed-off-by: Patrick Venture <venture@google.com>
* transporthandler: minor cleanup unused variablesPatrick Venture2017-11-141-6/+0
| | | | | | | | | Simple cleanup to remove obj, ifc, and nwinterface varibles likely holdovers from before the refactor to using util methods. Change-Id: Icf55cdcbe8cb75a08d1d32df4f23112b142bf55b Signed-off-by: Patrick Venture <venture@google.com>
* Don't set/get zeroconfig address if other IP address is presentNagaraju Goruganti2017-10-111-12/+4
| | | | | | | Resolves openbmc/openbmc#2265 Change-Id: I65b54358f13231c78b3c6488a59b94bc9323484c Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* GetLan: Support for get/set of ipsrc parameterRatan Gupta2017-09-081-59/+195
| | | | | Change-Id: Id9c52bb0963c5924f80f9e273b53ed5556b16a2c Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Add support for vlan(set lan command)Ratan Gupta2017-08-131-3/+58
| | | | | | | Resolves openbmc/openbmc#1899 Change-Id: I3c436045676bc96e5d91fd9420509bc991549a13 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Move LAN handling commands to the new xyz interfacesRatan Gupta2017-08-131-248/+276
| | | | | Change-Id: I4631c79c171883e5f0d531cfb5957a09496e4b3a Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Add privilege level for each IPMI commandTom2017-01-171-3/+9
| | | | | Change-Id: I07f160c6ea83dc91f46e21f263c4cf994aff081d Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Add transaction support to Set Lan Cmd and Set Channel Access CmdNan Li2016-11-231-68/+43
| | | | | | | | | | | | | * Ipmid will cache single setting to memory by Set Lan cmd * Add Set Channel Access cmd to ipmid * Set Channel Access cmd is used to apply the previous cached settings TODO: parse the request data of Set Channel Access cmd if needed. Resolves openbmc/openbmc#444 Change-Id: Ia7ac57a551731920ffe69dad5c69c995521fed02 Signed-off-by: Nan Li <william.bjlinan@hotmail.com>
* Print failing object path after failed bus lookupBrad Bishop2016-10-061-3/+6
| | | | | Change-Id: I599d8297b4d2fd45831443685ea5b7d53f1515b6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Modify respond of un-supported IPMI commandNan Li2016-09-091-1/+1
| | | | | | | | | | | A number of callbacks are registered for 'WILDCARD' types, which currently do nothing except respond with CC_OK(00h). Change complete codes to CC_INVALID(C1h). Resolves openbmc/openbmc#469. Change-Id: I91ea5ee1a23284a4159ff1c1867342e89c6fa444 Signed-off-by: Nan Li <william.bjlinan@hotmail.com>
* Allow out-of-tree buildsPatrick Williams2016-09-061-1/+1
| | | | | Change-Id: If4b97e65f63c3abbf23140dd97b9febe00b3be0d Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* ipmid: Change .H -> .hppPatrick Williams2016-09-061-1/+1
| | | | | Change-Id: Ia1ed05a533736105909717b86f16274b30d36401 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Hard-coded service name replaced with call to ObjectMapperSergey Solomin2016-08-251-1/+23
| | | | | | | | | | | | | In the openbmc code, the dbus service name is hardcoded. The ObjectMapper provides a way to find out the service name by issuing a GetObject method call to the ObjectMapper. That functionality is implemented in mapper.c The output of the call to the mapper is a service name. Resolves openbmc/openbmc#319. Change-Id: I724a31ede6bdf3ae4b361e730857b1f2696a8966 Signed-off-by: Sergey Solomin <sergey.solomin@us.ibm.com>
* Switch C++ source files to .cpp extensionMatthew Barth2016-08-081-0/+395
Change-Id: I495186b4afd58ec1e5d9d5c6472394f96541d17d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
OpenPOWER on IntegriCloud