Charles M.C. Chan

Pass the selector/treatment set by CLI to the HostToHostIntent

NOTE:
During PathIntent compilation, the ethSrc and ethDst in the selector will be overridden by the MAC of the end-points.
Also, an output action will be appended to the treatment.

Change-Id: Ie2e621b91203a49237e7466b919abedceb3e697d
...@@ -20,6 +20,8 @@ import java.util.List; ...@@ -20,6 +20,8 @@ import java.util.List;
20 import org.apache.karaf.shell.commands.Argument; 20 import org.apache.karaf.shell.commands.Argument;
21 import org.apache.karaf.shell.commands.Command; 21 import org.apache.karaf.shell.commands.Command;
22 import org.onosproject.net.HostId; 22 import org.onosproject.net.HostId;
23 +import org.onosproject.net.flow.TrafficSelector;
24 +import org.onosproject.net.flow.TrafficTreatment;
23 import org.onosproject.net.intent.Constraint; 25 import org.onosproject.net.intent.Constraint;
24 import org.onosproject.net.intent.HostToHostIntent; 26 import org.onosproject.net.intent.HostToHostIntent;
25 import org.onosproject.net.intent.IntentService; 27 import org.onosproject.net.intent.IntentService;
...@@ -46,6 +48,8 @@ public class AddHostToHostIntentCommand extends ConnectivityIntentCommand { ...@@ -46,6 +48,8 @@ public class AddHostToHostIntentCommand extends ConnectivityIntentCommand {
46 HostId oneId = HostId.hostId(one); 48 HostId oneId = HostId.hostId(one);
47 HostId twoId = HostId.hostId(two); 49 HostId twoId = HostId.hostId(two);
48 50
51 + TrafficSelector selector = buildTrafficSelector();
52 + TrafficTreatment treatment = buildTrafficTreatment();
49 List<Constraint> constraints = buildConstraints(); 53 List<Constraint> constraints = buildConstraints();
50 54
51 HostToHostIntent intent = HostToHostIntent.builder() 55 HostToHostIntent intent = HostToHostIntent.builder()
...@@ -53,6 +57,8 @@ public class AddHostToHostIntentCommand extends ConnectivityIntentCommand { ...@@ -53,6 +57,8 @@ public class AddHostToHostIntentCommand extends ConnectivityIntentCommand {
53 .key(key()) 57 .key(key())
54 .one(oneId) 58 .one(oneId)
55 .two(twoId) 59 .two(twoId)
60 + .selector(selector)
61 + .treatment(treatment)
56 .constraints(constraints) 62 .constraints(constraints)
57 .priority(priority()) 63 .priority(priority())
58 .build(); 64 .build();
......