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 #include <ostream>
29 #include <stdint.h>
30 
31 namespace ns3
32 {
33 
39 class SatMacTag : public Tag
40 {
41  public:
45  SatMacTag();
46 
50  ~SatMacTag();
51 
56  void SetDestAddress(Mac48Address dest);
57 
62  Mac48Address GetDestAddress(void) const;
63 
68  void SetSourceAddress(Mac48Address source);
69 
74  Mac48Address GetSourceAddress(void) const;
75 
80  static TypeId GetTypeId(void);
81 
86  virtual TypeId GetInstanceTypeId(void) const;
87 
92  virtual uint32_t GetSerializedSize(void) const;
93 
98  virtual void Serialize(TagBuffer i) const;
99 
104  virtual void Deserialize(TagBuffer i);
105 
110  virtual void Print(std::ostream& os) const;
111 
112  private:
113  static const uint32_t ADDRESS_LENGHT = 6;
114 
115  Mac48Address m_destAddress;
116  Mac48Address m_sourceAddress;
117 };
118 
125 class SatAddressE2ETag : public Tag
126 {
127  public:
128  static const uint32_t SIZE = 12;
129 
134 
139 
144  void SetE2EDestAddress(Mac48Address e2eDestAddress);
145 
150  Mac48Address GetE2EDestAddress(void) const;
151 
156  void SetE2ESourceAddress(Mac48Address e2eSourceAddress);
157 
162  Mac48Address GetE2ESourceAddress(void) const;
163 
168  static TypeId GetTypeId(void);
169 
174  virtual TypeId GetInstanceTypeId(void) const;
175 
180  virtual uint32_t GetSerializedSize(void) const;
181 
186  virtual void Serialize(TagBuffer i) const;
187 
192  virtual void Deserialize(TagBuffer i);
193 
198  virtual void Print(std::ostream& os) const;
199 
200  private:
201  static const uint32_t ADDRESS_LENGHT = 6;
202 
203  Mac48Address m_e2eDestAddress;
204  Mac48Address m_e2eSourceAddress;
205 };
206 
212 class SatFlowIdTag : public Tag
213 {
214  public:
218  SatFlowIdTag();
219 
223  ~SatFlowIdTag();
224 
229  void SetFlowId(uint8_t flowId);
230 
235  uint8_t GetFlowId() const;
236 
241  static TypeId GetTypeId(void);
242 
247  virtual TypeId GetInstanceTypeId(void) const;
248 
253  virtual uint32_t GetSerializedSize(void) const;
254 
259  virtual void Serialize(TagBuffer i) const;
260 
265  virtual void Deserialize(TagBuffer i);
266 
271  virtual void Print(std::ostream& os) const;
272 
273  private:
274  uint8_t m_flowId;
275 };
276 
277 } // namespace ns3
278 
279 #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.