aboutsummaryrefslogtreecommitdiff
path: root/src/libip/testreadipifc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libip/testreadipifc.c')
-rw-r--r--src/libip/testreadipifc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libip/testreadipifc.c b/src/libip/testreadipifc.c
new file mode 100644
index 00000000..aa57120c
--- /dev/null
+++ b/src/libip/testreadipifc.c
@@ -0,0 +1,21 @@
+#include <u.h>
+#include <libc.h>
+#include <ip.h>
+
+void
+main(void)
+{
+ Ipifc *ifc, *list;
+ Iplifc *lifc;
+ int i;
+
+ fmtinstall('I', eipfmt);
+ fmtinstall('M', eipfmt);
+
+ list = readipifc("/net", nil, -1);
+ for(ifc = list; ifc; ifc = ifc->next){
+ print("ipifc %s %d\n", ifc->dev, ifc->mtu);
+ for(lifc = ifc->lifc; lifc; lifc = lifc->next)
+ print("\t%I %M %I\n", lifc->ip, lifc->mask, lifc->net);
+ }
+}