summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/GlobalProcessExposed.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/Kernel/GlobalProcessExposed.cpp b/Kernel/GlobalProcessExposed.cpp
index 8ab58cbcf9..a98fed1db0 100644
--- a/Kernel/GlobalProcessExposed.cpp
+++ b/Kernel/GlobalProcessExposed.cpp
@@ -47,11 +47,15 @@ private:
obj.add("class_name", adapter.class_name());
obj.add("mac_address", adapter.mac_address().to_string());
if (!adapter.ipv4_address().is_zero()) {
- obj.add("ipv4_address", adapter.ipv4_address().to_string());
- obj.add("ipv4_netmask", adapter.ipv4_netmask().to_string());
+ auto ipv4_address = adapter.ipv4_address().to_string().release_value_but_fixme_should_propagate_errors();
+ obj.add("ipv4_address", ipv4_address->view());
+ auto ipv4_netmask = adapter.ipv4_netmask().to_string().release_value_but_fixme_should_propagate_errors();
+ obj.add("ipv4_netmask", ipv4_netmask->view());
+ }
+ if (!adapter.ipv4_gateway().is_zero()) {
+ auto ipv4_gateway = adapter.ipv4_gateway().to_string().release_value_but_fixme_should_propagate_errors();
+ obj.add("ipv4_gateway", ipv4_gateway->view());
}
- if (!adapter.ipv4_gateway().is_zero())
- obj.add("ipv4_gateway", adapter.ipv4_gateway().to_string());
obj.add("packets_in", adapter.packets_in());
obj.add("bytes_in", adapter.bytes_in());
obj.add("packets_out", adapter.packets_out());
@@ -78,7 +82,8 @@ private:
arp_table().for_each([&](const auto& it) {
auto obj = array.add_object();
obj.add("mac_address", it.value.to_string());
- obj.add("ip_address", it.key.to_string());
+ auto ip_address = it.key.to_string().release_value_but_fixme_should_propagate_errors();
+ obj.add("ip_address", ip_address->view());
});
array.finish();
return {};
@@ -96,9 +101,11 @@ private:
JsonArraySerializer array { builder };
TCPSocket::for_each([&array](auto& socket) {
auto obj = array.add_object();
- obj.add("local_address", socket.local_address().to_string());
+ auto local_address = socket.local_address().to_string().release_value_but_fixme_should_propagate_errors();
+ obj.add("local_address", local_address->view());
obj.add("local_port", socket.local_port());
- obj.add("peer_address", socket.peer_address().to_string());
+ auto peer_address = socket.peer_address().to_string().release_value_but_fixme_should_propagate_errors();
+ obj.add("peer_address", peer_address->view());
obj.add("peer_port", socket.peer_port());
obj.add("state", TCPSocket::to_string(socket.state()));
obj.add("ack_number", socket.ack_number());
@@ -153,9 +160,11 @@ private:
JsonArraySerializer array { builder };
UDPSocket::for_each([&array](auto& socket) {
auto obj = array.add_object();
- obj.add("local_address", socket.local_address().to_string());
+ auto local_address = socket.local_address().to_string().release_value_but_fixme_should_propagate_errors();
+ obj.add("local_address", local_address->view());
obj.add("local_port", socket.local_port());
- obj.add("peer_address", socket.peer_address().to_string());
+ auto peer_address = socket.peer_address().to_string().release_value_but_fixme_should_propagate_errors();
+ obj.add("peer_address", peer_address->view());
obj.add("peer_port", socket.peer_port());
if (Process::current().is_superuser() || Process::current().uid() == socket.origin_uid()) {
obj.add("origin_pid", socket.origin_pid().value());