satellite-gw-llc.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: Jani Puttonen <jani.puttonen@magister.fi>
19  */
20 
21 #ifndef SATELLITE_GW_LLC_H_
22 #define SATELLITE_GW_LLC_H_
23 
24 #include "satellite-llc.h"
25 
26 #include <ns3/ptr.h>
27 
28 #include <stdint.h>
29 #include <vector>
30 
31 namespace ns3
32 {
33 
40 class SatGwLlc : public SatLlc
41 {
42  public:
47  static TypeId GetTypeId(void);
48 
52  SatGwLlc();
53 
59  virtual ~SatGwLlc();
60 
69  virtual bool Enque(Ptr<Packet> packet, Address dest, uint8_t flowId);
70 
82  virtual Ptr<Packet> NotifyTxOpportunity(uint32_t bytes,
83  Mac48Address utAddr,
84  uint8_t flowId,
85  uint32_t& bytesLeft,
86  uint32_t& nextMinTxO);
87 
94  virtual void GetSchedulingContexts(std::vector<Ptr<SatSchedulingObject>>& output) const;
95 
104  virtual uint32_t GetNBytesInQueue(Mac48Address utAddress) const;
105 
114  virtual uint32_t GetNPacketsInQueue(Mac48Address utAddress) const;
115 
119  virtual void ClearQueues();
120 
121  protected:
125  void DoDispose();
126 
131  virtual void CreateEncap(Ptr<EncapKey> key);
132 
137  virtual void CreateDecap(Ptr<EncapKey> key);
138 
144 
150 };
151 
152 } // namespace ns3
153 
154 #endif /* SATELLITE_GW_LLC_H_ */
SatLinkDir_t
Link direction used for packet tracing.
SatGwLlc holds the GW implementation of LLC layer.
virtual void CreateDecap(Ptr< EncapKey > key)
Virtual method to create a new decapsulator 'on-a-need-basis' dynamically.
SatGwLlc()
Construct a SatGwLlc.
virtual Ptr< Packet > NotifyTxOpportunity(uint32_t bytes, Mac48Address utAddr, uint8_t flowId, uint32_t &bytesLeft, uint32_t &nextMinTxO)
Called from lower layer (MAC) to inform a tx opportunity of certain amount of bytes.
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()
Get the link RX direction.
virtual ~SatGwLlc()
Destroy a SatGwLlc.
virtual bool Enque(Ptr< Packet > packet, Address dest, uint8_t flowId)
Called from higher layer (SatNetDevice) to enque packet to LLC.
virtual void GetSchedulingContexts(std::vector< Ptr< SatSchedulingObject >> &output) const
Create and fill the scheduling objects based on LLC layer information.
static TypeId GetTypeId(void)
Get the type ID.
virtual void ClearQueues()
Remove all packets from the queues.
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()
Get the link TX direction.
virtual void CreateEncap(Ptr< EncapKey > key)
Virtual method to create a new encapsulator 'on-a-need-basis' dynamically.
void DoDispose()
Dispose of this class instance.
SatLlc base class holds the UT specific SatBaseEncapsulator instances, which are responsible of fragm...
virtual uint32_t GetNBytesInQueue() const
Get the total number of (new) bytes in all encapsulators.
virtual uint32_t GetNPacketsInQueue() const
Get the total number of (new) packets in all encapsulators.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.