Add implementation for flat L3 overlay
[groupbasedpolicy.git] / renderers / vpp / src / main / java / org / opendaylight / groupbasedpolicy / renderer / vpp / commands / AbstractInterfaceCommand.java
index 27d7bdeee54b5b21cb2c9c0dbb1fa2d0321badfe..8b921d64612968e64bc0353b4f7f9c82785ce25c 100644 (file)
@@ -16,6 +16,9 @@ import org.opendaylight.groupbasedpolicy.renderer.vpp.util.General;
 import org.opendaylight.groupbasedpolicy.renderer.vpp.util.VppIidFactory;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.proxy.arp.rev170315.ProxyArpInterfaceAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.proxy.arp.rev170315.ProxyArpInterfaceAugmentationBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.proxy.arp.rev170315.interfaces._interface.ProxyArpBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -27,8 +30,10 @@ public abstract class AbstractInterfaceCommand implements ConfigCommand, Interfa
     protected General.Operations operation;
     protected String name;
     protected String description;
-    String bridgeDomain;
-    Boolean enabled;
+    protected String bridgeDomain;
+    protected Boolean enabled;
+    protected Boolean enableProxyArp;
+    protected Long vrfId;
 
     public General.Operations getOperation() {
         return operation;
@@ -38,6 +43,10 @@ public abstract class AbstractInterfaceCommand implements ConfigCommand, Interfa
         return name;
     }
 
+    public Long getVrfId() {
+        return vrfId;
+    }
+
     public String getDescription() {
         return description;
     }
@@ -47,7 +56,7 @@ public abstract class AbstractInterfaceCommand implements ConfigCommand, Interfa
         return this;
     }
 
-    String getBridgeDomain() {
+    public String getBridgeDomain() {
         return bridgeDomain;
     }
 
@@ -98,4 +107,12 @@ public abstract class AbstractInterfaceCommand implements ConfigCommand, Interfa
         return VppIidFactory.getInterfaceIID(this.getInterfaceBuilder().getKey());
     }
 
+    protected void addEnableProxyArpAugmentation(InterfaceBuilder interfaceBuilder) {
+        if (enableProxyArp != null) {
+            ProxyArpInterfaceAugmentationBuilder augmentationBuilder = new ProxyArpInterfaceAugmentationBuilder();
+            augmentationBuilder.setProxyArp((new ProxyArpBuilder()).build());
+            interfaceBuilder.addAugmentation(ProxyArpInterfaceAugmentation.class, augmentationBuilder.build());
+        }
+    }
+
 }