mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 10:03:58 +02:00
Remove broadcast hack
This commit is contained in:
parent
751daa724b
commit
e05dc827cc
2 changed files with 17 additions and 57 deletions
|
@ -68,11 +68,7 @@ IslMockChannel::TransmitStart (
|
|||
if (dst == nullptr)
|
||||
{
|
||||
NS_LOG_LOGIC ("destination address " << destAddr << " unknown on channel");
|
||||
for (uint32_t i = 0; i < GetNDevices (); i++)
|
||||
{
|
||||
Deliver (p, src, DynamicCast<MockNetDevice> (GetDevice (i)), txTime);
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -49,43 +49,8 @@ LeoMockChannel::TransmitStart (Ptr<const Packet> p,
|
|||
return false;
|
||||
}
|
||||
|
||||
// Hack for NDP and ARP caches
|
||||
// TODO check if NDP or ARP address
|
||||
bool isBroadcast = (m_groundDevices.find (dst) == m_groundDevices.end ()
|
||||
&& m_satelliteDevices.find (dst) == m_satelliteDevices.end ());
|
||||
|
||||
bool fromGround = m_groundDevices.find (srcDev->GetAddress ()) != m_groundDevices.end ();
|
||||
|
||||
if (isBroadcast)
|
||||
{
|
||||
NS_LOG_DEBUG (">>>broadcast for " << srcDev->GetAddress () << " -> " << dst);
|
||||
// Broadcast hack for ARP and neighbor cache
|
||||
// TODO remove if found a way to fill neighbor cache / ARP by hand
|
||||
if (fromGround)
|
||||
{
|
||||
for (DeviceIndex::iterator it = m_satelliteDevices.begin ();
|
||||
it != m_satelliteDevices.end ();
|
||||
it++)
|
||||
{
|
||||
// TODO deliver only to devices in the same beam
|
||||
NS_LOG_DEBUG ("from ground " << srcDev->GetAddress () << " -> " << it->second->GetAddress ());
|
||||
Deliver (p, srcDev, it->second, txTime);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (DeviceIndex::iterator it = m_groundDevices.begin ();
|
||||
it != m_groundDevices.end ();
|
||||
it++)
|
||||
{
|
||||
// TODO deliver only to devices in the same beam
|
||||
NS_LOG_DEBUG ("from space " << srcDev->GetAddress () << " -> " << it->second->GetAddress ());
|
||||
Deliver (p, srcDev, it->second, txTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fromGround)
|
||||
{
|
||||
// Satellites can always directly be addresses
|
||||
|
@ -111,7 +76,6 @@ LeoMockChannel::TransmitStart (Ptr<const Packet> p,
|
|||
Deliver (p, srcDev, it->second, txTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue