- int protocol_number = IPProtocols.getProtocolNumberInt(protocol);
- if (protocol_number < 1 || protocol_number > 255) {
- return false;
- }
- return true;
- }
-
- private Status conflictWithContainerFlow(IContainer container) {
- // Return true if it's default container
- if (container.getName().equals(GlobalConstants.DEFAULT.toString())) {
- return new Status(StatusCode.SUCCESS);
- }
-
- // No container flow = no conflict
- List<ContainerFlow> cFlowList = container.getContainerFlows();
- if (((cFlowList == null)) || cFlowList.isEmpty()) {
- return new Status(StatusCode.SUCCESS);
- }
-
- // Check against each container's flow
- Flow flow = this.getFlow();
-
- // Configuration is rejected if it conflicts with _all_ the container
- // flows
- for (ContainerFlow cFlow : cFlowList) {
- if (cFlow.allowsFlow(flow)) {
- log.trace("Config is congruent with at least one container flow");
- return new Status(StatusCode.SUCCESS);
- }
- }
- String msg = "Flow Config conflicts with all existing container flows";
- log.trace(msg);
-
- return new Status(StatusCode.BADREQUEST, msg);