Commit 83d8c39
committed
Auto merge of #2080 - jbit:freebsd-bpf, r=JohnTitor
Add FreeBSD BPF structures
This PR adds BPF structures that are common between [FreeBSD 11](https://github.com/freebsd/freebsd-src/blob/release/11.0.0/sys/net/bpf.h), [FreeBSD 12](https://github.com/freebsd/freebsd-src/blob/release/12.0.0/sys/net/bpf.h), [FreeBSD mainline/13](https://github.com/freebsd/freebsd-src/blob/main/sys/net/bpf.h) and [DragonFlyBSD 5.9](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/v5.9.0/sys/net/bpf.h).
It also fixes the definition of `BPF_ALIGNMENT`, which should be equal to `sizeof(long)`, which is `4` on 32bit FreeBSD.
https://www.freebsd.org/cgi/man.cgi?query=arch&sektion=7
> All supported ABIs can be divided into two groups:
> * ILP32: `int`, `long`, `void *` types machine representations all have 4-byte size.
> * LP64: `int` type machine representation uses 4 bytes, while `long` and `void *` are 8 bytes.
I introduced the private `SIZEOF_LONG` const, since I didn't want to introduce a dependency on rust 1.24+ by depending on `libc_const_size_of`.
These changes allow my experimental crate to build on FreeBSD: https://github.com/jbit/powerline1 file changed
+45
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
275 | 311 | | |
276 | 312 | | |
277 | 313 | | |
| |||
359 | 395 | | |
360 | 396 | | |
361 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
362 | 406 | | |
363 | 407 | | |
364 | 408 | | |
| |||
1216 | 1260 | | |
1217 | 1261 | | |
1218 | 1262 | | |
1219 | | - | |
1220 | | - | |
| 1263 | + | |
1221 | 1264 | | |
1222 | 1265 | | |
1223 | 1266 | | |
| |||
0 commit comments