add .clang-format

Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/host-ipmid/ipmid-api.h b/host-ipmid/ipmid-api.h
index 1bec851..a085270 100644
--- a/host-ipmid/ipmid-api.h
+++ b/host-ipmid/ipmid-api.h
@@ -13,13 +13,14 @@
  * privilege level. Those commands which can be executed via system interface
  * only should use SYSTEM_INTERFACE
  */
-enum CommandPrivilege {
-  PRIVILEGE_CALLBACK = 0x01,
-  PRIVILEGE_USER,
-  PRIVILEGE_OPERATOR,
-  PRIVILEGE_ADMIN,
-  PRIVILEGE_OEM,
-  SYSTEM_INTERFACE   = 0xFF,
+enum CommandPrivilege
+{
+    PRIVILEGE_CALLBACK = 0x01,
+    PRIVILEGE_USER,
+    PRIVILEGE_OPERATOR,
+    PRIVILEGE_ADMIN,
+    PRIVILEGE_OEM,
+    SYSTEM_INTERFACE = 0xFF,
 };
 
 // length of Completion Code and its ALWAYS _1_
@@ -28,13 +29,13 @@
 // IPMI Net Function number as specified by IPMI V2.0 spec.
 // Example :
 // NETFUN_APP      =   (0x06 << 2),
-typedef unsigned char   ipmi_netfn_t;
+typedef unsigned char ipmi_netfn_t;
 
 // IPMI Command for a Net Function number as specified by IPMI V2.0 spec.
-typedef unsigned char   ipmi_cmd_t;
+typedef unsigned char ipmi_cmd_t;
 
 // Buffer containing data from sender of netfn and command as part of request
-typedef void*           ipmi_request_t;
+typedef void* ipmi_request_t;
 
 // This is the response buffer that the provider of [netfn,cmd] will send back
 // to the caller. Provider will allocate the memory inside the handler and then
@@ -44,7 +45,7 @@
 // unsigned char str[] = {0x00, 0x01, 0xFE, 0xFF, 0x0A, 0x01};
 // *data_len = 6;
 // memcpy(response, &str, *data_len);
-typedef void*           ipmi_response_t;
+typedef void* ipmi_response_t;
 
 // This buffer contains any *user specific* data that is of interest only to the
 // plugin. For a ipmi function router, this data is opaque. At the time of
@@ -52,11 +53,11 @@
 // fill in whatever needed that will be of help during the actual handling of
 // command. IPMID will just pass the netfn, cmd and also this data to plugins
 // during the command handler invocation.
-typedef void*           ipmi_context_t;
+typedef void* ipmi_context_t;
 
 // Length of request / response buffer depending on whether the data is a
 // request or a response from a plugin handler.
-typedef size_t*   ipmi_data_len_t;
+typedef size_t* ipmi_data_len_t;
 
 // Plugin function return the status code
 typedef unsigned char ipmi_ret_t;
@@ -67,14 +68,14 @@
 // function router will then make a call to this callback handler with the
 // necessary arguments of netfn, cmd, request, response, size and context.
 typedef ipmi_ret_t (*ipmid_callback_t)(ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t,
-                                       ipmi_response_t, ipmi_data_len_t, ipmi_context_t);
+                                       ipmi_response_t, ipmi_data_len_t,
+                                       ipmi_context_t);
 
 // This is the constructor function that is called into by each plugin handlers.
 // When ipmi sets up the callback handlers, a call is made to this with
 // information of netfn, cmd, callback handler pointer and context data.
-void ipmi_register_callback(ipmi_netfn_t, ipmi_cmd_t, ipmi_context_t, ipmid_callback_t,
-                            ipmi_cmd_privilege_t);
-
+void ipmi_register_callback(ipmi_netfn_t, ipmi_cmd_t, ipmi_context_t,
+                            ipmid_callback_t, ipmi_cmd_privilege_t);
 
 unsigned short get_sel_reserve_id(void);
 
@@ -85,18 +86,18 @@
 // Note: these are also shifted left to make room for the LUN.
 enum ipmi_net_fns
 {
-    NETFUN_CHASSIS   =   0x00,
-    NETFUN_BRIDGE    =   0x02,
-    NETFUN_SENSOR    =   0x04,
-    NETFUN_APP       =   0x06,
-    NETFUN_FIRMWARE  =   0x08,
-    NETFUN_STORAGE   =   0x0a,
-    NETFUN_TRANSPORT =   0x0c,
-    NETFUN_GRPEXT    =   0x2c,
-    NETFUN_OEM_GROUP =   0x2e,
-    NETFUN_NONE      =   0x30,
-    NETFUN_OEM       =   0x32,
-    NETFUN_IBM_OEM   =   0x3A
+    NETFUN_CHASSIS = 0x00,
+    NETFUN_BRIDGE = 0x02,
+    NETFUN_SENSOR = 0x04,
+    NETFUN_APP = 0x06,
+    NETFUN_FIRMWARE = 0x08,
+    NETFUN_STORAGE = 0x0a,
+    NETFUN_TRANSPORT = 0x0c,
+    NETFUN_GRPEXT = 0x2c,
+    NETFUN_OEM_GROUP = 0x2e,
+    NETFUN_NONE = 0x30,
+    NETFUN_OEM = 0x32,
+    NETFUN_IBM_OEM = 0x3A
 };
 
 // IPMI commands for net functions. Since this is to be used both by the ipmi
@@ -104,7 +105,7 @@
 // in this .H file.
 enum ipmi_netfn_wild_card_cmd
 {
-    IPMI_CMD_WILDCARD       = 0xFF,
+    IPMI_CMD_WILDCARD = 0xFF,
 };
 
 // Return (completion) codes from a IPMI operation as needed by IPMI V2.0 spec.
@@ -126,9 +127,9 @@
     IPMI_CC_UNSPECIFIED_ERROR = 0xFF,
 };
 
-sd_bus *ipmid_get_sd_bus_connection(void);
-sd_event *ipmid_get_sd_event_connection(void);
-sd_bus_slot *ipmid_get_sd_bus_slot(void);
+sd_bus* ipmid_get_sd_bus_connection(void);
+sd_event* ipmid_get_sd_event_connection(void);
+sd_bus_slot* ipmid_get_sd_bus_slot(void);
 
 #ifdef __cplusplus
 }
diff --git a/host-ipmid/ipmid-host-cmd-utils.hpp b/host-ipmid/ipmid-host-cmd-utils.hpp
index 293cc0c..e7c6dc2 100644
--- a/host-ipmid/ipmid-host-cmd-utils.hpp
+++ b/host-ipmid/ipmid-host-cmd-utils.hpp
@@ -1,7 +1,8 @@
 #pragma once
 
-#include <functional>
 #include <unistd.h>
+
+#include <functional>
 #include <tuple>
 
 namespace phosphor
@@ -10,40 +11,40 @@
 {
 namespace command
 {
-    /** @detail After sending SMS_ATN to the Host, Host comes down and
-     *          asks why an 'SMS_ATN` was sent.
-     *          BMC then sends 'There is a Message to be Read` as response.
-     *          Host then comes down asks for Message and the specified
-     *          commands and data would go as data conforming to IPMI spec.
-     *
-     *          Refer: 6.13.2 Send Message Command From System Interface
-     *          in IPMI V2.0 spec.
-     */
+/** @detail After sending SMS_ATN to the Host, Host comes down and
+ *          asks why an 'SMS_ATN` was sent.
+ *          BMC then sends 'There is a Message to be Read` as response.
+ *          Host then comes down asks for Message and the specified
+ *          commands and data would go as data conforming to IPMI spec.
+ *
+ *          Refer: 6.13.2 Send Message Command From System Interface
+ *          in IPMI V2.0 spec.
+ */
 
-    /** @brief IPMI command */
-    using IPMIcmd = uint8_t;
+/** @brief IPMI command */
+using IPMIcmd = uint8_t;
 
-    /** @brief Data associated with command */
-    using Data = uint8_t;
+/** @brief Data associated with command */
+using Data = uint8_t;
 
-    /** @brief <IPMI command, Data> to be sent as payload when Host asks for
-     *          the message that can be associated with the previous SMS_ATN
-     */
-    using IpmiCmdData = std::pair<IPMIcmd, Data>;
+/** @brief <IPMI command, Data> to be sent as payload when Host asks for
+ *          the message that can be associated with the previous SMS_ATN
+ */
+using IpmiCmdData = std::pair<IPMIcmd, Data>;
 
-    /** @detail Implementation specific callback function to be invoked
-     *          conveying the status of the executed command. Specific
-     *          implementations may then broadcast an agreed signal
-     */
-    using CallBack = std::function<void(IpmiCmdData, bool)>;
+/** @detail Implementation specific callback function to be invoked
+ *          conveying the status of the executed command. Specific
+ *          implementations may then broadcast an agreed signal
+ */
+using CallBack = std::function<void(IpmiCmdData, bool)>;
 
-    /** @detail Tuple encapsulating above 2 to enable using Manager by
-     *          different implementations. Users of Manager will supply
-     *          <Ipmi command, Data> along with the callback handler.
-     *          Manager will invoke the handler onveying the status of
-     *          the command.
-     */
-    using CommandHandler = std::tuple<IpmiCmdData, CallBack>;
+/** @detail Tuple encapsulating above 2 to enable using Manager by
+ *          different implementations. Users of Manager will supply
+ *          <Ipmi command, Data> along with the callback handler.
+ *          Manager will invoke the handler onveying the status of
+ *          the command.
+ */
+using CommandHandler = std::tuple<IpmiCmdData, CallBack>;
 
 } // namespace command
 } // namespace host
diff --git a/host-ipmid/ipmid-host-cmd.hpp b/host-ipmid/ipmid-host-cmd.hpp
index 6541bae..4fd95a9 100644
--- a/host-ipmid/ipmid-host-cmd.hpp
+++ b/host-ipmid/ipmid-host-cmd.hpp
@@ -1,9 +1,10 @@
-#include <memory>
-#include <sdbusplus/bus.hpp>
 #include "ipmid-host-cmd-utils.hpp"
 
+#include <memory>
+#include <sdbusplus/bus.hpp>
+
 // Need this to use new sdbusplus compatible interfaces
-using sdbusPtr =  std::unique_ptr<sdbusplus::bus::bus>;
+using sdbusPtr = std::unique_ptr<sdbusplus::bus::bus>;
 extern sdbusPtr& ipmid_get_sdbus_plus_handler();
 
 // Global Host Bound Command manager
diff --git a/host-ipmid/oemopenbmc.hpp b/host-ipmid/oemopenbmc.hpp
index c3bfaa4..8b5dc0c 100644
--- a/host-ipmid/oemopenbmc.hpp
+++ b/host-ipmid/oemopenbmc.hpp
@@ -1,8 +1,9 @@
 #pragma once
 
-#include "host-ipmid/ipmid-api.h"
 #include "host-ipmid/oemrouter.hpp"
 
+#include "host-ipmid/ipmid-api.h"
+
 namespace oem
 {
 
@@ -22,4 +23,4 @@
     fanManualCmd = 4,
 };
 
-}  // namespace oem
+} // namespace oem
diff --git a/host-ipmid/oemrouter.hpp b/host-ipmid/oemrouter.hpp
index bc2b88c..d6f0735 100644
--- a/host-ipmid/oemrouter.hpp
+++ b/host-ipmid/oemrouter.hpp
@@ -12,38 +12,39 @@
 constexpr size_t groupMagicSize = 3;
 
 using Group = std::array<uint8_t, groupMagicSize>;
-using Number = uint32_t;  // smallest standard size >= 24.
+using Number = uint32_t; // smallest standard size >= 24.
 
 // Handler signature includes ipmi cmd to support wildcard cmd match.
 // Buffers and lengths exclude the OemGroup bytes in the IPMI message.
 // dataLen supplies length of reqBuf upon call, and should be set to the
 // length of replyBuf upon return - conventional in this code base.
-using Handler = std::function<ipmi_ret_t(
-                       ipmi_cmd_t,     // cmd byte
-                       const uint8_t*, // reqBuf
-                       uint8_t*,       // replyBuf
-                       size_t*)>;      // dataLen
+using Handler = std::function<ipmi_ret_t(ipmi_cmd_t,     // cmd byte
+                                         const uint8_t*, // reqBuf
+                                         uint8_t*,       // replyBuf
+                                         size_t*)>;      // dataLen
 
 /// Router Interface class.
 /// @brief Abstract Router Interface
 class Router
 {
-    public:
-        virtual ~Router() {}
+  public:
+    virtual ~Router()
+    {
+    }
 
-        /// Enable message routing to begin.
-        virtual void activate() = 0;
+    /// Enable message routing to begin.
+    virtual void activate() = 0;
 
-        /// Register a handler for given OEMNumber & cmd.
-        /// Use IPMI_CMD_WILDCARD to catch any unregistered cmd
-        /// for the given OEMNumber.
-        ///
-        /// @param[in] oen - the OEM Number.
-        /// @param[in] cmd - the Command.
-        /// @param[in] handler - the handler to call given that OEN and
-        ///                      command.
-        virtual void registerHandler(Number oen, ipmi_cmd_t cmd,
-                                     Handler handler) = 0;
+    /// Register a handler for given OEMNumber & cmd.
+    /// Use IPMI_CMD_WILDCARD to catch any unregistered cmd
+    /// for the given OEMNumber.
+    ///
+    /// @param[in] oen - the OEM Number.
+    /// @param[in] cmd - the Command.
+    /// @param[in] handler - the handler to call given that OEN and
+    ///                      command.
+    virtual void registerHandler(Number oen, ipmi_cmd_t cmd,
+                                 Handler handler) = 0;
 };
 
 /// Expose mutable Router for configuration & activation.
@@ -75,9 +76,8 @@
 /// @return the OEM Group.
 constexpr Group toOemGroup(Number oen)
 {
-    return Group { static_cast<uint8_t>(oen),
-                      static_cast<uint8_t>(oen >> 8),
-                      static_cast<uint8_t>(oen >> 16) };
+    return Group{static_cast<uint8_t>(oen), static_cast<uint8_t>(oen >> 8),
+                 static_cast<uint8_t>(oen >> 16)};
 }
 
-}  // namespace oem
+} // namespace oem