Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | |
2 /* | |
3 * Copyright (c) 2005, 2009 INRIA | |
4 * Copyright (c) 2009 MIRKO BANCHI | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License version 2 as | |
8 * published by the Free Software Foundation; | |
9 * | |
10 * This program is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License | |
16 * along with this program; if not, write to the Free Software | |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 * | |
19 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> | |
20 * Mirko Banchi <mk.banchi@gmail.com> | |
21 * Stefano Avallone <stavallo@unina.it> | |
22 */ | |
23 | |
24 #include "ns3/simulator.h" | |
25 #include "ns3/uinteger.h" | |
26 #include "ns3/enum.h" | |
27 #include "ns3/assert.h" | |
28 #include "wifi-mac-queue-item.h" | |
29 #include "qos-blocked-destinations.h" | |
30 | |
31 namespace ns3 { | |
32 | |
33 NS_LOG_COMPONENT_DEFINE ("WifiMacQueueItem"); | |
S. Deronne
2018/02/23 20:25:56
We should add it to EnableLogComponents
ammo6818-vandals.uidaho.edu
2018/02/25 10:41:45
Added
| |
34 | |
35 WifiMacQueueItem::WifiMacQueueItem (Ptr<const Packet> p, const WifiMacHeader & h eader) | |
36 : m_packet (p), | |
37 m_header (header), | |
38 m_tstamp (Simulator::Now ()) | |
39 { | |
40 } | |
41 | |
42 WifiMacQueueItem::~WifiMacQueueItem () | |
43 { | |
44 } | |
45 | |
46 Ptr<const Packet> | |
47 WifiMacQueueItem::GetPacket (void) const | |
48 { | |
49 return m_packet; | |
50 } | |
51 | |
52 const WifiMacHeader& | |
53 WifiMacQueueItem::GetHeader (void) const | |
54 { | |
55 return m_header; | |
56 } | |
57 | |
58 Mac48Address | |
59 WifiMacQueueItem::GetAddress (enum WifiMacHeader::AddressType type) const | |
60 { | |
61 if (type == WifiMacHeader::ADDR1) | |
62 { | |
63 return m_header.GetAddr1 (); | |
64 } | |
65 if (type == WifiMacHeader::ADDR2) | |
66 { | |
67 return m_header.GetAddr2 (); | |
68 } | |
69 if (type == WifiMacHeader::ADDR3) | |
70 { | |
71 return m_header.GetAddr3 (); | |
72 } | |
73 return 0; | |
74 } | |
75 | |
76 Time | |
77 WifiMacQueueItem::GetTimeStamp (void) const | |
78 { | |
79 return m_tstamp; | |
80 } | |
81 | |
82 uint32_t | |
83 WifiMacQueueItem::GetSize (void) const | |
84 { | |
85 return m_packet->GetSize () + m_header.GetSerializedSize (); | |
86 } | |
87 | |
88 #ifdef _WIN32 | |
89 NS_OBJECT_TEMPLATE_CLASS_DEFINE_LIB(Queue, WifiMacQueueItem, NS3WIFILIB); | |
90 #else | |
91 NS_OBJECT_TEMPLATE_CLASS_DEFINE(Queue, WifiMacQueueItem); | |
92 #endif | |
93 | |
94 } //namespace ns3 | |
OLD | NEW |