* 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:
@@ -92,11 +92,21 @@ static int
|
|||||||
dump_interface(int argc, char** argv)
|
dump_interface(int argc, char** argv)
|
||||||
{
|
{
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
kprintf("usage: %s [address]\n", argv[0]);
|
kprintf("usage: %s [name|address]\n", argv[0]);
|
||||||
return 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();
|
interface->Dump();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user