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

Function print_ipsecstats

tools/netstat/ipsec.c:159–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157static void print_ipsecstats(const struct ipsecstat *ipsecstat);
158
159static void
160print_ipsecstats(const struct ipsecstat *ipsecstat)
161{
162 xo_open_container("ipsec-statistics");
163
164#define p(f, m) if (ipsecstat->f || sflag <= 1) \
165 xo_emit(m, (uintmax_t)ipsecstat->f, plural(ipsecstat->f))
166#define p2(f, m) if (ipsecstat->f || sflag <= 1) \
167 xo_emit(m, (uintmax_t)ipsecstat->f, plurales(ipsecstat->f))
168
169 p(ips_in_polvio, "\t{:dropped-policy-violation/%ju} "
170 "{N:/inbound packet%s violated process security policy}\n");
171 p(ips_in_nomem, "\t{:dropped-no-memory/%ju} "
172 "{N:/inbound packet%s failed due to insufficient memory}\n");
173 p(ips_in_inval, "\t{:dropped-invalid/%ju} "
174 "{N:/invalid inbound packet%s}\n");
175 p(ips_out_polvio, "\t{:discarded-policy-violation/%ju} "
176 "{N:/outbound packet%s violated process security policy}\n");
177 p(ips_out_nosa, "\t{:discarded-no-sa/%ju} "
178 "{N:/outbound packet%s with no SA available}\n");
179 p(ips_out_nomem, "\t{:discarded-no-memory/%ju} "
180 "{N:/outbound packet%s failed due to insufficient memory}\n");
181 p(ips_out_noroute, "\t{:discarded-no-route/%ju} "
182 "{N:/outbound packet%s with no route available}\n");
183 p(ips_out_inval, "\t{:discarded-invalid/%ju} "
184 "{N:/invalid outbound packet%s}\n");
185 p(ips_out_bundlesa, "\t{:send-bundled-sa/%ju} "
186 "{N:/outbound packet%s with bundled SAs}\n");
187 p(ips_spdcache_hits, "\t{:spdcache-hits/%ju} "
188 "{N:/spd cache hit%s}\n");
189 p2(ips_spdcache_misses, "\t{:spdcache-misses/%ju} "
190 "{N:/spd cache miss%s}\n");
191 p(ips_clcopied, "\t{:clusters-copied-during-clone/%ju} "
192 "{N:/cluster%s copied during clone}\n");
193 p(ips_mbinserted, "\t{:mbufs-inserted/%ju} "
194 "{N:/mbuf%s inserted during makespace}\n");
195#undef p2
196#undef p
197 xo_close_container("ipsec-statistics");
198}
199
200void
201ipsec_stats(u_long off, const char *name, int af1 __unused, int proto __unused)

Callers 1

ipsec_statsFunction · 0.85

Calls 2

xo_open_containerFunction · 0.85
xo_close_containerFunction · 0.85

Tested by

no test coverage detected