Add cross-platform getInterfaces() and test.

This commit is contained in:
cheatfate 2019-03-18 10:42:30 +02:00
parent 9ddc47fa56
commit 518d33e26c
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
2 changed files with 1270 additions and 0 deletions

1261
iface.nim Normal file

File diff suppressed because it is too large Load Diff

9
tests/testiface.nim Normal file
View File

@ -0,0 +1,9 @@
import unittest
import ../libp2p/ipnet/iface
suite "OS interfaces list suite":
test "Get interfaces list test":
var ifaces = getInterfaces()
for item in ifaces:
echo item
check len(ifaces) > 0