示例#1
0
def create_flow_mod(dp, config):

    matches_config = FlowDescription.get_matches(config)
    matches = Matches.create_matches(dp, matches_config)

    instr_config = FlowDescription.get_instr_config(config)
    instructions = Instructions.create_instructions(dp, instr_config)

    mod = dp.ofproto_parser.OFPFlowMod (
        dp,
        cookie = 0,
        cookie_mask = 0,
        table_id = Utils.get_table(config['table']),
        command = Utils.get_mod_command(dp, config['cmd']),
        idle_timeout = 0,
        hard_timeout = 0,
        priority = 0,
        buffer_id = 0,
        out_port = Utils.get_mod_port(dp, config['port']),
        out_group = Utils.get_mod_group(dp, config['group']),
        flags=0,
        match=matches,
        instructions=instructions
    )
    return mod
示例#2
0
def create_flow_mod(dp, config):

    matches_config = FlowDescription.get_matches(config)
    matches = Matches.create_matches(dp, matches_config)

    instr_config = FlowDescription.get_instr_config(config)
    instructions = Instructions.create_instructions(dp, instr_config)

    mod = dp.ofproto_parser.OFPFlowMod(
        dp,
        cookie=0,
        cookie_mask=0,
        table_id=Utils.get_table(config['table']),
        command=Utils.get_mod_command(dp, config['cmd']),
        idle_timeout=0,
        hard_timeout=0,
        priority=0,
        buffer_id=0,
        out_port=Utils.get_mod_port(dp, config['port']),
        out_group=Utils.get_mod_group(dp, config['group']),
        flags=0,
        match=matches,
        instructions=instructions)
    return mod
示例#3
0
def process_goto(dp, config):
    table = Utils.get_table(config['table'])
    return dp.ofproto_parser.OFPInstructionGotoTable(table)
示例#4
0
def process_goto(dp,config):
    table = Utils.get_table(config['table'])
    return dp.ofproto_parser.OFPInstructionGotoTable(table)