def __init__(self, prefix): self.prefix = Name(prefix) self.outstanding = dict( ) # a dictionary to keep track of outstanding Interests and retransmissions. self.isDone = False self.face = Face("127.0.0.1") # self.face = Face() self.keyChain = KeyChain() self.nodeid = OSCommand.getnodeid()
def __init__(self): self.keyChain = KeyChain() self.isDone = False self.ofmsg = OFMSG() self.nodeid = OSCommand.getnodeid() self.face = Face() self.featurereq = FeatureReq() self.helloreq_name_list = [] self.new_CtrlInfo_data = "---Initial CtrlInfo data---" # used to get new ctrlinfo data and send to nodes. self.CtrlInfo_data = "" # used to record used ctrlinfo data
def __init__(self): self.keyChain = KeyChain() self.isDone = False self.ofmsg = OFMSG() self.outstanding = dict() # a dictionary to keep track of outstanding Interests and retransmissions. # self.face = Face("127.0.0.1") self.face = Face() self.nodeid = OSCommand.getnodeid() self.send_ctrlinfo_interest = True self.ctrlinfo_operation = CtrlInfo_Operation()
def _onData(self, interest, data): payload = data.getContent() name = data.getName() print("Received <<<<FlowMod data>>>>from Controller ") self.nodeid = OSCommand.getnodeid() # add this item to flow table. FlowModDataList = NdnFlowTable.parse_FlowMod_Data(payload) # print(FlowModDataList) NdnFlowTable.updatendnflowtable(FlowModDataList,self.nodeid) print(NdnFlowTable) del self.outstanding[name.toUri()] self.isDone = True
def run(self): nodeid = OSCommand.getnodeid() # nexthop_to_controller_faceid = OSCommand.getRIBnexthop_of_prefix('/ndn/ie/tcd/controller01/') nexthop_to_controller_faceid = OSCommand.getRIBnexthop_of_prefix( '/ndn/h6-site/h6') # just for demo subprocess.check_output(["export HOME=/tmp/minindn/{0} && nfdc route add / {1} ". \ format(nodeid, nexthop_to_controller_faceid)], shell=True) try: self._sendNextInterest(self.prefix) while not self.isDone: self.face.processEvents() time.sleep(0.01) except RuntimeError as e: print("ERROR: %s" % e)
def __init__(self): self.nodeid = OSCommand.getnodeid() self.unknownprefixtable = set()
def __init__(self): self.keyChain = KeyChain() self.isDone = False self.nodeid = OSCommand.getnodeid() self.face = Face() self.featurereq = FeatureReq()