A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
mac-tx-middle.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005, 2009 INRIA
3 * Copyright (c) 2009 MIRKO BANCHI
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
8 * Mirko Banchi <mk.banchi@gmail.com>
9 */
10
11#ifndef MAC_TX_MIDDLE_H
12#define MAC_TX_MIDDLE_H
13
14#include "ns3/simple-ref-count.h"
15
16#include <map>
17
18namespace ns3
19{
20
21class WifiMacHeader;
22class Mac48Address;
23
24/**
25 * \ingroup wifi
26 *
27 * Handles sequence numbering of IEEE 802.11 data frames
28 */
29class MacTxMiddle : public SimpleRefCount<MacTxMiddle>
30{
31 public:
34
35 /**
36 * Return the next sequence number for the given header.
37 *
38 * \param hdr Wi-Fi header
39 * \return the next sequence number
40 */
41 uint16_t GetNextSequenceNumberFor(const WifiMacHeader* hdr);
42 /**
43 * Return the next sequence number for the Traffic ID and destination, but do not pick it (i.e.
44 * the current sequence number remains unchanged). This functions is used for A-MPDU
45 * aggregation.
46 *
47 * \param hdr Wi-Fi header
48 * \return the next sequence number
49 */
50 uint16_t PeekNextSequenceNumberFor(const WifiMacHeader* hdr);
51 /**
52 * Return the next sequence number for the Traffic ID and destination.
53 *
54 * \param tid Traffic ID
55 * \param addr destination address
56 * \return the next sequence number
57 */
58 uint16_t GetNextSeqNumberByTidAndAddress(uint8_t tid, Mac48Address addr) const;
59 /**
60 * Set the sequence number of the given MAC header as the next sequence
61 * number for the Traffic ID and destination of the given MAC header.
62 *
63 * \param hdr the given MAC header
64 */
65 void SetSequenceNumberFor(const WifiMacHeader* hdr);
66
67 private:
68 std::map<Mac48Address, uint16_t*> m_qosSequences; ///< QOS sequences
69 uint16_t m_sequence; ///< current sequence number
70};
71
72} // namespace ns3
73
74#endif /* MAC_TX_MIDDLE_H */
an EUI-48 address
Handles sequence numbering of IEEE 802.11 data frames.
void SetSequenceNumberFor(const WifiMacHeader *hdr)
Set the sequence number of the given MAC header as the next sequence number for the Traffic ID and de...
std::map< Mac48Address, uint16_t * > m_qosSequences
QOS sequences.
uint16_t m_sequence
current sequence number
uint16_t GetNextSeqNumberByTidAndAddress(uint8_t tid, Mac48Address addr) const
Return the next sequence number for the Traffic ID and destination.
uint16_t GetNextSequenceNumberFor(const WifiMacHeader *hdr)
Return the next sequence number for the given header.
uint16_t PeekNextSequenceNumberFor(const WifiMacHeader *hdr)
Return the next sequence number for the Traffic ID and destination, but do not pick it (i....
A template-based reference counting class.
Implements the IEEE 802.11 MAC header.
Every class exported by the ns3 library is enclosed in the ns3 namespace.