EMANE  1.2.1
downstreamqueueentry.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014 - Adjacent Link LLC, Bridgewater, New Jersey
3  * Copyright (c) 2008 - DRS CenGen, LLC, Columbia, Maryland
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  * * Neither the name of DRS CenGen, LLC nor the names of its
17  * contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef EMANEMODELSIEEE80211ABGDOWNSTREAMQUEUEENTRY_HEADER_
35 #define EMANEMODELSIEEE80211ABGDOWNSTREAMQUEUEENTRY_HEADER_
36 
37 #include "emane/maclayerimpl.h"
38 #include "emane/types.h"
39 
40 
41 namespace EMANE
42 {
43  namespace Models
44  {
45  namespace IEEE80211ABG
46  {
53  {
55  TimePoint acquireTime_; // acquire time from network layer abs
56  Microseconds txOpMicroseconds_; // pkt tx op duration
58  TimePoint preTxDelayTime_; // pre tx delay time abs
59  Microseconds postTxDelayMicroseconds_; // post tx delay duration
60  TimePoint txTime_; // tx time abs
61  std::uint16_t u16Seq_; // sequence number
62  std::uint8_t u8Category_; // queue index
63  std::uint8_t numRetries_; // number of retries count
64  std::uint8_t maxRetries_; // max retry count
65  bool bRtsCtsEnable_; // rts cts enable
66  bool bCollisionOccured_; // flag that a tx collision occured
67  std::uint64_t u64DataRatebps_; // data rate bps
68 
70  pkt_{EMANE::DownstreamPacket{EMANE::PacketInfo{0,0,0,{}},nullptr,0}},
71  acquireTime_{},
72  txOpMicroseconds_{},
73  durationMicroseconds_{},
74  preTxDelayTime_{},
75  postTxDelayMicroseconds_{},
76  txTime_{},
77  u16Seq_{},
78  u8Category_{},
79  numRetries_{},
80  maxRetries_{},
81  bRtsCtsEnable_{false},
82  bCollisionOccured_{false},
83  u64DataRatebps_{}
84  { }
85 
87  const TimePoint & tv,
88  const Microseconds & txOpMicroseconds,
89  std::uint8_t u8Category,
90  std::uint8_t maxRetries):
91  pkt_{std::move(pkt)},
92  acquireTime_{tv},
93  txOpMicroseconds_{txOpMicroseconds},
94  durationMicroseconds_{},
95  preTxDelayTime_{},
96  postTxDelayMicroseconds_{},
97  txTime_{},
98  u16Seq_{},
99  u8Category_{u8Category},
100  numRetries_{},
101  maxRetries_{maxRetries},
102  bRtsCtsEnable_{false},
103  bCollisionOccured_{false},
104  u64DataRatebps_{}
105  { }
106 
108  {
109  pkt_ = std::move(entry.pkt_);
110  acquireTime_ = entry.acquireTime_;
111  txOpMicroseconds_ = entry.txOpMicroseconds_;
112  durationMicroseconds_ = entry.durationMicroseconds_;
113  preTxDelayTime_ = entry.preTxDelayTime_;
114  postTxDelayMicroseconds_ = entry.postTxDelayMicroseconds_;
115  txTime_ = entry.txTime_;
116  u16Seq_ = entry.u16Seq_;
117  u8Category_= entry.u8Category_;
118  numRetries_ = entry.numRetries_;
119  maxRetries_= entry.maxRetries_;
120  bRtsCtsEnable_= entry.bRtsCtsEnable_;
121  bCollisionOccured_ = entry. bCollisionOccured_;
122  u64DataRatebps_ = entry.u64DataRatebps_;
123 
124  return *this;
125  }
126 
128  pkt_{std::move(entry.pkt_)},
129  acquireTime_{entry.acquireTime_},
130  txOpMicroseconds_{entry.txOpMicroseconds_},
131  durationMicroseconds_{entry.durationMicroseconds_},
132  preTxDelayTime_{entry.preTxDelayTime_},
133  postTxDelayMicroseconds_{entry.postTxDelayMicroseconds_},
134  txTime_{entry.txTime_},
135  u16Seq_{entry.u16Seq_},
136  u8Category_{entry.u8Category_},
137  numRetries_{entry.numRetries_},
138  maxRetries_{entry.maxRetries_},
139  bRtsCtsEnable_{entry.bRtsCtsEnable_},
140  bCollisionOccured_{entry. bCollisionOccured_},
141  u64DataRatebps_{entry.u64DataRatebps_}
142  {}
143  };
144  }
145  }
146 }
147 #endif //EMANEMODELSIEEE80211ABGDOWNSTREAMQUEUEENTRY_HEADER_
structure defines the mac downstream packet queue entry
Store source, destination, creation time and priority information for a packet.
Definition: packetinfo.h:50
Specialized packet the allows downstream processing to add layer specific headers as the packet trave...
std::chrono::microseconds Microseconds
Definition: types.h:45
Clock::time_point TimePoint
Definition: types.h:50
Definition: agent.h:43
DownstreamQueueEntry & operator=(DownstreamQueueEntry &&entry)
DownstreamQueueEntry(EMANE::DownstreamPacket &pkt, const TimePoint &tv, const Microseconds &txOpMicroseconds, std::uint8_t u8Category, std::uint8_t maxRetries)