From 92bc429fe1283dd2994ac3cf8da3cb2c06ce01b2 Mon Sep 17 00:00:00 2001 From: awlane Date: Mon, 22 May 2023 18:35:58 -0500 Subject: [PATCH] Add boolean parameter to NDNRoutingHelper constructor to allow for creating permanent faces. Refs #5264 Change-Id: I6da3e777261ec978c8cff7da4d10f9661371dacf --- minindn/helpers/ndn_routing_helper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/minindn/helpers/ndn_routing_helper.py b/minindn/helpers/ndn_routing_helper.py index 93b196f..d614926 100644 --- a/minindn/helpers/ndn_routing_helper.py +++ b/minindn/helpers/ndn_routing_helper.py @@ -285,10 +285,11 @@ class NdnRoutingHelper(object): :param Routing routingType: (optional) Routing algorithm, link-state or hr etc """ - def __init__(self, netObject, faceType=nfdc.PROTOCOL_UDP, routingType="link-state"): + def __init__(self, netObject, faceType=nfdc.PROTOCOL_UDP, routingType="link-state", permanentFaces=False): self.net = netObject self.faceType = faceType self.routingType = routingType + self.permanentFaces = permanentFaces self.routes = [] self.namePrefixes = {host_name.name: [] for host_name in self.net.hosts} self.routeObject = _CalculateRoutes(self.net, self.routingType) @@ -349,7 +350,7 @@ class NdnRoutingHelper(object): def createFaces(self, node, neighborIPs): neighborFaces = {} for k, ip in neighborIPs.items(): - faceID = nfdc.createFace(node, ip, self.faceType) + faceID = nfdc.createFace(node, ip, self.faceType, self.permanentFaces) if not isinstance(faceID, str): raise ValueError(faceID) neighborFaces[k] = faceID return neighborFaces