From 0fbb068e75df2822faadbc5d76a7c079e48e0998 Mon Sep 17 00:00:00 2001 From: thompsa Date: Mon, 27 Nov 2006 20:52:57 +0000 Subject: [PATCH] Show the MAC address cache size and timeout. --- sbin/ifconfig/ifbridge.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index 2f24f5ac120f..a4cf86162751 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -248,31 +248,39 @@ bridge_addresses(int s, const char *prefix) static void bridge_status(int s) { - struct ifbropreq param; + struct ifbropreq ifbp; + struct ifbrparam param; u_int16_t pri; u_int8_t ht, fd, ma, hc, pro; u_int8_t lladdr[ETHER_ADDR_LEN]; u_int16_t bprio; + u_int32_t csize, ctime; - if (do_cmd(s, BRDGPARAM, ¶m, sizeof(param), 0) < 0) + if (do_cmd(s, BRDGGCACHE, ¶m, sizeof(param), 0) < 0) return; - pri = param.ifbop_priority; - pro = param.ifbop_protocol; - ht = param.ifbop_hellotime; - fd = param.ifbop_fwddelay; - hc = param.ifbop_holdcount; - ma = param.ifbop_maxage; + csize = param.ifbrp_csize; + if (do_cmd(s, BRDGGTO, ¶m, sizeof(param), 0) < 0) + return; + ctime = param.ifbrp_ctime; + if (do_cmd(s, BRDGPARAM, &ifbp, sizeof(ifbp), 0) < 0) + return; + pri = ifbp.ifbop_priority; + pro = ifbp.ifbop_protocol; + ht = ifbp.ifbop_hellotime; + fd = ifbp.ifbop_fwddelay; + hc = ifbp.ifbop_holdcount; + ma = ifbp.ifbop_maxage; - PV2ID(param.ifbop_bridgeid, bprio, lladdr); + PV2ID(ifbp.ifbop_bridgeid, bprio, lladdr); printf("\tid %s priority %u hellotime %u fwddelay %u\n", ether_ntoa((struct ether_addr *)lladdr), pri, ht, fd); - printf("\tmaxage %u holdcnt %u proto %s\n", - ma, hc, stpproto[pro]); + printf("\tmaxage %u holdcnt %u proto %s maxaddr %u timeout %u\n", + ma, hc, stpproto[pro], csize, ctime); - PV2ID(param.ifbop_designated_root, bprio, lladdr); + PV2ID(ifbp.ifbop_designated_root, bprio, lladdr); printf("\troot id %s priority %d ifcost %u port %u\n", ether_ntoa((struct ether_addr *)lladdr), bprio, - param.ifbop_root_path_cost, param.ifbop_root_port & 0xfff); + ifbp.ifbop_root_path_cost, ifbp.ifbop_root_port & 0xfff); bridge_interfaces(s, "\tmember: ");