Search in sources :

Example 61 with Match

use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match in project bgpcep by opendaylight.

the class FlowspecL3vpnIpv4NlriParserTest method testParseMpUnreachNlriConstraint.

@Test
public void testParseMpUnreachNlriConstraint() throws BGPParsingException {
    final List<Flowspec> fs = new ArrayList<>();
    final MpUnreachNlriBuilder mp = new MpUnreachNlriBuilder();
    final FlowspecBuilder builder = new FlowspecBuilder();
    final FlowspecType icmpType = createIcmpType();
    builder.setFlowspecType(icmpType);
    fs.add(builder.build());
    final FlowspecType icmpCode = createIcmpCode();
    builder.setFlowspecType(icmpCode);
    fs.add(builder.build());
    final TcpFlagsCase tcp = createTcp();
    builder.setFlowspecType(tcp);
    fs.add(builder.build());
    final PacketLengthCase packet = createPackets();
    builder.setFlowspecType(packet);
    fs.add(builder.build());
    final FlowspecType dscp = createDscp();
    builder.setFlowspecType(dscp);
    fs.add(builder.build());
    final FlowspecType fragment = createFragment();
    builder.setFlowspecType(fragment);
    fs.add(builder.build());
    final FlowspecL3vpnIpv4NlriParser parser = new FlowspecL3vpnIpv4NlriParser(this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
    final MpUnreachNlriBuilder result = new MpUnreachNlriBuilder();
    result.setAfi(Ipv4AddressFamily.class);
    result.setSafi(FlowspecL3vpnSubsequentAddressFamily.class);
    parser.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI_ADD_PATH), result, this.constraint);
    DestinationFlowspecL3vpnIpv4 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) result.getWithdrawnRoutes().getDestinationType()).getDestinationFlowspecL3vpnIpv4();
    final List<Flowspec> flows = flowspecDst.getFlowspec();
    checkUnreachFlows(flows, icmpType, icmpCode, tcp, packet, dscp, fragment);
    final RouteDistinguisher rd = flowspecDst.getRouteDistinguisher();
    mp.setAfi(Ipv4AddressFamily.class).setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder().setDestinationFlowspecL3vpnIpv4(new DestinationFlowspecL3vpnIpv4Builder().setRouteDistinguisher(rd).setPathId(PATH_ID).setFlowspec(fs).build()).build()).build());
    final ByteBuf buffer = Unpooled.buffer();
    parser.serializeNlri(new Object[] { rd, flows }, PATH_ID, buffer);
    assertArrayEquals(UNREACHED_NLRI_ADD_PATH, ByteArray.readAllBytes(buffer));
    parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class, new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
    assertArrayEquals(UNREACHED_NLRI_ADD_PATH, ByteArray.readAllBytes(buffer));
    assertEquals("all packets where ICMP type is less than 2 or is less than 3 AND where ICMP code is less than 4 or 5 AND where TCP flags is not 1025 or does match 22193 AND where packet length is less than 57005 AND where DSCP is greater than 42 AND where fragment does match 'IS FIRST' 'IS LAST' 'IS A' ", this.FS_PARSER.stringNlri(flows));
}
Also used : MockitoAnnotations(org.mockito.MockitoAnnotations) Ipv4AddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv4AddressFamily) ArrayList(java.util.ArrayList) PacketLengthCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.flowspec.flowspec.type.PacketLengthCase) ByteBuf(io.netty.buffer.ByteBuf) TcpFlagsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.flowspec.flowspec.type.TcpFlagsCase) WithdrawnRoutesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder) MpUnreachNlriBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.MpUnreachNlriBuilder) FlowspecType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.flowspec.FlowspecType) Flowspec(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.Flowspec) RouteDistinguisherUtil.extractRouteDistinguisher(org.opendaylight.bgp.concepts.RouteDistinguisherUtil.extractRouteDistinguisher) RouteDistinguisher(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.RouteDistinguisher) FlowspecL3vpnIpv4NlriParser(org.opendaylight.protocol.bgp.flowspec.l3vpn.ipv4.FlowspecL3vpnIpv4NlriParser) FlowspecBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.FlowspecBuilder) Attributes2Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.Attributes2Builder) DestinationFlowspecL3vpnIpv4(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv4.DestinationFlowspecL3vpnIpv4) DestinationFlowspecL3vpnIpv4Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv4.DestinationFlowspecL3vpnIpv4Builder) AttributesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.AttributesBuilder) Test(org.junit.Test)

Example 62 with Match

use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match in project bgpcep by opendaylight.

the class FlowspecL3vpnIpv4NlriParserTest method testParseMpUnreachNlri.

@Test
public void testParseMpUnreachNlri() throws BGPParsingException {
    final List<Flowspec> fs = new ArrayList<>();
    final MpUnreachNlriBuilder mp = new MpUnreachNlriBuilder();
    final FlowspecBuilder builder = new FlowspecBuilder();
    final FlowspecType icmpType = createIcmpType();
    builder.setFlowspecType(icmpType);
    fs.add(builder.build());
    final FlowspecType icmpCode = createIcmpCode();
    builder.setFlowspecType(icmpCode);
    fs.add(builder.build());
    final TcpFlagsCase tcp = createTcp();
    builder.setFlowspecType(tcp);
    fs.add(builder.build());
    final PacketLengthCase packet = createPackets();
    builder.setFlowspecType(packet);
    fs.add(builder.build());
    final FlowspecType dscp = createDscp();
    builder.setFlowspecType(dscp);
    fs.add(builder.build());
    final FlowspecType fragment = createFragment();
    builder.setFlowspecType(fragment);
    fs.add(builder.build());
    final FlowspecL3vpnIpv4NlriParser parser = new FlowspecL3vpnIpv4NlriParser(this.flowspecContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4, SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC_VPN));
    final MpUnreachNlriBuilder result = new MpUnreachNlriBuilder();
    result.setAfi(Ipv4AddressFamily.class);
    result.setSafi(FlowspecL3vpnSubsequentAddressFamily.class);
    parser.parseNlri(Unpooled.wrappedBuffer(UNREACHED_NLRI), result);
    DestinationFlowspecL3vpnIpv4 flowspecDst = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4Case) result.getWithdrawnRoutes().getDestinationType()).getDestinationFlowspecL3vpnIpv4();
    final List<Flowspec> flows = flowspecDst.getFlowspec();
    checkUnreachFlows(flows, icmpType, icmpCode, tcp, packet, dscp, fragment);
    final RouteDistinguisher rd = flowspecDst.getRouteDistinguisher();
    mp.setAfi(Ipv4AddressFamily.class).setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder().setDestinationFlowspecL3vpnIpv4(new DestinationFlowspecL3vpnIpv4Builder().setRouteDistinguisher(rd).setFlowspec(fs).build()).build()).build());
    final ByteBuf buffer = Unpooled.buffer();
    parser.serializeNlri(new Object[] { rd, flows }, null, buffer);
    assertArrayEquals(UNREACHED_NLRI, ByteArray.readAllBytes(buffer));
    parser.serializeAttribute(new AttributesBuilder().addAugmentation(Attributes2.class, new Attributes2Builder().setMpUnreachNlri(mp.build()).build()).build(), buffer);
    assertArrayEquals(UNREACHED_NLRI, ByteArray.readAllBytes(buffer));
    assertEquals("all packets where ICMP type is less than 2 or is less than 3 AND where ICMP code is less than 4 or 5 AND where TCP flags is not 1025 or does match 22193 AND where packet length is less than 57005 AND where DSCP is greater than 42 AND where fragment does match 'IS FIRST' 'IS LAST' 'IS A' ", this.FS_PARSER.stringNlri(flows));
}
Also used : MockitoAnnotations(org.mockito.MockitoAnnotations) Ipv4AddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv4AddressFamily) ArrayList(java.util.ArrayList) PacketLengthCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.flowspec.flowspec.type.PacketLengthCase) ByteBuf(io.netty.buffer.ByteBuf) TcpFlagsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.flowspec.flowspec.type.TcpFlagsCase) WithdrawnRoutesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder) MpUnreachNlriBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.MpUnreachNlriBuilder) FlowspecType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.flowspec.FlowspecType) Flowspec(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.Flowspec) RouteDistinguisherUtil.extractRouteDistinguisher(org.opendaylight.bgp.concepts.RouteDistinguisherUtil.extractRouteDistinguisher) RouteDistinguisher(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.RouteDistinguisher) FlowspecL3vpnIpv4NlriParser(org.opendaylight.protocol.bgp.flowspec.l3vpn.ipv4.FlowspecL3vpnIpv4NlriParser) FlowspecBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.FlowspecBuilder) Attributes2Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.Attributes2Builder) DestinationFlowspecL3vpnIpv4(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv4.DestinationFlowspecL3vpnIpv4) DestinationFlowspecL3vpnIpv4Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv4.DestinationFlowspecL3vpnIpv4Builder) AttributesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.AttributesBuilder) Test(org.junit.Test)

Example 63 with Match

use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match in project bgpcep by opendaylight.

the class PCCTunnelManagerImpl method reportMissedLsp.

/**
 * Reports Missed Lsp when DbVersion doesnt match.
 */
private void reportMissedLsp(final PCCSession session) {
    for (long missedLsp = this.syncOptimization.getRemoteLspDbVersionValue().longValue() + 1; missedLsp <= this.syncOptimization.getLocalLspDbVersionValue().longValue(); missedLsp++) {
        final PlspId plspId = new PlspId(missedLsp);
        final PCCTunnel tunnel = this.tunnels.get(plspId);
        createLspAndSendReport(missedLsp, tunnel, session, Optional.absent(), NO_SRP);
    }
}
Also used : PlspId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PlspId)

Example 64 with Match

use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match in project openflowplugin by opendaylight.

the class MatchEntriesInitializer method registerMatchEntrySerializers.

/**
 * Registers match entry serializers into provided registry.
 * @param serializerRegistry registry to be initialized with match entry serializers
 */
public static void registerMatchEntrySerializers(SerializerRegistry serializerRegistry) {
    // register OF v1.3 OpenflowBasicClass match entry serializers
    Class<OpenflowBasicClass> oxmClass = OpenflowBasicClass.class;
    MatchEntrySerializerRegistryHelper<OpenflowBasicClass> helper = new MatchEntrySerializerRegistryHelper<>(EncodeConstants.OF13_VERSION_ID, oxmClass, serializerRegistry);
    helper.registerSerializer(InPort.class, new OxmInPortSerializer());
    helper.registerSerializer(InPhyPort.class, new OxmInPhyPortSerializer());
    helper.registerSerializer(Metadata.class, new OxmMetadataSerializer());
    helper.registerSerializer(EthDst.class, new OxmEthDstSerializer());
    helper.registerSerializer(EthSrc.class, new OxmEthSrcSerializer());
    helper.registerSerializer(EthType.class, new OxmEthTypeSerializer());
    helper.registerSerializer(VlanVid.class, new OxmVlanVidSerializer());
    helper.registerSerializer(VlanPcp.class, new OxmVlanPcpSerializer());
    helper.registerSerializer(IpDscp.class, new OxmIpDscpSerializer());
    helper.registerSerializer(IpEcn.class, new OxmIpEcnSerializer());
    helper.registerSerializer(IpProto.class, new OxmIpProtoSerializer());
    helper.registerSerializer(Ipv4Src.class, new OxmIpv4SrcSerializer());
    helper.registerSerializer(Ipv4Dst.class, new OxmIpv4DstSerializer());
    helper.registerSerializer(TcpSrc.class, new OxmTcpSrcSerializer());
    helper.registerSerializer(TcpDst.class, new OxmTcpDstSerializer());
    helper.registerSerializer(UdpSrc.class, new OxmUdpSrcSerializer());
    helper.registerSerializer(UdpDst.class, new OxmUdpDstSerializer());
    helper.registerSerializer(SctpSrc.class, new OxmSctpSrcSerializer());
    helper.registerSerializer(SctpDst.class, new OxmSctpDstSerializer());
    helper.registerSerializer(Icmpv4Type.class, new OxmIcmpv4TypeSerializer());
    helper.registerSerializer(Icmpv4Code.class, new OxmIcmpv4CodeSerializer());
    helper.registerSerializer(ArpOp.class, new OxmArpOpSerializer());
    helper.registerSerializer(ArpSpa.class, new OxmArpSpaSerializer());
    helper.registerSerializer(ArpTpa.class, new OxmArpTpaSerializer());
    helper.registerSerializer(ArpSha.class, new OxmArpShaSerializer());
    helper.registerSerializer(ArpTha.class, new OxmArpThaSerializer());
    helper.registerSerializer(Ipv6Src.class, new OxmIpv6SrcSerializer());
    helper.registerSerializer(Ipv6Dst.class, new OxmIpv6DstSerializer());
    helper.registerSerializer(Ipv6Flabel.class, new OxmIpv6FlabelSerializer());
    helper.registerSerializer(Icmpv6Type.class, new OxmIcmpv6TypeSerializer());
    helper.registerSerializer(Icmpv6Code.class, new OxmIcmpv6CodeSerializer());
    helper.registerSerializer(Ipv6NdTarget.class, new OxmIpv6NdTargetSerializer());
    helper.registerSerializer(Ipv6NdSll.class, new OxmIpv6NdSllSerializer());
    helper.registerSerializer(Ipv6NdTll.class, new OxmIpv6NdTllSerializer());
    helper.registerSerializer(MplsLabel.class, new OxmMplsLabelSerializer());
    helper.registerSerializer(MplsTc.class, new OxmMplsTcSerializer());
    helper.registerSerializer(MplsBos.class, new OxmMplsBosSerializer());
    helper.registerSerializer(PbbIsid.class, new OxmPbbIsidSerializer());
    helper.registerSerializer(TunnelId.class, new OxmTunnelIdSerializer());
    helper.registerSerializer(Ipv6Exthdr.class, new OxmIpv6ExtHdrSerializer());
    // Register approved openflow match entry serializers
    helper.registerExperimenterSerializer(TcpFlags.class, EncodeConstants.ONF_EXPERIMENTER_ID, new OnfOxmTcpFlagsSerializer());
}
Also used : OxmArpTpaSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmArpTpaSerializer) OxmIpv6NdTargetSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpv6NdTargetSerializer) OxmArpSpaSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmArpSpaSerializer) OxmIcmpv6TypeSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv6TypeSerializer) OxmEthTypeSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmEthTypeSerializer) OxmUdpDstSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmUdpDstSerializer) OxmIpv6SrcSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpv6SrcSerializer) OpenflowBasicClass(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass) OxmTcpDstSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmTcpDstSerializer) OxmEthDstSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmEthDstSerializer) OxmIpDscpSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpDscpSerializer) OxmMplsLabelSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmMplsLabelSerializer) OxmUdpSrcSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmUdpSrcSerializer) OxmIcmpv4CodeSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv4CodeSerializer) OxmIcmpv4TypeSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv4TypeSerializer) OxmSctpSrcSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmSctpSrcSerializer) OxmMetadataSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmMetadataSerializer) OxmVlanPcpSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmVlanPcpSerializer) OxmIpv4SrcSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpv4SrcSerializer) OxmSctpDstSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmSctpDstSerializer) OxmIcmpv6CodeSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv6CodeSerializer) OxmTcpSrcSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmTcpSrcSerializer) OxmVlanVidSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmVlanVidSerializer) OxmIpProtoSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpProtoSerializer) OxmIpv4DstSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpv4DstSerializer) OxmArpShaSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmArpShaSerializer) OxmIpv6NdSllSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpv6NdSllSerializer) OxmArpThaSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmArpThaSerializer) OxmIpv6NdTllSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpv6NdTllSerializer) OxmIpv6FlabelSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpv6FlabelSerializer) OxmInPortSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmInPortSerializer) OxmIpv6DstSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpv6DstSerializer) MatchEntrySerializerRegistryHelper(org.opendaylight.openflowjava.protocol.impl.util.MatchEntrySerializerRegistryHelper) OxmInPhyPortSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmInPhyPortSerializer) OxmMplsTcSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmMplsTcSerializer) OxmPbbIsidSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmPbbIsidSerializer) OxmEthSrcSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmEthSrcSerializer) OxmArpOpSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmArpOpSerializer) OxmMplsBosSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmMplsBosSerializer) OxmIpEcnSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpEcnSerializer) OxmTunnelIdSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmTunnelIdSerializer) OxmIpv6ExtHdrSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIpv6ExtHdrSerializer) OnfOxmTcpFlagsSerializer(org.opendaylight.openflowjava.protocol.impl.serialization.match.ext.OnfOxmTcpFlagsSerializer)

Example 65 with Match

use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match in project openflowplugin by opendaylight.

the class MultipartRequestInputFactory method serializeFlowBody.

private void serializeFlowBody(final MultipartRequestBody multipartRequestBody, final ByteBuf output) {
    MultipartRequestFlowCase flowCase = (MultipartRequestFlowCase) multipartRequestBody;
    MultipartRequestFlow flow = flowCase.getMultipartRequestFlow();
    output.writeByte(flow.getTableId().byteValue());
    output.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_01);
    output.writeInt(flow.getOutPort().intValue());
    output.writeInt(flow.getOutGroup().intValue());
    output.writeZero(PADDING_IN_MULTIPART_REQUEST_FLOW_BODY_02);
    output.writeLong(flow.getCookie().longValue());
    output.writeLong(flow.getCookieMask().longValue());
    OFSerializer<Match> serializer = registry.getSerializer(new MessageTypeKey<>(EncodeConstants.OF13_VERSION_ID, Match.class));
    serializer.serialize(flow.getMatch(), output);
}
Also used : MultipartRequestFlowCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCase) MultipartRequestFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlow) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)

Aggregations

Test (org.junit.Test)182 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)138 ArrayList (java.util.ArrayList)82 BigInteger (java.math.BigInteger)66 EthernetMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder)62 Ipv6MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder)61 Ipv4MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder)60 ByteBuf (io.netty.buffer.ByteBuf)59 IpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder)53 Icmpv6MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder)49 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)48 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match)45 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match)44 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)43 ArpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder)43 TcpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder)42 VlanMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder)41 Icmpv4MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder)40 UdpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder)40 Ipv4Match (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match)39