* Added ability to be able to dump a net_interface by name.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38117 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-08-15 13:17:52 +00:00
parent 5574811008
commit 11eccb54e2

View File

@ -92,11 +92,21 @@ static int
dump_interface(int argc, char** argv)
{
if (argc != 2) {
kprintf("usage: %s [address]\n", argv[0]);
kprintf("usage: %s [name|address]\n", argv[0]);
return 0;
}
Interface* interface = (Interface*)parse_expression(argv[1]);
Interface* interface = NULL;
InterfaceList::Iterator iterator = sInterfaces.GetIterator();
while ((interface = iterator.Next()) != NULL) {
if (!strcmp(argv[1], interface->name))
break;
}
if (interface == NULL)
interface = (Interface*)parse_expression(argv[1]);
interface->Dump();
return 0;