| 2405 | #undef BPF_TSTAMP_EXTERN |
| 2406 | |
| 2407 | static int |
| 2408 | bpf_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 | |
| 2435 | static void |
| 2436 | bpf_bintime2ts(struct bintime *bt, struct bpf_ts *ts, int tstype) |