add index for satellite / ground net devices

This commit is contained in:
Tim Schubert 2020-06-26 13:54:03 +02:00
parent 20ad318cb9
commit 432866d8ca
3 changed files with 79 additions and 36 deletions

View file

@ -30,13 +30,12 @@
#include "ns3/mobility-module.h"
#include "ns3/propagation-delay-model.h"
#include "ns3/propagation-loss-model.h"
#include "leo-mock-net-device.h"
#include "mock-channel.h"
namespace ns3 {
/**
* \ingroup network
* \ingroup leo
* \defgroup channel Channel
*/
/**
@ -44,8 +43,6 @@ namespace ns3 {
* \brief Mocked satellite-gateway, satellite-terminal channel types
*
*/
// TODO make separate clases for ut and gw links
// TODO make separate clases for ut and gw devices
class LeoMockChannel : public MockChannel
{
public:
@ -61,28 +58,19 @@ public:
*/
virtual bool TransmitStart (Ptr<const Packet> p, uint32_t devId, Address dst, Time txTime);
protected:
enum ChannelType
{
GW,
UT,
UNKNOWN
};
ChannelType GetChannelType () const;
virtual int32_t Attach (Ptr<MockNetDevice> device);
virtual bool Detach (uint32_t deviceId);
private:
/**
* \brief Type of the channel
* \brief Ground and satellite devices
*
* This channel does not allow for communication between devices of the same
* type (no sat-sat or ground-ground).
*/
ChannelType m_channelType;
bool IsChannel (Ptr<LeoMockNetDevice> dstType, Ptr<LeoMockNetDevice> srcType, bool isBroadcast);
typedef std::map<Address, Ptr<LeoMockNetDevice> > DeviceIndex;
DeviceIndex m_gndDevs;
DeviceIndex m_satDevs;
typedef std::map<Address, Ptr<MockNetDevice> > DeviceIndex;
DeviceIndex m_groundDevices;
DeviceIndex m_satelliteDevices;
}; // class MockChannel
} // namespace ns3