From 025152f3597699dc3e2f26f26cc11ba04668b144 Mon Sep 17 00:00:00 2001 From: Mudit Vats Date: Fri, 12 Feb 2021 14:42:43 -0700 Subject: [PATCH] feat: add hostname to activation info --- activation.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/activation.cpp b/activation.cpp index b7b3d42..3d46fe0 100644 --- a/activation.cpp +++ b/activation.cpp @@ -77,6 +77,16 @@ web::json::value get_dns() return web::json::value::string(tmp); } +web::json::value get_hostname() +{ + utility::string_t tmp; + + std::string hostName = net_get_hostname(); + tmp = utility::conversions::convertstring(hostName); + + return web::json::value::string(tmp); +} + bool getVersion(web::json::value& value) { std::string version; @@ -202,6 +212,9 @@ bool get_activation_payload(web::json::value& payload) // get DNS Info activationParams[U("fqdn")] = get_dns(); + // get hostname + activationParams[U("hostname")] = get_hostname(); + // get client string if (!get_client_string(value)) return false; activationParams[U("client")] = value; @@ -290,3 +303,4 @@ bool act_create_response(std::string payload, std::string& response) return true; } +