From be48947ead73f97fbe4de3478deafe7b0ca991a4 Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Sun, 30 Apr 2017 16:46:28 -0700 Subject: [PATCH] Move is_dot3 into details/pdu_helpers.h --- include/tins/detail/pdu_helpers.h | 4 ++++ include/tins/internals.h | 4 ---- src/ethernetII.cpp | 1 - src/packet_sender.cpp | 2 +- src/ppi.cpp | 2 +- src/sniffer.cpp | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/tins/detail/pdu_helpers.h b/include/tins/detail/pdu_helpers.h index 77cc767..83d9b67 100644 --- a/include/tins/detail/pdu_helpers.h +++ b/include/tins/detail/pdu_helpers.h @@ -56,6 +56,10 @@ PDU::PDUType ether_type_to_pdu_flag(Constants::Ethernet::e flag); Constants::IP::e pdu_flag_to_ip_type(PDU::PDUType flag); PDU::PDUType ip_type_to_pdu_flag(Constants::IP::e flag); +inline bool is_dot3(const uint8_t* ptr, size_t sz) { + return (sz >= 13 && ptr[12] < 8); +} + } // Internals } // Tins diff --git a/include/tins/internals.h b/include/tins/internals.h index d6697af..9de7866 100644 --- a/include/tins/internals.h +++ b/include/tins/internals.h @@ -46,10 +46,6 @@ namespace Internals { // Compares sequence numbers as defined by RFC 1982. int seq_compare(uint32_t seq1, uint32_t seq2); -inline bool is_dot3(const uint8_t* ptr, size_t sz) { - return (sz >= 13 && ptr[12] < 8); -} - } // namespace Internals } // namespace Tins /** diff --git a/src/ethernetII.cpp b/src/ethernetII.cpp index 8dcdbaa..c0704c4 100644 --- a/src/ethernetII.cpp +++ b/src/ethernetII.cpp @@ -48,7 +48,6 @@ #include "ipv6.h" #include "arp.h" #include "constants.h" -#include "internals.h" #include "exceptions.h" #include "memory_helpers.h" #include "detail/pdu_helpers.h" diff --git a/src/packet_sender.cpp b/src/packet_sender.cpp index e95bdd2..b9a57f8 100644 --- a/src/packet_sender.cpp +++ b/src/packet_sender.cpp @@ -64,8 +64,8 @@ #include "dot11/dot11_base.h" #include "radiotap.h" #include "ieee802_3.h" -#include "internals.h" #include "cxxstd.h" +#include "detail/pdu_helpers.h" #if TINS_IS_CXX11 #include #endif // TINS_IS_CXX11 diff --git a/src/ppi.cpp b/src/ppi.cpp index 51bd00f..effc049 100644 --- a/src/ppi.cpp +++ b/src/ppi.cpp @@ -37,9 +37,9 @@ #include "loopback.h" #include "sll.h" #include "ppi.h" -#include "internals.h" #include "exceptions.h" #include "memory_helpers.h" +#include "detail/pdu_helpers.h" using Tins::Memory::InputMemoryStream; diff --git a/src/sniffer.cpp b/src/sniffer.cpp index 2b95872..c2b3c71 100644 --- a/src/sniffer.cpp +++ b/src/sniffer.cpp @@ -45,7 +45,7 @@ #include "pktap.h" #include "sll.h" #include "ppi.h" -#include "internals.h" +#include "detail/pdu_helpers.h" using std::string; using std::runtime_error;