Changeset View
Changeset View
Standalone View
Standalone View
sbin/ifconfig/ifconfig.c
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
#include <ifaddrs.h> | #include <ifaddrs.h> | ||||
#include <ctype.h> | #include <ctype.h> | ||||
#include <err.h> | #include <err.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#ifdef JAIL | #ifdef JAIL | ||||
#include <jail.h> | #include <jail.h> | ||||
#endif | #endif | ||||
#include <locale.h> | |||||
#include <stdbool.h> | #include <stdbool.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include <libifconfig.h> | #include <libifconfig.h> | ||||
▲ Show 20 Lines • Show All 337 Lines • ▼ Show 20 Lines | main(int argc, char *argv[]) | ||||
const char *ifname, *matchgroup, *nogroup; | const char *ifname, *matchgroup, *nogroup; | ||||
struct option *p; | struct option *p; | ||||
size_t iflen; | size_t iflen; | ||||
int flags; | int flags; | ||||
all = downonly = uponly = namesonly = noload = verbose = 0; | all = downonly = uponly = namesonly = noload = verbose = 0; | ||||
f_inet = f_inet6 = f_ether = f_addr = NULL; | f_inet = f_inet6 = f_ether = f_addr = NULL; | ||||
matchgroup = nogroup = NULL; | matchgroup = nogroup = NULL; | ||||
setlocale(LC_CTYPE, ""); | |||||
lifh = ifconfig_open(); | lifh = ifconfig_open(); | ||||
if (lifh == NULL) | if (lifh == NULL) | ||||
err(EXIT_FAILURE, "ifconfig_open"); | err(EXIT_FAILURE, "ifconfig_open"); | ||||
envformat = getenv("IFCONFIG_FORMAT"); | envformat = getenv("IFCONFIG_FORMAT"); | ||||
if (envformat != NULL) | if (envformat != NULL) | ||||
setformat(envformat); | setformat(envformat); | ||||
▲ Show 20 Lines • Show All 1,401 Lines • Show Last 20 Lines |