A Discrete-Event Network Simulator
API
lr-wpan-mac-pl-headers.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2019 Ritsumeikan University, Shiga, Japan.
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: Alberto Gallegos Ramonet <ramonet@fc.ritsumei.ac.jp>
19  */
20 
21 #ifndef LR_WPAN_MAC_PL_HEADERS_H
22 #define LR_WPAN_MAC_PL_HEADERS_H
23 
24 #include <ns3/header.h>
25 #include <ns3/mac16-address.h>
26 #include <ns3/mac64-address.h>
27 #include "lr-wpan-fields.h"
28 
29 
30 namespace ns3 {
31 
32 
33 
40 {
41 
42 public:
48  static TypeId GetTypeId (void);
49  TypeId GetInstanceTypeId (void) const;
50  uint32_t GetSerializedSize (void) const;
51  virtual void Serialize (Buffer::Iterator start) const;
53  void Print (std::ostream &os) const;
58  void SetSuperframeSpecField (SuperframeField sfrmField);
63  void SetGtsFields (GtsFields gtsFields);
68  void SetPndAddrFields (PendingAddrFields pndAddrFields);
78  GtsFields GetGtsFields (void) const;
84 
85 private:
98 
99 };
100 
101 
108 {
109 
110 public:
116  {
120  DATA_REQ = 0x04,
121  PANID_CONFLICT = 0x05,
122  ORPHAN_NOTIF = 0x06,
123  BEACON_REQ = 0x07,
124  COOR_REALIGN = 0x08,
125  GTS_REQ = 0x09,
126  CMD_RESERVED = 0xff
127  };
128 
129 
130  CommandPayloadHeader (void);
135  CommandPayloadHeader (enum MacCommand macCmd);
140  static TypeId GetTypeId (void);
141  TypeId GetInstanceTypeId (void) const;
142  uint32_t GetSerializedSize (void) const;
143  virtual void Serialize (Buffer::Iterator start) const;
145  void Print (std::ostream &os) const;
146 
151  void SetCommandFrameType (MacCommand macCmd);
156  MacCommand GetCommandFrameType (void) const;
157 
158 
159 private:
161  uint8_t m_cmdFrameId;
162 
163 };
164 
165 } // namespace ns3
166 
167 #endif /* LR_WPAN_MAC_PL_HEADERS_H */
Protocol header serialization and deserialization.
Definition: header.h:42
void SetCommandFrameType(MacCommand macCmd)
Set the command frame type.
SuperframeField m_superframeField
Superframe Specification Field.
Association response (RFD true: Rx)
Association request (RFD true: Tx)
virtual void Serialize(Buffer::Iterator start) const
PendingAddrFields GetPndAddrFields(void) const
Get the pending address fields from the beacon payload header.
Coordinator Realignment (RFD true: Rx)
def start()
Definition: core.py:1855
PendingAddrFields m_pndAddrFields
Pending Address Fields.
uint8_t m_cmdFrameId
The command Frame Identifier.
static TypeId GetTypeId(void)
Get the type ID.
MacCommand
The MAC command frames.
static TypeId GetTypeId(void)
Get the type ID.
iterator in a Buffer instance
Definition: buffer.h:98
uint32_t GetSerializedSize(void) const
void SetSuperframeSpecField(SuperframeField sfrmField)
Set the superframe specification field to the beacon payload header.
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Beacon Request (RFD true: none )
virtual void Serialize(Buffer::Iterator start) const
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
void Print(std::ostream &os) const
Pan ID conflict notification (RFD true: Tx)
SuperframeField GetSuperframeSpecField(void) const
Get the superframe specification field from the beacon payload header.
Implements the header for the MAC payload beacon frame according to the IEEE 802.15.4-2011 Std.
uint32_t Deserialize(Buffer::Iterator start)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t Deserialize(Buffer::Iterator start)
Represent the Superframe Specification information field.
GtsFields m_gtsFields
GTS Fields.
uint32_t GetSerializedSize(void) const
void Print(std::ostream &os) const
void SetGtsFields(GtsFields gtsFields)
Set the superframe Guaranteed Time Slot (GTS) fields to the beacon payload header.
Implements the header for the MAC payload command frame according to the IEEE 802.15.4-2011 Std.
MacCommand GetCommandFrameType(void) const
Get the command frame type.
void SetPndAddrFields(PendingAddrFields pndAddrFields)
Set the superframe Pending Address fields to the beacon payload header.
Represent the Pending Address Specification field.
Represent the GTS information fields.
Orphan Notification (RFD true: Tx)
a unique identifier for an interface.
Definition: type-id.h:58
GtsFields GetGtsFields(void) const
Get the Guaranteed Time Slots (GTS) fields from the beacon payload header.
Disassociation notification (RFD true: TX, Rx)