Changeset View
Changeset View
Standalone View
Standalone View
sbin/ifconfig/ifbridge.c
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
#include <string.h> | #include <string.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include <err.h> | #include <err.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include "ifconfig.h" | #include "ifconfig.h" | ||||
#define PV2ID(pv, epri, eaddr) do { \ | static const char *stpstates[] = { STP_STATES }; | ||||
epri = pv >> 48; \ | static const char *stpproto[] = { STP_PROTOS }; | ||||
eaddr[0] = pv >> 40; \ | static const char *stproles[] = { STP_ROLES }; | ||||
eaddr[1] = pv >> 32; \ | |||||
eaddr[2] = pv >> 24; \ | |||||
eaddr[3] = pv >> 16; \ | |||||
eaddr[4] = pv >> 8; \ | |||||
eaddr[5] = pv >> 0; \ | |||||
} while (0) | |||||
static const char *stpstates[] = { | |||||
"disabled", | |||||
"listening", | |||||
"learning", | |||||
"forwarding", | |||||
"blocking", | |||||
"discarding" | |||||
}; | |||||
static const char *stpproto[] = { | |||||
"stp", | |||||
"-", | |||||
"rstp" | |||||
}; | |||||
static const char *stproles[] = { | |||||
"disabled", | |||||
"root", | |||||
"designated", | |||||
"alternate", | |||||
"backup" | |||||
}; | |||||
static int | static int | ||||
get_val(const char *cp, u_long *valp) | get_val(const char *cp, u_long *valp) | ||||
{ | { | ||||
char *endptr; | char *endptr; | ||||
u_long val; | u_long val; | ||||
errno = 0; | errno = 0; | ||||
▲ Show 20 Lines • Show All 653 Lines • Show Last 20 Lines |