author | Kirill Andreev <andreev@iitp.ru> |
Tue, 25 Aug 2009 14:37:10 +0400 | |
changeset 5161 | 1c685e8be8d1 |
parent 5140 | 64084ae6cff1 |
child 5423 | 79ff6ad1adbb |
permissions | -rw-r--r-- |
4822 | 1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
5140
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
2 |
/* |
4822 | 3 |
* Copyright (c) 2009 IITP RAS |
5140
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
4 |
* |
4822 | 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 |
|
5140
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
17 |
* |
4822 | 18 |
* Author: Pavel Boyko <boyko@iitp.ru> |
19 |
*/ |
|
20 |
||
21 |
#ifndef MESHWIFIBEACON_H_ |
|
22 |
#define MESHWIFIBEACON_H_ |
|
23 |
||
24 |
#include "ns3/object.h" |
|
25 |
#include "ns3/packet.h" |
|
26 |
#include "ns3/mgt-headers.h" // from wifi module |
|
4843
f65f22ef327e
MeshWifiInterfaceMac just added and beacon generation refactored
Pavel Boyko <boyko@iitp.ru>
parents:
4842
diff
changeset
|
27 |
#include "ns3/wifi-mac-header.h" |
5140
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
28 |
#include "ns3/wifi-information-element-vector.h" |
4822 | 29 |
|
30 |
#include <vector> |
|
31 |
||
32 |
namespace ns3 { |
|
33 |
||
34 |
/** |
|
35 |
* \brief Beacon is beacon header + list of arbitrary information elements |
|
5140
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
36 |
* |
4822 | 37 |
* It is supposed that distinct mesh protocols can use beacons to transport |
38 |
* their own information elements. |
|
39 |
*/ |
|
40 |
class MeshWifiBeacon |
|
41 |
{ |
|
42 |
public: |
|
5140
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
43 |
/** |
4822 | 44 |
* C-tor |
5140
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
45 |
* |
4822 | 46 |
* \param ssid is SSID for beacon header |
47 |
* \param rates is a set of supported rates |
|
48 |
* \param us beacon interval in microseconds |
|
49 |
*/ |
|
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4843
diff
changeset
|
50 |
MeshWifiBeacon (Ssid ssid, SupportedRates rates, uint64_t us); |
4822 | 51 |
/// Read standard Wifi beacon header |
4843
f65f22ef327e
MeshWifiInterfaceMac just added and beacon generation refactored
Pavel Boyko <boyko@iitp.ru>
parents:
4842
diff
changeset
|
52 |
MgtBeaconHeader BeaconHeader () const { return m_header; } |
4822 | 53 |
/// Add information element |
4842
605a2680b56b
Use reference counting for WifiInformationElement
Pavel Boyko <boyko@iitp.ru>
parents:
4822
diff
changeset
|
54 |
void AddInformationElement (Ptr<WifiInformationElement> ie); |
5140
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
55 |
|
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
56 |
/** |
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
57 |
* Create wifi header for beacon frame. |
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
58 |
* |
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
59 |
* \param address is sender address |
5063 | 60 |
* \param mpAddress is mesh point address |
61 |
*/ |
|
4985
8dbdba66f5e1
Mehs point MAC address is now known to all interfaces and included into beacons as Address3
Pavel Boyko <boyko@iitp.ru>
parents:
4852
diff
changeset
|
62 |
WifiMacHeader CreateHeader (Mac48Address address, Mac48Address mpAddress); |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4843
diff
changeset
|
63 |
/// Create frame = { beacon header + all information elements sorted by ElementId () } |
4843
f65f22ef327e
MeshWifiInterfaceMac just added and beacon generation refactored
Pavel Boyko <boyko@iitp.ru>
parents:
4842
diff
changeset
|
64 |
Ptr<Packet> CreatePacket (); |
5140
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
65 |
|
4822 | 66 |
private: |
67 |
/// Beacon header |
|
68 |
MgtBeaconHeader m_header; |
|
5140
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
69 |
/// List of information elements added |
64084ae6cff1
Removed FindFirst from WifiInformationElement
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
70 |
WifiInformationElementVector m_elements; |
4822 | 71 |
}; |
72 |
||
73 |
} |
|
74 |
||
75 |
||
76 |
#endif /* MESHWIFIBEACON_H_ */ |