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

Function bpf_get_bp_params

freebsd/net/bpf.c:2722–2737  ·  view source on GitHub ↗

* When moving interfaces between vnet instances we need a way to * query the dlt and hdrlen before detach so we can re-attch the if_bpf * after the vmove. We unfortunately have no device driver infrastructure * to query the interface for these values after creation/attach, thus * add this as a workaround. */

Source from the content-addressed store, hash-verified

2720 * add this as a workaround.
2721 */
2722int
2723bpf_get_bp_params(struct bpf_if *bp, u_int *bif_dlt, u_int *bif_hdrlen)
2724{
2725
2726 if (bp == NULL)
2727 return (ENXIO);
2728 if (bif_dlt == NULL && bif_hdrlen == NULL)
2729 return (0);
2730
2731 if (bif_dlt != NULL)
2732 *bif_dlt = bp->bif_dlt;
2733 if (bif_hdrlen != NULL)
2734 *bif_hdrlen = bp->bif_hdrlen;
2735
2736 return (0);
2737}
2738#endif
2739
2740/*

Callers 1

if_vmoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected