A Discrete-Event Network Simulator
API
mesh-wifi-beacon.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 IITP RAS
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: Pavel Boyko <boyko@iitp.ru>
19  */
20 
21 #include "ns3/mesh-wifi-beacon.h"
22 
23 
24 namespace ns3 {
25 
27 {
28  m_header.SetSsid (ssid);
31 }
32 void
34 {
36 }
37 
38 Time
40 {
42 }
43 
46 {
47  Ptr<Packet> packet = Create <Packet> ();
48  packet->AddHeader (m_elements);
49  packet->AddHeader (BeaconHeader ());
50  return packet;
51 }
54 {
55  WifiMacHeader hdr;
56 
57  hdr.SetBeacon ();
59  hdr.SetAddr2 (address);
60  hdr.SetAddr3 (mpAddress);
61  hdr.SetDsNotFrom ();
62  hdr.SetDsNotTo ();
63 
64  return hdr;
65 }
66 } // namespace ns3
67 
void AddInformationElement(Ptr< WifiInformationElement > ie)
Add information element.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
uint64_t GetBeaconIntervalUs(void) const
Return the beacon interval in microseconds unit.
Definition: mgt-headers.cc:191
MeshInformationElementVector m_elements
List of information elements added.
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
bool AddInformationElement(Ptr< WifiInformationElement > element)
add an IE, if maxSize has exceeded, returns false
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
void SetBeacon(void)
Set Type/Subtype values for a beacon header.
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
static Mac48Address GetBroadcast(void)
WifiMacHeader CreateHeader(Mac48Address address, Mac48Address mpAddress)
Create Wifi header for beacon frame.
void SetSsid(Ssid ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:275
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetBeaconIntervalUs(uint64_t us)
Set the beacon interval in microseconds unit.
Definition: mgt-headers.cc:281
Ptr< Packet > CreatePacket()
Create frame = { beacon header + all information elements sorted by ElementId () }.
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
MgtBeaconHeader BeaconHeader() const
Read standard Wifi beacon header.
an EUI-48 address
Definition: mac48-address.h:43
tuple ssid
Definition: third.py:93
MeshWifiBeacon(Ssid ssid, SupportedRates rates, uint64_t us)
C-tor.
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:35
Time GetBeaconInterval() const
Returns the beacon interval of Wifi beacon.
MgtBeaconHeader m_header
Beacon header.
void SetSupportedRates(SupportedRates rates)
Set the supported rates.
Definition: mgt-headers.cc:287
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1009
tuple address
Definition: first.py:37
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
Implements the IEEE 802.11 MAC header.
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.