Changeset View
Changeset View
Standalone View
Standalone View
sbin/ifconfig/ifmedia.c
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | if (strcmp(status, "no carrier") == 0 && | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
putchar('\n'); | putchar('\n'); | ||||
} | } | ||||
if (args.supmedia) { | if (args.supmedia) { | ||||
printf("\tsupported media:\n"); | printf("\tsupported media:\n"); | ||||
for (size_t i = 0; i < ifmr->ifm_count; ++i) { | for (int i = 0; i < ifmr->ifm_count; ++i) { | ||||
printf("\t\t"); | printf("\t\t"); | ||||
print_media_ifconfig(ifmr->ifm_ulist[i]); | print_media_ifconfig(ifmr->ifm_ulist[i]); | ||||
putchar('\n'); | putchar('\n'); | ||||
} | } | ||||
} | } | ||||
free: | free: | ||||
free(ifmr); | free(ifmr); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 323 Lines • ▼ Show 20 Lines | static struct afswtch af_media = { | ||||
.af_name = "af_media", | .af_name = "af_media", | ||||
.af_af = AF_UNSPEC, | .af_af = AF_UNSPEC, | ||||
.af_other_status = media_status, | .af_other_status = media_status, | ||||
}; | }; | ||||
static __constructor void | static __constructor void | ||||
ifmedia_ctor(void) | ifmedia_ctor(void) | ||||
{ | { | ||||
size_t i; | for (size_t i = 0; i < nitems(media_cmds); i++) | ||||
for (i = 0; i < nitems(media_cmds); i++) | |||||
cmd_register(&media_cmds[i]); | cmd_register(&media_cmds[i]); | ||||
af_register(&af_media); | af_register(&af_media); | ||||
} | } |