def randomize(self): tries = 0 while True: self.type = randomizer.getRandom(self.probabilities) if tries > 100: self.force_type = 1 if self.force_type is not None: self.type = self.force_type if self.type == 0: tries += 1 self.value = key_element_list() self.value.randomize() elif self.type == 1: self.value = action_list() self.value.randomize() elif self.type == 2: self.value = entries_list() self.value.randomize() elif self.type == 3: self.opt_annotations = opt_annotations() self.opt_annotations.randomize() self.const_initializer = True self.value = initializer() self.value.randomize() elif self.type == 4: self.opt_annotations = opt_annotations() self.opt_annotations.randomize() self.value = initializer() self.value.randomize() if not self.filter(): break
def unpack(self, binary_string): binary_string = ofp_instruction_actions.unpack(self, binary_string) bytes = self.len - OFP_INSTRUCTION_ACTIONS_BYTES self.actions = action_list() binary_string = self.actions.unpack(binary_string, bytes=bytes) return binary_string
def unpack(self, binary_string): binary_string = ofp_bucket.unpack(self, binary_string) self.actions = action_list() return self.actions.unpack(binary_string)
def __init__(self): ofp_instruction_actions.__init__(self) self.type = OFPIT_APPLY_ACTIONS self.actions = action_list() self.len = self.__len__()
def __init__(self): ofp_bucket.__init__(self) self.actions = action_list() self.type = None self.len = self.__len__()