}
container acl {
- uses acl-base-attributes;
+ container ingress {
+ uses acl-base-attributes;
+ }
+ container egress {
+ uses acl-base-attributes;
+ }
}
container ietf-acl {
- uses ietf-acl-base-attributes;
+ container ingress {
+ uses ietf-acl-base-attributes;
+ }
+ container egress {
+ uses ietf-acl-base-attributes;
+ }
}
}
}
container acl {
- uses acl-base-attributes;
+ container ingress {
+ uses acl-base-attributes;
+ }
+ container egress {
+ uses acl-base-attributes;
+ }
}
container ietf-acl {
- uses ietf-acl-base-attributes;
+ container ingress {
+ uses ietf-acl-base-attributes;
+ }
+ container egress {
+ uses ietf-acl-base-attributes;
+ }
}
}
}
container acl {
- uses v3po:acl-base-attributes;
+ container ingress {
+ uses v3po:acl-base-attributes;
+ }
+ container egress {
+ uses v3po:acl-base-attributes;
+ }
}
container ietf-acl {
- uses v3po:ietf-acl-base-attributes;
+ container ingress {
+ uses v3po:ietf-acl-base-attributes;
+ }
+ container egress {
+ uses v3po:ietf-acl-base-attributes;
+ }
}
}
{
"id": "17b4b10b-83da-7cdd-d291-16f8367b7783",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/local0/v3po:ietf-acl/access-lists/acl/ietf-access-control-list:ipv4-acl/acl3",
+ "url": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/local0/ietf-acl/ingress/access-lists/acl/ietf-access-control-list:ipv4-acl/acl3",
"preRequestScript": "",
"pathVariables": {},
"method": "PUT",
{
"id": "24ac98f0-1556-e623-ec87-1c2d7f4f089c",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/local0/v3po:acl",
+ "url": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/local0/acl/ingress",
"preRequestScript": "",
"pathVariables": {},
"method": "PUT",
"collectionId": "5bad4634-e5cf-900e-9733-0976aa9bea64",
"responses": [],
"folder": "d47d6b3b-4c3f-7671-5bba-447d6c59ea3b",
- "rawModeData": "{\n \"v3po:acl\": {\n \"l2-acl\": {\n \"classify-table\": \"table0\"\n },\n \"ip4-acl\": {\n \"classify-table\": \"table0\"\n }\n }\n}"
+ "rawModeData": "{\n \"ingress\": {\n \"l2-acl\": {\n \"classify-table\": \"table0\"\n },\n \"ip4-acl\": {\n \"classify-table\": \"table0\"\n }\n }\n}"
},
{
"id": "24fdd76e-e90b-d552-c0d1-87a745a5ac6f",
{
"id": "46c3bf20-4abd-07f8-3d74-7fd573ebb970",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/local0/v3po:ietf-acl",
+ "url": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/local0/ietf-acl/ingress",
"preRequestScript": "",
"pathVariables": {},
"method": "PUT",
"description": "Creates chain of classfy tabless/sessions in VPP and assigns them to local0 interface.\n\nCan be verified with:\nvppctl show classify table verbose\n\nthen:\nvppctl show inacl type l2",
"collectionId": "5bad4634-e5cf-900e-9733-0976aa9bea64",
"responses": [],
- "rawModeData": "{\n \"v3po:ietf-acl\": {\n \"access-lists\": {\n \"acl\": [\n {\n \"type\" : \"ietf-access-control-list:eth-acl\",\n \"name\" : \"acl1\"\n },\n {\n \"type\" : \"ietf-access-control-list:eth-acl\",\n \"name\" : \"acl2\"\n }\n ]\n }\n }\n}",
+ "rawModeData": "{\n \"ingress\": {\n \"access-lists\": {\n \"acl\": [\n {\n \"type\" : \"ietf-access-control-list:eth-acl\",\n \"name\" : \"acl1\"\n },\n {\n \"type\" : \"ietf-access-control-list:eth-acl\",\n \"name\" : \"acl2\"\n }\n ]\n }\n }\n}",
"folder": "c05d7211-11b0-5688-2079-afa51196045c"
},
{
{
"id": "52d38df8-8d85-d6f0-dccd-cbd8544631f9",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/local0/v3po:ietf-acl/access-lists/acl/ietf-access-control-list:ipv6-acl/acl4",
+ "url": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/local0/ietf-acl/ingress/access-lists/acl/ietf-access-control-list:ipv6-acl/acl4",
"preRequestScript": "",
"pathVariables": {},
"method": "PUT",
import com.google.common.collect.Sets;
import io.fd.honeycomb.translate.impl.write.GenericListWriter;
-import io.fd.honeycomb.translate.v3po.interfaces.acl.AclWriter;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.IetfAclWriter;
import io.fd.honeycomb.translate.write.WriterFactory;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
import javax.annotation.Nonnull;
final InstanceIdentifier<Matches> matchesId = aceId.child(Matches.class);
registry.subtreeAddBefore(Sets.newHashSet(aceId, actionsId, matchesId),
- new GenericListWriter<>(ACL_ID, new AclWriter()),
+ new GenericListWriter<>(ACL_ID, new IetfAclWriter()),
Sets.newHashSet(IETF_ACL_ID, SUBIF_IETF_ACL_ID));
}
}
import com.google.inject.Inject;
import com.google.inject.Provider;
-import io.fd.honeycomb.translate.v3po.interfaces.acl.IetfAClWriter;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.IetfAClWriter;
import io.fd.vpp.jvpp.core.future.FutureJVppCore;
class IetfAClWriterProvider implements Provider<IetfAClWriter> {
import io.fd.honeycomb.translate.impl.read.GenericReader;
import io.fd.honeycomb.translate.read.ReaderFactory;
import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
-import io.fd.honeycomb.translate.v3po.interfacesstate.AclCustomizer;
import io.fd.honeycomb.translate.v3po.interfacesstate.EthernetCustomizer;
import io.fd.honeycomb.translate.v3po.interfacesstate.GreCustomizer;
+import io.fd.honeycomb.translate.v3po.interfacesstate.acl.ingress.AclCustomizer;
import io.fd.honeycomb.translate.v3po.interfacesstate.InterfaceCustomizer;
import io.fd.honeycomb.translate.v3po.interfacesstate.L2Customizer;
import io.fd.honeycomb.translate.v3po.interfacesstate.ProxyArpCustomizer;
import io.fd.honeycomb.translate.v3po.interfacesstate.ip.Ipv4Customizer;
import io.fd.honeycomb.translate.v3po.interfacesstate.ip.Ipv4NeighbourCustomizer;
import io.fd.honeycomb.translate.v3po.interfacesstate.ip.Ipv6Customizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
+import io.fd.honeycomb.translate.vpp.util.NamingContext;
+import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesStateBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
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.state._interface.Acl;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.AclBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Ethernet;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Gre;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.L2;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VhostUser;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Vxlan;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VxlanGpe;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.acl.Ingress;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
public final class InterfacesStateReaderFactory implements ReaderFactory {
private final FutureJVppCore jvpp;
static final InstanceIdentifier<InterfacesState> IFC_STATE_ID =
- InstanceIdentifier.create(InterfacesState.class);
+ InstanceIdentifier.create(InterfacesState.class);
static final InstanceIdentifier<Interface> IFC_ID = IFC_STATE_ID.child(Interface.class);
@Inject
private void initVppIfcAugmentationReaders(final ModifiableReaderRegistryBuilder registry,
final InstanceIdentifier<Interface> ifcId) {
// VppInterfaceStateAugmentation
- final InstanceIdentifier<VppInterfaceStateAugmentation> vppIfcAugId = ifcId.augmentation(VppInterfaceStateAugmentation.class);
+ final InstanceIdentifier<VppInterfaceStateAugmentation> vppIfcAugId =
+ ifcId.augmentation(VppInterfaceStateAugmentation.class);
registry.addStructuralReader(vppIfcAugId, VppInterfaceStateAugmentationBuilder.class);
// Ethernet
- registry.add(new GenericReader<>(vppIfcAugId.child(Ethernet.class), new EthernetCustomizer(jvpp, ifcNamingCtx)));
+ registry
+ .add(new GenericReader<>(vppIfcAugId.child(Ethernet.class), new EthernetCustomizer(jvpp, ifcNamingCtx)));
// Tap
registry.add(new GenericReader<>(vppIfcAugId.child(Tap.class), new TapCustomizer(jvpp, ifcNamingCtx)));
// VhostUser
- registry.add(new GenericReader<>(vppIfcAugId.child(VhostUser.class), new VhostUserCustomizer(jvpp, ifcNamingCtx)));
+ registry
+ .add(new GenericReader<>(vppIfcAugId.child(VhostUser.class), new VhostUserCustomizer(jvpp, ifcNamingCtx)));
// Vxlan
registry.add(new GenericReader<>(vppIfcAugId.child(Vxlan.class), new VxlanCustomizer(jvpp, ifcNamingCtx)));
// VxlanGpe
- registry.add(new GenericReader<>(vppIfcAugId.child(VxlanGpe.class), new VxlanGpeCustomizer(jvpp, ifcNamingCtx)));
+ registry
+ .add(new GenericReader<>(vppIfcAugId.child(VxlanGpe.class), new VxlanGpeCustomizer(jvpp, ifcNamingCtx)));
// Gre
registry.add(new GenericReader<>(vppIfcAugId.child(Gre.class), new GreCustomizer(jvpp, ifcNamingCtx)));
// L2
- registry.add(new GenericReader<>(vppIfcAugId.child(L2.class), new L2Customizer(jvpp, ifcNamingCtx, bdNamingCtx)));
- // Acl(Subtree)
- final InstanceIdentifier<Acl> aclIdRelative = InstanceIdentifier.create(Acl.class);
+ registry
+ .add(new GenericReader<>(vppIfcAugId.child(L2.class), new L2Customizer(jvpp, ifcNamingCtx, bdNamingCtx)));
+ // Acl(Structural)
+ final InstanceIdentifier<Acl> aclIid = vppIfcAugId.child(Acl.class);
+ registry.addStructuralReader(aclIid, AclBuilder.class);
+ // Ingress(Subtree)
+ final InstanceIdentifier<Ingress> ingressIdRelative = InstanceIdentifier.create(Ingress.class);
registry.subtreeAdd(
- Sets.newHashSet(aclIdRelative.child(L2Acl.class), aclIdRelative.child(Ip4Acl.class), aclIdRelative.child(Ip6Acl.class)),
- new GenericReader<>(vppIfcAugId.child(Acl.class), new AclCustomizer(jvpp, ifcNamingCtx,
+ Sets.newHashSet(ingressIdRelative.child(L2Acl.class), ingressIdRelative.child(Ip4Acl.class),
+ ingressIdRelative.child(Ip6Acl.class)),
+ new GenericReader<>(aclIid.child(Ingress.class),
+ new AclCustomizer(jvpp, ifcNamingCtx,
classifyContext)));
// Proxy ARP
registry.add(new GenericReader<>(vppIfcAugId.child(ProxyArp.class), new ProxyArpCustomizer(jvpp,
- ifcNamingCtx)));
+ ifcNamingCtx)));
}
}
import com.google.inject.name.Named;
import io.fd.honeycomb.translate.impl.write.GenericListWriter;
import io.fd.honeycomb.translate.impl.write.GenericWriter;
-import io.fd.honeycomb.translate.v3po.interfaces.AclCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.EthernetCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.GreCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.InterfaceCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.VhostUserCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.VxlanCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.VxlanGpeCustomizer;
-import io.fd.honeycomb.translate.v3po.interfaces.acl.IetfAClWriter;
-import io.fd.honeycomb.translate.v3po.interfaces.acl.IetfAclCustomizer;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.AclCustomizer;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.IetfAClWriter;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.IetfAclCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv4AddressCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv4Customizer;
import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv4NeighbourCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.ip.Ipv6Customizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
+import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.write.WriterFactory;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
+import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import java.util.Set;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.VhostUser;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Vxlan;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.VxlanGpe;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.acl.Ingress;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
public final class InterfacesWriterFactory implements WriterFactory {
public static final InstanceIdentifier<VppInterfaceAugmentation> VPP_IFC_AUG_ID =
IFC_ID.augmentation(VppInterfaceAugmentation.class);
public static final InstanceIdentifier<Acl> ACL_ID = VPP_IFC_AUG_ID.child(Acl.class);
+ public static final InstanceIdentifier<Ingress> INGRESS_ACL_ID = ACL_ID.child(Ingress.class);
public static final InstanceIdentifier<L2> L2_ID = VPP_IFC_AUG_ID.child(L2.class);
public static final InstanceIdentifier<IetfAcl> IETF_ACL_ID = VPP_IFC_AUG_ID.child(IetfAcl.class);
+ public static final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.ietf.acl.Ingress>
+ INGRESS_IETF_ACL_ID = IETF_ACL_ID.child(
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.ietf.acl.Ingress.class);
private final FutureJVppCore jvpp;
private final IetfAClWriter aclWriter;
final InstanceIdentifier<Interface1> ifc1AugId = ifcId.augmentation(Interface1.class);
// Ipv6(after interface) =
registry.addAfter(new GenericWriter<>(ifc1AugId.child(Ipv6.class), new Ipv6Customizer(jvpp)),
- ifcId);
+ ifcId);
// Ipv4(after interface)
final InstanceIdentifier<Ipv4> ipv4Id = ifc1AugId.child(Ipv4.class);
registry.addAfter(new GenericWriter<>(ipv4Id, new Ipv4Customizer(jvpp)),
- ifcId);
+ ifcId);
// Address(after Ipv4) =
final InstanceIdentifier<Address> ipv4AddressId = ipv4Id.child(Address.class);
registry.addAfter(new GenericListWriter<>(ipv4AddressId, new Ipv4AddressCustomizer(jvpp, ifcNamingContext)),
- ipv4Id);
+ ipv4Id);
// Neighbor(after ipv4Address)
registry.addAfter(new GenericListWriter<>(ipv4Id.child(Neighbor.class), new Ipv4NeighbourCustomizer(jvpp,
- ifcNamingContext)),
- ipv4AddressId);
+ ifcNamingContext)),
+ ipv4AddressId);
}
private void addVppInterfaceAgmentationWriters(final InstanceIdentifier<Interface> ifcId,
// VhostUser(Needs to be executed before Interface customizer) =
final InstanceIdentifier<VhostUser> vhostId = VPP_IFC_AUG_ID.child(VhostUser.class);
registry.addBefore(new GenericWriter<>(vhostId, new VhostUserCustomizer(jvpp, ifcNamingContext)),
- ifcId);
+ ifcId);
// Vxlan(Needs to be executed before Interface customizer) =
final InstanceIdentifier<Vxlan> vxlanId = VPP_IFC_AUG_ID.child(Vxlan.class);
registry.addBefore(new GenericWriter<>(vxlanId, new VxlanCustomizer(jvpp, ifcNamingContext, ifcDisableContext)),
- ifcId);
+ ifcId);
// VxlanGpe(Needs to be executed before Interface customizer) =
final InstanceIdentifier<VxlanGpe> vxlanGpeId = VPP_IFC_AUG_ID.child(VxlanGpe.class);
registry.addBefore(new GenericWriter<>(vxlanGpeId,
- new VxlanGpeCustomizer(jvpp, ifcNamingContext, ifcDisableContext)), ifcId);
+ new VxlanGpeCustomizer(jvpp, ifcNamingContext, ifcDisableContext)), ifcId);
// Tap(Needs to be executed before Interface customizer) =
final InstanceIdentifier<Tap> tapId = VPP_IFC_AUG_ID.child(Tap.class);
registry.addBefore(new GenericWriter<>(tapId, new TapCustomizer(jvpp, ifcNamingContext)),
- ifcId);
+ ifcId);
// Gre(Needs to be executed before Interface customizer) =
final InstanceIdentifier<Gre> greId = VPP_IFC_AUG_ID.child(Gre.class);
registry.addBefore(new GenericWriter<>(greId, new GreCustomizer(jvpp, ifcNamingContext)),
- ifcId);
+ ifcId);
final Set<InstanceIdentifier<?>> specificIfcTypes = Sets.newHashSet(vhostId, vxlanGpeId, vxlanGpeId, tapId);
registry.add(new GenericWriter<>(VPP_IFC_AUG_ID.child(Ethernet.class), new EthernetCustomizer(jvpp)));
// Routing(Execute only after specific interface customizers) =
registry.addAfter(
- new GenericWriter<>(VPP_IFC_AUG_ID.child(Routing.class), new RoutingCustomizer(jvpp, ifcNamingContext)),
- specificIfcTypes);
+ new GenericWriter<>(VPP_IFC_AUG_ID.child(Routing.class), new RoutingCustomizer(jvpp, ifcNamingContext)),
+ specificIfcTypes);
// L2(Execute only after subinterface (and all other ifc types) =
registry.addAfter(new GenericWriter<>(L2_ID, new L2Customizer(jvpp, ifcNamingContext, bdNamingContext)),
- SubinterfaceAugmentationWriterFactory.SUB_IFC_ID);
+ SubinterfaceAugmentationWriterFactory.SUB_IFC_ID);
// Proxy Arp (execute after specific interface customizers)
registry.addAfter(
- new GenericWriter<>(VPP_IFC_AUG_ID.child(ProxyArp.class), new ProxyArpCustomizer(jvpp)),
- specificIfcTypes);
- // ACL (execute after classify table and session writers)
+ new GenericWriter<>(VPP_IFC_AUG_ID.child(ProxyArp.class), new ProxyArpCustomizer(jvpp)),
+ specificIfcTypes);
+ // Ingress (execute after classify table and session writers)
// also handles L2Acl, Ip4Acl and Ip6Acl:
- final InstanceIdentifier<Acl> aclId = InstanceIdentifier.create(Acl.class);
+ final InstanceIdentifier<Ingress> ingressId = InstanceIdentifier.create(Ingress.class);
registry
.subtreeAddAfter(
- Sets.newHashSet(aclId.child(L2Acl.class), aclId.child(Ip4Acl.class), aclId.child(Ip6Acl.class)),
- new GenericWriter<>(ACL_ID, new AclCustomizer(jvpp, ifcNamingContext, classifyTableContext)),
+ Sets.newHashSet(ingressId.child(L2Acl.class), ingressId.child(Ip4Acl.class), ingressId.child(Ip6Acl.class)),
+ new GenericWriter<>(INGRESS_ACL_ID,
+ new AclCustomizer(jvpp, ifcNamingContext, classifyTableContext)),
Sets.newHashSet(CLASSIFY_TABLE_ID, CLASSIFY_SESSION_ID));
- // IETF-ACL, also handles IetfAcl, AccessLists and Acl:
- final InstanceIdentifier<AccessLists> accessListsID = InstanceIdentifier.create(IetfAcl.class)
+ // Ingress IETF-ACL, also handles AccessLists and Acl:
+ final InstanceIdentifier<AccessLists> accessListsID = InstanceIdentifier.create(
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.ietf.acl.Ingress.class)
.child(AccessLists.class);
final InstanceIdentifier<?> aclListId = accessListsID.child(
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.ietf.acl.base.attributes.access.lists.Acl.class);
registry.subtreeAdd(
Sets.newHashSet(accessListsID, aclListId),
- new GenericWriter<>(IETF_ACL_ID, new IetfAclCustomizer(aclWriter, ifcNamingContext)));
+ new GenericWriter<>(INGRESS_IETF_ACL_ID, new IetfAclCustomizer(aclWriter, ifcNamingContext)));
}
import io.fd.honeycomb.translate.impl.write.GenericListWriter;
import io.fd.honeycomb.translate.impl.write.GenericWriter;
import io.fd.honeycomb.translate.v3po.interfaces.RewriteCustomizer;
-import io.fd.honeycomb.translate.v3po.interfaces.SubInterfaceAclCustomizer;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.SubInterfaceAclCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.SubInterfaceCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.SubInterfaceL2Customizer;
-import io.fd.honeycomb.translate.v3po.interfaces.acl.IetfAClWriter;
-import io.fd.honeycomb.translate.v3po.interfaces.acl.SubInterfaceIetfAclCustomizer;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.IetfAClWriter;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.SubInterfaceIetfAclCustomizer;
import io.fd.honeycomb.translate.v3po.interfaces.ip.SubInterfaceIpv4AddressCustomizer;
import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.L2;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Tags;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.Ingress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.l2.Rewrite;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.tags.Tag;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.Ipv4;
public static final InstanceIdentifier<L2> L2_ID = SUB_IFC_ID.child(
L2.class);
public static final InstanceIdentifier<Acl> SUBIF_ACL_ID = SUB_IFC_ID.child(Acl.class);
+ public static final InstanceIdentifier<Ingress> SUBIF_INGRESS_ACL_ID = SUBIF_ACL_ID.child(Ingress.class);
public static final InstanceIdentifier<IetfAcl> SUBIF_IETF_ACL_ID = SUB_IFC_ID.child(IetfAcl.class);
+ public static final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.ietf.acl.Ingress> SUBIF_INGRESS_IETF_ACL_ID = SUBIF_IETF_ACL_ID.child(
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.ietf.acl.Ingress.class);
public SubinterfaceAugmentationWriterFactory(final FutureJVppCore jvpp,
final IetfAClWriter aclWriter,
new SubInterfaceIpv4AddressCustomizer(jvpp, ifcContext)),
rewriteId);
- // ACL (execute after classify table and session writers)
+ // Ingress (execute after classify table and session writers)
// also handles L2Acl, Ip4Acl and Ip6Acl:
- final InstanceIdentifier<Acl> aclId = InstanceIdentifier.create(Acl.class);
+ final InstanceIdentifier<Ingress> aclId = InstanceIdentifier.create(Ingress.class);
registry
.subtreeAddAfter(
Sets.newHashSet(aclId.child(L2Acl.class), aclId.child(Ip4Acl.class), aclId.child(Ip6Acl.class)),
- new GenericWriter<>(SUBIF_ACL_ID, new SubInterfaceAclCustomizer(jvpp, ifcContext, classifyTableContext)),
+ new GenericWriter<>(SUBIF_INGRESS_ACL_ID, new SubInterfaceAclCustomizer(jvpp, ifcContext, classifyTableContext)),
Sets.newHashSet(CLASSIFY_TABLE_ID, CLASSIFY_SESSION_ID));
- // IETF-ACL, also handles IetfAcl, AccessLists and Acl:
- final InstanceIdentifier<AccessLists> accessListsID = InstanceIdentifier.create(IetfAcl.class)
+ // Ingress IETF-ACL, also handles AccessLists and Acl:
+ final InstanceIdentifier<AccessLists> accessListsID = InstanceIdentifier.create(
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.ietf.acl.Ingress.class)
.child(AccessLists.class);
final InstanceIdentifier<?> aclListId = accessListsID.child(
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.ietf.acl.base.attributes.access.lists.Acl.class);
registry.subtreeAdd(
Sets.newHashSet(accessListsID, aclListId),
- new GenericWriter<>(SUBIF_IETF_ACL_ID, new SubInterfaceIetfAclCustomizer(aclWriter, ifcContext)));
+ new GenericWriter<>(SUBIF_INGRESS_IETF_ACL_ID, new SubInterfaceIetfAclCustomizer(aclWriter, ifcContext)));
}
}
import io.fd.honeycomb.translate.read.ReaderFactory;
import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
import io.fd.honeycomb.translate.v3po.interfacesstate.RewriteCustomizer;
-import io.fd.honeycomb.translate.v3po.interfacesstate.SubInterfaceAclCustomizer;
import io.fd.honeycomb.translate.v3po.interfacesstate.SubInterfaceCustomizer;
+import io.fd.honeycomb.translate.v3po.interfacesstate.acl.ingress.SubInterfaceAclCustomizer;
import io.fd.honeycomb.translate.v3po.interfacesstate.SubInterfaceL2Customizer;
import io.fd.honeycomb.translate.v3po.interfacesstate.ip.SubInterfaceIpv4AddressCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
+import io.fd.honeycomb.translate.vpp.util.NamingContext;
+import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.or.any.Dot1qTag;
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.vpp.vlan.rev150527.interfaces.state._interface.sub.interfaces.SubInterface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.match.attributes.match.type.vlan.tagged.VlanTagged;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Acl;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.AclBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.L2;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Tags;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.Ingress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.l2.Rewrite;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.tags.Tag;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.Ipv4;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.ip4.attributes.ipv4.Address;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.tag.rewrite.PushTags;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
final class SubinterfaceStateAugmentationReaderFactory implements ReaderFactory {
private final VppClassifierContextManager classifyCtx;
SubinterfaceStateAugmentationReaderFactory(final FutureJVppCore jvpp, final NamingContext ifcCtx,
- final NamingContext bdCtx, final VppClassifierContextManager classifyCtx) {
+ final NamingContext bdCtx,
+ final VppClassifierContextManager classifyCtx) {
this.jvpp = jvpp;
this.ifcCtx = ifcCtx;
this.bdCtx = bdCtx;
public void init(final ModifiableReaderRegistryBuilder registry) {
// SubinterfaceStateAugmentation(Structural)
final InstanceIdentifier<SubinterfaceStateAugmentation> subIfcAugId =
- InterfacesStateReaderFactory.IFC_ID.augmentation(SubinterfaceStateAugmentation.class);
+ InterfacesStateReaderFactory.IFC_ID.augmentation(SubinterfaceStateAugmentation.class);
registry.addStructuralReader(subIfcAugId, SubinterfaceStateAugmentationBuilder.class);
// SubInterfaces(Structural)
final InstanceIdentifier<SubInterfaces> subIfcsId = subIfcAugId.child(SubInterfaces.class);
// SubInterface(Subtree)
final InstanceIdentifier<SubInterface> subIfcId = subIfcsId.child(SubInterface.class);
registry.subtreeAdd(Sets.newHashSet(
- InstanceIdentifier.create(SubInterface.class).child(Tags.class),
- InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class),
- InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class).child(Dot1qTag.class),
- InstanceIdentifier.create(SubInterface.class).child(Match.class),
- InstanceIdentifier.create(SubInterface.class).child(Match.class).child(VlanTagged.class)),
- new GenericListReader<>(subIfcId, new SubInterfaceCustomizer(jvpp, ifcCtx)));
+ InstanceIdentifier.create(SubInterface.class).child(Tags.class),
+ InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class),
+ InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class).child(Dot1qTag.class),
+ InstanceIdentifier.create(SubInterface.class).child(Match.class),
+ InstanceIdentifier.create(SubInterface.class).child(Match.class).child(VlanTagged.class)),
+ new GenericListReader<>(subIfcId, new SubInterfaceCustomizer(jvpp, ifcCtx)));
// L2
final InstanceIdentifier<L2> l2Id = subIfcId.child(L2.class);
registry.add(new GenericReader<>(l2Id, new SubInterfaceL2Customizer(jvpp, ifcCtx, bdCtx)));
// Rewrite(Subtree)
registry.subtreeAdd(Sets.newHashSet(
- InstanceIdentifier.create(Rewrite.class).child(PushTags.class),
- InstanceIdentifier.create(Rewrite.class).child(PushTags.class)
- .child(org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.Dot1qTag.class)),
- new GenericReader<>(l2Id.child(Rewrite.class), new RewriteCustomizer(jvpp, ifcCtx)));
+ InstanceIdentifier.create(Rewrite.class).child(PushTags.class),
+ InstanceIdentifier.create(Rewrite.class).child(PushTags.class)
+ .child(
+ org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.Dot1qTag.class)),
+ new GenericReader<>(l2Id.child(Rewrite.class), new RewriteCustomizer(jvpp, ifcCtx)));
// Ipv4(Structural)
final InstanceIdentifier<Ipv4> ipv4Id = subIfcId.child(Ipv4.class);
registry.addStructuralReader(ipv4Id, Ipv4Builder.class);
// Address
- registry.add(new GenericListReader<>(ipv4Id.child(Address.class), new SubInterfaceIpv4AddressCustomizer(jvpp, ifcCtx)));
- // Acl(Subtree)
- final InstanceIdentifier<Acl> aclIdRelative = InstanceIdentifier.create(Acl.class);
+ registry.add(
+ new GenericListReader<>(ipv4Id.child(Address.class), new SubInterfaceIpv4AddressCustomizer(jvpp, ifcCtx)));
+ // Acl(Structural)
+ final InstanceIdentifier<Acl> aclIid = subIfcId.child(Acl.class);
+ registry.addStructuralReader(aclIid, AclBuilder.class);
+ // Ingress(Subtree)
+ final InstanceIdentifier<Ingress> ingressIdRelative = InstanceIdentifier.create(Ingress.class);
registry.subtreeAdd(
- Sets.newHashSet(aclIdRelative.child(L2Acl.class), aclIdRelative.child(Ip4Acl.class), aclIdRelative.child(Ip6Acl.class)),
- new GenericReader<>(subIfcId.child(Acl.class), new SubInterfaceAclCustomizer(jvpp, ifcCtx, classifyCtx)));
+ Sets.newHashSet(ingressIdRelative.child(L2Acl.class), ingressIdRelative.child(Ip4Acl.class),
+ ingressIdRelative.child(Ip6Acl.class)),
+ new GenericReader<>(aclIid.child(Ingress.class),
+ new SubInterfaceAclCustomizer(jvpp, ifcCtx, classifyCtx)));
}
}
import io.fd.honeycomb.translate.v3po.initializers.InterfacesInitializer;
import io.fd.honeycomb.translate.v3po.initializers.VppClassifierInitializer;
import io.fd.honeycomb.translate.v3po.initializers.VppInitializer;
-import io.fd.honeycomb.translate.v3po.interfaces.acl.IetfAClWriter;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.IetfAClWriter;
import io.fd.honeycomb.translate.v3po.notification.InterfaceChangeNotificationProducer;
import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.VhostUserBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.VxlanBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.VxlanGpeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.acl.EgressBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.acl.IngressBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Acl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Ethernet;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Gre;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VhostUser;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Vxlan;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VxlanGpe;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.acl.Egress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.acl.Ingress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.base.attributes.Interconnection;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.base.attributes.interconnection.BridgeBased;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.base.attributes.interconnection.BridgeBasedBuilder;
private static void setAcl(final VppInterfaceAugmentationBuilder augmentBuilder, final Acl acl) {
final AclBuilder aclBuilder = new AclBuilder();
- aclBuilder.setL2Acl(acl.getL2Acl());
- aclBuilder.setIp4Acl(acl.getIp4Acl());
- aclBuilder.setIp6Acl(acl.getIp6Acl());
+
+ final Ingress ingress = acl.getIngress();
+ if (ingress != null) {
+ final IngressBuilder builder = new IngressBuilder();
+ builder.setL2Acl(ingress.getL2Acl());
+ builder.setIp4Acl(ingress.getIp4Acl());
+ builder.setIp6Acl(ingress.getIp6Acl());
+ aclBuilder.setIngress(builder.build());
+ }
+
+ final Egress egress = acl.getEgress();
+ if (egress != null) {
+ final EgressBuilder builder = new EgressBuilder();
+ builder.setL2Acl(egress.getL2Acl());
+ builder.setIp4Acl(egress.getIp4Acl());
+ builder.setIp6Acl(egress.getIp6Acl());
+ aclBuilder.setEgress(builder.build());
+ }
augmentBuilder.setAcl(aclBuilder.build());
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.SubInterfaces;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.sub.interfaces.SubInterface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.AclBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.Egress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.EgressBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.Ingress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.IngressBuilder;
/**
* Utility class for sub interface initialization
if (operationalData.getAcl() != null) {
final AclBuilder aclBuilder = new AclBuilder();
- aclBuilder.setL2Acl(operationalData.getAcl().getL2Acl());
- aclBuilder.setIp4Acl(operationalData.getAcl().getIp4Acl());
- aclBuilder.setIp6Acl(operationalData.getAcl().getIp6Acl());
+ final Ingress ingress = operationalData.getAcl().getIngress();
+ if (ingress != null) {
+ final IngressBuilder builder = new IngressBuilder();
+ builder.setL2Acl(ingress.getL2Acl());
+ builder.setIp4Acl(ingress.getIp4Acl());
+ builder.setIp6Acl(ingress.getIp6Acl());
+ aclBuilder.setIngress(builder.build());
+ }
+
+ final Egress egress = operationalData.getAcl().getEgress();
+ if (egress != null) {
+ final EgressBuilder builder = new EgressBuilder();
+ builder.setL2Acl(egress.getL2Acl());
+ builder.setIp4Acl(egress.getIp4Acl());
+ builder.setIp6Acl(egress.getIp6Acl());
+ aclBuilder.setEgress(builder.build());
+ }
subInterfaceCfgBuilder.setAcl(aclBuilder.build());
}
*
* ACLs that are currently assigned to an interface cannot be updated/deleted.
*/
-public class AclWriter implements ListWriterCustomizer<Acl, AclKey> {
+public class IetfAclWriter implements ListWriterCustomizer<Acl, AclKey> {
public static final InstanceIdentifier<AccessLists> ACL_ID =
InstanceIdentifier.create(AccessLists.class);
- private static final Logger LOG = LoggerFactory.getLogger(AclWriter.class);
+ private static final Logger LOG = LoggerFactory.getLogger(IetfAclWriter.class);
@Override
public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Acl> id, @Nonnull final Acl dataAfter,
return interfaces.getInterface().stream()
.map(i -> Optional.ofNullable(i.getAugmentation(VppInterfaceAugmentation.class))
.map(aug -> aug.getIetfAcl())
- .map(ietfAcl -> ietfAcl.getAccessLists())
+ .map(ietfAcl -> ietfAcl.getIngress())
+ .map(ingress -> ingress.getAccessLists())
.map(accessLists -> accessLists.getAcl())
)
.flatMap(iacl -> iacl.isPresent()
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import com.google.common.annotations.VisibleForTesting;
import io.fd.honeycomb.translate.vpp.util.MacTranslator;
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static com.google.common.base.Preconditions.checkArgument;
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static com.google.common.base.Preconditions.checkArgument;
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import io.fd.honeycomb.translate.vpp.util.WriteTimeoutException;
import java.util.List;
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static com.google.common.base.Preconditions.checkNotNull;
import io.fd.honeycomb.translate.spi.write.WriterCustomizer;
+import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.vpp.util.WriteTimeoutException;
-import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
import io.fd.honeycomb.translate.write.WriteContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
+import io.fd.vpp.jvpp.VppBaseCallException;
+import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
-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.acl.Ingress;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Customizer for enabling/disabling ACLs on given interface.
+ * Customizer for enabling/disabling ingress ACLs on given interface based on low lever classfier model.
*/
-public class AclCustomizer extends FutureJVppCustomizer implements WriterCustomizer<Acl>, AclWriter {
+public class AclCustomizer extends FutureJVppCustomizer implements WriterCustomizer<Ingress>, AclWriter {
private static final Logger LOG = LoggerFactory.getLogger(AclCustomizer.class);
private final NamingContext interfaceContext;
}
@Override
- public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Acl> id, @Nonnull final Acl dataAfter,
+ public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataAfter,
@Nonnull final WriteContext writeContext) throws WriteFailedException {
try {
setAcl(true, id, dataAfter, writeContext);
}
@Override
- public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Acl> id, @Nonnull final Acl dataBefore,
- @Nonnull final Acl dataAfter, @Nonnull final WriteContext writeContext)
+ public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataBefore,
+ @Nonnull final Ingress dataAfter, @Nonnull final WriteContext writeContext)
throws WriteFailedException {
throw new UnsupportedOperationException("Acl update is not supported. Please delete Acl container first.");
}
@Override
- public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Acl> id, @Nonnull final Acl dataBefore,
+ public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataBefore,
@Nonnull final WriteContext writeContext) throws WriteFailedException {
try {
setAcl(false, id, dataBefore, writeContext);
}
}
- private void setAcl(final boolean isAdd, @Nonnull final InstanceIdentifier<Acl> id, @Nonnull final Acl acl,
+ private void setAcl(final boolean isAdd, @Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress acl,
@Nonnull final WriteContext writeContext)
throws VppBaseCallException, WriteTimeoutException {
final String ifName = id.firstKeyOf(Interface.class).getName();
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static com.google.common.base.Preconditions.checkNotNull;
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.IetfAclWriter;
import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
import io.fd.honeycomb.translate.vpp.util.WriteTimeoutException;
import io.fd.honeycomb.translate.write.WriteContext;
// ietf-acl updates are handled first, so we use writeContext.readAfter
final Optional<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl>
- aclOptional = writeContext.readAfter(AclWriter.ACL_ID.child(
+ aclOptional = writeContext.readAfter(IetfAclWriter.ACL_ID.child(
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl.class,
new AclKey(aclName, aclType)));
checkArgument(aclOptional.isPresent(), "Acl lists not configured");
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.write.WriteContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
+import io.fd.vpp.jvpp.VppBaseCallException;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.ietf.acl.base.attributes.AccessLists;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.IetfAcl;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.ietf.acl.Ingress;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Customizer for enabling/disabling ACLs for given interface (as defined in ietf-acl model).
+ * Customizer for enabling/disabling ingress ACLs for given interface (as defined in ietf-acl model).
*
* The customizer assumes it owns classify table management for interfaces where ietf-acl container is present. Using
* low level classifier model or direct changes to classify tables in combination with ietf-acls are not supported and
* can result in unpredictable behaviour.
*/
-public class IetfAclCustomizer implements WriterCustomizer<IetfAcl> {
+public class IetfAclCustomizer implements WriterCustomizer<Ingress> {
private static final Logger LOG = LoggerFactory.getLogger(IetfAclCustomizer.class);
private final IetfAClWriter aclWriter;
}
@Override
- public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<IetfAcl> id, @Nonnull final IetfAcl dataAfter,
+ public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataAfter,
@Nonnull final WriteContext writeContext) throws WriteFailedException {
final String ifName = id.firstKeyOf(Interface.class).getName();
final int ifIndex = interfaceContext.getIndex(ifName, writeContext.getMappingContext());
}
@Override
- public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<IetfAcl> id,
- @Nonnull final IetfAcl dataBefore, @Nonnull final IetfAcl dataAfter,
+ public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id,
+ @Nonnull final Ingress dataBefore, @Nonnull final Ingress dataAfter,
@Nonnull final WriteContext writeContext)
throws WriteFailedException {
LOG.debug("ACLs update: removing previously configured ACLs");
}
@Override
- public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<IetfAcl> id,
- @Nonnull final IetfAcl dataBefore,
+ public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id,
+ @Nonnull final Ingress dataBefore,
@Nonnull final WriteContext writeContext) throws WriteFailedException {
final String ifName = id.firstKeyOf(Interface.class).getName();
final int ifIndex = interfaceContext.getIndex(ifName, writeContext.getMappingContext());
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static com.google.common.base.Preconditions.checkNotNull;
import io.fd.honeycomb.translate.spi.write.WriterCustomizer;
+import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.vpp.util.SubInterfaceUtils;
import io.fd.honeycomb.translate.vpp.util.WriteTimeoutException;
-import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
import io.fd.honeycomb.translate.write.WriteContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
+import io.fd.vpp.jvpp.VppBaseCallException;
+import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
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.vlan.rev150527.interfaces._interface.sub.interfaces.SubInterface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces._interface.sub.interfaces.SubInterfaceKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Acl;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.Ingress;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Customizer for enabling/disabling ACLs on given sub-interface.
+ * Customizer for enabling/disabling ingress ACLs on given sub-interface.
*/
public class SubInterfaceAclCustomizer extends FutureJVppCustomizer
- implements WriterCustomizer<Acl>, AclWriter {
+ implements WriterCustomizer<Ingress>, AclWriter {
private static final Logger LOG = LoggerFactory.getLogger(SubInterfaceAclCustomizer.class);
private final NamingContext interfaceContext;
}
@Override
- public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Acl> id, @Nonnull final Acl dataAfter,
+ public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataAfter,
@Nonnull final WriteContext writeContext) throws WriteFailedException {
try {
setAcl(true, id, dataAfter, writeContext);
}
@Override
- public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Acl> id, @Nonnull final Acl dataBefore,
- @Nonnull final Acl dataAfter, @Nonnull final WriteContext writeContext)
+ public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataBefore,
+ @Nonnull final Ingress dataAfter, @Nonnull final WriteContext writeContext)
throws WriteFailedException {
throw new UnsupportedOperationException("Acl update is not supported. Please delete Acl container first.");
}
@Override
- public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Acl> id, @Nonnull final Acl dataBefore,
+ public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataBefore,
@Nonnull final WriteContext writeContext) throws WriteFailedException {
try {
setAcl(false, id, dataBefore, writeContext);
}
}
- private void setAcl(final boolean isAdd, @Nonnull final InstanceIdentifier<Acl> id, @Nonnull final Acl acl,
+ private void setAcl(final boolean isAdd, @Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress acl,
@Nonnull final WriteContext writeContext)
throws VppBaseCallException, WriteTimeoutException {
final InterfaceKey parentInterfacekey = id.firstKeyOf(Interface.class);
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import io.fd.honeycomb.translate.vpp.util.SubInterfaceUtils;
import io.fd.honeycomb.translate.write.WriteContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
+import io.fd.vpp.jvpp.VppBaseCallException;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
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.v3po.rev150105.ietf.acl.base.attributes.AccessLists;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces._interface.sub.interfaces.SubInterface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces._interface.sub.interfaces.SubInterfaceKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.IetfAcl;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.ietf.acl.Ingress;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Customizer for enabling/disabling ACLs for given sub-interface (as defined in ietf-acl model).
+ * Customizer for enabling/disabling ingress ACLs for given sub-interface (as defined in ietf-acl model).
*
* The customizer assumes it owns classify table management for sub-interfaces where ietf-acl container is present.
* Using low level classifier model or direct changes to classify tables in combination with ietf-acls are not supported
* and can result in unpredictable behaviour.
*/
-public class SubInterfaceIetfAclCustomizer implements WriterCustomizer<IetfAcl> {
+public class SubInterfaceIetfAclCustomizer implements WriterCustomizer<Ingress> {
private static final Logger LOG = LoggerFactory.getLogger(SubInterfaceIetfAclCustomizer.class);
private final IetfAClWriter aclWriter;
this.interfaceContext = checkNotNull(interfaceContext, "interfaceContext should not be null");
}
- private String getSubInterfaceName(@Nonnull final InstanceIdentifier<IetfAcl> id) {
+ private String getSubInterfaceName(@Nonnull final InstanceIdentifier<Ingress> id) {
final InterfaceKey parentInterfacekey = id.firstKeyOf(Interface.class);
final SubInterfaceKey subInterfacekey = id.firstKeyOf(SubInterface.class);
return SubInterfaceUtils
}
@Override
- public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<IetfAcl> id, @Nonnull final IetfAcl dataAfter,
+ public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final Ingress dataAfter,
@Nonnull final WriteContext writeContext) throws WriteFailedException {
final String subInterfaceName = getSubInterfaceName(id);
final int subInterfaceIndex = interfaceContext.getIndex(subInterfaceName, writeContext.getMappingContext());
}
@Override
- public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<IetfAcl> id,
- @Nonnull final IetfAcl dataBefore, @Nonnull final IetfAcl dataAfter,
+ public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id,
+ @Nonnull final Ingress dataBefore, @Nonnull final Ingress dataAfter,
@Nonnull final WriteContext writeContext) throws WriteFailedException {
LOG.debug("Sub-interface ACLs update: removing previously configured ACLs");
deleteCurrentAttributes(id, dataBefore, writeContext);
}
@Override
- public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<IetfAcl> id,
- @Nonnull final IetfAcl dataBefore, @Nonnull final WriteContext writeContext)
+ public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id,
+ @Nonnull final Ingress dataBefore, @Nonnull final WriteContext writeContext)
throws WriteFailedException {
final String subInterfaceName = getSubInterfaceName(id);
final int subInterfaceIndex = interfaceContext.getIndex(subInterfaceName, writeContext.getMappingContext());
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfacesstate;
+package io.fd.honeycomb.translate.v3po.interfacesstate.acl.ingress;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
+import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
+import io.fd.vpp.jvpp.VppBaseCallException;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterface;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
+import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Acl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.AclBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.acl.Ingress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.acl.IngressBuilder;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterface;
-import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Customizer for reading ACLs enabled on given interface.
+ * Customizer for reading ingress ACLs enabled on given interface.
*/
public class AclCustomizer extends FutureJVppCustomizer
- implements ReaderCustomizer<Acl, AclBuilder>, AclReader, JvppReplyConsumer {
+ implements ReaderCustomizer<Ingress, IngressBuilder>, AclReader, JvppReplyConsumer {
private static final Logger LOG = LoggerFactory.getLogger(AclCustomizer.class);
private final NamingContext interfaceContext;
}
@Override
- public void merge(@Nonnull final Builder<? extends DataObject> parentBuilder, @Nonnull final Acl readValue) {
- ((VppInterfaceStateAugmentationBuilder) parentBuilder).setAcl(readValue);
+ public void merge(@Nonnull final Builder<? extends DataObject> parentBuilder, @Nonnull final Ingress readValue) {
+ ((AclBuilder) parentBuilder).setIngress(readValue);
}
@Nonnull
@Override
- public AclBuilder getBuilder(@Nonnull final InstanceIdentifier<Acl> id) {
- return new AclBuilder();
+ public IngressBuilder getBuilder(@Nonnull final InstanceIdentifier<Ingress> id) {
+ return new IngressBuilder();
}
@Override
- public void readCurrentAttributes(@Nonnull final InstanceIdentifier<Acl> id, @Nonnull final AclBuilder builder,
+ public void readCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final IngressBuilder builder,
@Nonnull final ReadContext ctx) throws ReadFailedException {
LOG.debug("Reading attributes for interface ACL: {}", id);
final InterfaceKey interfaceKey = id.firstKeyOf(Interface.class);
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfacesstate;
+package io.fd.honeycomb.translate.v3po.interfacesstate.acl.ingress;
import io.fd.honeycomb.translate.MappingContext;
import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfacesstate;
+package io.fd.honeycomb.translate.v3po.interfacesstate.acl.ingress;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
+import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
import io.fd.honeycomb.translate.vpp.util.JvppReplyConsumer;
import io.fd.honeycomb.translate.vpp.util.NamingContext;
-import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
+import io.fd.vpp.jvpp.VppBaseCallException;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterface;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
+import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.sub.interfaces.SubInterface;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.sub.interfaces.SubInterfaceBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.sub.interfaces.SubInterfaceKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Acl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.AclBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.Ingress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.IngressBuilder;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterface;
-import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Customizer for reading ACLs enabled on given sub-interface.
+ * Customizer for reading ingress ACLs enabled on given sub-interface.
*/
public class SubInterfaceAclCustomizer extends FutureJVppCustomizer
- implements ReaderCustomizer<Acl, AclBuilder>, AclReader, JvppReplyConsumer {
+ implements ReaderCustomizer<Ingress, IngressBuilder>, AclReader, JvppReplyConsumer {
private static final Logger LOG = LoggerFactory.getLogger(SubInterfaceAclCustomizer.class);
private final NamingContext interfaceContext;
}
@Override
- public void merge(@Nonnull final Builder<? extends DataObject> parentBuilder, @Nonnull final Acl readValue) {
- ((SubInterfaceBuilder) parentBuilder).setAcl(readValue);
+ public void merge(@Nonnull final Builder<? extends DataObject> parentBuilder, @Nonnull final Ingress readValue) {
+ ((AclBuilder) parentBuilder).setIngress(readValue);
}
@Nonnull
@Override
- public AclBuilder getBuilder(@Nonnull final InstanceIdentifier<Acl> id) {
- return new AclBuilder();
+ public IngressBuilder getBuilder(@Nonnull final InstanceIdentifier<Ingress> id) {
+ return new IngressBuilder();
}
@Override
- public void readCurrentAttributes(@Nonnull final InstanceIdentifier<Acl> id, @Nonnull final AclBuilder builder,
+ public void readCurrentAttributes(@Nonnull final InstanceIdentifier<Ingress> id, @Nonnull final IngressBuilder builder,
@Nonnull final ReadContext ctx) throws ReadFailedException {
LOG.debug("Reading attributes for sub-interface ACL: {}", id);
final InterfaceKey parentInterfacekey = id.firstKeyOf(Interface.class);
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.AclCustomizer;
import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
+import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest;
+import io.fd.vpp.jvpp.VppBaseCallException;
+import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
+import io.fd.vpp.jvpp.core.dto.InputAclSetInterfaceReply;
import org.junit.Test;
import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces;
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.acl.base.attributes.L2AclBuilder;
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.AclBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.acl.Ingress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.acl.IngressBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterfaceReply;
public class AclCustomizerTest extends WriterCustomizerTest {
classifyTableContext);
}
- private InstanceIdentifier<Acl> getAclId(final String name) {
+ private InstanceIdentifier<Ingress> getAclId(final String name) {
return InstanceIdentifier.create(Interfaces.class).child(Interface.class, new InterfaceKey(name)).augmentation(
- VppInterfaceAugmentation.class).child(Acl.class);
+ VppInterfaceAugmentation.class).child(Acl.class).child(Ingress.class);
}
- private Acl generateAcl(final String tableName) {
- final AclBuilder builder = new AclBuilder();
+ private Ingress generateAcl(final String tableName) {
+ final IngressBuilder builder = new IngressBuilder();
final L2Acl l2Acl = new L2AclBuilder().setClassifyTable(tableName).build();
builder.setL2Acl(l2Acl);
return builder.build();
@Test
public void testCreate() throws Exception {
- final Acl acl = generateAcl(ACL_TABLE_NAME);
- final InstanceIdentifier<Acl> id = getAclId(IF_NAME);
+ final Ingress acl = generateAcl(ACL_TABLE_NAME);
+ final InstanceIdentifier<Ingress> id = getAclId(IF_NAME);
whenInputAclSetInterfaceThenSuccess();
@Test
public void testCreateFailed() throws Exception {
- final Acl acl = generateAcl(ACL_TABLE_NAME);
- final InstanceIdentifier<Acl> id = getAclId(IF_NAME);
+ final Ingress acl = generateAcl(ACL_TABLE_NAME);
+ final InstanceIdentifier<Ingress> id = getAclId(IF_NAME);
whenInputAclSetInterfaceThenFailure();
@Test
public void testDelete() throws Exception {
- final Acl acl = generateAcl(ACL_TABLE_NAME);
- final InstanceIdentifier<Acl> id = getAclId(IF_NAME);
+ final Ingress acl = generateAcl(ACL_TABLE_NAME);
+ final InstanceIdentifier<Ingress> id = getAclId(IF_NAME);
whenInputAclSetInterfaceThenSuccess();
@Test
public void testDeleteFailed() throws Exception {
- final Acl acl = generateAcl(ACL_TABLE_NAME);
- final InstanceIdentifier<Acl> id = getAclId(IF_NAME);
+ final Ingress acl = generateAcl(ACL_TABLE_NAME);
+ final InstanceIdentifier<Ingress> id = getAclId(IF_NAME);
whenInputAclSetInterfaceThenFailure();
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.ietf.acl.base.attributes.AccessListsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.ietf.acl.base.attributes.access.lists.AclBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.IetfAclBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.ietf.acl.IngressBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public class AclWriterTest extends WriterCustomizerTest {
@Mock
private Acl acl;
- private AclWriter customizer;
+ private IetfAclWriter customizer;
@Override
public void setUp() {
- customizer = new AclWriter();
+ customizer = new IetfAclWriter();
when(acl.getAclName()).thenReturn(ACL_NAME);
doReturn(ACL_TYPE).when(acl).getAclType();
}
public void testDeleteFailed() throws WriteFailedException {
final Interface iface = new InterfaceBuilder().addAugmentation(VppInterfaceAugmentation.class,
new VppInterfaceAugmentationBuilder().setIetfAcl(
- new IetfAclBuilder().setAccessLists(
- new AccessListsBuilder().setAcl(
- Collections.singletonList(new AclBuilder().setName(ACL_NAME).setType(ACL_TYPE).build())
+ new IetfAclBuilder().setIngress(
+ new IngressBuilder().setAccessLists(
+ new AccessListsBuilder().setAcl(
+ Collections.singletonList(new AclBuilder().setName(ACL_NAME).setType(ACL_TYPE).build())
+ ).build()
).build()
).build()
).build()
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.mockito.MockitoAnnotations.initMocks;
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSession;
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable;
+import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
+import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.matches.ace.type.AceEth;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.matches.ace.type.AceEthBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
-import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSession;
-import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
public class AceEthWriterTest {
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
-import static io.fd.honeycomb.translate.v3po.interfaces.acl.AbstractAceWriter.VLAN_TAG_LEN;
-import static io.fd.honeycomb.translate.v3po.interfaces.acl.AceIpWriterTestUtils.assertArrayEqualsWithOffset;
+import static io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.AbstractAceWriter.VLAN_TAG_LEN;
import static org.junit.Assert.assertEquals;
import static org.mockito.MockitoAnnotations.initMocks;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1,
-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
- assertArrayEqualsWithOffset(expectedMask, request.mask, vlanTags * VLAN_TAG_LEN);
+ AceIpWriterTestUtils.assertArrayEqualsWithOffset(expectedMask, request.mask, vlanTags * VLAN_TAG_LEN);
}
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 1, 2,
4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
- assertArrayEqualsWithOffset(expectedMatch, request.match, vlanTags * VLAN_TAG_LEN);
+ AceIpWriterTestUtils.assertArrayEqualsWithOffset(expectedMatch, request.match, vlanTags * VLAN_TAG_LEN);
}
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
-import static io.fd.honeycomb.translate.v3po.interfaces.acl.AbstractAceWriter.VLAN_TAG_LEN;
-import static io.fd.honeycomb.translate.v3po.interfaces.acl.AceIpWriterTestUtils.assertArrayEqualsWithOffset;
+import static io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.AbstractAceWriter.VLAN_TAG_LEN;
import static org.junit.Assert.assertEquals;
import static org.mockito.MockitoAnnotations.initMocks;
// padding to multiple of 16B:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
- assertArrayEqualsWithOffset(expectedMask, request.mask, vlanTags * VLAN_TAG_LEN);
+ AceIpWriterTestUtils.assertArrayEqualsWithOffset(expectedMask, request.mask, vlanTags * VLAN_TAG_LEN);
}
// padding to multiple of 16B:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
- assertArrayEqualsWithOffset(expectedMatch, request.match, vlanTags * VLAN_TAG_LEN);
+ AceIpWriterTestUtils.assertArrayEqualsWithOffset(expectedMatch, request.match, vlanTags * VLAN_TAG_LEN);
}
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static org.junit.Assert.assertArrayEquals;
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.verify;
import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest;
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSessionReply;
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable;
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTableReply;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterface;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
+import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
+import io.fd.vpp.jvpp.core.dto.InputAclSetInterfaceReply;
import java.util.Collections;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.AclBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.ietf.acl.base.attributes.AccessListsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.ietf.acl.base.attributes.access.lists.AclBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.IetfAcl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.IetfAclBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.ietf.acl.Ingress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.ietf.acl.IngressBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSessionReply;
-import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable;
-import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTableReply;
-import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterface;
-import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterfaceReply;
public class IetfAclCustomizerTest extends WriterCustomizerTest {
private static final String IFC_TEST_INSTANCE = "ifc-test-instance";
private static final String IF_NAME = "local0";
private static final int IF_INDEX = 1;
- private static final InstanceIdentifier<IetfAcl> IID = InstanceIdentifier.create(Interfaces.class).child(Interface.class, new InterfaceKey(IF_NAME)).augmentation(
- VppInterfaceAugmentation.class).child(IetfAcl.class);
+ private static final InstanceIdentifier<Ingress> IID = InstanceIdentifier.create(Interfaces.class).child(Interface.class, new InterfaceKey(IF_NAME)).augmentation(
+ VppInterfaceAugmentation.class).child(IetfAcl.class).child(Ingress.class);
private static final String ACL_NAME = "acl1";
private static final Class<? extends AclBase> ACL_TYPE = EthAcl.class;
private IetfAclCustomizer customizer;
- private IetfAcl acl;
+ private Ingress acl;
@Override
protected void setUp() {
customizer = new IetfAclCustomizer(new IetfAClWriter(api), new NamingContext("prefix", IFC_TEST_INSTANCE));
defineMapping(mappingContext, IF_NAME, IF_INDEX, IFC_TEST_INSTANCE);
- acl = new IetfAclBuilder().setAccessLists(
+ acl = new IngressBuilder().setAccessLists(
new AccessListsBuilder().setAcl(
Collections.singletonList(new AclBuilder()
.setName(ACL_NAME)
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
+import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest;
+import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
+import io.fd.vpp.jvpp.core.dto.InputAclSetInterfaceReply;
import org.junit.Test;
import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces._interface.sub.interfaces.SubInterface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces._interface.sub.interfaces.SubInterfaceKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Acl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.AclBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.Ingress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.IngressBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterfaceReply;
public class SubInterfaceAclCustomizerTest extends WriterCustomizerTest {
private static final String IFC_TEST_INSTANCE = "ifc-test-instance";
private static final String TABLE_NAME = "table0";
private static final int TABLE_INDEX = 123;
- private static final InstanceIdentifier<Acl> IID =
+ private static final InstanceIdentifier<Ingress> IID =
InstanceIdentifier.create(Interfaces.class).child(Interface.class, new InterfaceKey(IF_NAME)).augmentation(
SubinterfaceAugmentation.class).child(SubInterfaces.class)
- .child(SubInterface.class, new SubInterfaceKey(SUBIF_ID)).child(Acl.class);
+ .child(SubInterface.class, new SubInterfaceKey(SUBIF_ID)).child(Acl.class).child(Ingress.class);
@Mock
private VppClassifierContextManager classifyTableContext;
customizer.deleteCurrentAttributes(IID, ip4Acl(), writeContext);
}
- private Acl ip4Acl() {
- final AclBuilder builder = new AclBuilder();
+ private Ingress ip4Acl() {
+ final IngressBuilder builder = new IngressBuilder();
final Ip4Acl acl = new Ip4AclBuilder().setClassifyTable(TABLE_NAME).build();
builder.setIp4Acl(acl);
return builder.build();
return request;
}
- private Acl ip6Acl() {
- final AclBuilder builder = new AclBuilder();
+ private Ingress ip6Acl() {
+ final IngressBuilder builder = new IngressBuilder();
final Ip6Acl acl = new Ip6AclBuilder().setClassifyTable(TABLE_NAME).build();
builder.setIp6Acl(acl);
return builder.build();
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfaces.acl;
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.google.common.base.Optional;
+import io.fd.honeycomb.translate.v3po.interfaces.acl.IetfAclWriter;
import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterface;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
+import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
+import io.fd.vpp.jvpp.core.dto.InputAclSetInterfaceReply;
import java.util.Collections;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.AclBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces._interface.sub.interfaces.SubInterfaceBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces._interface.sub.interfaces.SubInterfaceKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.IetfAcl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.IetfAclBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.ietf.acl.Ingress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.ietf.acl.IngressBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterface;
-import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterfaceReply;
public class SubInterfaceIetfAclCustomizerTest extends WriterCustomizerTest {
private static final String SUBIF_NAME = "local0.123";
private static final int SUBIF_INDEX = 2;
private static final long SUB_IF_ID = 123;
- private static final InstanceIdentifier<IetfAcl> IID =
+ private static final InstanceIdentifier<Ingress> IID =
InstanceIdentifier.create(Interfaces.class).child(Interface.class, new InterfaceKey(IF_NAME)).augmentation(
SubinterfaceAugmentation.class).child(SubInterfaces.class)
- .child(SubInterface.class, new SubInterfaceKey(SUB_IF_ID)).child(IetfAcl.class);
+ .child(SubInterface.class, new SubInterfaceKey(SUB_IF_ID)).child(IetfAcl.class).child(Ingress.class);
private static final String ACL_NAME = "acl1";
private static final Class<? extends AclBase> ACL_TYPE = EthAcl.class;
private SubInterfaceIetfAclCustomizer customizer;
- private IetfAcl acl;
+ private Ingress acl;
@Override
protected void setUp() {
new SubInterfaceIetfAclCustomizer(new IetfAClWriter(api), new NamingContext("prefix", IFC_TEST_INSTANCE));
defineMapping(mappingContext, IF_NAME, IF_INDEX, IFC_TEST_INSTANCE);
- acl = new IetfAclBuilder().setAccessLists(
+ acl = new IngressBuilder().setAccessLists(
new AccessListsBuilder().setAcl(
Collections.singletonList(new AclBuilder()
.setName(ACL_NAME)
new SubInterfaceBuilder().build()
));
- when(writeContext.readAfter(AclWriter.ACL_ID.child(
+ when(writeContext.readAfter(IetfAclWriter.ACL_ID.child(
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl.class,
new AclKey(ACL_NAME, ACL_TYPE)))).thenReturn(Optional.of(
new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.AclBuilder()
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfacesstate;
+package io.fd.honeycomb.translate.v3po.interfacesstate.acl.ingress;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
+import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.vpp.test.read.ReaderCustomizerTest;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
import org.junit.Test;
import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.acl.base.attributes.L2AclBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Acl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.AclBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.acl.Ingress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.acl.IngressBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
-public class AclCustomizerTest extends ReaderCustomizerTest<Acl, AclBuilder> {
+public class AclCustomizerTest extends ReaderCustomizerTest<Ingress, IngressBuilder> {
private static final String IF_NAME = "local0";
private static final int IF_INDEX = 1;
private static final int TABLE_INDEX = 123;
private static final String TABLE_NAME = "table123";
- private static final InstanceIdentifier<Acl> IID =
+ private static final InstanceIdentifier<Ingress> IID =
InstanceIdentifier.create(InterfacesState.class).child(Interface.class, new InterfaceKey(IF_NAME))
- .augmentation(VppInterfaceStateAugmentation.class).child(Acl.class);
+ .augmentation(VppInterfaceStateAugmentation.class).child(Acl.class).child(Ingress.class);
private static final String IFC_CTX_NAME = "ifc-test-instance";
private VppClassifierContextManager classifyTableContext;
public AclCustomizerTest() {
- super(Acl.class, VppInterfaceStateAugmentationBuilder.class);
+ super(Ingress.class, AclBuilder.class);
}
@Override
}
@Override
- protected ReaderCustomizer<Acl, AclBuilder> initCustomizer() {
+ protected ReaderCustomizer<Ingress, IngressBuilder> initCustomizer() {
return new AclCustomizer(api, interfaceContext, classifyTableContext);
}
@Test
public void testRead() throws ReadFailedException {
- final AclBuilder builder = mock(AclBuilder.class);
+ final IngressBuilder builder = mock(IngressBuilder.class);
final ClassifyTableByInterfaceReply reply = new ClassifyTableByInterfaceReply();
reply.l2TableId = TABLE_INDEX;
@Test(expected = ReadFailedException.class)
public void testReadFailed() throws ReadFailedException {
when(api.classifyTableByInterface(any())).thenReturn(failedFuture());
- getCustomizer().readCurrentAttributes(IID, mock(AclBuilder.class), ctx);
+ getCustomizer().readCurrentAttributes(IID, mock(IngressBuilder.class), ctx);
}
}
\ No newline at end of file
* limitations under the License.
*/
-package io.fd.honeycomb.translate.v3po.interfacesstate;
+package io.fd.honeycomb.translate.v3po.interfacesstate.acl.ingress;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
-import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.v3po.vppclassifier.VppClassifierContextManager;
+import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.vpp.test.read.ReaderCustomizerTest;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
import org.junit.Test;
import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.SubinterfaceStateAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.SubInterfaces;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.sub.interfaces.SubInterface;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.sub.interfaces.SubInterfaceBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.interfaces.state._interface.sub.interfaces.SubInterfaceKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Acl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.AclBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.Ingress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.acl.IngressBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
-public class SubInterfaceAclCustomizerTest extends ReaderCustomizerTest<Acl, AclBuilder> {
+public class SubInterfaceAclCustomizerTest extends ReaderCustomizerTest<Ingress, IngressBuilder> {
private static final String IFC_CTX_NAME = "ifc-test-instance";
private static final String IF_NAME = "local0";
private static final int IF_INDEX = 1;
private static final int TABLE_INDEX = 123;
private static final String TABLE_NAME = "table123";
- private static final InstanceIdentifier<Acl> IID =
+ private static final InstanceIdentifier<Ingress> IID =
InstanceIdentifier.create(InterfacesState.class).child(Interface.class, new InterfaceKey(IF_NAME))
.augmentation(SubinterfaceStateAugmentation.class).child(SubInterfaces.class)
- .child(SubInterface.class, new SubInterfaceKey(SUB_IF_ID)).child(Acl.class);
+ .child(SubInterface.class, new SubInterfaceKey(SUB_IF_ID)).child(Acl.class).child(Ingress.class);
private NamingContext interfaceContext;
private VppClassifierContextManager classifyTableContext;
public SubInterfaceAclCustomizerTest() {
- super(Acl.class, SubInterfaceBuilder.class);
+ super(Ingress.class, AclBuilder.class);
}
@Override
}
@Override
- protected ReaderCustomizer<Acl, AclBuilder> initCustomizer() {
+ protected ReaderCustomizer<Ingress, IngressBuilder> initCustomizer() {
return new SubInterfaceAclCustomizer(api, interfaceContext, classifyTableContext);
}
@Test
public void testRead() throws ReadFailedException {
- final AclBuilder builder = mock(AclBuilder.class);
+ final IngressBuilder builder = mock(IngressBuilder.class);
final ClassifyTableByInterfaceReply reply = new ClassifyTableByInterfaceReply();
reply.swIfIndex = SUB_IF_INDEX;
@Test(expected = ReadFailedException.class)
public void testReadFailed() throws ReadFailedException {
when(api.classifyTableByInterface(any())).thenReturn(failedFuture());
- getCustomizer().readCurrentAttributes(IID, mock(AclBuilder.class), ctx);
+ getCustomizer().readCurrentAttributes(IID, mock(IngressBuilder.class), ctx);
}
}
\ No newline at end of file