wifi: Remove MacLowTransmissionParameters
This commit is contained in:
@@ -1,181 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2005,2006 INRIA
|
||||
* Copyright (c) 2009 MIRKO BANCHI
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
|
||||
* Mirko Banchi <mk.banchi@gmail.com>
|
||||
*/
|
||||
|
||||
#include "mac-low-transmission-parameters.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
MacLowTransmissionParameters::MacLowTransmissionParameters ()
|
||||
: m_nextSize (0),
|
||||
m_waitAck ({WaitAckType::NONE}),
|
||||
m_sendBar ({SendBarType::NONE}),
|
||||
m_sendRts (false)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
MacLowTransmissionParameters::EnableNextData (uint32_t size)
|
||||
{
|
||||
m_nextSize = size;
|
||||
}
|
||||
|
||||
void
|
||||
MacLowTransmissionParameters::DisableNextData (void)
|
||||
{
|
||||
m_nextSize = 0;
|
||||
}
|
||||
|
||||
void
|
||||
MacLowTransmissionParameters::EnableBlockAck (BlockAckType type)
|
||||
{
|
||||
m_waitAck = {WaitAckType::BLOCK_ACK, type};
|
||||
|
||||
// Reset m_sendBar
|
||||
m_sendBar = {SendBarType::NONE};
|
||||
}
|
||||
|
||||
void
|
||||
MacLowTransmissionParameters::EnableBlockAckRequest (BlockAckReqType barType, BlockAckType baType)
|
||||
{
|
||||
m_sendBar = {SendBarType::BLOCK_ACK_REQ, barType, baType};
|
||||
|
||||
// Reset m_waitAck
|
||||
m_waitAck = {WaitAckType::NONE};
|
||||
}
|
||||
|
||||
void
|
||||
MacLowTransmissionParameters::EnableAck (void)
|
||||
{
|
||||
m_waitAck = {WaitAckType::NORMAL};
|
||||
|
||||
// Reset m_sendBar
|
||||
m_sendBar = {SendBarType::NONE};
|
||||
}
|
||||
|
||||
void
|
||||
MacLowTransmissionParameters::DisableAck (void)
|
||||
{
|
||||
m_waitAck = {WaitAckType::NONE};
|
||||
}
|
||||
|
||||
void
|
||||
MacLowTransmissionParameters::DisableBlockAckRequest (void)
|
||||
{
|
||||
m_sendBar = {SendBarType::NONE};
|
||||
}
|
||||
|
||||
void
|
||||
MacLowTransmissionParameters::EnableRts (void)
|
||||
{
|
||||
m_sendRts = true;
|
||||
}
|
||||
|
||||
void
|
||||
MacLowTransmissionParameters::DisableRts (void)
|
||||
{
|
||||
m_sendRts = false;
|
||||
}
|
||||
|
||||
bool
|
||||
MacLowTransmissionParameters::MustWaitNormalAck (void) const
|
||||
{
|
||||
return (m_waitAck.m_type == WaitAckType::NORMAL);
|
||||
}
|
||||
|
||||
bool
|
||||
MacLowTransmissionParameters::MustWaitBlockAck (void) const
|
||||
{
|
||||
return (m_waitAck.m_type == WaitAckType::BLOCK_ACK);
|
||||
}
|
||||
|
||||
BlockAckType
|
||||
MacLowTransmissionParameters::GetBlockAckType (void) const
|
||||
{
|
||||
if (m_waitAck.m_type == WaitAckType::BLOCK_ACK)
|
||||
{
|
||||
return m_waitAck.m_baType;
|
||||
}
|
||||
|
||||
NS_ABORT_MSG_IF (m_sendBar.m_type != SendBarType::BLOCK_ACK_REQ, "Block ack is not used");
|
||||
return m_sendBar.m_baType;
|
||||
}
|
||||
|
||||
bool
|
||||
MacLowTransmissionParameters::MustSendBlockAckRequest (void) const
|
||||
{
|
||||
return (m_sendBar.m_type == SendBarType::BLOCK_ACK_REQ);
|
||||
}
|
||||
|
||||
BlockAckReqType
|
||||
MacLowTransmissionParameters::GetBlockAckRequestType (void) const
|
||||
{
|
||||
NS_ABORT_MSG_IF (m_sendBar.m_type != SendBarType::BLOCK_ACK_REQ, "Block ack request must not be sent");
|
||||
return m_sendBar.m_barType;
|
||||
}
|
||||
|
||||
bool
|
||||
MacLowTransmissionParameters::MustSendRts (void) const
|
||||
{
|
||||
return m_sendRts;
|
||||
}
|
||||
|
||||
bool
|
||||
MacLowTransmissionParameters::HasNextPacket (void) const
|
||||
{
|
||||
return (m_nextSize != 0);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
MacLowTransmissionParameters::GetNextPacketSize (void) const
|
||||
{
|
||||
NS_ASSERT (HasNextPacket ());
|
||||
return m_nextSize;
|
||||
}
|
||||
|
||||
std::ostream &operator << (std::ostream &os, const MacLowTransmissionParameters ¶ms)
|
||||
{
|
||||
os << "["
|
||||
<< "send rts=" << params.m_sendRts << ", "
|
||||
<< "next size=" << params.m_nextSize << ", ";
|
||||
|
||||
if (params.m_waitAck.m_type == MacLowTransmissionParameters::WaitAckType::NORMAL)
|
||||
{
|
||||
os << "ack=normal";
|
||||
}
|
||||
else if (params.m_waitAck.m_type == MacLowTransmissionParameters::WaitAckType::BLOCK_ACK)
|
||||
{
|
||||
os << "ack=" << params.m_waitAck.m_baType;
|
||||
}
|
||||
else if (params.m_sendBar.m_type == MacLowTransmissionParameters::SendBarType::BLOCK_ACK_REQ)
|
||||
{
|
||||
os << "bar=" << params.m_sendBar.m_barType;
|
||||
}
|
||||
else
|
||||
{
|
||||
os << "ack=none";
|
||||
}
|
||||
|
||||
os << "]";
|
||||
return os;
|
||||
}
|
||||
|
||||
} //namespace ns3
|
||||
@@ -1,176 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2005, 2006 INRIA
|
||||
* Copyright (c) 2009 MIRKO BANCHI
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
|
||||
* Mirko Banchi <mk.banchi@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef MAC_LOW_TRANSMISSION_PARAMETERS_H
|
||||
#define MAC_LOW_TRANSMISSION_PARAMETERS_H
|
||||
|
||||
#include "ns3/uinteger.h"
|
||||
#include "block-ack-type.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \brief control how a packet is transmitted.
|
||||
* \ingroup wifi
|
||||
*
|
||||
* The ns3::MacLow::StartTransmission method expects
|
||||
* an instance of this class to describe how the packet
|
||||
* should be transmitted.
|
||||
*/
|
||||
class MacLowTransmissionParameters
|
||||
{
|
||||
public:
|
||||
MacLowTransmissionParameters ();
|
||||
|
||||
/**
|
||||
* Wait ACKTimeout for an Ack. If we get an Ack
|
||||
* on time, call MacLowTransmissionListener::GotAck.
|
||||
* Call MacLowTransmissionListener::MissedAck otherwise.
|
||||
*/
|
||||
void EnableAck (void);
|
||||
/**
|
||||
* Wait the timeout corresponding to the given BlockAck response type.
|
||||
*
|
||||
* \param type the BlockAck response type
|
||||
*/
|
||||
void EnableBlockAck (BlockAckType type);
|
||||
/**
|
||||
* A BlockAckRequest of the given type will be transmitted, followed by a
|
||||
* BlockAck of the given type.
|
||||
*
|
||||
* \param barType the Block Ack Request type
|
||||
* \param baType the type of the Block Ack solicited by the Block Ack Request
|
||||
*/
|
||||
void EnableBlockAckRequest (BlockAckReqType barType, BlockAckType baType);
|
||||
/**
|
||||
* Send a RTS, and wait CTSTimeout for a CTS. If we get a
|
||||
* CTS on time, call MacLowTransmissionListener::GotCts
|
||||
* and send data. Otherwise, call MacLowTransmissionListener::MissedCts
|
||||
* and do not send data.
|
||||
*/
|
||||
void EnableRts (void);
|
||||
/**
|
||||
* \param size size of next data to send after current packet is
|
||||
* sent in bytes.
|
||||
*
|
||||
* Add the transmission duration of the next data to the
|
||||
* durationId of the outgoing packet and call
|
||||
* MacLowTransmissionListener::StartNextFragment at the end of
|
||||
* the current transmission + SIFS.
|
||||
*/
|
||||
void EnableNextData (uint32_t size);
|
||||
/**
|
||||
* Do not wait for Ack after data transmission. Typically
|
||||
* used for Broadcast and multicast frames.
|
||||
*/
|
||||
void DisableAck (void);
|
||||
/**
|
||||
* Do not send BlockAckRequest after data transmission
|
||||
*/
|
||||
void DisableBlockAckRequest (void);
|
||||
/**
|
||||
* Do not send RTS and wait for CTS before sending data.
|
||||
*/
|
||||
void DisableRts (void);
|
||||
/**
|
||||
* Do not attempt to send data burst after current transmission
|
||||
*/
|
||||
void DisableNextData (void);
|
||||
/**
|
||||
* \returns true if normal ack protocol should be used, false
|
||||
* otherwise.
|
||||
*
|
||||
* \sa EnableAck
|
||||
*/
|
||||
bool MustWaitNormalAck (void) const;
|
||||
/**
|
||||
* \returns true if block ack mechanism is used, false otherwise.
|
||||
*
|
||||
* \sa EnableBlockAck
|
||||
*/
|
||||
bool MustWaitBlockAck (void) const;
|
||||
/**
|
||||
* \returns the selected BlockAck variant.
|
||||
*
|
||||
* Only call this method if the block ack mechanism is used.
|
||||
*/
|
||||
BlockAckType GetBlockAckType (void) const;
|
||||
/**
|
||||
* \returns true if a BlockAckRequest must be sent, false otherwise.
|
||||
*
|
||||
* Return true if a BlockAckRequest must be sent, false otherwise.
|
||||
*/
|
||||
bool MustSendBlockAckRequest (void) const;
|
||||
/**
|
||||
* \returns the selected BlockAckRequest variant.
|
||||
*
|
||||
* Only call this method if a BlockAckRequest must be sent.
|
||||
*/
|
||||
BlockAckReqType GetBlockAckRequestType (void) const;
|
||||
/**
|
||||
* \returns true if RTS should be sent and CTS waited for before
|
||||
* sending data, false otherwise.
|
||||
*/
|
||||
bool MustSendRts (void) const;
|
||||
/**
|
||||
* \returns true if EnableNextData was called, false otherwise.
|
||||
*/
|
||||
bool HasNextPacket (void) const;
|
||||
/**
|
||||
* \returns the size specified by EnableNextData.
|
||||
*/
|
||||
uint32_t GetNextPacketSize (void) const;
|
||||
|
||||
private:
|
||||
friend std::ostream &operator << (std::ostream &os, const MacLowTransmissionParameters ¶ms);
|
||||
/// Struct storing the type of Ack to wait for
|
||||
struct WaitAckType
|
||||
{
|
||||
enum {NONE, NORMAL, BLOCK_ACK} m_type;
|
||||
BlockAckType m_baType;
|
||||
};
|
||||
/// Struct storing the type of BAR to send
|
||||
struct SendBarType
|
||||
{
|
||||
enum {NONE, BLOCK_ACK_REQ} m_type;
|
||||
BlockAckReqType m_barType;
|
||||
BlockAckType m_baType;
|
||||
};
|
||||
|
||||
uint32_t m_nextSize; //!< the next size
|
||||
WaitAckType m_waitAck; //!< type of Ack to wait for
|
||||
SendBarType m_sendBar; //!< type of BAR to send
|
||||
bool m_sendRts; //!< whether to send an RTS or not
|
||||
};
|
||||
|
||||
/**
|
||||
* Serialize MacLowTransmissionParameters to ostream in a human-readable form.
|
||||
*
|
||||
* \param os std::ostream
|
||||
* \param params MacLowTransmissionParameters
|
||||
* \return std::ostream
|
||||
*/
|
||||
std::ostream &operator << (std::ostream &os, const MacLowTransmissionParameters ¶ms);
|
||||
|
||||
} //namespace ns3
|
||||
|
||||
#endif /* MAC_LOW_TRANSMISSION_PARAMETERS_H */
|
||||
@@ -37,7 +37,6 @@ def build(bld):
|
||||
'model/ht-frame-exchange-manager.cc',
|
||||
'model/vht-frame-exchange-manager.cc',
|
||||
'model/he-frame-exchange-manager.cc',
|
||||
'model/mac-low-transmission-parameters.cc',
|
||||
'model/wifi-mac-queue.cc',
|
||||
'model/mac-tx-middle.cc',
|
||||
'model/mac-rx-middle.cc',
|
||||
@@ -220,7 +219,6 @@ def build(bld):
|
||||
'model/ht-frame-exchange-manager.h',
|
||||
'model/vht-frame-exchange-manager.h',
|
||||
'model/he-frame-exchange-manager.h',
|
||||
'model/mac-low-transmission-parameters.h',
|
||||
'model/originator-block-ack-agreement.h',
|
||||
'model/recipient-block-ack-agreement.h',
|
||||
'model/ctrl-headers.h',
|
||||
|
||||
Reference in New Issue
Block a user