satellite-mac-tag.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: Sami Rantanen <sami.rantanen@magister.fi>
19  * Bastien Tauran <bastien.tauran@viveris.fr>
20  */
21 
22 #ifndef SATELLITE_MAC_TAG_H
23 #define SATELLITE_MAC_TAG_H
24 
25 #include <ns3/mac48-address.h>
26 #include <ns3/tag.h>
27 
28 namespace ns3
29 {
30 
36 class SatMacTag : public Tag
37 {
38  public:
42  SatMacTag();
43 
47  ~SatMacTag();
48 
53  void SetDestAddress(Mac48Address dest);
54 
59  Mac48Address GetDestAddress(void) const;
60 
65  void SetSourceAddress(Mac48Address source);
66 
71  Mac48Address GetSourceAddress(void) const;
72 
77  static TypeId GetTypeId(void);
78 
83  virtual TypeId GetInstanceTypeId(void) const;
84 
89  virtual uint32_t GetSerializedSize(void) const;
90 
95  virtual void Serialize(TagBuffer i) const;
96 
101  virtual void Deserialize(TagBuffer i);
102 
107  virtual void Print(std::ostream& os) const;
108 
109  private:
110  static const uint32_t ADDRESS_LENGHT = 6;
111 
112  Mac48Address m_destAddress;
113  Mac48Address m_sourceAddress;
114 };
115 
122 class SatAddressE2ETag : public Tag
123 {
124  public:
125  static const uint32_t SIZE = 12;
126 
131 
136 
141  void SetE2EDestAddress(Mac48Address e2eDestAddress);
142 
147  Mac48Address GetE2EDestAddress(void) const;
148 
153  void SetE2ESourceAddress(Mac48Address e2eSourceAddress);
154 
159  Mac48Address GetE2ESourceAddress(void) const;
160 
165  static TypeId GetTypeId(void);
166 
171  virtual TypeId GetInstanceTypeId(void) const;
172 
177  virtual uint32_t GetSerializedSize(void) const;
178 
183  virtual void Serialize(TagBuffer i) const;
184 
189  virtual void Deserialize(TagBuffer i);
190 
195  virtual void Print(std::ostream& os) const;
196 
197  private:
198  static const uint32_t ADDRESS_LENGHT = 6;
199 
200  Mac48Address m_e2eDestAddress;
201  Mac48Address m_e2eSourceAddress;
202 };
203 
209 class SatFlowIdTag : public Tag
210 {
211  public:
215  SatFlowIdTag();
216 
220  ~SatFlowIdTag();
221 
226  void SetFlowId(uint8_t flowId);
227 
232  uint8_t GetFlowId() const;
233 
238  static TypeId GetTypeId(void);
239 
244  virtual TypeId GetInstanceTypeId(void) const;
245 
250  virtual uint32_t GetSerializedSize(void) const;
251 
256  virtual void Serialize(TagBuffer i) const;
257 
262  virtual void Deserialize(TagBuffer i);
263 
268  virtual void Print(std::ostream& os) const;
269 
270  private:
271  uint8_t m_flowId;
272 };
273 
274 } // namespace ns3
275 
276 #endif /* SATELLITE_MAC_TAG_H */
This class implements a tag that carries the satellite MAC of GW and UT.
static const uint32_t ADDRESS_LENGHT
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatMacTag.
static const uint32_t SIZE
~SatAddressE2ETag()
Destructor for SatMacTag.
void SetE2ESourceAddress(Mac48Address e2eSourceAddress)
Set E2E source MAC address.
virtual uint32_t GetSerializedSize(void) const
Get serialized size of SatMacTag.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatMacTag.
SatAddressE2ETag()
Default constructor.
static TypeId GetTypeId(void)
Get the type ID.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
Mac48Address GetE2ESourceAddress(void) const
Get E2E source MAC address.
void SetE2EDestAddress(Mac48Address e2eDestAddress)
Set E2E destination MAC address.
Mac48Address GetE2EDestAddress(void) const
Get E2E destination MAC address.
Mac48Address m_e2eSourceAddress
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatMacTag.
SatFlowIdTag implements a tag which carries the flow identifier of a packet.
void SetFlowId(uint8_t flowId)
Set flow id.
virtual uint32_t GetSerializedSize(void) const
Get serialized size of SatFlowIdTag.
SatFlowIdTag()
Default constructor.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatFlowIdTag.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
uint8_t GetFlowId() const
Get flow identifier.
static TypeId GetTypeId(void)
Get the type ID.
~SatFlowIdTag()
Destructor for SatFlowIdTag.
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatFlowIdTag.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatFlowIdTag.
This class implements a tag that carries the satellite MAC specific information, such as source and d...
SatMacTag()
Default constructor.
static const uint32_t ADDRESS_LENGHT
static TypeId GetTypeId(void)
Get the type ID.
Mac48Address m_sourceAddress
virtual uint32_t GetSerializedSize(void) const
Get serialized size of SatMacTag.
~SatMacTag()
Destructor for SatMacTag.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatMacTag.
void SetDestAddress(Mac48Address dest)
Set destination MAC address.
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatMacTag.
Mac48Address m_destAddress
Mac48Address GetSourceAddress(void) const
Get source MAC address.
Mac48Address GetDestAddress(void) const
Get destination MAC address.
void SetSourceAddress(Mac48Address source)
Set source MAC address.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatMacTag.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.