- // check output ports
- sstr = Pattern.compile("OUTPUT=(.*)").matcher(actiongrp);
- if (sstr.matches()) {
- for (String t : sstr.group(1).split(",")) {
- if (t != null) {
- if (!isPortValid(sw, t)) {
- String msg = String.format("Output port %s is not valid for this switch", t);
- if (!containerName.equals(GlobalConstants.DEFAULT.toString())) {
- msg += " in Container " + containerName;
- }
- return new Status(StatusCode.BADREQUEST, msg);
- }
- }
- }
- continue;
- }
- // check enqueue
- sstr = Pattern.compile("ENQUEUE=(.*)").matcher(actiongrp);
- if (sstr.matches()) {
- for (String t : sstr.group(1).split(",")) {
- if (t != null) {
- String port = t.split(":")[0];
- if (!isPortValid(sw, port)) {
- String msg = String.format("Output port %d is not valid for this switch", port);
- if (!containerName.equals(GlobalConstants.DEFAULT.toString())) {
- msg += " in Container " + containerName;
- }
- return new Status(StatusCode.BADREQUEST, msg);
- }
- }
- }
- continue;
- }
- // Check src IP
- sstr = Pattern.compile(ActionType.FLOOD.toString()).matcher(actiongrp);
- if (sstr.matches()) {
- if (!containerName.equals(GlobalConstants.DEFAULT.toString())) {
- return new Status(StatusCode.BADREQUEST, String.format(
- "flood is not allowed in container %s", containerName));
- }
- continue;
- }