CMake 4 removed compatibility with CMake versions < 3.5, and versions
between 3.5-3.10 are deprecated.
This change updates the minimum required version to 3.10 to ensure
compatibility with modern CMake versions including CMake 4.x.
This issue is affecting NixOS users (see
https://github.com/NixOS/nixpkgs/issues/450198) and will likely impact
other distributions as they upgrade to CMake 4.x.
This commit adds support for the Real-time Transport Protocol (RTP) as
defined in RFC 3550. Some tests have also been added to ensure that the
RTP PDU class functionality is working as expected.
Signed-off-by: James Raphael Tiovalen <jamestiotio@gmail.com>
This commit replaces the remaining `rfind_pdu` calls to `find_pdu` in
the `src` directory. Any existing `rfind_pdu` calls in the `examples`
and `tests` directories are unmodified.
The main motivation is that conditional statements are generally more
performant than exception handling. Since `rfind_pdu` calls `find_pdu`
internally anyway, this eliminates some overhead as well.
Signed-off-by: James Raphael Tiovalen <jamestiotio@gmail.com>
Based on RFC 7348, the default IANA-assigned destination UDP port number
for VXLAN is 4789, not the source port number. Update the value in the
VXLANTest class to align with the RFC.
The VXLAN implementation still allows for the destination port number to
be configurable to allow interoperability (as specified by the RFC),
such as with the Linux kernel's default value of 8472.
Signed-off-by: James Raphael Tiovalen <jamestiotio@gmail.com>
This patch adds a new PDU class to support VXLAN. Several VXLAN-related
tests have also been added.
Signed-off-by: James Raphael Tiovalen <jamestiotio@gmail.com>
IPv6 data packets with payload or padded bytes received after one with
no Next Header were not being parsed correctly, resulting in NULL PDU.
This commit fixes the IPv6 parser to be compliant with RFC 2460 Section
4.7 by adding a check in the IPv6 constructor to ignore the subsequent
packets if an IPv6 packet contains no Next Header.
Signed-off-by: James Raphael Tiovalen <jamestiotio@gmail.com>
According to the C/C++ Standard, for shift operations, the behavior is undefined if the right operand is equal to the width of the promoted left operand.
On a 64-bit Windows machine, this causes IP addresses 0.0.0.0 and 255.255.255.255 to have the same internal representation, leading to various issues when using a /0 prefix.
On some platforms (like RedHat ones), CMAKE_INSTALL_LIBDIR is set to
`lib64` instead of `lib`. The CMake files should also be installed to
`lib64`, but because CONF_CMAKE_INSTALL_DIR is set unconditionally to
use `lib`, the proper path can't be configured.
This change makes CONF_CMAKE_INSTALL_DIR use the configured
CMAKE_INSTALL_LIBDIR value, which defaults to `lib`.
Using a submodule to download and build GTest is a great approach for
most circumstances, but some may prefer to use the system-provided GTest
if it is available.
This change adds a fallback to using the system's GTest if the submodule
is absent.
Fix `query_route_table()` returning a buffer padded with extra '\0'
bytes because it ignored the buffer size returned by `sysctl()`.
This caused `route_entries()` / `route6_entries()` to fall into an
infinite loop, forever trying to parse a 0-length routing entry.