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

Function bpf_flags

tools/netstat/bpf.c:79–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79static void
80bpf_flags(struct xbpf_d *bd, char *flagbuf)
81{
82
83 *flagbuf++ = bd->bd_promisc ? 'p' : '-';
84 *flagbuf++ = bd->bd_immediate ? 'i' : '-';
85 *flagbuf++ = bd->bd_hdrcmplt ? '-' : 'f';
86 *flagbuf++ = (bd->bd_direction == BPF_D_IN) ? '-' :
87 ((bd->bd_direction == BPF_D_OUT) ? 'o' : 's');
88 *flagbuf++ = bd->bd_feedback ? 'b' : '-';
89 *flagbuf++ = bd->bd_async ? 'a' : '-';
90 *flagbuf++ = bd->bd_locked ? 'l' : '-';
91 *flagbuf++ = '\0';
92
93 if (bd->bd_promisc)
94 xo_emit("{e:promiscuous/}");
95 if (bd->bd_immediate)
96 xo_emit("{e:immediate/}");
97 if (bd->bd_hdrcmplt)
98 xo_emit("{e:header-complete/}");
99 xo_emit("{e:direction}", (bd->bd_direction == BPF_D_IN) ? "input" :
100 (bd->bd_direction == BPF_D_OUT) ? "output" : "bidirectional");
101 if (bd->bd_feedback)
102 xo_emit("{e:feedback/}");
103 if (bd->bd_async)
104 xo_emit("{e:async/}");
105 if (bd->bd_locked)
106 xo_emit("{e:locked/}");
107}
108
109void
110bpf_stats(char *ifname)

Callers 1

bpf_statsFunction · 0.85

Calls 1

xo_emitFunction · 0.85

Tested by

no test coverage detected