satellite-orbiter-user-mac.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions Ltd.
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: Bastien Tauran <bastien.tauran@viveris.fr>
19  */
20 
21 #ifndef SATELLITE_ORBITER_USER_MAC_H
22 #define SATELLITE_ORBITER_USER_MAC_H
23 
25 #include "satellite-mac.h"
26 #include "satellite-orbiter-mac.h"
28 #include "satellite-phy.h"
30 
31 #include <ns3/address.h>
32 #include <ns3/nstime.h>
33 #include <ns3/object.h>
34 #include <ns3/packet.h>
35 #include <ns3/ptr.h>
36 
37 #include <set>
38 #include <stdint.h>
39 
40 namespace ns3
41 {
42 
50 {
51  public:
55  SatOrbiterUserMac(void);
56 
65  SatOrbiterUserMac(uint32_t satId, uint32_t beamId);
66 
70  virtual ~SatOrbiterUserMac();
71 
75  static TypeId GetTypeId(void);
76  TypeId GetInstanceTypeId(void) const;
77  virtual void DoInitialize(void);
78 
82  virtual void DoDispose(void);
83 
88  virtual void EnquePacket(Ptr<Packet> packet);
89 
96  void Receive(SatPhy::PacketContainer_t packets, Ptr<SatSignalParameters> txParams);
97 
98  void ReceiveSignalingPacket(Ptr<Packet> packet);
99 
106  virtual bool AddPeer(Mac48Address address);
107 
114  virtual bool RemovePeer(Mac48Address address);
115 
116  private:
122 
128 
135  virtual Address GetRxUtAddress(Ptr<Packet> packet);
136 
142  virtual bool HasPeer();
143 
147  std::set<Mac48Address> m_peers;
148 };
149 
150 } // namespace ns3
151 
152 #endif /* SATELLITE_ORBITER_USER_MAC_H */
SatLinkDir_t
Link direction used for packet tracing.
The SatOrbiterMac models the global link MAC layer of the satellite node.
The SatOrbiterUserMac models the user link MAC layer of the satellite node.
virtual void EnquePacket(Ptr< Packet > packet)
Add new packet to the LLC queue.
virtual ~SatOrbiterUserMac()
Destructor for SatOrbiterUserMac.
virtual bool RemovePeer(Mac48Address address)
Remove a remote peer from this MAC.
virtual bool AddPeer(Mac48Address address)
Add a remote peer to this MAC.
std::set< Mac48Address > m_peers
List of UT MAC connected to this MAC.
void Receive(SatPhy::PacketContainer_t packets, Ptr< SatSignalParameters > txParams)
Receive packet from lower layer.
virtual void DoDispose(void)
Dispose of this class instance.
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()
Get the link RX direction.
SatOrbiterUserMac(void)
Default constructor.
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()
Get the link TX direction.
static TypeId GetTypeId(void)
inherited from Object
void ReceiveSignalingPacket(Ptr< Packet > packet)
virtual Address GetRxUtAddress(Ptr< Packet > packet)
Get the UT address associated to this RX packet.
virtual bool HasPeer()
Indicates if at least one device is connected in this beam.
SatSignalParameters::PacketsInBurst_t PacketContainer_t
Define PacketContainer in SatPhy.
Definition: satellite-phy.h:79
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.