diff --git a/network_interface.nim b/network_interface.nim index 3000b3e..8fd38b1 100644 --- a/network_interface.nim +++ b/network_interface.nim @@ -4,6 +4,7 @@ from posix import SockAddr, Sockaddr_in, inet_ntoa, AF_INET type NetworkInterface* = object ipAddress*: string + netMask*: string name*: string index*: cint flags*: cuint @@ -34,6 +35,7 @@ proc fromIpAddress*(address: string): NetworkInterface = it.ifa_addr.sa_family.cint == AF_INET and it.ifa_addr.getAddrString() == address: result.ipAddress = address + result.netMask = it.ifa_netmask.getAddrString() result.name = $it.ifa_name result.index = if_nametoindex(result.name).cint result.flags = it.ifa_flags