src/devices/mesh/mesh-wifi-interface-mac-plugin.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu Nov 12 13:01:01 2009 +0100 (2009-11-12)
changeset 5505 c0ac392289c3
parent 5012 c81291702113
permissions -rw-r--r--
replace RefCountBase with SimpleRefCount<> to avoid duplicate refcounting implementations.
boyko@4844
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
boyko@4844
     2
/* 
boyko@4844
     3
 * Copyright (c) 2009 IITP RAS
boyko@4844
     4
 * 
boyko@4844
     5
 * This program is free software; you can redistribute it and/or modify
boyko@4844
     6
 * it under the terms of the GNU General Public License version 2 as
boyko@4844
     7
 * published by the Free Software Foundation;
boyko@4844
     8
 *
boyko@4844
     9
 * This program is distributed in the hope that it will be useful,
boyko@4844
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
boyko@4844
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
boyko@4844
    12
 * GNU General Public License for more details.
boyko@4844
    13
 *
boyko@4844
    14
 * You should have received a copy of the GNU General Public License
boyko@4844
    15
 * along with this program; if not, write to the Free Software
boyko@4844
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
boyko@4844
    17
 * 
boyko@4844
    18
 * Author: Pavel Boyko <boyko@iitp.ru>
boyko@4844
    19
 */
boyko@4844
    20
boyko@4844
    21
#ifndef MESHWIFIINTERFACEMACPLUGIN_H_
boyko@4844
    22
#define MESHWIFIINTERFACEMACPLUGIN_H_
boyko@4844
    23
boyko@4844
    24
#include "ns3/wifi-mac-header.h"
boyko@4844
    25
#include "ns3/packet.h"
boyko@4844
    26
#include "ns3/mac48-address.h"
boyko@4844
    27
#include "ns3/mesh-wifi-beacon.h"
mathieu@5505
    28
#include "ns3/simple-ref-count.h"
boyko@4844
    29
boyko@4844
    30
namespace ns3 {
boyko@4844
    31
boyko@4844
    32
class MeshWifiInterfaceMac;
boyko@4844
    33
  
boyko@4844
    34
/**
boyko@4844
    35
 * \ingroup mesh
boyko@4844
    36
 * 
boyko@4844
    37
 * \brief Common interface for mesh point interface MAC plugins
boyko@4844
    38
 * 
boyko@4844
    39
 * TODO: plugins description
boyko@4844
    40
 */
mathieu@5505
    41
class MeshWifiInterfaceMacPlugin : public SimpleRefCount<MeshWifiInterfaceMacPlugin>
boyko@4844
    42
{
boyko@4844
    43
public:
boyko@4844
    44
  /// This is for subclasses
andreev@4857
    45
  virtual ~MeshWifiInterfaceMacPlugin (){};
boyko@4844
    46
  /// Each plugin must be installed on interface to work 
andreev@4856
    47
  virtual void SetParent (Ptr<MeshWifiInterfaceMac> parent) = 0; 
boyko@4844
    48
  /** 
boyko@4844
    49
   * \brief Process received frame
boyko@4844
    50
   * 
boyko@4844
    51
   * \return false if (and only if) frame should be dropped
boyko@4844
    52
   * TODO define when MAC call this
boyko@4844
    53
   */
mazo@4852
    54
  virtual bool Receive (Ptr<Packet> packet, const WifiMacHeader & header) = 0;
boyko@4844
    55
  /**
boyko@4844
    56
   * \brief Update frame before it will be forwarded down
boyko@4844
    57
   * 
boyko@4844
    58
   * \return false if (and only if) frame should be dropped
boyko@4844
    59
   * TODO define when MAC call this, preconditions & postconditions
boyko@4844
    60
   */
andreev@5012
    61
  virtual bool UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) = 0;
boyko@4844
    62
  /**
boyko@4844
    63
   * \brief Update beacon before it will be formed and sent
boyko@4844
    64
   *  
boyko@4844
    65
   * TODO define when MAC call this
boyko@4844
    66
   */
andreev@4856
    67
  virtual void UpdateBeacon (MeshWifiBeacon & beacon) const = 0;
boyko@4844
    68
};
boyko@4844
    69
boyko@4844
    70
} // namespace ns3
boyko@4844
    71
#endif /* MESHWIFIINTERFACEMACPLUGIN_H_ */