author | Kirill Andreev <andreev@iitp.ru> |
Tue, 21 Jul 2009 12:51:09 +0400 | |
changeset 5125 | b90c6c0af6a3 |
parent 5098 | 13ded9ff11c4 |
child 5126 | 8e06088a785d |
permissions | -rw-r--r-- |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
2 |
/* |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
3 |
* Copyright (c) 2008,2009 IITP RAS |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
4 |
* |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
8 |
* |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
13 |
* |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
17 |
* |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
18 |
* Authors: Kirill Andreev <andreev@iitp.ru> |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
19 |
* Aleksey Kovalenko <kovalenko@iitp.ru> |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
20 |
*/ |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
21 |
|
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
22 |
|
4858
78437693dcc7
Peer manager restructure - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
4857
diff
changeset
|
23 |
#ifndef DOT11S_PEER_MAN_H |
78437693dcc7
Peer manager restructure - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
4857
diff
changeset
|
24 |
#define DOT11S_PEER_MAN_H |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
25 |
|
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
26 |
#include "ns3/mac48-address.h" |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4882
diff
changeset
|
27 |
#include "ns3/net-device.h" |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
28 |
#include "ns3/event-id.h" |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4882
diff
changeset
|
29 |
#include "ns3/nstime.h" |
4882
3eab2f6b1adc
Moved hwmp to dot11s, removed unneded files, removed unneded headers from
Kirill Andreev <andreev@iitp.ru>
parents:
4881
diff
changeset
|
30 |
#include "ie-dot11s-beacon-timing.h" |
4899
50591b95753a
dot11s-codes.h removed. StatusCode enum is found to be unused and removed. ReadonCode enum is moved to dot11s/ie-dot11s-peer-management.h
Pavel Boyko <boyko@iitp.ru>
parents:
4898
diff
changeset
|
31 |
#include "ie-dot11s-peer-management.h" |
5020
79e8178d69eb
Mesh ID is made separately from SSID
Kirill Andreev <andreev@iitp.ru>
parents:
5017
diff
changeset
|
32 |
#include "ie-dot11s-id.h" |
5085
5cfc1e9372af
Fixed peer link status notification
Kirill Andreev <andreev@iitp.ru>
parents:
5075
diff
changeset
|
33 |
#include "peer-link.h" |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
34 |
|
4866
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
35 |
#include <map> |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
36 |
namespace ns3 { |
4888
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
37 |
class MeshPointDevice; |
4872 | 38 |
namespace dot11s { |
5086
fccfd0073ea3
Fixed names: now protocols are called *-protocol.[h,cc], plugin is called
Kirill Andreev <andreev@iitp.ru>
parents:
5085
diff
changeset
|
39 |
class PeerManagementProtocolMac; |
4865
e331ed5d3662
Added header for peer link frame (first fields without information element)
Kirill Andreev <andreev@iitp.ru>
parents:
4861
diff
changeset
|
40 |
class PeerLink; |
4887
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4882
diff
changeset
|
41 |
class IePeerManagement; |
cbf02c77d5c1
HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents:
4882
diff
changeset
|
42 |
class IeConfiguration; |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
43 |
/** |
4860
bb5194d57734
New peer management protocol moved to 802.11s/
Pavel Boyko <boyko@iitp.ru>
parents:
4858
diff
changeset
|
44 |
* \ingroup dot11s |
4881
cec7f8e2bbdf
Minor cosmetics. Peer management protocol is assumed to be implemented now.
Pavel Boyko <boyko@iitp.ru>
parents:
4879
diff
changeset
|
45 |
* |
cec7f8e2bbdf
Minor cosmetics. Peer management protocol is assumed to be implemented now.
Pavel Boyko <boyko@iitp.ru>
parents:
4879
diff
changeset
|
46 |
* \brief 802.11s Peer Management Protocol model |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
47 |
*/ |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4899
diff
changeset
|
48 |
class PeerManagementProtocol : public Object |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
49 |
{ |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
50 |
public: |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4899
diff
changeset
|
51 |
PeerManagementProtocol (); |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4899
diff
changeset
|
52 |
~PeerManagementProtocol (); |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
53 |
static TypeId GetTypeId (); |
5005
8038200dac53
Fixed removing peer links
Kirill Andreev <andreev@iitp.ru>
parents:
5003
diff
changeset
|
54 |
void DoDispose (); |
4898
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
55 |
/** |
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
56 |
* \brief Install PMP on given mesh point. |
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
57 |
* |
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
58 |
* Installing protocol cause installing its interface MAC plugins. |
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
59 |
* |
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
60 |
* Also MP aggregates all installed protocols, PMP protocol can be accessed |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4899
diff
changeset
|
61 |
* via MeshPointDevice::GetObject<PeerManagementProtocol>(); |
4898
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
62 |
*/ |
4888
dec245c213ab
Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents:
4887
diff
changeset
|
63 |
bool Install(Ptr<MeshPointDevice>); |
4898
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
64 |
/** |
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
65 |
* \brief Methods that handle beacon sending/receiving procedure. |
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
66 |
* |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
67 |
* This methods interact with MAC_layer plug-in |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
68 |
* \{ |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
69 |
*/ |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
70 |
/** |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
71 |
* \brief When we are sending a beacon - we fill beacon timing |
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
72 |
* element |
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
73 |
* \param IeBeaconTiming is a beacon timing element that |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
74 |
* should be present in beacon |
4861 | 75 |
* \param interface is a interface sending a beacon |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
76 |
*/ |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
77 |
Ptr<IeBeaconTiming> GetBeaconTimingElement(uint32_t interface); |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
78 |
/** |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
79 |
* \brief When we receive a beacon from peer-station, we remember |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
80 |
* its beacon timing element (needed for peer choosing mechanism), |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
81 |
* and remember beacon timers - last beacon and beacon interval to |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
82 |
* detect beacon loss and cancel links |
4861 | 83 |
* \param interface is a interface on which beacon was received |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
84 |
* \param timingElement is a timing element of remote beacon |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
85 |
*/ |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
86 |
void UpdatePeerBeaconTiming( |
4861 | 87 |
uint32_t interface, |
88 |
bool meshBeacon, |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
89 |
IeBeaconTiming timingElement, |
4861 | 90 |
Mac48Address peerAddress, |
91 |
Time receivingTime, |
|
92 |
Time beaconInterval |
|
93 |
); |
|
4898
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
94 |
//\} |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
95 |
/** |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
96 |
* \brief Methods that handle Peer link management frames |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
97 |
* interaction: |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
98 |
* \{ |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
99 |
*/ |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
100 |
/** |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
101 |
* Deliver Peer link management information to the protocol-part |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
102 |
* \param void is returning value - we pass a frame and forget |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
103 |
* about it |
4861 | 104 |
* \param uint32_t - is a interface ID of a given MAC (interfaceID rather |
105 |
* than MAC address, beacause many interfaces may have the same MAC) |
|
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
106 |
* \param Mac48Address is address of peer |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
107 |
* \param Mac48Address is address of peer mesh point device (equal |
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
108 |
* to peer address when only one interface) |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
109 |
* \param uint16_t is association ID, which peer has assigned to |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
110 |
* us |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
111 |
* \param IeConfiguration is mesh configuration element |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
112 |
* taken from the peer management frame |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
113 |
* \param IePeerManagement is peer link management element |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
114 |
*/ |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
115 |
void ReceivePeerLinkFrame( |
4861 | 116 |
uint32_t interface, |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
117 |
Mac48Address peerAddress, |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
118 |
Mac48Address peerMeshPointAddress, |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
119 |
uint16_t aid, |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
120 |
IePeerManagement peerManagementElement, |
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
121 |
IeConfiguration meshConfig |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
122 |
); |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
123 |
/** |
4867
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
124 |
* Cancell peer link due to broken configuration (SSID or Supported |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
125 |
* rates) |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
126 |
*/ |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
127 |
void ConfigurationMismatch (uint32_t interface, Mac48Address peerAddress); |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
128 |
/** |
4870
79f9c2b6dffc
Uncommented destructor and cleaner
Kirill Andreev <andreev@iitp.ru>
parents:
4867
diff
changeset
|
129 |
* Checks if there is established link |
79f9c2b6dffc
Uncommented destructor and cleaner
Kirill Andreev <andreev@iitp.ru>
parents:
4867
diff
changeset
|
130 |
*/ |
79f9c2b6dffc
Uncommented destructor and cleaner
Kirill Andreev <andreev@iitp.ru>
parents:
4867
diff
changeset
|
131 |
bool IsActiveLink (uint32_t interface, Mac48Address peerAddress); |
4898
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
132 |
//\} |
4877
f08902c42733
Added a method to find peer link, code cleanup
Kirill Andreev <andreev@iitp.ru>
parents:
4876
diff
changeset
|
133 |
///\brief Needed by external module to do MLME |
f08902c42733
Added a method to find peer link, code cleanup
Kirill Andreev <andreev@iitp.ru>
parents:
4876
diff
changeset
|
134 |
Ptr<PeerLink> FindPeerLink(uint32_t interface, Mac48Address peerAddress); |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
135 |
void SetPeerLinkStatusCallback (Callback<void, Mac48Address, Mac48Address, uint32_t, bool> cb); |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4899
diff
changeset
|
136 |
std::vector<Mac48Address> GetActiveLinks(uint32_t interface); |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
137 |
///\brief needed by plugins to set global source address |
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
138 |
Mac48Address GetAddress (); |
5017
a2a6accbc167
Restructured mesh configuration element
Kirill Andreev <andreev@iitp.ru>
parents:
5013
diff
changeset
|
139 |
///\Needed to fill mesh configuration |
a2a6accbc167
Restructured mesh configuration element
Kirill Andreev <andreev@iitp.ru>
parents:
5013
diff
changeset
|
140 |
uint8_t GetNumberOfLinks (); |
5049 | 141 |
void SetMeshId (std::string s); |
5020
79e8178d69eb
Mesh ID is made separately from SSID
Kirill Andreev <andreev@iitp.ru>
parents:
5017
diff
changeset
|
142 |
Ptr<IeMeshId> GetMeshId() const; |
5009
ac0ea6c1e012
Added statistics for PMP-MAC
Kirill Andreev <andreev@iitp.ru>
parents:
5005
diff
changeset
|
143 |
///\brief: Report statistics |
5012 | 144 |
void Report (std::ostream &) const; |
5013 | 145 |
void ResetStats (); |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
146 |
private: |
4898
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
147 |
/** \name Private structures |
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
148 |
* \{ |
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
149 |
*/ |
b079cb67fda2
For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents:
4888
diff
changeset
|
150 |
/// Keeps information about beacon of peer station: beacon interval, association ID, last time we have received a beacon |
4861 | 151 |
struct BeaconInfo |
152 |
{ |
|
153 |
uint16_t aid; //Assoc ID |
|
154 |
Time referenceTbtt; //When one of my station's beacons was put into a beacon queue; |
|
155 |
Time beaconInterval; //Beacon interval of my station; |
|
156 |
}; |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
157 |
/// We keep a vector of pointers to PeerLink class. This vector |
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
158 |
/// keeps all peer links at a given interface. |
4866
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
159 |
typedef std::vector<Ptr<PeerLink> > PeerLinksOnInterface; |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
160 |
/// This map keeps all peer links. |
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
161 |
///\param uint32_t is interface ID |
4866
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
162 |
typedef std::map<uint32_t, PeerLinksOnInterface> PeerLinksMap; |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
163 |
///\brief This map keeps relationship between peer address and its |
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
164 |
/// beacon information |
4866
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
165 |
typedef std::map<Mac48Address, BeaconInfo> BeaconsOnInterface; |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
166 |
///\brief This map keeps beacon information on all intefaces |
4866
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
167 |
typedef std::map<uint32_t, BeaconsOnInterface> BeaconInfoMap; |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4874
diff
changeset
|
168 |
///\brief this vector keeps pointers to MAC-plugins |
5087 | 169 |
typedef std::map<uint32_t, Ptr<PeerManagementProtocolMac> > PeerManagementProtocolMacMap; |
4874
f7ea3717e668
Code cleanups. Software delay is removed
Kirill Andreev <andreev@iitp.ru>
parents:
4873
diff
changeset
|
170 |
///\} |
4867
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
171 |
private: |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
172 |
/** |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
173 |
* Return a position in beacon-storage for a given remote station |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
174 |
*/ |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
175 |
void FillBeaconInfo(uint32_t interface, Mac48Address peerAddress, Time receivingTime, Time beaconInterval); |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
176 |
Ptr<PeerLink> InitiateLink ( |
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
177 |
uint32_t interface, |
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
178 |
Mac48Address peerAddress, |
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
179 |
Mac48Address peerMeshPointAddress, |
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
180 |
Time lastBeacon, |
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
181 |
Time beaconInterval |
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
182 |
); |
4867
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
183 |
/** |
4874
f7ea3717e668
Code cleanups. Software delay is removed
Kirill Andreev <andreev@iitp.ru>
parents:
4873
diff
changeset
|
184 |
* \name External peer-chooser |
4867
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
185 |
* \{ |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
186 |
*/ |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
187 |
bool ShouldSendOpen (uint32_t interface, Mac48Address peerAddress); |
4899
50591b95753a
dot11s-codes.h removed. StatusCode enum is found to be unused and removed. ReadonCode enum is moved to dot11s/ie-dot11s-peer-management.h
Pavel Boyko <boyko@iitp.ru>
parents:
4898
diff
changeset
|
188 |
bool ShouldAcceptOpen (uint32_t interface, Mac48Address peerAddress, PmpReasonCode & reasonCode); |
4867
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
189 |
/** |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
190 |
* \} |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
191 |
* \brief Indicates changes in peer links |
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
192 |
*/ |
5085
5cfc1e9372af
Fixed peer link status notification
Kirill Andreev <andreev@iitp.ru>
parents:
5075
diff
changeset
|
193 |
void PeerLinkStatus (uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddres, PeerLink::PeerState ostate, PeerLink::PeerState nstate); |
4879 | 194 |
///\brief BCA |
195 |
Time GetNextBeaconShift (uint32_t interface); |
|
5075 | 196 |
/** |
197 |
* \name Time<-->TU converters: |
|
198 |
* \{ |
|
199 |
*/ |
|
200 |
Time TuToTime (uint32_t x); |
|
201 |
uint32_t TimeToTu (Time x); |
|
202 |
///\} |
|
4867
3a02e4e89292
Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents:
4866
diff
changeset
|
203 |
private: |
5087 | 204 |
PeerManagementProtocolMacMap m_plugins; |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
205 |
Mac48Address m_address; |
5020
79e8178d69eb
Mesh ID is made separately from SSID
Kirill Andreev <andreev@iitp.ru>
parents:
5017
diff
changeset
|
206 |
Ptr<IeMeshId> m_meshId; |
4861 | 207 |
/** |
4874
f7ea3717e668
Code cleanups. Software delay is removed
Kirill Andreev <andreev@iitp.ru>
parents:
4873
diff
changeset
|
208 |
* \name Information related to beacons: |
4861 | 209 |
* \{ |
210 |
*/ |
|
211 |
BeaconInfoMap m_neighbourBeacons; |
|
4874
f7ea3717e668
Code cleanups. Software delay is removed
Kirill Andreev <andreev@iitp.ru>
parents:
4873
diff
changeset
|
212 |
///\} |
4861 | 213 |
uint16_t m_lastAssocId; |
214 |
uint16_t m_lastLocalLinkId; |
|
4866
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
215 |
uint8_t m_maxNumberOfPeerLinks; |
5125
b90c6c0af6a3
Added max beacon loss to PeerManagementProtocol (for beacon timing), cosmetic
Kirill Andreev <andreev@iitp.ru>
parents:
5098
diff
changeset
|
216 |
uint8_t m_maxBeaconLostForBeaconTiming; |
4866
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
217 |
/** |
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
218 |
* Peer Links |
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
219 |
* \{ |
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
220 |
*/ |
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
221 |
PeerLinksMap m_peerLinks; |
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
222 |
/** |
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
223 |
* \} |
564372fc5491
First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents:
4865
diff
changeset
|
224 |
*/ |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4899
diff
changeset
|
225 |
///\brief Callback to notify about peer link changes: |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
226 |
///\param Mac48Address is peer address of mesh point |
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
227 |
///\param Mac48Address is peer address of interface |
4919
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4899
diff
changeset
|
228 |
///\param uint32_t - interface ID |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4899
diff
changeset
|
229 |
///\param bool is staus - true when new link has appeared, false - |
b8a0476c7e06
Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents:
4899
diff
changeset
|
230 |
//when link was closed |
4933
72f0481cfb2d
Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents:
4919
diff
changeset
|
231 |
Callback <void, Mac48Address, Mac48Address, uint32_t, bool> m_peerStatusCallback; |
5013 | 232 |
///\} |
233 |
//Keeps statistics |
|
234 |
struct Statistics { |
|
5098
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5087
diff
changeset
|
235 |
uint16_t linksTotal; |
5013 | 236 |
uint16_t linksOpened; |
237 |
uint16_t linksClosed; |
|
238 |
||
5098
13ded9ff11c4
XML reports simplified for better parsing
Pavel Boyko <boyko@iitp.ru>
parents:
5087
diff
changeset
|
239 |
Statistics (uint16_t t = 0) : linksTotal(t), linksOpened (0), linksClosed (0) {}; |
5013 | 240 |
void Print (std::ostream & os) const; |
241 |
}; |
|
242 |
struct Statistics m_stats; |
|
243 |
||
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
244 |
}; |
4872 | 245 |
|
246 |
} // namespace dot11s |
|
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
247 |
} //namespace ns3 |
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
248 |
#endif |