+ try {
+ actionList.add(new SetNwSrc(InetAddress.getByName("2.2.2.2")));
+ actionList.add(new SetNwDst(InetAddress.getByName("1.1.1.1")));
+ } catch (UnknownHostException e) {
+
+ }
+ actionList.add(new SetNwTos(0x10));
+ actionList.add(new SetTpSrc(4201));
+ actionList.add(new SetTpDst(8080));
+
+ for (Action a : actionList) {
+ Flow flow = new Flow();
+ Match match = new Match();
+ try {
+ match.setField(MatchType.NW_DST,
+ InetAddress.getByName("1.1.1.1"));
+ } catch (UnknownHostException e) {
+
+ }
+ flow.setMatch(match);
+ List<Action> actions = new ArrayList<Action>();
+ actions.add(a);
+ flow.setActions(actions);
+ flow.setPriority((short) 3500);
+ flow.setIdleTimeout((short) 1000);
+ flow.setHardTimeout((short) 2000);
+ flow.setId(12345);
+
+ FlowOnNode fn1 = new FlowOnNode(flow);
+ fn1.setByteCount(100);
+ fn1.setDurationNanoseconds(400);
+ fn1.setDurationSeconds(40);
+ fn1.setTableId((byte) 0x1);
+ fn1.setPacketCount(200);
+
+ list.add(fn1);
+ }