From 8ad5e19087880afabe0cd87182bec273b555d6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Wed, 13 Dec 2017 13:15:01 +0100 Subject: [PATCH] wifi: move AddWifiMacTrailer to wifi-utils --- src/wifi/model/edca-txop-n.cc | 4 ++-- src/wifi/model/mac-low.cc | 7 ------- src/wifi/model/mac-low.h | 6 ------ src/wifi/model/wifi-utils.cc | 7 +++++++ src/wifi/model/wifi-utils.h | 8 ++++++++ 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/wifi/model/edca-txop-n.cc b/src/wifi/model/edca-txop-n.cc index 730b76112..16caf4245 100644 --- a/src/wifi/model/edca-txop-n.cc +++ b/src/wifi/model/edca-txop-n.cc @@ -145,9 +145,9 @@ uint16_t EdcaTxopN::PeekNextSequenceNumberFor (WifiMacHeader *hdr) } Ptr -EdcaTxopN::PeekNextRetransmitPacket (WifiMacHeader &header,Mac48Address recipient, uint8_t tid, Time *timestamp) +EdcaTxopN::PeekNextRetransmitPacket (WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp) { - return m_baManager->PeekNextPacketByTidAndAddress (header,recipient,tid, timestamp); + return m_baManager->PeekNextPacketByTidAndAddress (header, recipient, tid, timestamp); } void diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index 8b410c3a8..3421d04d5 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -2810,11 +2810,4 @@ MacLow::PerformMsduAggregation (Ptr packet, WifiMacHeader *hdr, Ti } } -void -MacLow::AddWifiMacTrailer (Ptr packet) -{ - WifiMacTrailer fcs; - packet->AddTrailer (fcs); -} - } //namespace ns3 diff --git a/src/wifi/model/mac-low.h b/src/wifi/model/mac-low.h index 96bb2600d..a98a43e3b 100644 --- a/src/wifi/model/mac-low.h +++ b/src/wifi/model/mac-low.h @@ -419,12 +419,6 @@ private: * \return the total packet size */ static uint32_t GetSize (Ptr packet, const WifiMacHeader *hdr, bool isAmpdu); - /** - * Add FCS trailer to a packet. - * - * \param packet - */ - static void AddWifiMacTrailer (Ptr packet); /** * Forward the packet down to WifiPhy for transmission. This is called for the entire A-MPDu when MPDU aggregation is used. * diff --git a/src/wifi/model/wifi-utils.cc b/src/wifi/model/wifi-utils.cc index da3eead98..00e834d08 100644 --- a/src/wifi/model/wifi-utils.cc +++ b/src/wifi/model/wifi-utils.cc @@ -128,4 +128,11 @@ IsInWindow (uint16_t seq, uint16_t winstart, uint16_t winsize) return ((seq - winstart + 4096) % 4096) < winsize; } +void +AddWifiMacTrailer (Ptr packet) +{ + WifiMacTrailer fcs; + packet->AddTrailer (fcs); +} + } //namespace ns3 diff --git a/src/wifi/model/wifi-utils.h b/src/wifi/model/wifi-utils.h index 2467ce73a..71990511a 100644 --- a/src/wifi/model/wifi-utils.h +++ b/src/wifi/model/wifi-utils.h @@ -25,6 +25,8 @@ #include "ctrl-headers.h" #include "ns3/nstime.h" #include "ns3/uinteger.h" +#include "ns3/packet.h" +#include "wifi-mac-trailer.h" namespace ns3 { @@ -112,6 +114,12 @@ uint32_t GetCtsSize (void); * This method checks if the MPDU's sequence number is inside the scoreboard boundaries or not */ bool IsInWindow (uint16_t seq, uint16_t winstart, uint16_t winsize); +/** + * Add FCS trailer to a packet. + * + * \param packet + */ +void AddWifiMacTrailer (Ptr packet); } // namespace ns3