2015-12-22 12:55:44 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the UCB release of Plan 9. It is subject to the license
|
|
|
|
* terms in the LICENSE file found in the top-level directory of this
|
|
|
|
* distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
|
|
|
|
* part of the UCB release of Plan 9, including this file, may be copied,
|
|
|
|
* modified, propagated, or distributed except according to the terms contained
|
|
|
|
* in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <u.h>
|
|
|
|
#include <libc.h>
|
2016-11-25 17:18:40 +01:00
|
|
|
#include <ip.h>
|
2015-12-22 12:55:44 +01:00
|
|
|
|
2016-11-25 17:18:40 +01:00
|
|
|
void
|
|
|
|
main(void)
|
2015-12-22 12:55:44 +01:00
|
|
|
{
|
2016-11-25 17:18:40 +01:00
|
|
|
Ipifc *ifc, *list;
|
|
|
|
Iplifc *lifc;
|
2015-12-22 12:55:44 +01:00
|
|
|
int i;
|
|
|
|
|
2016-11-25 17:18:40 +01:00
|
|
|
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);
|
2015-12-22 12:55:44 +01:00
|
|
|
}
|
|
|
|
}
|