Пример #1
0
    def run(self, ctrlinfo_raw_data):
        # The structure and and basic function just list here, other functions need to be added in future work.
        CtrlInfo_data_list = self.parse_CtrlInfo_Data(ctrlinfo_raw_data)

        if (CtrlInfo_data_list[0] == '0x0000'):  # FlowMod
            pass


        elif (CtrlInfo_data_list[0] == '0x0001'):  # FaceMod
            FaceMod_Operate_list = [CtrlInfo_data_list[2], CtrlInfo_data_list[1]]
            OSCommand.facemod(FaceMod_Operate_list)


        elif (CtrlInfo_data_list[0] == '0x0002'):  # TableMod
            pass

        elif (CtrlInfo_data_list[0] == '0x0003'):  # Role
            pass

        elif (CtrlInfo_data_list[0] == '0x0004'):  # Error
            pass

        elif (CtrlInfo_data_list[0] == '0x0005'):  # CS
            pass

        elif (CtrlInfo_data_list[0] == '0x0006'):  # PrefixMod
            pass

        elif (CtrlInfo_data_list[0] == '0x0007'):  # Fib RouteMod
            pass

        else:
            pass
Пример #2
0
    def onInterest_FaceMod(self, mainPrefix, interest, transport,
                           registeredPrefixId):
        print("--------Received <<<FaceMod>>> interest Msg")
        FaceMod_suffix_list = NdnFlowTable.parse_FaceMod_Interest(interest)
        # FaceMod_suffix_list pattern:[faceid, action]

        print(OSCommand.facemod(FaceMod_suffix_list)
              )  # modify the face and print the command output
        self.isDone = True  #