1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-22 18:25:57 +01:00

281 Commits

Author SHA1 Message Date
James R T
fe22186623 Add RTP support (#530)
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>
2024-03-31 07:46:42 -07:00
Yang Bin
64da67ca56 Update tcp.h (#516)
Fix a spelling error
2023-09-19 07:04:43 -07:00
James R T
850bb9b642 Add VXLAN support (#501)
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>
2023-05-03 18:21:59 -07:00
Ed Catmur
b7e61f4c76 Qualify calls to std::move (clang 15) (#488)
Co-authored-by: Ed Catmur <edward.catmur@mavensecurities.com>
2023-04-30 10:13:56 -07:00
Ed Catmur
e2a14d8898 Remove use of deprecated std::iterator (#481)
Co-authored-by: Ed Catmur <edward.catmur@mavensecurities.com>
2023-04-30 10:11:57 -07:00
Tobias Specht
ba0c820852 Add FileSniffer constructor with FILE pointer as pcap source (#499) 2023-04-30 09:44:49 -07:00
Ed Catmur
fa87e1b6f6 Add missing include (#497)
`<algorithm>` is needed for std::fill (error in clang-16)
2023-01-31 10:02:50 -08:00
Vasiliy Glazov
812be7966d Fix build with GCC13 (#496)
Due to changes in GCC13 need fix include.
2023-01-24 08:29:36 -08:00
Bill Willcox
7204fbd688 dns: parser reads into garbage on misreported packet size (#468)
Co-authored-by: Bill Willcox <billwcorp@gmail.com>
2022-02-26 14:29:22 -08:00
Matias Fontanini
24ac038c30 Merge pull request #448 from FlukeCorp/link-local-uses-interface
IPv6 use interface when sending to link-local dest
2021-07-22 19:23:51 -07:00
Prosper Van
a619e4ff98 IPv6 use interface when sending to link-local dest 2021-07-22 11:18:48 -07:00
Gaya Cohen
137b56d5a7 fix exception inheritance and change exception names in DNS code 2021-06-09 15:57:04 +03:00
Gaya Cohen
ed2b3c12d5 Make new exceptions inherit from malformed_packet and change exception names 2021-06-09 11:46:07 +03:00
Gaya Cohen
1650b60234 change counter variable type and add exception description comment 2021-05-24 17:04:11 +03:00
Gaya Cohen
c20c82bcb5 Fix pointer loop bug and add descriptive exceptions 2021-05-24 15:12:23 +03:00
Adrian Costin
16f5795243 Fix getter being labeled as setter in dns header file comments 2021-04-24 01:04:24 +03:00
ceerrep
222611b377 Fix wrong address endian
Host endian has been implicitly converted to big endian in "IPv4Address::operator uint32_t()"
2021-03-24 18:41:59 +08:00
Martin O'Neal
553b1fb255 Added RFC8335 Extended Echo types 2020-12-29 08:36:30 +00:00
Martin O'Neal
94939dd0fa Added RFC8355 ICMP Extended Echo support
Added RFC8355 ICMP Extended Echo request/reply to Flags (no other changes made)
2020-12-29 08:32:29 +00:00
Matias Fontanini
07012648fb Assign a PDUType for Dot11ControlTA 2020-09-10 07:34:54 -07:00
Matias Fontanini
16e77146ab Merge pull request #382 from laudrup/fix-install-without-libpcap
Don't include non-existing headers when installed without libpcap
2020-02-01 11:01:16 -08:00
Kasper Laudrup
9e61286a59 Fix compiler warnings from MSVC 2017
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.
2019-12-20 14:37:38 +01:00
Kasper Laudrup
8da102fb48 Don't include non-existing headers when installed without libpcap
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.
2019-12-20 14:18:07 +01:00
Matias Fontanini
731e36e373 Fix "fi" in comment 2019-10-02 08:32:54 -07:00
Karas Lukáš
608b48f25c add IPv6 check for Link-Local unicast address 2019-10-01 17:08:01 +02:00
Lukáš Karas
22b4435c81 simplify tcp flag checks, fix stream_follower (#334)
* 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
2019-03-14 18:18:12 -07:00
Jens Keim
2a8101eef3 add advertised_size method 2019-01-22 19:32:51 +01:00
Matias Fontanini
776ae4e83b Merge pull request #305 from christophert/master
Add comprehensive list of 802.11 Element IDs
2019-01-07 18:53:41 -08:00
Matias Fontanini
2158c7a92e Merge pull request #313 from fflexo/raw_ip
add support for libpcap's DLT_RAW link type
2019-01-07 18:49:10 -08:00
DDoSolitary
6c92bcdad1 Clarify pointer's validity for documentation of current_option_ptr(). 2018-12-25 10:38:44 +08:00
Teodoro Vargas
57ac099703 Fix serialization for QinQ (#316)
* Add QinQ Frame

* Fix serialization for QinQ
2018-10-09 14:02:01 -07:00
fflexo
eb7628eca4 add support for libpcap's DLT_RAW link type 2018-09-08 15:11:06 +01:00
Ulf Wetzker
c26e4943c2 Added base class access specifier for socket_close_error (#306) 2018-08-02 09:17:07 -07:00
Christopher Tran
7e90c8be6a add comprehensive list of Element IDs per 802.11-2016 9.4.2/T9-77 2018-07-26 13:29:23 -04:00
Kasper Laudrup
fa79582b89 Add parsing of well known IPv6 extension headers (#287)
* 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.
2018-03-28 21:05:01 -07:00
stubbfel
342e2c77a7 Add missing operators to address classes (#275)
* * 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
2018-03-28 20:44:28 -07:00
Matias Fontanini
7848e28b62 Add version macros in config.h
Fixes #286
2018-03-20 18:50:42 -07:00
Matias Fontanini
f29566d6d9 Implement IPv6::recv_response 2018-02-25 10:42:16 -08:00
Ed Catmur
1038c6f7f3 Don't call &* on PDUIterator 2018-02-03 09:32:43 -08:00
Jeff Ebert
8efc0271f5 Don't include dot11.h in tins.h if it is not configured in the library (#277) 2018-02-03 09:31:24 -08:00
Matias Fontanini
f44b253a42 Fix memory leak in PDU's move assignment operator
Fixes #272
2017-12-14 14:42:46 -03:00
Matias Fontanini
8f85a6e557 Append padding to IPv6 options
Relates to #270
2017-12-12 10:33:17 -03:00
Matias Fontanini
a3dd057147 Use first IP fragment as base for reassembly
Fixes #225 for good
2017-12-03 13:50:02 -08:00
mavrikiy
39f3b24058 Fix dhcpv6::duid_type constructor from duid_ll (#266) 2017-11-06 09:29:57 -08:00
Santiago Alessandri
8e50756afa Add MPLS experimental field (#265)
* Add experimental field to MPLS PDU

See RFC-4950 https://tools.ietf.org/html/rfc4950

* Add tests for MPLS' experimental field
2017-11-04 12:08:34 -07:00
Ed Catmur
983325bfdf Ensure TCP::OptionTypes has 8-bit range (#259)
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`.
2017-10-19 10:17:51 -07:00
Matias Fontanini
f4635a696e Fix build issues when disabling Dot11
Fixes #258
2017-10-18 06:40:51 -07:00
Alex Collins
04e29858ee Add RawPDU c'tor for const payload_type&. (#253)
* Add RawPDU c'tor for const payload_type &.

* Correct indentation.
2017-10-12 20:02:28 -07:00
juno0812
b43d2f74e4 Add getter/setter for more data field in Dot11Base (#252) 2017-10-04 07:03:17 -07:00
Matias Fontanini
f2766db829 Add IPv4/6Address::size member function 2017-10-01 20:38:54 -07:00