mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:17:34 +00:00
Applets/Network: Remove include_loopback
parameter
This is always false, so we can do without it and simplify things a little.
This commit is contained in:
parent
c8bfb07b41
commit
eacf017112
1 changed files with 5 additions and 5 deletions
|
@ -105,7 +105,7 @@ private:
|
||||||
m_connected = connected;
|
m_connected = connected;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual String get_adapter_info(bool include_loopback = false)
|
virtual String get_adapter_info()
|
||||||
{
|
{
|
||||||
StringBuilder adapter_info;
|
StringBuilder adapter_info;
|
||||||
|
|
||||||
|
@ -127,16 +127,16 @@ private:
|
||||||
return adapter_info.to_string();
|
return adapter_info.to_string();
|
||||||
|
|
||||||
int connected_adapters = 0;
|
int connected_adapters = 0;
|
||||||
json.value().as_array().for_each([&adapter_info, include_loopback, &connected_adapters](auto& value) {
|
json.value().as_array().for_each([&adapter_info, &connected_adapters](auto& value) {
|
||||||
auto& if_object = value.as_object();
|
auto& if_object = value.as_object();
|
||||||
auto ip_address = if_object.get("ipv4_address"sv).as_string_or("no IP");
|
auto ip_address = if_object.get("ipv4_address"sv).as_string_or("no IP");
|
||||||
auto ifname = if_object.get("name"sv).to_string();
|
auto ifname = if_object.get("name"sv).to_string();
|
||||||
auto link_up = if_object.get("link_up"sv).as_bool();
|
auto link_up = if_object.get("link_up"sv).as_bool();
|
||||||
auto link_speed = if_object.get("link_speed"sv).to_i32();
|
auto link_speed = if_object.get("link_speed"sv).to_i32();
|
||||||
|
|
||||||
if (!include_loopback)
|
if (ifname == "loop")
|
||||||
if (ifname == "loop")
|
return;
|
||||||
return;
|
|
||||||
if (ip_address != "null")
|
if (ip_address != "null")
|
||||||
connected_adapters++;
|
connected_adapters++;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue