OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2005, 2009 INRIA | 3 * Copyright (c) 2005, 2009 INRIA |
4 * Copyright (c) 2009 MIRKO BANCHI | 4 * Copyright (c) 2009 MIRKO BANCHI |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 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 | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 } | 71 } |
72 else | 72 else |
73 { | 73 { |
74 retval = m_sequence; | 74 retval = m_sequence; |
75 m_sequence++; | 75 m_sequence++; |
76 m_sequence %= 4096; | 76 m_sequence %= 4096; |
77 } | 77 } |
78 return retval; | 78 return retval; |
79 } | 79 } |
| 80 uint16_t |
| 81 MacTxMiddle::PeekNextSequenceNumberfor (const WifiMacHeader *hdr) |
| 82 { |
| 83 uint16_t retval; |
| 84 if (hdr->IsQosData () |
| 85 && !hdr->GetAddr1 ().IsGroup ()) |
| 86 { |
| 87 uint8_t tid = hdr->GetQosTid (); |
| 88 NS_ASSERT (tid < 16); |
| 89 std::map<Mac48Address, uint16_t*>::iterator it = m_qosSequences.find (hdr-
>GetAddr1 ()); |
| 90 if (it != m_qosSequences.end ()) |
| 91 { |
| 92 retval = it->second[tid]; |
| 93 } |
| 94 else |
| 95 { |
| 96 retval = 0; |
| 97 } |
| 98 } |
| 99 else |
| 100 { |
| 101 retval = m_sequence; |
| 102 } |
| 103 return retval; |
| 104 } |
80 | 105 |
81 uint16_t | 106 uint16_t |
82 MacTxMiddle::GetNextSeqNumberByTidAndAddress (uint8_t tid, Mac48Address addr) co
nst | 107 MacTxMiddle::GetNextSeqNumberByTidAndAddress (uint8_t tid, Mac48Address addr) co
nst |
83 { | 108 { |
84 NS_ASSERT (tid < 16); | 109 NS_ASSERT (tid < 16); |
85 uint16_t seq = 0; | 110 uint16_t seq = 0; |
86 std::map <Mac48Address,uint16_t*>::const_iterator it = m_qosSequences.find (ad
dr); | 111 std::map <Mac48Address,uint16_t*>::const_iterator it = m_qosSequences.find (ad
dr); |
87 if (it != m_qosSequences.end ()) | 112 if (it != m_qosSequences.end ()) |
88 { | 113 { |
89 return it->second[tid]; | 114 return it->second[tid]; |
90 } | 115 } |
91 return seq; | 116 return seq; |
92 } | 117 } |
93 | 118 |
94 } // namespace ns3 | 119 } // namespace ns3 |
OLD | NEW |