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