src/devices/wifi/mac-high-nqap.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 10 Oct 2007 11:23:28 +0200
changeset 1940 6c62be5cf73a
child 1964 041240a915f8
permissions -rw-r--r--
add NQap to build

/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2005,2006 INRIA
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as 
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
 */
#ifndef MAC_HIGH_NQAP_H
#define MAC_HIGH_NQAP_H

#include <stdint.h>
#include "ns3/mac48-address.h"
#include "ns3/callback.h"
#include "ns3/packet.h"
#include "supported-rates.h"

namespace ns3 {

class WifiMacHeader;
class WifiNetDevice;
class DcaTxop;
class MacStations;

class MacHighNqap {
public:
  typedef Callback<void, Packet > ForwardCallback;

  MacHighNqap ();
  ~MacHighNqap ();

  void SetDcaTxop (DcaTxop *dca);
  void SetInterface (WifiNetDevice *interface);
  void SetStations (MacStations *stations);
  void SetForwardCallback (ForwardCallback callback);
  void SetSupportedRates (SupportedRates rates);
  void SetBeaconIntervalUs (uint64_t us);

  void Queue (Packet packet, Mac48Address to);

  void Receive (Packet packet, WifiMacHeader const *hdr);
private:
  void ForwardDown (Packet packet, Mac48Address from, Mac48Address to);
  void TxOk (WifiMacHeader const &hdr);
  void TxFailed (WifiMacHeader const &hdr);
  void SendProbeResp (Mac48Address to);
  void SendAssocResp (Mac48Address to);
  SupportedRates GetSupportedRates (void);

  DcaTxop *m_dca;
  WifiNetDevice *m_interface;
  MacStations *m_stations;
  ForwardCallback m_forwardUp;
  SupportedRates m_rates;
  uint64_t m_beaconIntervalUs;
};

} // namespace ns3


#endif /* MAC_HIGH_NQAP_H */