16 package org.openkilda.floodlight.test.standard;
18 import static java.util.Collections.singletonList;
22 import net.floodlightcontroller.util.FlowModUtils;
23 import org.projectfloodlight.openflow.protocol.OFFlowAdd;
24 import org.projectfloodlight.openflow.protocol.match.MatchField;
25 import org.projectfloodlight.openflow.types.OFBufferId;
26 import org.projectfloodlight.openflow.types.OFPort;
27 import org.projectfloodlight.openflow.types.OFVlanVidMatch;
28 import org.projectfloodlight.openflow.types.U64;
30 import java.util.Arrays;
35 long meterId,
long cookie) {
37 .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
38 .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
39 .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
40 .setBufferId(OFBufferId.NO_BUFFER)
41 .setPriority(DEFAULT_RULE_PRIORITY)
43 .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
44 .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(inputVlan))
46 .setInstructions(Arrays.asList(
47 ofFactory.instructions().buildMeter().setMeterId(meterId).build(),
48 ofFactory.instructions().applyActions(Arrays.asList(
51 .setValue(OFVlanVidMatch.ofVlan(transitVlan))
55 .setMaxLen(0xFFFFFFFF)
56 .setPort(OFPort.of(outputPort))
66 public OFFlowAdd
egressPushFlowMod(
int inputPort,
int outputPort,
int transitVlan,
int outputVlan,
long cookie) {
68 .setCookie(U64.of(cookie & FLOW_COOKIE_MASK))
69 .setHardTimeout(FlowModUtils.INFINITE_TIMEOUT)
70 .setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT)
71 .setBufferId(OFBufferId.NO_BUFFER)
72 .setPriority(DEFAULT_RULE_PRIORITY)
74 .setExact(MatchField.IN_PORT, OFPort.of(inputPort))
75 .setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(transitVlan))
77 .setInstructions(singletonList(
78 ofFactory.instructions().applyActions(Arrays.asList(
81 .setValue(OFVlanVidMatch.ofVlan(outputVlan))
85 .setMaxLen(0xFFFFFFFF)
86 .setPort(OFPort.of(outputPort))
95 public OFFlowAdd
egressPopFlowMod(
int inputPort,
int outputPort,
int transitVlan,
long cookie) {
100 public OFFlowAdd
egressReplaceFlowMod(
int inputPort,
int outputPort,
int inputVlan,
int outputVlan,
long cookie) {
static final int DEFAULT_RULE_PRIORITY
OFFlowAdd egressPopFlowMod(int inputPort, int outputPort, int transitVlan, long cookie)
OFFlowAdd egressNoneFlowMod(int inputPort, int outputPort, int transitVlan, long cookie)
OFFlowAdd egressReplaceFlowMod(int inputPort, int outputPort, int inputVlan, int outputVlan, long cookie)
OFFlowAdd egressPushFlowMod(int inputPort, int outputPort, int transitVlan, int outputVlan, long cookie)
static final long FLOW_COOKIE_MASK
OFFlowAdd ingressMatchVlanIdFlowMod(int inputPort, int outputPort, int inputVlan, int transitVlan, long meterId, long cookie)