CS350 COS
COS
Loading...
Searching...
No Matches
ifconfig.c File Reference
#include <stdio.h>
#include <errno.h>
#include <syscall.h>
Include dependency graph for ifconfig.c:

Go to the source code of this file.

Functions

int main (int argc, const char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
const char *  argv[] 
)

Definition at line 7 of file ifconfig.c.

8{
9 int i;
10 uint64_t status;
11 NIC nic;
12
13 printf("Network Status\n");
14
15 for (i = 0; i < 32; i++) {
16 status = OSNICStat(i, &nic);
17 if (status == ENOENT)
18 continue;
19
20 printf("nic%d:\n", (int)nic.nicNo);
21 printf(" ether %02x:%02x:%02x:%02x:%02x:%02x\n",
22 nic.mac[0], nic.mac[1], nic.mac[2],
23 nic.mac[3], nic.mac[4], nic.mac[5]);
24 }
25
26 return 0;
27}
#define ENOENT
Definition: errno.h:15
int OSNICStat(uint64_t nicNo, NIC *nic)
Definition: syscall.c:137
int printf(const char *fmt,...)
Definition: printf.c:212
Definition: nic.h:11
uint64_t nicNo
Definition: nic.h:13
uint8_t mac[6]
Definition: nic.h:14
unsigned long uint64_t
Definition: types.h:13
Here is the call graph for this function: