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

Function bpf_hdrlen

freebsd/net/bpf.c:2407–2433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2405#undef BPF_TSTAMP_EXTERN
2406
2407static int
2408bpf_hdrlen(struct bpf_d *d)
2409{
2410 int hdrlen;
2411
2412 hdrlen = d->bd_bif->bif_hdrlen;
2413#ifndef BURN_BRIDGES
2414 if (d->bd_tstamp == BPF_T_NONE ||
2415 BPF_T_FORMAT(d->bd_tstamp) == BPF_T_MICROTIME)
2416#ifdef COMPAT_FREEBSD32
2417 if (d->bd_compat32)
2418 hdrlen += SIZEOF_BPF_HDR(struct bpf_hdr32);
2419 else
2420#endif
2421 hdrlen += SIZEOF_BPF_HDR(struct bpf_hdr);
2422 else
2423#endif
2424 hdrlen += SIZEOF_BPF_HDR(struct bpf_xhdr);
2425#ifdef COMPAT_FREEBSD32
2426 if (d->bd_compat32)
2427 hdrlen = BPF_WORDALIGN32(hdrlen);
2428 else
2429#endif
2430 hdrlen = BPF_WORDALIGN(hdrlen);
2431
2432 return (hdrlen - d->bd_bif->bif_hdrlen);
2433}
2434
2435static void
2436bpf_bintime2ts(struct bintime *bt, struct bpf_ts *ts, int tstype)

Callers 1

catchpacketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected