Add ARP cache helper

This commit is contained in:
Tim Schubert 2020-07-18 11:55:21 +02:00
parent 4628af9511
commit bbf9269a14
5 changed files with 95 additions and 1 deletions

View file

@ -1,7 +1,9 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "nd-cache-helper.h"
#include "arp-cache-helper.h"
#include "ns3/ipv4-address-helper.h"
#include "ns3/ipv4-interface-container.h"
#include "leo-helper.h"
namespace ns3 {
@ -40,6 +42,17 @@ LeoHelper::Install (NodeContainer &satellites, NodeContainer &gateways, NodeCont
ndCache.Install (gwNet, gwAddrs);
ndCache.Install (utNet, utAddrs);
// Make all networks addressable for legacy protocol
Ipv4AddressHelper legacy;
Ipv4InterfaceContainer islLegacy = legacy.Assign (islNet);
Ipv4InterfaceContainer gwLegacy = legacy.Assign (gwNet);
Ipv4InterfaceContainer utLegacy = legacy.Assign (utNet);
ArpCacheHelper arpCache;
arpCache.Install (islNet, islLegacy);
arpCache.Install (gwNet, gwLegacy);
arpCache.Install (utNet, utLegacy);
// Add to resulting container of net devices
container.Add (islNet);
container.Add (gwNet);