Pavlin Radoslavov

Fixes related to single-point-to-multi-point intents:

 * At the CLI level, the Ingress point argument should be specified
   before the Egress points arguments.
   This follows the natural Ingress/Egress argument ordering for
   other intents.
 * Added missing optional CLI complementer to shell-config.xml

Change-Id: I49f1ec9706a2f47bbb513d388a26fa5d40cba1bd
NOTE: Those changes are carried from Gerrit 1586.
...@@ -36,10 +36,10 @@ import static org.onosproject.net.PortNumber.portNumber; ...@@ -36,10 +36,10 @@ import static org.onosproject.net.PortNumber.portNumber;
36 36
37 37
38 @Command(scope = "onos", name = "add-single-to-multi-intent", 38 @Command(scope = "onos", name = "add-single-to-multi-intent",
39 - description = "Installs connectivity intent between multiple egress devices and a single ingress device") 39 + description = "Installs connectivity intent between a single ingress device and multiple egress devices")
40 public class AddSinglePointToMultiPointIntentCommand extends ConnectivityIntentCommand { 40 public class AddSinglePointToMultiPointIntentCommand extends ConnectivityIntentCommand {
41 - @Argument(index = 0, name = "egressDevices ingressDevice", 41 + @Argument(index = 0, name = "ingressDevice egressDevices",
42 - description = "egressDevice/Port...egressDevice/Port ingressDevice/port", 42 + description = "ingressDevice/Port egressDevice/Port...egressDevice/Port",
43 required = true, multiValued = true) 43 required = true, multiValued = true)
44 String[] deviceStrings = null; 44 String[] deviceStrings = null;
45 45
...@@ -51,14 +51,14 @@ public class AddSinglePointToMultiPointIntentCommand extends ConnectivityIntentC ...@@ -51,14 +51,14 @@ public class AddSinglePointToMultiPointIntentCommand extends ConnectivityIntentC
51 return; 51 return;
52 } 52 }
53 53
54 - String ingressDeviceString = deviceStrings[deviceStrings.length - 1]; 54 + String ingressDeviceString = deviceStrings[0];
55 DeviceId ingressDeviceId = deviceId(getDeviceId(ingressDeviceString)); 55 DeviceId ingressDeviceId = deviceId(getDeviceId(ingressDeviceString));
56 PortNumber ingressPortNumber = portNumber(getPortNumber(ingressDeviceString)); 56 PortNumber ingressPortNumber = portNumber(getPortNumber(ingressDeviceString));
57 ConnectPoint ingressPoint = new ConnectPoint(ingressDeviceId, 57 ConnectPoint ingressPoint = new ConnectPoint(ingressDeviceId,
58 ingressPortNumber); 58 ingressPortNumber);
59 59
60 Set<ConnectPoint> egressPoints = new HashSet<>(); 60 Set<ConnectPoint> egressPoints = new HashSet<>();
61 - for (int index = 0; index < deviceStrings.length - 1; index++) { 61 + for (int index = 1; index < deviceStrings.length; index++) {
62 String egressDeviceString = deviceStrings[index]; 62 String egressDeviceString = deviceStrings[index];
63 DeviceId egressDeviceId = deviceId(getDeviceId(egressDeviceString)); 63 DeviceId egressDeviceId = deviceId(getDeviceId(egressDeviceString));
64 PortNumber egressPortNumber = portNumber(getPortNumber(egressDeviceString)); 64 PortNumber egressPortNumber = portNumber(getPortNumber(egressDeviceString));
......
...@@ -180,6 +180,7 @@ ...@@ -180,6 +180,7 @@
180 </completers> 180 </completers>
181 <optional-completers> 181 <optional-completers>
182 <entry key="-t" value-ref="ethTypeCompleter"/> 182 <entry key="-t" value-ref="ethTypeCompleter"/>
183 + <entry key="--ipProto" value-ref="ipProtocolCompleter"/>
183 </optional-completers> 184 </optional-completers>
184 </command> 185 </command>
185 <command> 186 <command>
......