A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ofdm-downlink-frame-prefix.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007,2008 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: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19  */
20 
21 #ifndef DL_FRAME_PREFIX_IE_H
22 #define DL_FRAME_PREFIX_IE_H
23 
24 #include <stdint.h>
25 #include "ns3/header.h"
26 
27 namespace ns3 {
28 
35 {
36 public:
37  DlFramePrefixIe ();
38  ~DlFramePrefixIe ();
39 
40  void SetRateId (uint8_t rateId);
41  void SetDiuc (uint8_t diuc);
42  void SetPreamblePresent (uint8_t preamblePresent);
43  void SetLength (uint16_t length);
44  void SetStartTime (uint16_t startTime);
45 
46  uint8_t GetRateId (void) const;
47  uint8_t GetDiuc (void) const;
48  uint8_t GetPreamblePresent (void) const;
49  uint16_t GetLength (void) const;
50  uint16_t GetStartTime (void) const;
51 
52  uint16_t GetSize (void) const;
53 
54  Buffer::Iterator Write (Buffer::Iterator start) const;
56 private:
57  uint8_t m_rateId;
58  uint8_t m_diuc;
59  uint8_t m_preamblePresent;
60  uint16_t m_length;
61  uint16_t m_startTime;
62 
63  // shall actually contain m_startTime if DIUC is 0. see Table 225, page 452
64 
65 };
66 
67 } // namespace ns3
68 
69 #endif /* DL_FRAME_PREFIX_IE_H */
70 
71 #ifndef OFDM_DOWNLINK_FRAME_PREFIX_H
72 #define OFDM_DOWNLINK_FRAME_PREFIX_H
73 
74 #include <stdint.h>
75 #include "ns3/header.h"
76 #include "ns3/mac48-address.h"
77 
78 namespace ns3 {
79 
81 {
82 public:
85 
86  void SetBaseStationId (Mac48Address baseStationId);
87  void SetFrameNumber (uint32_t frameNumber);
88  void SetConfigurationChangeCount (uint8_t configurationChangeCount);
89  void AddDlFramePrefixElement (DlFramePrefixIe dlFramePrefixElement);
90  void SetHcs (uint8_t hcs);
91 
92  Mac48Address GetBaseStationId (void) const;
93  uint32_t GetFrameNumber (void) const;
94  uint8_t GetConfigurationChangeCount (void) const;
95  std::vector<DlFramePrefixIe> GetDlFramePrefixElements (void) const;
96  uint8_t GetHcs (void) const;
97 
98  std::string GetName (void) const;
99  void Print (std::ostream &os) const;
100  uint32_t GetSerializedSize (void) const;
101  void Serialize (Buffer::Iterator start) const;
102  uint32_t Deserialize (Buffer::Iterator start);
103 private:
104  Mac48Address m_baseStationId;
105  uint32_t m_frameNumber; // shall actually be only 4 LSB of the same field in OFDM DCD Channel Encodings
106  uint8_t m_configurationChangeCount; // shall actually be only 4 LSB of the same field in DCD
107  std::vector<DlFramePrefixIe> m_dlFramePrefixElements; // vector of dl frame prefix elements
108  uint8_t m_hcs; // Header Check Sequence
109 };
110 
111 } // namespace ns3
112 
113 #endif /* OFDM_DOWNLINK_FRAME_PREFIX_H */
Protocol header serialization and deserialization.
Definition: header.h:42
iterator in a Buffer instance
Definition: buffer.h:98
This class implements the DL Frame Prefix IE as described by IEEE-802.16 standard.
an EUI-48 address
Definition: mac48-address.h:41