src/devices/wifi/mac-high-adhoc.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 09 Oct 2007 16:11:08 +0200
changeset 1933 59328b2e04e1
child 1934 13c65460caee
permissions -rw-r--r--
add MacHighAdhoc to build
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1933
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
 * Copyright (c) 2005 INRIA
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 * All rights reserved.
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 *
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * This program is free software; you can redistribute it and/or modify
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * it under the terms of the GNU General Public License version 2 as 
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 * published by the Free Software Foundation;
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 *
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 * GNU General Public License for more details.
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 *
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
 * along with this program; if not, write to the Free Software
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 *
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
 */
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
#ifndef MAC_HIGH_ADHOC_H
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
#define MAC_HIGH_ADHOC_H
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
#include "ns3/mac48-address.h"
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
#include "ns3/callback.h"
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
#include "ns3/packet.h"
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
namespace ns3 {
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
class DcaTxop;
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
class Packet;
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    32
class WifiNetDevice;
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
class WifiMacHeader;
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
class MacHighAdhoc {
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
public:
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    37
  typedef Callback<void, Packet > ForwardCallback;
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    38
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    39
  MacHighAdhoc ();
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    40
  ~MacHighAdhoc ();
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
  void SetInterface (WifiNetDevice *interface);
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    43
  void SetForwardCallback (ForwardCallback callback);
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    44
  void SetDcaTxop (DcaTxop *dca);
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    45
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    46
  Mac48Address GetBssid (void) const;
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    47
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    48
  void Enqueue (Packet packet, Mac48Address to);
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    49
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    50
  /* invoked by the MacLows. */
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    51
  void Receive (Packet packet, WifiMacHeader const*hdr);
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    52
private:
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    53
  DcaTxop *m_dca;
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    54
  WifiNetDevice *m_interface;
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    55
  ForwardCallback m_callback;
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    56
};
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    57
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
}; // namespace ns3
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
59328b2e04e1 add MacHighAdhoc to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    60
#endif /* MAC_HIGH_ADHOC_H */