When Rest module calls createPolicy(), set null for IP_PROTO and ETHER_TYPE when they are not specified by operator.
Change-Id: If7fb3568c3b99d4337c589eb163ae9c699eaeb03
diff --git a/src/main/java/net/onrc/onos/apps/segmentrouting/web/SegmentRouterPolicyResource.java b/src/main/java/net/onrc/onos/apps/segmentrouting/web/SegmentRouterPolicyResource.java
index 694258c..cbea58d 100644
--- a/src/main/java/net/onrc/onos/apps/segmentrouting/web/SegmentRouterPolicyResource.java
+++ b/src/main/java/net/onrc/onos/apps/segmentrouting/web/SegmentRouterPolicyResource.java
@@ -47,7 +47,7 @@
createParams.getPriority(), createParams.getTunnel_id());
boolean result = segmentRoutingService.createPolicy(
- createParams.getPolicy_id(), null, null, (short) 0,
+ createParams.getPolicy_id(), null, null, null,
new IPv4Net(createParams.getSrc_ip()),
new IPv4Net(createParams.getDst_ip()),
getProtoTypeByte(createParams.getProto_type()),
@@ -59,7 +59,7 @@
}
private Byte getProtoTypeByte(String protoType) {
- Byte protoTypeByte = 0;
+ Byte protoTypeByte = null;
switch (protoType) {
case "tcp":
protoTypeByte = IPv4.PROTOCOL_TCP;