Java 类org.projectfloodlight.openflow.protocol.oxm.OFOxmMplsBos 实例源码

项目:fresco_floodlight    文件:FlowModUtils.java   
public static OFFlowModify toFlowModify(OFFlowMod fm) {
    OFVersion version = fm.getVersion();
    OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify();
    if (b.getVersion().compareTo(OFVersion.OF_10) == 0) {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                // cookie-mask not supported
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                // instructions not supported
                .setMatch(fm.getMatch())
                // out-group not supported
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                // table-id not supported
                .setXid(fm.getXid())
                .build();
    } else {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                .setCookieMask(fm.getCookieMask()) // added in OF1.1
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                .setInstructions(fm.getInstructions()) // added in OF1.1
                .setMatch(fm.getMatch())
                .setOutGroup(fm.getOutGroup()) // added in OF1.1
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                .setTableId(fm.getTableId())
                .setXid(fm.getXid())
                .build();
    }
}
项目:iTAP-controller    文件:FlowModUtils.java   
public static OFFlowModify toFlowModify(OFFlowMod fm) {
    OFVersion version = fm.getVersion();
    OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify();
    if (b.getVersion().compareTo(OFVersion.OF_10) == 0) {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                // cookie-mask not supported
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                // instructions not supported
                .setMatch(fm.getMatch())
                // out-group not supported
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                // table-id not supported
                .setXid(fm.getXid())
                .build();
    } else {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                .setCookieMask(fm.getCookieMask()) // added in OF1.1
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                .setInstructions(fm.getInstructions()) // added in OF1.1
                .setMatch(fm.getMatch())
                .setOutGroup(fm.getOutGroup()) // added in OF1.1
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                .setTableId(fm.getTableId())
                .setXid(fm.getXid())
                .build();
    }
}
项目:SDN-Multicast    文件:FlowModUtils.java   
public static OFFlowModify toFlowModify(OFFlowMod fm) {
    OFVersion version = fm.getVersion();
    OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify();
    if (b.getVersion().compareTo(OFVersion.OF_10) == 0) {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                // cookie-mask not supported
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                // instructions not supported
                .setMatch(fm.getMatch())
                // out-group not supported
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                // table-id not supported
                .setXid(fm.getXid())
                .build();
    } else {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                .setCookieMask(fm.getCookieMask()) // added in OF1.1
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                .setInstructions(fm.getInstructions()) // added in OF1.1
                .setMatch(fm.getMatch())
                .setOutGroup(fm.getOutGroup()) // added in OF1.1
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                .setTableId(fm.getTableId())
                .setXid(fm.getXid())
                .build();
    }
}
项目:arscheduler    文件:FlowModUtils.java   
public static OFFlowModify toFlowModify(OFFlowMod fm) {
    OFVersion version = fm.getVersion();
    OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify();
    if (b.getVersion().compareTo(OFVersion.OF_10) == 0) {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                // cookie-mask not supported
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                // instructions not supported
                .setMatch(fm.getMatch())
                // out-group not supported
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                // table-id not supported
                .setXid(fm.getXid())
                .build();
    } else {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                .setCookieMask(fm.getCookieMask()) // added in OF1.1
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                .setInstructions(fm.getInstructions()) // added in OF1.1
                .setMatch(fm.getMatch())
                .setOutGroup(fm.getOutGroup()) // added in OF1.1
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                .setTableId(fm.getTableId())
                .setXid(fm.getXid())
                .build();
    }
}
项目:floodlight1.2-delay    文件:FlowModUtils.java   
public static OFFlowModify toFlowModify(OFFlowMod fm) {
    OFVersion version = fm.getVersion();
    OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify();
    if (b.getVersion().compareTo(OFVersion.OF_10) == 0) {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                // cookie-mask not supported
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                // instructions not supported
                .setMatch(fm.getMatch())
                // out-group not supported
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                // table-id not supported
                .setXid(fm.getXid())
                .build();
    } else {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                .setCookieMask(fm.getCookieMask()) // added in OF1.1
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                .setInstructions(fm.getInstructions()) // added in OF1.1
                .setMatch(fm.getMatch())
                .setOutGroup(fm.getOutGroup()) // added in OF1.1
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                .setTableId(fm.getTableId())
                .setXid(fm.getXid())
                .build();
    }
}
项目:floodlight-hardware    文件:FlowModUtils.java   
public static OFFlowModify toFlowModify(OFFlowMod fm) {
    OFVersion version = fm.getVersion();
    OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify();
    if (b.getVersion().compareTo(OFVersion.OF_10) == 0) {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                // cookie-mask not supported
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                // instructions not supported
                .setMatch(fm.getMatch())
                // out-group not supported
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                // table-id not supported
                .setXid(fm.getXid())
                .build();
    } else {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                .setCookieMask(fm.getCookieMask()) // added in OF1.1
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                .setInstructions(fm.getInstructions()) // added in OF1.1
                .setMatch(fm.getMatch())
                .setOutGroup(fm.getOutGroup()) // added in OF1.1
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                .setTableId(fm.getTableId())
                .setXid(fm.getXid())
                .build();
    }
}
项目:ACAMPController    文件:FlowModUtils.java   
public static OFFlowModify toFlowModify(OFFlowMod fm) {
    OFVersion version = fm.getVersion();
    OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify();
    if (b.getVersion().compareTo(OFVersion.OF_10) == 0) {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                // cookie-mask not supported
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                // instructions not supported
                .setMatch(fm.getMatch())
                // out-group not supported
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                // table-id not supported
                .setXid(fm.getXid())
                .build();
    } else {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                .setCookieMask(fm.getCookieMask()) // added in OF1.1
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                .setInstructions(fm.getInstructions()) // added in OF1.1
                .setMatch(fm.getMatch())
                .setOutGroup(fm.getOutGroup()) // added in OF1.1
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                .setTableId(fm.getTableId())
                .setXid(fm.getXid())
                .build();
    }
}
项目:fast-failover-demo    文件:FlowModUtils.java   
public static OFFlowModify toFlowModify(OFFlowMod fm) {
    OFVersion version = fm.getVersion();
    OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify();
    if (b.getVersion().compareTo(OFVersion.OF_10) == 0) {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                // cookie-mask not supported
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                // instructions not supported
                .setMatch(fm.getMatch())
                // out-group not supported
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                // table-id not supported
                .setXid(fm.getXid())
                .build();
    } else {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                .setCookieMask(fm.getCookieMask()) // added in OF1.1
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                .setInstructions(fm.getInstructions()) // added in OF1.1
                .setMatch(fm.getMatch())
                .setOutGroup(fm.getOutGroup()) // added in OF1.1
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                .setTableId(fm.getTableId())
                .setXid(fm.getXid())
                .build();
    }
}
项目:floodlightLB    文件:FlowModUtils.java   
public static OFFlowModify toFlowModify(OFFlowMod fm) {
    OFVersion version = fm.getVersion();
    OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify();
    if (b.getVersion().compareTo(OFVersion.OF_10) == 0) {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                // cookie-mask not supported
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                // instructions not supported
                .setMatch(fm.getMatch())
                // out-group not supported
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                // table-id not supported
                .setXid(fm.getXid())
                .build();
    } else {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                .setCookieMask(fm.getCookieMask()) // added in OF1.1
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                .setInstructions(fm.getInstructions()) // added in OF1.1
                .setMatch(fm.getMatch())
                .setOutGroup(fm.getOutGroup()) // added in OF1.1
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                .setTableId(fm.getTableId())
                .setXid(fm.getXid())
                .build();
    }
}
项目:DSC    文件:FlowModUtils.java   
public static OFFlowModify toFlowModify(OFFlowMod fm) {
    OFVersion version = fm.getVersion();
    OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify();
    if (b.getVersion().compareTo(OFVersion.OF_10) == 0) {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                // cookie-mask not supported
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                // instructions not supported
                .setMatch(fm.getMatch())
                // out-group not supported
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                // table-id not supported
                .setXid(fm.getXid())
                .build();
    } else {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                .setCookieMask(fm.getCookieMask()) // added in OF1.1
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                .setInstructions(fm.getInstructions()) // added in OF1.1
                .setMatch(fm.getMatch())
                .setOutGroup(fm.getOutGroup()) // added in OF1.1
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                .setTableId(fm.getTableId())
                .setXid(fm.getXid())
                .build();
    }
}
项目:floodlight    文件:FlowModUtils.java   
public static OFFlowModify toFlowModify(OFFlowMod fm) {
    OFVersion version = fm.getVersion();
    OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify();
    if (b.getVersion().compareTo(OFVersion.OF_10) == 0) {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                // cookie-mask not supported
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                // instructions not supported
                .setMatch(fm.getMatch())
                // out-group not supported
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                // table-id not supported
                .setXid(fm.getXid())
                .build();
    } else {
        return b.setActions(fm.getActions())
                .setBufferId(fm.getBufferId())
                .setCookie(fm.getCookie())
                .setCookieMask(fm.getCookieMask()) // added in OF1.1
                .setFlags(fm.getFlags())
                .setHardTimeout(fm.getHardTimeout())
                .setIdleTimeout(fm.getIdleTimeout())
                .setInstructions(fm.getInstructions()) // added in OF1.1
                .setMatch(fm.getMatch())
                .setOutGroup(fm.getOutGroup()) // added in OF1.1
                .setOutPort(fm.getOutPort())
                .setPriority(fm.getPriority())
                .setTableId(fm.getTableId())
                .setXid(fm.getXid())
                .build();
    }
}
项目:spring-open    文件:FlowPusherTest.java   
/**
 * Test FlowObject is correctly converted to message and is sent to a switch.
 */
@SuppressWarnings("unchecked")
@Test
public void testAddFlow() {
    Dpid dpid = new Dpid(DPID_TO_VERIFY);

    // instantiate required objects
    FlowEntry flowEntry1 =
            new FlowEntry(DPID_TO_VERIFY, 1, 11, null,
                    null, 0, 0, Operator.ADD);

    beginInitMock();

    OFFlowModify fm = createMock(OFFlowModify.class);

    OFFlowModify.Builder bld = createMock(OFFlowModify.Builder.class);

    expect(bld.setIdleTimeout(anyInt())).andReturn(bld);
    expect(bld.setHardTimeout(anyInt())).andReturn(bld);
    expect(bld.setPriority(anyShort())).andReturn(bld);
    expect(bld.setBufferId(OFBufferId.NO_BUFFER)).andReturn(bld);
    expect(bld.setCookie(U64.of(anyLong()))).andReturn(bld);
    expect(bld.setMatch(anyObject(Match.class))).andReturn(bld);
    expect(bld.setActions((List<OFAction>) anyObject())).andReturn(bld);
    expect(bld.setOutPort(OFPort.of(anyInt()))).andReturn(bld).atLeastOnce();
    expect(bld.build()).andReturn(fm);

    expect(fm.getXid()).andReturn(XID_TO_VERIFY).anyTimes();
    expect(fm.getType()).andReturn(OFType.FLOW_MOD).anyTimes();

    IOFSwitch sw = createConnectedSwitchMock(DPID_TO_VERIFY);

    try {
        sw.write(anyObject(OFMessage.class), eq((FloodlightContext) null));
        expectLastCall().once();
    } catch (IOException e1) {
        fail("Failed in IOFWrite#write()");
    }

    replay(bld, fm);
    replay(sw);

    endInitMock();
    initPusher(1);

    pusher.pushFlowEntry(dpid, flowEntry1);

    try {
        Thread.sleep(1000);
    } catch (InterruptedException e) {
        fail("Failed to sleep");
    }

    verify(sw);
    verifyAll();

    pusher.stop();
}