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 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>
The MS C++ compiler doesn't seem to understand that a small constant
like 0, although strictly being an integer, will fit perfectly fine
into an 8 bit type so add some safe casts to silence that warning.
If libpcap support has been disabled (LIBTINS_ENABLE_PCAP=OFF)
then the headers requiring that library will not be installed,
but they will still be included from the main tins.h convenience
header.
This fixes that by sorrounding the includes with an #ifdef the
same way it has been done for DOT11 support.
* simplify tcp flag checks, fix stream_follower
On various places was used simple comparison for checking state of flags.
tcp.flags() == (TCP::SYN | TCP::ACK)
This is not what you want usually, because this check is false
in case that another flag is set also. Correct check for syn-ack
packet should be:
(tcp.flags() & (TCP::SYN | TCP::ACK)) == (TCP::SYN | TCP::ACK)
To simplify this kind of check, add new has_flags method:
bool TCP::has_flags(small_uint<12> check_flags) const
* remove duplicate TCP::SYN flag check
* Add parsing of well known IPv6 extension headers
Add classes for IPv6 extension headers defined in the IPv6 protocol
specification (RFC 2460) as well as functions for creating them from
the IPv6 class' ext_header type.
The currently known extension headers are Hop-By-Hop Option,
Destination Routing, Routing and Fragment.
* Cleanup after PR #287 comments
Pull in stuff from the std namespace with "using" instead of
qualifying with std::.
Keep starting braces on the same line.
Avoid potential copy when appending to vector.
* * add or-operator and a simlple unit test for hw_address, ip_address, ipv6_address
* add not-operator and a simlple unit test for hw_address, ip_address, ipv6_address
* add greater-then-operator and a simlple unit test for ipv6_address
* add new constructor and a simlple unit test for network_interface, which use a ipv6_address to find the nic
* add override the function gateway_from_ip for ipv6_address parameter (untested)
* change the ipv6_address in NotMaskAdress_Test, so that the expceted addresses are valid for the winsock api
* Delete CMakeLists.txt.user
* * add <=, >, >= operator for HWAddress with tests
* add <=, >, >= operator for IPv4Address with tests
* add <=,>= operator for IPv6Address with tests
* refactoring the & , |, ~ operator of ipv6_address to "regular" operator
When reading TCP packets with esoteric (or corrupt) values for option types, the asan fsanitize=enum will trigger if the read value is not in range of the enum. The range of a classic (pre-C++11) enum with no negative enumerators is determined by the highest bit set in any of its enumerators, so if `TCP::OptionTypes` has highest enumerator `ALTCHK = 14` it cannot take values above 15.
Define enumerators (per IANA) with bit 7 set to ensure that `TCP::OptionTypes` can take any 8-bit value.
An alternative (C++11 only) would be to give `TCP::OptionTypes` underlying type `uint8_t`.