Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
ArrayList<OFAction> actions = new ArrayList<OFAction>();
 
/* For OpenFlow 1.0 */
if (factory.getVersion().compareTo(OFVersion.OF_10) == 0) {
	OFActionEnqueue enqueue = factory.actions().buildEnqueue()
		.setPort(OFPort.of(2)) /* Must specify port number */
    	.setQueueId(1)
    	.build();
	actions(enqueue);
} else { /* For OpenFlow 1.1+ */
	OFActionSetQueue setQueue = factory.actions().buildSetQueue()
    	.setQueueId(1)
    	.build();
	actions(setQueue);
}
 
OFFlowAdd flowAdd = factory.buildFlowAdd()
    .setActions(actions)
    .build();


Questions, comments? Please send us an email at floodlight-dev@openflowhub.org Write to our email list.