1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 04:54:28 +01:00

Added ICMPv6 class. It's working. Option getters/setters are missing.

This commit is contained in:
Matias Fontanini
2012-11-24 18:50:21 -03:00
parent 75a4bbfed6
commit 443803caf0
14 changed files with 1067 additions and 91 deletions

View File

@@ -12,6 +12,7 @@
#include "tcp.h"
#include "udp.h"
#include "icmp.h"
#include "icmpv6.h"
#include "rawpdu.h"
namespace Tins {
@@ -62,6 +63,9 @@ IPv6::IPv6(const uint8_t *buffer, uint32_t total_sz)
case Constants::IP::PROTO_ICMP:
inner_pdu(new Tins::ICMP(buffer, total_sz));
break;
case Constants::IP::PROTO_ICMPV6:
inner_pdu(new Tins::ICMPv6(buffer, total_sz));
break;
default:
inner_pdu(new Tins::RawPDU(buffer, total_sz));
break;
@@ -176,7 +180,7 @@ void IPv6::add_ext_header(const ipv6_ext_header &header) {
headers_size += header.data_size() + sizeof(uint8_t) * 2;
}
const IPv6::ipv6_ext_header *IPv6::search_option(ExtensionHeader id) const {
const IPv6::ipv6_ext_header *IPv6::search_header(ExtensionHeader id) const {
uint8_t current_header = _header.next_header;
headers_type::const_iterator it = ext_headers.begin();
while(it != ext_headers.end() && current_header != id) {