summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java
diff options
context:
space:
mode:
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java')
-rw-r--r--v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java64
1 files changed, 44 insertions, 20 deletions
diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java
index 2d440cdd5..64f1e8a7c 100644
--- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java
+++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java
@@ -1,8 +1,12 @@
package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406;
+import static org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.VppClassifierHoneycombWriterModule.CLASSIFY_SESSION_ID;
+import static org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.VppClassifierHoneycombWriterModule.CLASSIFY_TABLE_ID;
+
import com.google.common.collect.Sets;
import io.fd.honeycomb.v3po.translate.impl.write.GenericListWriter;
import io.fd.honeycomb.v3po.translate.impl.write.GenericWriter;
+import io.fd.honeycomb.v3po.translate.v3po.interfaces.AclCustomizer;
import io.fd.honeycomb.v3po.translate.v3po.interfaces.EthernetCustomizer;
import io.fd.honeycomb.v3po.translate.v3po.interfaces.InterfaceCustomizer;
import io.fd.honeycomb.v3po.translate.v3po.interfaces.L2Customizer;
@@ -27,6 +31,10 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev14061
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Neighbor;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip4Acl;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.Ip6Acl;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.L2Acl;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Acl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Ethernet;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.L2;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Routing;
@@ -38,15 +46,16 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.openvpp.jvpp.future.FutureJVpp;
public class InterfacesHoneycombWriterModule extends
- org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesHoneycombWriterModule {
+ org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesHoneycombWriterModule {
// TODO split configuration and translation code into 2 or more bundles
public static final InstanceIdentifier<Interface> IFC_ID =
- InstanceIdentifier.create(Interfaces.class).child(Interface.class);
+ InstanceIdentifier.create(Interfaces.class).child(Interface.class);
public static final InstanceIdentifier<VppInterfaceAugmentation> VPP_IFC_AUG_ID =
- IFC_ID.augmentation(VppInterfaceAugmentation.class);
+ IFC_ID.augmentation(VppInterfaceAugmentation.class);
public static final InstanceIdentifier<L2> L2_ID = VPP_IFC_AUG_ID.child(L2.class);
+ public static final InstanceIdentifier<Acl> ACL_ID = VPP_IFC_AUG_ID.child(Acl.class);
public InterfacesHoneycombWriterModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
@@ -68,8 +77,9 @@ public class InterfacesHoneycombWriterModule extends
@Override
public java.lang.AutoCloseable createInstance() {
return new InterfacesWriterFactory(getVppJvppIfcDependency(),
- getBridgeDomainContextDependency(),
- getInterfaceContextDependency());
+ getBridgeDomainContextDependency(),
+ getInterfaceContextDependency(),
+ getClassifyTableContextDependency());
}
@@ -78,13 +88,16 @@ public class InterfacesHoneycombWriterModule extends
private final FutureJVpp jvpp;
private final NamingContext bdContext;
private final NamingContext ifcContext;
+ private final NamingContext classifyTableContext;
InterfacesWriterFactory(final FutureJVpp vppJvppIfcDependency,
- final NamingContext bridgeDomainContextDependency,
- final NamingContext interfaceContextDependency) {
+ final NamingContext bridgeDomainContextDependency,
+ final NamingContext interfaceContextDependency,
+ final NamingContext classifyTableContextDependency) {
this.jvpp = vppJvppIfcDependency;
this.bdContext = bridgeDomainContextDependency;
this.ifcContext = interfaceContextDependency;
+ this.classifyTableContext = classifyTableContextDependency;
}
@Override
@@ -102,7 +115,7 @@ public class InterfacesHoneycombWriterModule extends
// Interface1 (ietf-ip augmentation)
addInterface1AugmentationWriters(IFC_ID, registry);
// SubinterfaceAugmentation TODO make dedicated module for subIfc writer factory
- new SubinterfaceAugmentationWriterFactory(jvpp, ifcContext, bdContext).init(registry);
+ new SubinterfaceAugmentationWriterFactory(jvpp, ifcContext, bdContext, classifyTableContext).init(registry);
}
private void addInterface1AugmentationWriters(final InstanceIdentifier<Interface> ifcId,
@@ -110,18 +123,19 @@ public class InterfacesHoneycombWriterModule extends
final InstanceIdentifier<Interface1> ifc1AugId = ifcId.augmentation(Interface1.class);
// Ipv6(after interface) TODO unfinished customizer =
registry.addWriterAfter(new GenericWriter<>(ifc1AugId.child(Ipv6.class), new Ipv6Customizer(jvpp)),
- ifcId);
+ ifcId);
// Ipv4(after interface)
final InstanceIdentifier<Ipv4> ipv4Id = ifc1AugId.child(Ipv4.class);
registry.addWriterAfter(new GenericWriter<>(ipv4Id, new Ipv4Customizer(jvpp, ifcContext)),
- ifcId);
+ ifcId);
// Address(after Ipv4) =
final InstanceIdentifier<Address> ipv4AddressId = ipv4Id.child(Address.class);
registry.addWriterAfter(new GenericListWriter<>(ipv4AddressId, new Ipv4AddressCustomizer(jvpp, ifcContext)),
- ipv4Id);
+ ipv4Id);
// Neighbor(after ipv4Address)
- registry.addWriterAfter(new GenericListWriter<>(ipv4Id.child(Neighbor.class), new Ipv4NeighbourCustomizer(jvpp, ifcContext)),
- ipv4AddressId);
+ registry.addWriterAfter(
+ new GenericListWriter<>(ipv4Id.child(Neighbor.class), new Ipv4NeighbourCustomizer(jvpp, ifcContext)),
+ ipv4AddressId);
}
private void addVppInterfaceAgmentationWriters(final InstanceIdentifier<Interface> ifcId,
@@ -129,19 +143,19 @@ public class InterfacesHoneycombWriterModule extends
// VhostUser(Needs to be executed before Interface customizer) =
final InstanceIdentifier<VhostUser> vhostId = VPP_IFC_AUG_ID.child(VhostUser.class);
registry.addWriterBefore(new GenericWriter<>(vhostId, new VhostUserCustomizer(jvpp, ifcContext)),
- ifcId);
+ ifcId);
// Vxlan(Needs to be executed before Interface customizer) =
final InstanceIdentifier<Vxlan> vxlanId = VPP_IFC_AUG_ID.child(Vxlan.class);
registry.addWriterBefore(new GenericWriter<>(vxlanId, new VxlanCustomizer(jvpp, ifcContext)),
- ifcId);
+ ifcId);
// VxlanGpe(Needs to be executed before Interface customizer) =
final InstanceIdentifier<VxlanGpe> vxlanGpeId = VPP_IFC_AUG_ID.child(VxlanGpe.class);
registry.addWriterBefore(new GenericWriter<>(vxlanGpeId, new VxlanGpeCustomizer(jvpp, ifcContext)),
- ifcId);
+ ifcId);
// Tap(Needs to be executed before Interface customizer) =
final InstanceIdentifier<Tap> tapId = VPP_IFC_AUG_ID.child(Tap.class);
registry.addWriterBefore(new GenericWriter<>(tapId, new TapCustomizer(jvpp, ifcContext)),
- ifcId);
+ ifcId);
final Set<InstanceIdentifier<?>> specificIfcTypes = Sets.newHashSet(vhostId, vxlanGpeId, vxlanGpeId, tapId);
@@ -149,11 +163,21 @@ public class InterfacesHoneycombWriterModule extends
registry.addWriter(new GenericWriter<>(VPP_IFC_AUG_ID.child(Ethernet.class), new EthernetCustomizer(jvpp)));
// Routing(Execute only after specific interface customizers) =
registry.addWriterAfter(
- new GenericWriter<>(VPP_IFC_AUG_ID.child(Routing.class), new RoutingCustomizer(jvpp, ifcContext)),
- specificIfcTypes);
+ new GenericWriter<>(VPP_IFC_AUG_ID.child(Routing.class), new RoutingCustomizer(jvpp, ifcContext)),
+ specificIfcTypes);
// Routing(Execute only after specific interface customizers) =
registry.addWriterAfter(new GenericWriter<>(L2_ID, new L2Customizer(jvpp, ifcContext, bdContext)),
- specificIfcTypes);
+ specificIfcTypes);
+
+ // ACL (execute after classify table and session writers)
+ // also handles L2Acl, Ip4Acl and Ip6Acl:
+ final InstanceIdentifier<Acl> aclId = InstanceIdentifier.create(Acl.class);
+ registry
+ .addSubtreeWriterAfter(
+ Sets.newHashSet(aclId.child(L2Acl.class), aclId.child(Ip4Acl.class), aclId.child(Ip6Acl.class)),
+ new GenericWriter<>(ACL_ID, new AclCustomizer(jvpp, ifcContext, classifyTableContext)),
+ Sets.newHashSet(CLASSIFY_TABLE_ID, CLASSIFY_SESSION_ID)
+ );
}
}