Redfish Session : Support ClientOriginIPAddress

This commit implements the ClientOriginIPAddress property on
the session resource

Tested by:
  1. Create session
     POST https://${bmc}/redfish/v1/SessionService/Sessions -d '{"UserName":<>, "Password":<>}'
  2. Check the session gets updated with the ClientOriginIPAddress
     GET https://${bmc}/redfish/v1/SessionService/Sessions/<id>
  3. Redfish validator passed

Signed-off-by: Sunitha Harish <sunharis@in.ibm.com>
Change-Id: I4c5c6f651bb6faec0cb1b1b78d9da593ecb85ff0
diff --git a/http/http_connection.h b/http/http_connection.h
index ddedaea..ca3314b 100644
--- a/http/http_connection.h
+++ b/http/http_connection.h
@@ -317,6 +317,10 @@
             }
         }
 
+        // Copy the client's IP address
+        req->ipAddress =
+            boost::beast::get_lowest_layer(adaptor).remote_endpoint().address();
+
         BMCWEB_LOG_INFO << "Request: "
                         << " " << this << " HTTP/" << req->version() / 10 << "."
                         << req->version() % 10 << ' ' << req->methodString()
diff --git a/http/http_request.h b/http/http_request.h
index c160368..10aabc3 100644
--- a/http/http_request.h
+++ b/http/http_request.h
@@ -5,6 +5,7 @@
 #include "sessions.hpp"
 
 #include <boost/asio/io_context.hpp>
+#include <boost/asio/ip/address.hpp>
 #include <boost/beast/http/message.hpp>
 #include <boost/beast/http/string_body.hpp>
 #include <boost/beast/websocket.hpp>
@@ -25,6 +26,7 @@
     const std::string& body;
 
     boost::asio::io_context* ioService{};
+    boost::asio::ip::address ipAddress;
 
     std::shared_ptr<persistent_data::UserSession> session;