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

Function print_dscp

tools/ipfw/ipfw2.c:1375–1397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1373}
1374
1375static void
1376print_dscp(struct buf_pr *bp, const ipfw_insn_u32 *cmd)
1377{
1378 const uint32_t *v;
1379 const char *code;
1380 int i = 0;
1381 char sep= ' ';
1382
1383 bprintf(bp, " dscp");
1384 v = cmd->d;
1385 while (i < 64) {
1386 if (*v & (1 << i)) {
1387 if ((code = match_value(f_ipdscp, i)) != NULL)
1388 bprintf(bp, "%c%s", sep, code);
1389 else
1390 bprintf(bp, "%c%d", sep, i);
1391 sep = ',';
1392 }
1393
1394 if ((++i % 32) == 0)
1395 v++;
1396 }
1397}
1398
1399#define insntod(cmd, type) ((const ipfw_insn_ ## type *)(cmd))
1400struct show_state {

Callers 1

print_instructionFunction · 0.85

Calls 2

bprintfFunction · 0.85
match_valueFunction · 0.85

Tested by

no test coverage detected