A Discrete-Event Network Simulator
API
mac-rx-middle.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2005 INRIA
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19 */
20
21#ifndef MAC_RX_MIDDLE_H
22#define MAC_RX_MIDDLE_H
23
24#include <map>
25#include "ns3/simple-ref-count.h"
26#include "ns3/callback.h"
27
28namespace ns3 {
29
30class WifiMacHeader;
31class OriginatorRxStatus;
32class Packet;
33class Mac48Address;
34class WifiMacQueueItem;
35
41class MacRxMiddle : public SimpleRefCount<MacRxMiddle>
42{
43public:
48
49 MacRxMiddle ();
50 ~MacRxMiddle ();
51
58
65 void Receive (Ptr<WifiMacQueueItem> mpdu, uint8_t linkId);
66
67
68private:
70 friend class MacRxMiddleTest;
91 bool IsDuplicate (const WifiMacHeader* hdr, OriginatorRxStatus *originator) const;
108 OriginatorRxStatus *originator);
109
113 typedef std::map <Mac48Address, OriginatorRxStatus *, std::less<Mac48Address> > Originators;
117 typedef std::map <std::pair<Mac48Address, uint8_t>, OriginatorRxStatus *, std::less<std::pair<Mac48Address,uint8_t> > > QosOriginators;
121 typedef std::map <Mac48Address, OriginatorRxStatus *, std::less<Mac48Address> >::iterator OriginatorsI;
125 typedef std::map <std::pair<Mac48Address, uint8_t>, OriginatorRxStatus *, std::less<std::pair<Mac48Address,uint8_t> > >::iterator QosOriginatorsI;
126
130};
131
132} //namespace ns3
133
134#endif /* MAC_RX_MIDDLE_H */
Callback template class.
Definition: callback.h:1279
This class handles duplicate detection and recomposition of fragments.
Definition: mac-rx-middle.h:42
std::map< std::pair< Mac48Address, uint8_t >, OriginatorRxStatus *, std::less< std::pair< Mac48Address, uint8_t > > >::iterator QosOriginatorsI
typedef for an iterator for QosOriginators
friend class MacRxMiddleTest
allow MacRxMiddleTest associated class access
Definition: mac-rx-middle.h:70
void SetForwardCallback(ForwardUpCallback callback)
Set a callback to forward the packet up.
Originators m_originatorStatus
originator status
Ptr< const Packet > HandleFragments(Ptr< const Packet > packet, const WifiMacHeader *hdr, OriginatorRxStatus *originator)
Check if the received packet is a fragment and handle it appropriately.
bool IsDuplicate(const WifiMacHeader *hdr, OriginatorRxStatus *originator) const
Check if we have already received the packet from the sender before (by looking at the sequence contr...
std::map< Mac48Address, OriginatorRxStatus *, std::less< Mac48Address > > Originators
typedef for a map between address and OriginatorRxStatus
void Receive(Ptr< WifiMacQueueItem > mpdu, uint8_t linkId)
Receive an MPDU on the given link.
std::map< std::pair< Mac48Address, uint8_t >, OriginatorRxStatus *, std::less< std::pair< Mac48Address, uint8_t > > > QosOriginators
typedef for a map between address, OriginatorRxStatus, and Traffic ID
std::map< Mac48Address, OriginatorRxStatus *, std::less< Mac48Address > >::iterator OriginatorsI
typedef for an iterator for Originators
QosOriginators m_qosOriginatorStatus
QOS originator status.
ForwardUpCallback m_callback
forward up callback
OriginatorRxStatus * Lookup(const WifiMacHeader *hdr)
Look up for OriginatorRxStatus associated with the sender address (by looking at ADDR2 field in the h...
Callback< void, Ptr< WifiMacQueueItem >, uint8_t > ForwardUpCallback
typedef for callback
Definition: mac-rx-middle.h:47
A class to keep track of the packet originator status.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
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.