aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/channel/channelz.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/channel/channelz.cc')
-rw-r--r--src/core/lib/channel/channelz.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core/lib/channel/channelz.cc b/src/core/lib/channel/channelz.cc
index 33577d890a..032654b861 100644
--- a/src/core/lib/channel/channelz.cc
+++ b/src/core/lib/channel/channelz.cc
@@ -374,7 +374,8 @@ grpc_json* SocketNode::RenderJson() {
return top_level_json;
}
-ListenSocketNode::ListenSocketNode() : BaseNode(EntityType::kSocket) {}
+ListenSocketNode::ListenSocketNode(UniquePtr<char> host, int port)
+ : BaseNode(EntityType::kSocket), host_(std::move(host)), port_(port) {}
grpc_json* ListenSocketNode::RenderJson() {
// We need to track these three json objects to build our object
@@ -388,6 +389,21 @@ grpc_json* ListenSocketNode::RenderJson() {
json_iterator = nullptr;
json_iterator = grpc_json_add_number_string_child(json, json_iterator,
"socketId", uuid());
+ json = top_level_json;
+ json_iterator = nullptr;
+ json_iterator = grpc_json_create_child(json_iterator, json, "local", nullptr,
+ GRPC_JSON_OBJECT, false);
+ json = json_iterator;
+ json_iterator = nullptr;
+ json_iterator = grpc_json_create_child(json_iterator, json, "tcpip_address",
+ nullptr, GRPC_JSON_OBJECT, false);
+ json = json_iterator;
+ json_iterator = nullptr;
+ json_iterator =
+ grpc_json_add_number_string_child(json, json_iterator, "port", port_);
+ json_iterator = grpc_json_create_child(json_iterator, json, "ip_address",
+ host_.get(), GRPC_JSON_STRING, false);
+
return top_level_json;
}