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 * Each plugin must be installed on an interface to work
37 *
38 * \param parent the parent object
39 */
40 virtual void SetParent(Ptr<MeshWifiInterfaceMac> parent) = 0;
41 /**
42 * \brief Process received frame
43 * \param packet
44 * \param header
45 *
46 * \return false if (and only if) frame should be dropped
47 * \todo define when MAC call this
48 */
49 virtual bool Receive(Ptr<Packet> packet, const WifiMacHeader& header) = 0;
50 /**
51 * \brief Update frame before it will be forwarded down
52 * \param packet
53 * \param header
54 * \param from
55 * \param to
56 * \return false if (and only if) frame should be dropped
57 * \todo define when MAC call this, preconditions & postconditions
58 */
59 virtual bool UpdateOutcomingFrame(Ptr<Packet> packet,
60 WifiMacHeader& header,
61 Mac48Address from,
62 Mac48Address to) = 0;
63 /**
64 * \brief Update beacon before it will be formed and sent
65 * \param beacon
66 *
67 * \todo define when MAC call this
68 */
69 virtual void UpdateBeacon(MeshWifiBeacon& beacon) const = 0;
70 /**
71 * Assign a fixed random variable stream number to the random variables
72 * used by this model. Return the number of streams (possibly zero) that
73 * have been assigned.
74 *
75 * \param stream first stream index to use
76 * \return the number of stream indices assigned by this model
77 */
78 virtual int64_t AssignStreams(int64_t stream) = 0;
79};
80
81} // namespace ns3
82
83#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.