From 82ca7dbcb322443efd59e8a504b7675dcdf905a2 Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Fri, 24 Nov 2023 17:00:23 -0500 Subject: [PATCH] Add nic number as arg to ethdump. --- bin/ethdump/ethdump.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/ethdump/ethdump.c b/bin/ethdump/ethdump.c index 7817da8..ec4767c 100644 --- a/bin/ethdump/ethdump.c +++ b/bin/ethdump/ethdump.c @@ -1,12 +1,14 @@ #include +#include + #include #include #include #include -static int nicNo = 1; +static int nicNo = 0; static char buf[4096]; static MBuf mbuf; @@ -61,6 +63,10 @@ main(int argc, const char *argv[]) printf("Ethernet Dump Tool\n"); + if (argc == 2) { + nicNo = atoi(argv[1]); + } + status = OSNICStat(nicNo, &nic); if (status == ENOENT) { printf("nic%d not present\n", nicNo);