Matias Fontanini
63603b8ac8
Calculate IP option sizes properly
...
Fixes #288
2018-04-08 08:12:52 -07:00
Matias Fontanini
a6817528bc
Use absolute include paths
...
Fixes #250
2017-09-21 20:48:57 -07:00
Matias Fontanini
7250c7a03d
Performance improvements
...
* Remove option size memers on IP/TCP and instead calculate
these when they're needed
* Reorder members on IP/TCP so as to remove/decrease padding
* Move most memory helpers impl into header file so they
can be inlined
* Make PDUOption's move ctor/assignment operator noexcept
2017-05-13 16:21:18 -07:00
Matias Fontanini
cedd127e8f
Use vector instead of lists everywhere
2017-05-13 11:14:11 -07:00
Matias Fontanini
a5766a19c2
Remove useless includes
2017-05-13 10:43:29 -07:00
Matias Fontanini
60b5f3e6e4
Remove inclusion of algorithm almost everywhere
2017-04-30 18:51:55 -07:00
Matias Fontanini
a20f9d3e81
Move internals' PDU helpers into their own files
2017-04-30 13:49:50 -07:00
Matias Fontanini
589adba798
Move checksum utils into their own file
2017-04-30 11:59:02 -07:00
Matias Fontanini
1bd0cd504e
Include detail/type_traits.h rather than internals.h on pdu_option
2017-04-30 09:40:40 -07:00
Matias Fontanini
c06787ca22
Update license date to 2017
2017-04-29 09:56:26 -07:00
Matias Fontanini
15a353c123
Remove parent parameter from write_serialization
...
This is no longer needed as each PDU knows its parent PDU already
2017-04-29 09:53:33 -07:00
Kyle Fazzari
a71a3d29ff
Fix -Wextra compiler warnings. ( #184 )
...
* Fix -Wextra compiler warnings.
Fix #183 .
Signed-off-by: Kyle Fazzari <github@status.e4ward.com >
* Comment out unused parameters.
This is done everywhere possible instead of using Internals::unused().
Note that this involved moving some implementations into the
corresponding .cpp file.
Signed-off-by: Kyle Fazzari <github@status.e4ward.com >
* Fix warnings in tests as well.
Signed-off-by: Kyle Fazzari <github@status.e4ward.com >
* Leave IPv4Reassembler alone, it's growing.
Signed-off-by: Kyle Fazzari <github@status.e4ward.com >
2017-01-25 13:26:11 -08:00
Matias Fontanini
8dcfd6aae0
Set protocol to 0 if no inner_pdu on IP
2016-09-29 07:37:46 -07:00
Matias Fontanini
5dc7b20a43
Add active tests for IPv4
2016-03-20 16:27:43 -07:00
Matias Fontanini
cfbf88bb5f
Make *MemoryStream use size_t rather than uint32_t
2016-02-28 08:12:05 -08:00
Matias Fontanini
9dabb6f570
Fix IP fragment reassemble when packet has flags DF+MF
2016-02-21 09:23:44 -08:00
Matias Fontanini
17da10d76e
Add extract_metadata to main PDU classes
2016-02-20 22:19:12 -08:00
Matias Fontanini
5d41316b9a
Rename IP header member to header_
2016-02-04 20:37:24 -08:00
Matias Fontanini
72e038b9bf
Fix invalid endian on IP fragment offset on OSX
2016-02-04 20:20:14 -08:00
Matias Fontanini
fb4e5086fd
Update copyright notice
2016-01-31 20:03:49 -08:00
Matias Fontanini
d84f10cf08
Code cleanup and use same syntax on the entire project
...
Initial code cleanup
More code cleanup
Cleanup more code
Cleanup Dot11 code
Fix OSX build issue
Cleanup examples
Fix ref and pointer declaration syntax
Fix braces
2016-01-09 10:01:58 -08:00
Matias Fontanini
38239be472
Remove unused cassert header inclusions
2015-12-27 04:38:31 -08:00
Matias Fontanini
02e2b278de
Add OutputMemoryStream and port most classes to use it
2015-12-26 06:30:00 -08:00
Matias Fontanini
13c05fbdb1
Add input memory stream class and port some PDUs to use it
2015-12-24 15:21:07 -08:00
Matias Fontanini
a35b086d12
Use endian independent way of setting IP fragment offset and flags
2015-12-07 22:11:28 -08:00
Matias Fontanini
3e23bcc73c
Add IP::fragment_offset and IP::flags
2015-12-07 21:10:41 -08:00
Matias Fontanini
534bdaf30b
Always calculate IP checksum
...
Fixes #105
2015-11-08 10:25:49 -08:00
Matias Fontanini
6dec68128d
Add remove_option member to IP, TCP, Dot11, ICMPv6, DHCP and DHCPv6
2015-08-17 15:19:03 -07:00
Matias Fontanini
c42cd0114f
Fix compilation warnings on Windows x64.
2015-05-17 17:30:54 -07:00
Matias Fontanini
a607ab380c
Replace WIN32 macro with _WIN32.
2015-05-02 16:25:59 -07:00
Ben McMorran
eb5598be7c
Perserve IP protocol when using RawPDU
...
Previously, the IP protocol field for non-fragmented packets was forcibly overwritten to the protocol of the inner PDU even if that PDU was a RawPDU. This behavior contradicts the documentation.
2015-04-20 02:45:27 -04:00
Matias Fontanini
ae135bb035
Fixed IP total length zero bug.
2014-11-25 22:49:05 -08:00
Matias Fontanini
c4609fedd6
Added Loopback::matches_response.
2014-10-25 00:23:52 -05:00
Matias Fontanini
addf0b3d98
Fixed OSX IP packet sending.
2014-09-19 10:07:31 -03:00
Christian Hammerl
52b0ee7ceb
fix armv5 alignment issues
2014-07-31 15:49:52 +00:00
Matias Fontanini
2dff95700f
Updated copyright notice.
2014-07-13 11:04:29 -03:00
Matias Fontanini
559c963d63
Fixed compilation errors on Windows.
2014-05-06 00:13:05 -03:00
Matias Fontanini
ea6638c163
IP now uses PDUOption::to<>. Started porting ICMPv6 to do so as well.
2013-12-16 15:50:17 -03:00
Matias Fontanini
0acb0fee3e
IP packets sent using PacketSender::send_recv now match ICMP responses.
2013-12-14 12:48:56 -03:00
Matias Fontanini
2ddec368c3
Fixed bug on IP when serializing fragmented packets.
...
The original protocol id was being overwritten with 0xff(unknown)
when the inner_pdu was a RawPDU, even if it was just a fragment of
a transport layer PDU. The protocol id is now kept if the packet
is fragmented.
2013-12-04 10:56:48 -03:00
Matias Fontanini
6355aff3cd
Added IPv4Reassembler class.
2013-11-17 15:32:24 -03:00
Matias Fontanini
a6655191d4
Fragmented IP packet's inner_pdu PDUs are not decoded now.
2013-11-16 19:40:08 -03:00
Matias Fontanini
93ab8d3b91
Removed useless include directives from ip.cpp and ipv6.cpp.
2013-11-04 23:31:46 -03:00
Matias Fontanini
5345b29f8c
Added support for IPSec.
2013-11-04 23:05:00 -03:00
Matias Fontanini
6d329424f1
Created an overload of Internals::pdu_from_flag for transport layer PDUs.
2013-11-04 13:46:25 -03:00
Matias Fontanini
01b2a9c7b2
Modified some examples fixed some doxygen documentation.
2013-10-06 23:00:20 -03:00
Matias Fontanini
5f2c923c48
Added PDUAllocator class, which makes extending PDUs easier.
2013-08-29 23:31:10 -03:00
Santiago Alessandri
2a5b64526f
Replaced tabs for spaces in the previous commit
2013-07-14 13:13:38 -03:00
Santiago Alessandri
02d3a14083
Fixed issue related with EthernetII protocol.
...
The Ethernet II protocol forces a minimum length of 60 bytes. It is necessary to add a trailer for padding of null-bytes when the inner_pdu's size does not meet the requirement.
Also EthernetII packets received were being incorrectly parsed due to the existance of this padding.
The issue has been solved and several tests were added. All tests successfully pass.
2013-07-12 20:06:55 -03:00
Matias Fontanini
5064a9255b
Fixed BSD notice. Updated AUTHORS file.
2013-04-23 20:33:00 -03:00