diff options
| author | rsc <devnull@localhost> | 2003-11-23 18:23:20 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2003-11-23 18:23:20 +0000 |
| commit | d7094239263eac816ebb3af32641079b7924c666 (patch) | |
| tree | 61b016942d567560042adf110f5fb558dc328a98 /src/libip/testreadipifc.c | |
| parent | 99947423b136903263513b9022aab6586c8c6cc5 (diff) | |
| download | plan9port-d7094239263eac816ebb3af32641079b7924c666.tar.gz plan9port-d7094239263eac816ebb3af32641079b7924c666.zip | |
add libip
Diffstat (limited to 'src/libip/testreadipifc.c')
| -rw-r--r-- | src/libip/testreadipifc.c | 21 |
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); + } +} |
