Exemplo n.º 1
0
def setup_flow(dpath, mod, ofctl):
    """
    Setup flows.
    """
    _LOG.debug("Default FLow: %d %s", dpath.id, mod)

    ofp = dpath.ofproto

    # send whole packet to controller
    dpath.send_msg(offlow.set_sw_config(dpath))

    # clear all flows/groups.
    dpath.send_msg(offlow.clear_all(dpath))
    for msg in ofgroup.clear_all(dpath):
        dpath.send_msg(msg)

    # send all packet to controller
    flow = offlow.flow_mod(
        table_id=0,
        priority=0,
        match={},
        actions=[
            ofaction.output(ofp.OFPP_CONTROLLER),
        ],
        writes=[],
    )
    ofctl.mod_flow_entry(dpath, flow, ofp.OFPFC_ADD)
Exemplo n.º 2
0
def setup_flow(dpath, mod, ofctl, ofdpa_sim=True):
    """
    Setup flows.
    """
    _LOG.debug("Default FLow: %d %s", dpath.id, mod)

    dpath.send_msg(offlow.clear_all(dpath))
    for msg in ofgroup.clear_all(dpath):
        dpath.send_msg(msg)

    if ofdpa_sim:
        ofdpa2_builtin.setup_flows(dpath, ofctl)
        _lagopus_bugfix(dpath, ofctl)

    setup_term_mac_flow(dpath, ofctl)
    setup_policy_acl_flow(dpath, ofctl)