Changeset View
Changeset View
Standalone View
Standalone View
sbin/ifconfig/ifbridge.c
Show First 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | bridge_addresses(int s, const char *prefix) | ||||
} | } | ||||
free(inbuf); | free(inbuf); | ||||
} | } | ||||
static void | static void | ||||
bridge_status(int s) | bridge_status(int s) | ||||
{ | { | ||||
ifconfig_handle_t *lifh; | |||||
struct ifconfig_bridge_status *bridge; | struct ifconfig_bridge_status *bridge; | ||||
struct ifbropreq *params; | struct ifbropreq *params; | ||||
const char *pad, *prefix; | const char *pad, *prefix; | ||||
uint8_t lladdr[ETHER_ADDR_LEN]; | uint8_t lladdr[ETHER_ADDR_LEN]; | ||||
uint16_t bprio; | uint16_t bprio; | ||||
lifh = ifconfig_open(); | if (ifconfig_bridge_get_bridge_status(lifh, name, &bridge) == -1) | ||||
if (lifh == NULL) | |||||
return; | return; | ||||
if (ifconfig_bridge_get_bridge_status(lifh, name, &bridge) == -1) | |||||
goto close; | |||||
params = bridge->params; | params = bridge->params; | ||||
PV2ID(params->ifbop_bridgeid, bprio, lladdr); | PV2ID(params->ifbop_bridgeid, bprio, lladdr); | ||||
printf("\tid %s priority %u hellotime %u fwddelay %u\n", | printf("\tid %s priority %u hellotime %u fwddelay %u\n", | ||||
ether_ntoa((struct ether_addr *)lladdr), | ether_ntoa((struct ether_addr *)lladdr), | ||||
params->ifbop_priority, | params->ifbop_priority, | ||||
params->ifbop_hellotime, | params->ifbop_hellotime, | ||||
params->ifbop_fwddelay); | params->ifbop_fwddelay); | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | if (member->ifbr_ifsflags & IFBIF_STP) { | ||||
printf(" state %s", stpstates[state]); | printf(" state %s", stpstates[state]); | ||||
else | else | ||||
printf(" <unknown state %d>", state); | printf(" <unknown state %d>", state); | ||||
} | } | ||||
printf("\n"); | printf("\n"); | ||||
} | } | ||||
ifconfig_bridge_free_bridge_status(bridge); | ifconfig_bridge_free_bridge_status(bridge); | ||||
close: | |||||
ifconfig_close(lifh); | |||||
} | } | ||||
static void | static void | ||||
setbridge_add(const char *val, int d, int s, const struct afswtch *afp) | setbridge_add(const char *val, int d, int s, const struct afswtch *afp) | ||||
{ | { | ||||
struct ifbreq req; | struct ifbreq req; | ||||
memset(&req, 0, sizeof(req)); | memset(&req, 0, sizeof(req)); | ||||
▲ Show 20 Lines • Show All 459 Lines • Show Last 20 Lines |