20 #ifndef CSMA_CHANNEL_H
21 #define CSMA_CHANNEL_H
23 #include "ns3/channel.h"
24 #include "ns3/data-rate.h"
25 #include "ns3/nstime.h"
146 bool Detach(uint32_t deviceId);
Abstract Channel Base Class.
CsmaChannel & operator=(const CsmaChannel &)=delete
CsmaChannel(const CsmaChannel &)=delete
~CsmaChannel() override
Destroy a CsmaChannel.
Ptr< CsmaNetDevice > GetCsmaDevice(std::size_t i) const
uint32_t GetNumActDevices()
DataRate m_bps
The assigned data rate of the channel.
DataRate GetDataRate()
Get the assigned data rate of the channel.
bool Reattach(uint32_t deviceId)
Reattach a previously detached net device to the channel.
bool IsActive(uint32_t deviceId)
Indicates if a net device is currently attached or detached from the channel.
Time GetDelay()
Get the assigned speed-of-light delay of the channel.
int32_t GetDeviceNum(Ptr< CsmaNetDevice > device)
bool TransmitEnd()
Indicates that the net device has finished transmitting the packet over the channel.
Time m_delay
The assigned speed-of-light delay of the channel.
Ptr< const Packet > m_currentPkt
The Packet that is currently being transmitted on the channel (or last packet to have been transmitte...
bool TransmitStart(Ptr< const Packet > p, uint32_t srcId)
Start transmitting a packet over the channel.
static TypeId GetTypeId()
Get the type ID.
WireState m_state
Current state of the channel.
CsmaChannel()
Create a CsmaChannel.
bool Detach(Ptr< CsmaNetDevice > device)
Detach a given netdevice from this channel.
std::vector< CsmaDeviceRec > m_deviceList
List of the net devices that have been or are currently connected to the channel.
void PropagationCompleteEvent()
Indicates that the channel has finished propagating the current packet.
int32_t Attach(Ptr< CsmaNetDevice > device)
Attach a given netdevice to this channel.
Ptr< NetDevice > GetDevice(std::size_t i) const override
bool IsBusy()
Indicates if the channel is busy.
uint32_t m_currentSrc
Device Id of the source that is currently transmitting on the channel.
std::size_t GetNDevices() const override
Ptr< CsmaNetDevice > devicePtr
Pointer to the net device.
bool active
Is net device enabled to TX/RX.
Class for representing data rates.
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WireState
Current state of the channel.
@ TRANSMITTING
Channel is BUSY, a packet is being written by a net device.
@ PROPAGATING
Channel is BUSY, packet is propagating to all attached net devices.
@ IDLE
Channel is IDLE, no packet is being transmitted.