def create_buckets(dp, config): # buckets = [] # # print "@@@@@@@@@@@@@@@@@@@@@@" # print "buckets config: %s" % config # print "@@@@@@@@@@@@@@@@@@@@@@" # for entry in config: # # print "entry: %s " % entry actions = Actions.create_actions(dp, entry["actions"]) bucket = dp.ofproto_parser.OFPBucket( weight=Utils.to_int(entry["weight"]), watch_port=Utils.get_mod_port(dp, entry["watch_port"]), watch_group=Utils.get_mod_group(dp, entry["watch_group"]), actions=actions #entry[] ) # print "bucket: %s" % bucket buckets.append(bucket) # print "buckets: %s" % buckets return buckets
def process_write(dp,config): # print config type = dp.ofproto.OFPIT_WRITE_ACTIONS # for entry in config: actions = Actions.create_actions(dp, entry["actions"]) return dp.ofproto_parser.OFPInstructionActions(type,actions)
def process_apply(dp,config): # type = dp.ofproto.OFPIT_APPLY_ACTIONS # for entry in config: actions = Actions.create_actions(dp, entry["actions"]) return dp.ofproto_parser.OFPInstructionActions(type,actions)
def process_clear(dp,config): type = dp.ofproto.OFPIT_CLEAR_ACTIONS # for entry in config: actions = Actions.create_actions(dp, entry["actions"]) return dp.ofproto_parser.OFPInstructionActions(type,actions)