MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bridge_status

Function bridge_status

tools/ifconfig/ifbridge.c:239–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239static void
240bridge_status(int s)
241{
242 struct ifbropreq ifbp;
243 struct ifbrparam param;
244 u_int16_t pri;
245 u_int8_t ht, fd, ma, hc, pro;
246 u_int8_t lladdr[ETHER_ADDR_LEN];
247 u_int16_t bprio;
248 u_int32_t csize, ctime;
249
250 if (do_cmd(s, BRDGGCACHE, &param, sizeof(param), 0) < 0)
251 return;
252 csize = param.ifbrp_csize;
253 if (do_cmd(s, BRDGGTO, &param, sizeof(param), 0) < 0)
254 return;
255 ctime = param.ifbrp_ctime;
256 if (do_cmd(s, BRDGPARAM, &ifbp, sizeof(ifbp), 0) < 0)
257 return;
258 pri = ifbp.ifbop_priority;
259 pro = ifbp.ifbop_protocol;
260 ht = ifbp.ifbop_hellotime;
261 fd = ifbp.ifbop_fwddelay;
262 hc = ifbp.ifbop_holdcount;
263 ma = ifbp.ifbop_maxage;
264
265 PV2ID(ifbp.ifbop_bridgeid, bprio, lladdr);
266 printf("\tid %s priority %u hellotime %u fwddelay %u\n",
267 ether_ntoa((struct ether_addr *)lladdr), pri, ht, fd);
268 printf("\tmaxage %u holdcnt %u proto %s maxaddr %u timeout %u\n",
269 ma, hc, stpproto[pro], csize, ctime);
270
271 PV2ID(ifbp.ifbop_designated_root, bprio, lladdr);
272 printf("\troot id %s priority %d ifcost %u port %u\n",
273 ether_ntoa((struct ether_addr *)lladdr), bprio,
274 ifbp.ifbop_root_path_cost, ifbp.ifbop_root_port & 0xfff);
275
276 bridge_interfaces(s, "\tmember: ");
277
278 return;
279
280}
281
282static void
283setbridge_add(const char *val, int d, int s, const struct afswtch *afp)

Callers

nothing calls this directly

Calls 3

bridge_interfacesFunction · 0.85
do_cmdFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected