add .clang-format

Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/app/channel.cpp b/app/channel.cpp
index 3c011fd..2fee5cc 100644
--- a/app/channel.cpp
+++ b/app/channel.cpp
@@ -1,17 +1,17 @@
 #include "channel.hpp"
-#include "types.hpp"
-#include "transporthandler.hpp"
-#include "utils.hpp"
-#include "net.hpp"
 
-#include <fstream>
-#include <string>
+#include "net.hpp"
+#include "transporthandler.hpp"
+#include "types.hpp"
+#include "utils.hpp"
+
 #include <arpa/inet.h>
 
-#include <phosphor-logging/log.hpp>
+#include <fstream>
 #include <phosphor-logging/elog-errors.hpp>
-#include "xyz/openbmc_project/Common/error.hpp"
-
+#include <phosphor-logging/log.hpp>
+#include <string>
+#include <xyz/openbmc_project/Common/error.hpp>
 
 using namespace phosphor::logging;
 using namespace sdbusplus::xyz::openbmc_project::Common::Error;
@@ -22,8 +22,8 @@
  */
 struct GetChannelAccessRequest
 {
-    uint8_t channelNumber;      //!< Channel number.
-    uint8_t volatileSetting;    //!< Get non-volatile or the volatile setting.
+    uint8_t channelNumber;   //!< Channel number.
+    uint8_t volatileSetting; //!< Get non-volatile or the volatile setting.
 } __attribute__((packed));
 
 /** @struct GetChannelAccessResponse
@@ -32,20 +32,21 @@
  */
 struct GetChannelAccessResponse
 {
-    uint8_t settings;          //!< Channel settings.
-    uint8_t privilegeLimit;    //!< Channel privilege level limit.
+    uint8_t settings;       //!< Channel settings.
+    uint8_t privilegeLimit; //!< Channel privilege level limit.
 } __attribute__((packed));
 
-
 ipmi_ret_t ipmi_get_channel_access(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
-                            ipmi_request_t request, ipmi_response_t response,
-                            ipmi_data_len_t data_len, ipmi_context_t context)
+                                   ipmi_request_t request,
+                                   ipmi_response_t response,
+                                   ipmi_data_len_t data_len,
+                                   ipmi_context_t context)
 {
-    auto requestData = reinterpret_cast<const GetChannelAccessRequest*>
-                   (request);
+    auto requestData =
+        reinterpret_cast<const GetChannelAccessRequest*>(request);
     std::vector<uint8_t> outPayload(sizeof(GetChannelAccessResponse));
-    auto responseData = reinterpret_cast<GetChannelAccessResponse*>
-            (outPayload.data());
+    auto responseData =
+        reinterpret_cast<GetChannelAccessResponse*>(outPayload.data());
 
     /*
      * The value Eh is used as a way to identify the current channel that
@@ -71,7 +72,7 @@
     constexpr auto channelSetting = 0x32;
 
     responseData->settings = channelSetting;
-    //Defaulting the channel privilege to administrator level.
+    // Defaulting the channel privilege to administrator level.
     responseData->privilegeLimit = PRIVILEGE_ADMIN;
 
     *data_len = outPayload.size();
@@ -91,26 +92,35 @@
 #define IPMI_CHANNEL_MEDIUM_TYPE_OTHER 6
 
 ipmi_ret_t ipmi_app_channel_info(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
-                             ipmi_request_t request, ipmi_response_t response,
-                             ipmi_data_len_t data_len, ipmi_context_t context)
+                                 ipmi_request_t request,
+                                 ipmi_response_t response,
+                                 ipmi_data_len_t data_len,
+                                 ipmi_context_t context)
 {
     ipmi_ret_t rc = IPMI_CC_OK;
-    uint8_t resp[] = {
-        1,
-        IPMI_CHANNEL_MEDIUM_TYPE_OTHER,
-        IPMI_CHANNEL_TYPE_IPMB,
-        1,0x41,0xA7,0x00,0,0};
-    uint8_t *p = (uint8_t*) request;
+    uint8_t resp[] = {1,
+                      IPMI_CHANNEL_MEDIUM_TYPE_OTHER,
+                      IPMI_CHANNEL_TYPE_IPMB,
+                      1,
+                      0x41,
+                      0xA7,
+                      0x00,
+                      0,
+                      0};
+    uint8_t* p = (uint8_t*)request;
     int channel = (*p) & CHANNEL_MASK;
     std::string ethdevice = ipmi::network::ChanneltoEthernet(channel);
 
     // The supported channels numbers are those which are configured.
     // Channel Number E is used as way to identify the current channel
     // that the command is being is received from.
-    if (channel != 0xe && ethdevice.empty()) {
+    if (channel != 0xe && ethdevice.empty())
+    {
         rc = IPMI_CC_PARM_OUT_OF_RANGE;
         *data_len = 0;
-    } else {
+    }
+    else
+    {
         *data_len = sizeof(resp);
         memcpy(response, resp, *data_len);
     }
@@ -161,7 +171,6 @@
             records.push_back(record.value(oem, 0));
             records.push_back(record.value(oem, 0) >> 8);
             records.push_back(record.value(oem, 0) >> 16);
-
         }
         else
         {
@@ -182,10 +191,9 @@
     return records;
 }
 
-} //namespace cipher
+} // namespace cipher
 
-ipmi_ret_t getChannelCipherSuites(ipmi_netfn_t netfn,
-                                  ipmi_cmd_t cmd,
+ipmi_ret_t getChannelCipherSuites(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
                                   ipmi_request_t request,
                                   ipmi_response_t response,
                                   ipmi_data_len_t data_len,
@@ -197,7 +205,6 @@
     auto requestData =
         reinterpret_cast<const GetChannelCipherRequest*>(request);
 
-
     if (*data_len < sizeof(GetChannelCipherRequest))
     {
         *data_len = 0;
@@ -208,7 +215,7 @@
 
     // Support only for list algorithms by cipher suite
     if (cipher::listCipherSuite !=
-            (requestData->listIndex & cipher::listTypeMask))
+        (requestData->listIndex & cipher::listTypeMask))
     {
         return IPMI_CC_INVALID_FIELD_REQUEST;
     }
@@ -220,7 +227,7 @@
             records = cipher::getCipherRecords();
             recordInit = true;
         }
-        catch (const std::exception &e)
+        catch (const std::exception& e)
         {
             return IPMI_CC_UNSPECIFIED_ERROR;
         }
@@ -228,17 +235,16 @@
 
     // List index(00h-3Fh), 0h selects the first set of 16, 1h selects the next
     // set of 16 and so on.
-    auto index = static_cast<size_t>(
-            requestData->listIndex & cipher::listIndexMask);
+    auto index =
+        static_cast<size_t>(requestData->listIndex & cipher::listIndexMask);
 
     // Calculate the number of record data bytes to be returned.
     auto start = std::min(index * cipher::respSize, records.size());
-    auto end = std::min((index * cipher::respSize) + cipher::respSize,
-                        records.size());
+    auto end =
+        std::min((index * cipher::respSize) + cipher::respSize, records.size());
     auto size = end - start;
 
-    auto responseData = reinterpret_cast<GetChannelCipherRespHeader*>
-            (response);
+    auto responseData = reinterpret_cast<GetChannelCipherRespHeader*>(response);
     responseData->channelNumber = cipher::defaultChannelNumber;
 
     if (!size)
@@ -247,8 +253,7 @@
     }
     else
     {
-        std::copy_n(records.data() + start,
-                    size,
+        std::copy_n(records.data() + start, size,
                     static_cast<uint8_t*>(response) + 1);
         *data_len = size + sizeof(GetChannelCipherRespHeader);
     }