Reference Guide

Table Of Contents
private static final int FLOW_IDLE_TIMEOUT = 300;
private static final int FLOW_HARD_TIMEOUT = 600;
private static final int FLOW_PRIORITY = 50;
private static final Set<FlowModFlag> FLAGS = EnumSet.of(
FlowModFlag.SEND_FLOW_REM,
FlowModFlag.CHECK_OVERLAP,
FlowModFlag.NO_BYTE_COUNTS
);
private static final MacAddress MAC =
MacAddress.valueOf("00001e:000000");
private static final MacAddress MAC_MASK =
MacAddress.valueOf("ffffff:000000");
private static final PortNumber SMTP_PORT = PortNumber.valueOf(25);
private static final MacAddress MAC_DEST = MacAddress.BROADCAST;
private static final IpAddress IP_DEST = IpAddress.LOOPBACK_IPv4;
private OfmFlowMod sampleFlowModCreation() {
// Create a 1.3 FlowMod ADD message...
OfmMutableFlowMod fm = (OfmMutableFlowMod)
MessageFactory.create(PV, MessageType.FLOW_MOD,
FlowModCommand.ADD);
// NOTE: outPort = ANY and outGroup = ANY by default so we don’t have
// to explicitly set them.
// Also, bufferId defaults to BufferId.NO_BUFFER.
fm.cookie(COOKIE).tableId(TABLE_ID).priority(FLOW_PRIORITY)
.idleTimeout(FLOW_IDLE_TIMEOUT)
.hardTimeout(FLOW_HARD_TIMEOUT)
.flowModFlags(FLAGS)
.match(createMatch());
for (Instruction ins: createInstructions())
fm.addInstruction(ins);
return (OfmFlowMod) fm.toImmutable();
}
private Match createMatch() {
// NOTE static imports of:
// com.hp.of.lib.match.OxmBasicFieldType.*;
MutableMatch mm = MatchFactory.createMatch(PV)
32