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

Function ng_iface_bpftap

freebsd/netgraph/ng_iface.c:418–426  ·  view source on GitHub ↗

* Flash a packet by the BPF (requires prepending 4 byte AF header) * Note the phoney mbuf; this is OK because BPF treats it read-only. */

Source from the content-addressed store, hash-verified

416 * Note the phoney mbuf; this is OK because BPF treats it read-only.
417 */
418static void
419ng_iface_bpftap(struct ifnet *ifp, struct mbuf *m, sa_family_t family)
420{
421 KASSERT(family != AF_UNSPEC, ("%s: family=AF_UNSPEC", __func__));
422 if (bpf_peers_present(ifp->if_bpf)) {
423 int32_t family4 = (int32_t)family;
424 bpf_mtap2(ifp->if_bpf, &family4, sizeof(family4), m);
425 }
426}
427
428/*
429 * This routine does actual delivery of the packet into the

Callers 2

ng_iface_outputFunction · 0.85
ng_iface_rcvdataFunction · 0.85

Calls 2

bpf_mtap2Function · 0.85
bpf_peers_presentFunction · 0.50

Tested by

no test coverage detected