A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
mesh-wifi-interface-mac-plugin.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 IITP RAS
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Pavel Boyko <boyko@iitp.ru>
7 */
8
9#ifndef MESH_WIFI_INTERFACE_MAC_PLUGIN_H
10#define MESH_WIFI_INTERFACE_MAC_PLUGIN_H
11
12#include "mesh-wifi-beacon.h"
13
14#include "ns3/mac48-address.h"
15#include "ns3/packet.h"
16#include "ns3/simple-ref-count.h"
17
18namespace ns3
19{
20
21class MeshWifiInterfaceMac;
22
23/**
24 * @ingroup mesh
25 *
26 * @brief Common interface for mesh point interface MAC plugins
27 *
28 * @todo plugins description
29 */
30class MeshWifiInterfaceMacPlugin : public SimpleRefCount<MeshWifiInterfaceMacPlugin>
31{
32 public:
33 /// This is for subclasses
35 {
36 }
37
38 /**
39 * Each plugin must be installed on an interface to work
40 *
41 * @param parent the parent object
42 */
43 virtual void SetParent(Ptr<MeshWifiInterfaceMac> parent) = 0;
44 /**
45 * @brief Process received frame
46 * @param packet
47 * @param header
48 *
49 * @return false if (and only if) frame should be dropped
50 * @todo define when MAC call this
51 */
52 virtual bool Receive(Ptr<Packet> packet, const WifiMacHeader& header) = 0;
53 /**
54 * @brief Update frame before it will be forwarded down
55 * @param packet
56 * @param header
57 * @param from
58 * @param to
59 * @return false if (and only if) frame should be dropped
60 * @todo define when MAC call this, preconditions & postconditions
61 */
62 virtual bool UpdateOutcomingFrame(Ptr<Packet> packet,
63 WifiMacHeader& header,
64 Mac48Address from,
65 Mac48Address to) = 0;
66 /**
67 * @brief Update beacon before it will be formed and sent
68 * @param beacon
69 *
70 * @todo define when MAC call this
71 */
72 virtual void UpdateBeacon(MeshWifiBeacon& beacon) const = 0;
73 /**
74 * Assign a fixed random variable stream number to the random variables
75 * used by this model. Return the number of streams (possibly zero) that
76 * have been assigned.
77 *
78 * @param stream first stream index to use
79 * @return the number of stream indices assigned by this model
80 */
81 virtual int64_t AssignStreams(int64_t stream) = 0;
82};
83
84} // namespace ns3
85
86#endif /* MESH_WIFI_INTERFACE_MAC_PLUGIN_H */
an EUI-48 address
Beacon is beacon header + list of arbitrary information elements.
Common interface for mesh point interface MAC plugins.
virtual int64_t AssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
virtual bool Receive(Ptr< Packet > packet, const WifiMacHeader &header)=0
Process received frame.
virtual ~MeshWifiInterfaceMacPlugin()
This is for subclasses.
virtual void UpdateBeacon(MeshWifiBeacon &beacon) const =0
Update beacon before it will be formed and sent.
virtual void SetParent(Ptr< MeshWifiInterfaceMac > parent)=0
Each plugin must be installed on an interface to work.
virtual bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)=0
Update frame before it will be forwarded down.
Smart pointer class similar to boost::intrusive_ptr.
A template-based reference counting class.
Implements the IEEE 802.11 MAC header.
Every class exported by the ns3 library is enclosed in the ns3 namespace.