mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 01:53:58 +02:00
Use proper ethernet header
This commit is contained in:
parent
97de8c9d24
commit
1917223a5e
3 changed files with 61 additions and 41 deletions
|
@ -59,25 +59,42 @@ LeoMockChannel::TransmitStart (Ptr<const Packet> p,
|
|||
DeviceIndex *dests;
|
||||
if (fromGround)
|
||||
{
|
||||
NS_LOG_LOGIC ("ground to space: " << srcDev->GetAddress () << " to " << dst);
|
||||
dests = &m_satelliteDevices;
|
||||
}
|
||||
else if (fromSpace)
|
||||
{
|
||||
NS_LOG_LOGIC ("space to ground: " << srcDev->GetAddress () << " to " << dst);
|
||||
dests = &m_groundDevices;
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_LOG_ERROR ("unable to find satellite with address " << dst);
|
||||
NS_LOG_ERROR ("unable to find source interface " << srcDev);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (DeviceIndex::iterator it = dests->begin (); it != dests->end (); it ++)
|
||||
if (dst == srcDev->GetBroadcast () || dst == srcDev->GetMulticast (Ipv4Address ())) // mcast group ignored
|
||||
{
|
||||
// TODO deliver only to devices in the same beam
|
||||
Deliver (p, srcDev, it->second, txTime);
|
||||
for (DeviceIndex::iterator it = dests->begin (); it != dests->end(); it ++)
|
||||
{
|
||||
Deliver (p, srcDev, it->second, txTime);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DeviceIndex::iterator it = dests->find (dst);
|
||||
if (it == dests->end ())
|
||||
{
|
||||
NS_LOG_ERROR ("unable to find destination interface: " << dst);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO deliver only to devices in the same beam
|
||||
return Deliver (p, srcDev, it->second, txTime);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue