casaroli opened a new pull request, #21102: URL: https://github.com/apache/nuttx/pull/21102
## Summary Two small gaps of the netinet headers, one commit each. Both only add names; nothing that exists changes. ### in-systm `<netinet/in_systm.h>` gives `n_short`, `n_long` and `n_time`, the 4.4BSD types for the fields of the IP headers in network byte order. glibc, musl and the BSDs have this header, and network programs include it together with `<netinet/ip.h>` (tcp-wrappers' `fix_options.c`, for example). NuttX did not have it, so these programs did not compile. This PR adds the header with the three types. ### in-loopbacknet `<netinet/in.h>` had the classful address macros of 4.4BSD (`IN_CLASSA()` ... `IN_CLASSD()`, `IN_MULTICAST()`) but not `IN_LOOPBACKNET`, `IN_EXPERIMENTAL()` and `IN_BADCLASS()`. glibc, musl and the BSDs have them, and programs use them (openssh's `sshconnect.c`, for example, tests for `IN_LOOPBACKNET`). This PR adds the three macros with the glibc and musl values: `IN_LOOPBACKNET` is 127, `IN_EXPERIMENTAL()` is true for 224.0.0.0/3 and `IN_BADCLASS()` for 240.0.0.0/4. ## Impact - in-systm: A new public header with three types. No existing file includes it. No change in any build mode or architecture. No documentation lists the netinet headers. - in-loopbacknet: Three new macros in a public header. No change in any build mode or architecture. No documentation lists these macros. ## Testing The branches were first tested one by one (below). Then all commits of this PR together, on master b79dc18e015: insystm.c, inclass.c on `qemu-armv8a:knsh` (QEMU with HVF) all PASS, and ostest exits with status 0 on `qemu-armv8a:knsh` and `qemu-armv8a:nsh`. ### in-systm Test program `insystm.c` (the three types, their sizes, and that they are unsigned), compiled against the export of qemu-armv8a:knsh (kernel build) and run under QEMU (HVF): | | master aeab6fbf989 | this PR | |---|---|---| | `insystm` | does not compile (no `<netinet/in_systm.h>`) | PASS | ostest exits with status 0 on qemu-armv8a:knsh (kernel) and qemu-armv8a:nsh (flat). ### in-loopbacknet Test program `inclass.c` (`IN_LOOPBACKNET` is the network of `INADDR_LOOPBACK`; 240.0.0.1 is experimental and bad class; 224.0.0.1 is multicast, not bad class; 10.0.0.1 is neither), compiled against the export of qemu-armv8a:knsh (kernel build) and run under QEMU (HVF): | | master aeab6fbf989 | this PR | |---|---|---| | `inclass` | does not compile | values PASS, class PASS | ostest exits with status 0 on qemu-armv8a:knsh (kernel) and qemu-armv8a:nsh (flat). `tools/checkpatch.sh -c -u -m -g` passes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
