Update README and add contrib dir

This commit is contained in:
2025-12-01 15:56:02 +01:00
parent 1b80de2153
commit cd9ba93d58
150 changed files with 25563 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
#ifndef SWITCH_CHANNEL_H
#define SWITCH_CHANNEL_H
#include "ns3/channel.h"
#include "ns3/net-device.h"
#include <vector>
/**
* \file
* \ingroup ethernet
* ns3::SwitchChannel declaration.
*/
namespace ns3
{
/**
* \ingroup bridge
*
* \brief Virtual channel implementation for bridges (BridgeNetDevice).
*
* Just like SwitchNetDevice aggregates multiple NetDevices,
* SwitchChannel aggregates multiple channels and make them appear as
* a single channel to upper layers.
* This class is greatly inspire form BridgeChannel
*/
class SwitchChannel : public Channel
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId();
SwitchChannel();
~SwitchChannel() override;
// Delete copy constructor and assignment operator to avoid misuse
SwitchChannel(const SwitchChannel&) = delete;
SwitchChannel& operator=(const SwitchChannel&) = delete;
/**
* Adds a channel to the bridged pool
* \param bridgedChannel the channel to add to the pool
*/
void AddChannel(Ptr<Channel> bridgedChannel);
// virtual methods implementation, from Channel
std::size_t GetNDevices() const override;
Ptr<NetDevice> GetDevice(std::size_t i) const override;
private:
std::vector<Ptr<Channel>> m_switchedChannels; //!< pool of switched channels
};
} // namespace ns3
#endif /* SWITCH_CHANNEL_H */