A Discrete-Event Network Simulator
API
peer-link.h
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 * Authors: Kirill Andreev <andreev@iitp.ru>
19 * Aleksey Kovalenko <kovalenko@iitp.ru>
20 */
21
22#ifndef PEER_LINK_H
23#define PEER_LINK_H
24
25#include "ns3/nstime.h"
26#include "ns3/object.h"
27#include "ns3/callback.h"
28#include "ns3/mac48-address.h"
29#include "ns3/event-id.h"
30#include "ns3/ie-dot11s-beacon-timing.h"
31#include "ns3/ie-dot11s-peer-management.h"
32#include "ns3/ie-dot11s-configuration.h"
33
34namespace ns3 {
35namespace dot11s {
36
37class PeerManagementProtocolMac;
43class PeerLink : public Object
44{
45public:
52 static TypeId GetTypeId ();
54 PeerLink ();
55 ~PeerLink ();
56
57 // Delete copy constructor and assignment operator to avoid misuse
58 PeerLink (const PeerLink &) = delete;
59 PeerLink &operator= (const PeerLink &) = delete;
60
61 void DoDispose ();
63 enum PeerState {
70 };
74 static const char* const PeerStateNames[6];
81 void SetBeaconInformation (Time lastBeacon, Time BeaconInterval);
91
95 void SetPeerAddress (Mac48Address macaddr);
105 void SetInterface (uint32_t interface);
110 void SetLocalLinkId (uint16_t id);
115 void SetLocalAid (uint16_t aid);
120 uint16_t GetPeerAid () const;
125 void SetBeaconTimingElement (IeBeaconTiming beaconTiming);
135 uint16_t GetLocalAid () const;
140 Time GetLastBeacon () const;
145 Time GetBeaconInterval () const;
151 //IePeerManagement GetPeerLinkDescriptorElement ()const;
153
156
160 void MLMECancelPeerLink (PmpReasonCode reason);
173 void TransmissionSuccess ();
174 void TransmissionFailure ();
176
181 void Report (std::ostream & os) const;
182private:
185 {
197 TOH
198 };
214
221 void Close (uint16_t localLinkID, uint16_t peerLinkID, PmpReasonCode reason);
229 void OpenAccept (uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp);
238 void OpenReject (uint16_t localLinkId, IeConfiguration conf, Mac48Address peerMp, PmpReasonCode reason);
248 void ConfirmAccept (
249 uint16_t localLinkId,
250 uint16_t peerLinkId,
251 uint16_t peerAid,
253 Mac48Address peerMp
254 );
264 void ConfirmReject (
265 uint16_t localLinkId,
266 uint16_t peerLinkId,
268 Mac48Address peerMp,
269 PmpReasonCode reason
270 );
272
276 bool LinkIsEstab () const;
280 bool LinkIsIdle () const;
292 void ClearRetryTimer ();
294 void ClearConfirmTimer ();
296 void ClearHoldingTimer ();
298 void SetHoldingTimer ();
300 void SetRetryTimer ();
302 void SetConfirmTimer ();
304
309
313 void SendPeerLinkClose (PmpReasonCode reasoncode);
315 void SendPeerLinkOpen ();
317 void SendPeerLinkConfirm ();
319
325 void HoldingTimeout ();
327 void RetryTimeout ();
329 void ConfirmTimeout ();
331
333 void BeaconLoss ();
334private:
347 uint16_t m_peerLinkId;
349 uint16_t m_assocId;
352
358 uint16_t m_packetFail;
359
369
378
382 uint16_t m_retryCounter;
387
390};
391
392} // namespace dot11s
393} // namespace ns3
394
395#endif /* PEER_LINK_H */
Callback template class.
Definition: callback.h:1279
An identifier for simulation events.
Definition: event-id.h:54
an EUI-48 address
Definition: mac48-address.h:44
A base class which provides memory management and object aggregation.
Definition: object.h:88
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
a unique identifier for an interface.
Definition: type-id.h:59
See 7.3.2.89 of 802.11s draft 2.07.
Describes Mesh Configuration Element see 7.3.2.86 of 802.11s draft 3.0.
802.11s Peer Management Protocol model
PmpReasonCode
Codes used by 802.11s Peer Management Protocol.
Definition: conf.py:1
Every class exported by the ns3 library is enclosed in the ns3 namespace.