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
30namespace ns3 {
31
32
33
40{
41
42public:
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;
63 void SetGtsFields (GtsFields gtsFields);
68 void SetPndAddrFields (PendingAddrFields pndAddrFields);
78 GtsFields GetGtsFields (void) const;
84
85private:
98
99};
100
101
108{
109
110public:
116 {
120 DATA_REQ = 0x04,
123 BEACON_REQ = 0x07,
125 GTS_REQ = 0x09,
126 CMD_RESERVED = 0xff
127 };
133 {
134 SUCCESSFUL = 0x00,
136 ACCESS_DENIED = 0x02
137 };
138
144 CommandPayloadHeader (enum MacCommand macCmd);
149 static TypeId GetTypeId (void);
150 TypeId GetInstanceTypeId (void) const;
151 uint32_t GetSerializedSize (void) const;
152 virtual void Serialize (Buffer::Iterator start) const;
154 void Print (std::ostream &os) const;
155
160 void SetCommandFrameType (MacCommand macCmd);
170 void SetShortAddr (Mac16Address shortAddr);
175 void SetAssociationStatus (AssocStatus status);
180 Mac16Address GetShortAddr (void) const;
190 MacCommand GetCommandFrameType (void) const;
196
197private:
198
203
204};
205
206} // namespace ns3
207
208#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.
uint32_t Deserialize(Buffer::Iterator start)
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
Represent the Capability Information Field.
Implements the header for the MAC payload command frame according to the IEEE 802....
AssocStatus
Association Status Field values.
@ SUCCESSFUL
Association successful.
void SetCapabilityField(CapabilityField cap)
Set the Capability Information Field to the command payload header (Association Request Command).
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
CapabilityField m_capabilityInfo
Capability Information Field (Association Request Command)
MacCommand m_cmdFrameId
The command Frame Identifier.
void SetAssociationStatus(AssocStatus status)
Set status resulting from the association attempt (Association Response Command).
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.
uint32_t Deserialize(Buffer::Iterator start)
void Print(std::ostream &os) const
Mac16Address m_shortAddr
Contains the short address assigned by the coordinator (Association Response Command) See IEEE 802....
AssocStatus m_assocStatus
Association Status (Association Response Command)
MacCommand GetCommandFrameType(void) const
Get the command frame type ID.
static TypeId GetTypeId(void)
Get the type ID.
void SetShortAddr(Mac16Address shortAddr)
Set the Short Address Assigned by the coordinator (Association Response Command).
CapabilityField GetCapabilityField(void) const
Get the Capability Information Field from the command payload header.
AssocStatus GetAssociationStatus(void) const
Get the status resulting from an association request (Association Response Command).
Mac16Address GetShortAddr(void) const
Get the Short address assigned by the coordinator (Association Response Command).
Represent the GTS information fields.
Protocol header serialization and deserialization.
Definition: header.h:43
This class can contain 16 bit addresses.
Definition: mac16-address.h:42
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:1852