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 */
Implements the header for the MAC payload beacon frame according to the IEEE 802.15....
virtual void Serialize(Buffer::Iterator start) const
static TypeId GetTypeId(void)
Get the type ID.
GtsFields m_gtsFields
GTS Fields.
PendingAddrFields m_pndAddrFields
Pending Address Fields.
GtsFields GetGtsFields(void) const
Get the Guaranteed Time Slots (GTS) fields from the beacon payload header.
SuperframeField m_superframeField
Superframe Specification Field.
SuperframeField GetSuperframeSpecField(void) const
Get the superframe specification field from the beacon payload header.
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
void Print(std::ostream &os) const
void SetSuperframeSpecField(SuperframeField sfrmField)
Set the superframe specification field to the beacon payload header.
void SetGtsFields(GtsFields gtsFields)
Set the superframe Guaranteed Time Slot (GTS) fields to the beacon payload header.
PendingAddrFields GetPndAddrFields(void) const
Get the pending address fields from the beacon payload header.
void SetPndAddrFields(PendingAddrFields pndAddrFields)
Set the superframe Pending Address fields to the beacon payload header.
uint32_t GetSerializedSize(void) const
iterator in a Buffer instance
Definition: buffer.h:99
Implements the header for the MAC payload command frame according to the IEEE 802....
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint8_t m_cmdFrameId
The command Frame Identifier.
uint32_t GetSerializedSize(void) const
virtual void Serialize(Buffer::Iterator start) const
MacCommand
The MAC command frames.
@ ASSOCIATION_RESP
Association response (RFD true: Rx)
@ BEACON_REQ
Beacon Request (RFD true: none )
@ DATA_REQ
Data Request (RFD true: Tx)
@ ORPHAN_NOTIF
Orphan Notification (RFD true: Tx)
@ ASSOCIATION_REQ
Association request (RFD true: Tx)
@ DISASSOCIATION_NOTIF
Disassociation notification (RFD true: TX, Rx)
@ COOR_REALIGN
Coordinator Realignment (RFD true: Rx)
@ PANID_CONFLICT
Pan ID conflict notification (RFD true: Tx)
@ GTS_REQ
GTS Request (RFD true: none)
void SetCommandFrameType(MacCommand macCmd)
Set the command frame type.
void Print(std::ostream &os) const
MacCommand GetCommandFrameType(void) const
Get the command frame type.
static TypeId GetTypeId(void)
Get the type ID.
Represent the GTS information fields.
Protocol header serialization and deserialization.
Definition: header.h:43
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
Represent the Pending Address Specification field.
Represent the Superframe Specification information field.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
def start()
Definition: core.py:1853