author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Tue, 11 Jun 2013 17:02:23 -0700 | |
changeset 9870 | 6543f3876ff5 |
parent 8992 | 4fdf03b24af6 |
permissions | -rw-r--r-- |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
2 |
/* |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
3 |
* Copyright (c) 2009 IITP RAS |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
4 |
* |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
8 |
* |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
13 |
* |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
17 |
* |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
18 |
* Author: Pavel Boyko <boyko@iitp.ru> |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
19 |
*/ |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
20 |
|
7353
09fccf6195ea
bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents:
7178
diff
changeset
|
21 |
#ifndef MESH_WIFI_INTERFACE_MAC_PLUGIN_H |
09fccf6195ea
bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents:
7178
diff
changeset
|
22 |
#define MESH_WIFI_INTERFACE_MAC_PLUGIN_H |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
23 |
|
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
24 |
#include "ns3/wifi-mac-header.h" |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
25 |
#include "ns3/packet.h" |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
26 |
#include "ns3/mac48-address.h" |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
27 |
#include "ns3/mesh-wifi-beacon.h" |
5505
c0ac392289c3
replace RefCountBase with SimpleRefCount<> to avoid duplicate refcounting implementations.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5012
diff
changeset
|
28 |
#include "ns3/simple-ref-count.h" |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
29 |
|
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
30 |
namespace ns3 { |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
31 |
|
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
32 |
class MeshWifiInterfaceMac; |
7178
1a07cbb68308
mesh coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6851
diff
changeset
|
33 |
|
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
34 |
/** |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
35 |
* \ingroup mesh |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
36 |
* |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
37 |
* \brief Common interface for mesh point interface MAC plugins |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
38 |
* |
9870
6543f3876ff5
[Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8992
diff
changeset
|
39 |
* \todo plugins description |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
40 |
*/ |
5505
c0ac392289c3
replace RefCountBase with SimpleRefCount<> to avoid duplicate refcounting implementations.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5012
diff
changeset
|
41 |
class MeshWifiInterfaceMacPlugin : public SimpleRefCount<MeshWifiInterfaceMacPlugin> |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
42 |
{ |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
43 |
public: |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
44 |
/// This is for subclasses |
4857
ddfb13420455
Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
4856
diff
changeset
|
45 |
virtual ~MeshWifiInterfaceMacPlugin (){}; |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
46 |
/// Each plugin must be installed on interface to work |
4856
b7241df728a3
Added PM-mac - not implemented
Kirill Andreev <andreev@iitp.ru>
parents:
4852
diff
changeset
|
47 |
virtual void SetParent (Ptr<MeshWifiInterfaceMac> parent) = 0; |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
48 |
/** |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
49 |
* \brief Process received frame |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
50 |
* |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
51 |
* \return false if (and only if) frame should be dropped |
9870
6543f3876ff5
[Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8992
diff
changeset
|
52 |
* \todo define when MAC call this |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
53 |
*/ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4844
diff
changeset
|
54 |
virtual bool Receive (Ptr<Packet> packet, const WifiMacHeader & header) = 0; |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
55 |
/** |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
56 |
* \brief Update frame before it will be forwarded down |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
57 |
* |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
58 |
* \return false if (and only if) frame should be dropped |
9870
6543f3876ff5
[Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8992
diff
changeset
|
59 |
* \todo define when MAC call this, preconditions & postconditions |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
60 |
*/ |
5012 | 61 |
virtual bool UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) = 0; |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
62 |
/** |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
63 |
* \brief Update beacon before it will be formed and sent |
7178
1a07cbb68308
mesh coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6851
diff
changeset
|
64 |
* |
9870
6543f3876ff5
[Doxygen] use \todo
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
8992
diff
changeset
|
65 |
* \todo define when MAC call this |
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
66 |
*/ |
4856
b7241df728a3
Added PM-mac - not implemented
Kirill Andreev <andreev@iitp.ru>
parents:
4852
diff
changeset
|
67 |
virtual void UpdateBeacon (MeshWifiBeacon & beacon) const = 0; |
8992
4fdf03b24af6
Update mesh model, tests and reference traces for new random variable usage
Tom Henderson <tomh@tomh.org>
parents:
7353
diff
changeset
|
68 |
/** |
4fdf03b24af6
Update mesh model, tests and reference traces for new random variable usage
Tom Henderson <tomh@tomh.org>
parents:
7353
diff
changeset
|
69 |
* Assign a fixed random variable stream number to the random variables |
4fdf03b24af6
Update mesh model, tests and reference traces for new random variable usage
Tom Henderson <tomh@tomh.org>
parents:
7353
diff
changeset
|
70 |
* used by this model. Return the number of streams (possibly zero) that |
4fdf03b24af6
Update mesh model, tests and reference traces for new random variable usage
Tom Henderson <tomh@tomh.org>
parents:
7353
diff
changeset
|
71 |
* have been assigned. |
4fdf03b24af6
Update mesh model, tests and reference traces for new random variable usage
Tom Henderson <tomh@tomh.org>
parents:
7353
diff
changeset
|
72 |
* |
4fdf03b24af6
Update mesh model, tests and reference traces for new random variable usage
Tom Henderson <tomh@tomh.org>
parents:
7353
diff
changeset
|
73 |
* \param stream first stream index to use |
4fdf03b24af6
Update mesh model, tests and reference traces for new random variable usage
Tom Henderson <tomh@tomh.org>
parents:
7353
diff
changeset
|
74 |
* \return the number of stream indices assigned by this model |
4fdf03b24af6
Update mesh model, tests and reference traces for new random variable usage
Tom Henderson <tomh@tomh.org>
parents:
7353
diff
changeset
|
75 |
*/ |
4fdf03b24af6
Update mesh model, tests and reference traces for new random variable usage
Tom Henderson <tomh@tomh.org>
parents:
7353
diff
changeset
|
76 |
virtual int64_t AssignStreams (int64_t stream) = 0; |
4fdf03b24af6
Update mesh model, tests and reference traces for new random variable usage
Tom Henderson <tomh@tomh.org>
parents:
7353
diff
changeset
|
77 |
|
4844
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
78 |
}; |
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
79 |
|
3c38e23fa821
Basic MAC plugins functionality implemented
Pavel Boyko <boyko@iitp.ru>
parents:
diff
changeset
|
80 |
} // namespace ns3 |
7353
09fccf6195ea
bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents:
7178
diff
changeset
|
81 |
|
09fccf6195ea
bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents:
7178
diff
changeset
|
82 |
#endif /* MESH_WIFI_INTERFACE_MAC_PLUGIN_H */ |