Search in sources :

Example 51 with Tunnel

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel in project openflowplugin by opendaylight.

the class OpenflowpluginTestCommandProvider method createAppyActionInstruction48.

private static InstructionsBuilder createAppyActionInstruction48() {
    final List<Action> actionList = new ArrayList<>();
    final ActionBuilder ab = new ActionBuilder();
    final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
    // Tunnel
    final TunnelBuilder tunnel = new TunnelBuilder();
    tunnel.setTunnelId(BigInteger.valueOf(10668));
    setFieldBuilder.setTunnel(tunnel.build());
    ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());
    final ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);
    final InstructionBuilder ib = new InstructionBuilder();
    ib.setKey(new InstructionKey(0));
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
    // Put our Instruction in a list of Instructions
    final InstructionsBuilder isb = new InstructionsBuilder();
    final List<Instruction> instructions = new ArrayList<>();
    instructions.add(ib.build());
    isb.setInstruction(instructions);
    return isb;
}
Also used : InstructionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder) DropAction(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropAction) Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) SetFieldCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCaseBuilder) ControllerActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.controller.action._case.ControllerActionBuilder) LoopbackActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.loopback.action._case.LoopbackActionBuilder) HwPathActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.hw.path.action._case.HwPathActionBuilder) SetVlanIdActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder) DropActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.drop.action._case.DropActionBuilder) SetVlanCfiActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.cfi.action._case.SetVlanCfiActionBuilder) PushPbbActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.pbb.action._case.PushPbbActionBuilder) SetMplsTtlActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.mpls.ttl.action._case.SetMplsTtlActionBuilder) PopMplsActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.mpls.action._case.PopMplsActionBuilder) SetDlSrcActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder) SetDlTypeActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.type.action._case.SetDlTypeActionBuilder) SetTpDstActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder) SetNextHopActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.next.hop.action._case.SetNextHopActionBuilder) PushVlanActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.vlan.action._case.PushVlanActionBuilder) SetNwTtlActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.ttl.action._case.SetNwTtlActionBuilder) PopPbbActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.pbb.action._case.PopPbbActionBuilder) SetNwTosActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder) SetTpSrcActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder) SetNwDstActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder) GroupActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder) PushMplsActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.mpls.action._case.PushMplsActionBuilder) PopVlanActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.vlan.action._case.PopVlanActionBuilder) OutputActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder) SwPathActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.sw.path.action._case.SwPathActionBuilder) SetDlDstActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder) StripVlanActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.strip.vlan.action._case.StripVlanActionBuilder) FloodAllActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.all.action._case.FloodAllActionBuilder) SetVlanPcpActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder) SetQueueActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.queue.action._case.SetQueueActionBuilder) SetNwSrcActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder) FloodActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.flood.action._case.FloodActionBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) ArrayList(java.util.ArrayList) InstructionKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey) ActionKey(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey) Instruction(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction) SetFieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetFieldBuilder) TunnelBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TunnelBuilder) InstructionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder) ApplyActionsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder) ApplyActionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder)

Example 52 with Tunnel

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel in project openflowplugin by opendaylight.

the class MatchDeserializerInjector method injectDeserializers.

/**
 * Injects deserializers into provided
 * {@link org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider}.
 *
 * @param provider OpenflowJava deserializer extension provider
 */
static void injectDeserializers(final DeserializerExtensionProvider provider) {
    for (MatchPath path : MatchPath.values()) {
        final MatchDeserializer deserializer = new MatchDeserializer(path);
        provider.registerDeserializer(new MessageCodeMatchKey(EncodeConstants.OF13_VERSION_ID, EncodeConstants.EMPTY_LENGTH, Match.class, path), deserializer);
        // Inject new match entry serializers here using injector created by createInjector method
        final Function<Integer, Function<Long, Function<Integer, Consumer<MatchEntryDeserializer>>>> injector = createInjector(deserializer, EncodeConstants.OF13_VERSION_ID);
        // Wrapped injector that uses OPENFLOW_BASIC_CLASS
        final Function<Integer, Consumer<MatchEntryDeserializer>> basicInjector = injector.apply(OxmMatchConstants.OPENFLOW_BASIC_CLASS).apply(null);
        // Wrapped injector that uses EXPERIMENTER_CLASS
        final Function<Long, Function<Integer, Consumer<MatchEntryDeserializer>>> experInjector = injector.apply(OxmMatchConstants.EXPERIMENTER_CLASS);
        basicInjector.apply(OxmMatchConstants.ARP_OP).accept(new ArpOpEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.ARP_SHA).accept(new ArpSourceHardwareAddressEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.ARP_THA).accept(new ArpTargetHardwareAddressEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.ARP_SPA).accept(new ArpSourceTransportAddressEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.ARP_TPA).accept(new ArpTargetTransportAddressEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IN_PORT).accept(new InPortEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IN_PHY_PORT).accept(new InPhyPortEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.METADATA).accept(new MetadataEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.ETH_DST).accept(new EthernetDestinationEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.ETH_SRC).accept(new EthernetSourceEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.ETH_TYPE).accept(new EthernetTypeEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.VLAN_PCP).accept(new VlanPcpEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.VLAN_VID).accept(new VlanVidEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IP_DSCP).accept(new IpDscpEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IP_ECN).accept(new IpEcnEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IP_PROTO).accept(new IpProtoEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.TCP_SRC).accept(new TcpSourcePortEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.TCP_DST).accept(new TcpDestinationPortEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.UDP_SRC).accept(new UdpSourcePortEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.UDP_DST).accept(new UdpDestinationPortEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.SCTP_SRC).accept(new SctpSourcePortEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.SCTP_DST).accept(new SctpDestinationPortEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.ICMPV4_CODE).accept(new Icmpv4CodeEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.ICMPV4_TYPE).accept(new Icmpv4TypeEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.ICMPV6_CODE).accept(new Icmpv6CodeEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.ICMPV6_TYPE).accept(new Icmpv6TypeEntryDeserializer());
        // TODO: How to differentiate between Ipv4 and Tunnel when both are serialized to same format?
        basicInjector.apply(OxmMatchConstants.IPV4_SRC).accept(new Ipv4SourceEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IPV4_DST).accept(new Ipv4DestinationEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IPV6_SRC).accept(new Ipv6SourceEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IPV6_DST).accept(new Ipv6DestinationEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IPV6_EXTHDR).accept(new Ipv6ExtHeaderEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IPV6_FLABEL).accept(new Ipv6FlabelEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IPV6_ND_SLL).accept(new Ipv6NdSllEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IPV6_ND_TLL).accept(new Ipv6NdTllEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.IPV6_ND_TARGET).accept(new Ipv6NdTargetEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.MPLS_LABEL).accept(new MplsLabelEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.MPLS_BOS).accept(new MplsBosEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.MPLS_TC).accept(new MplsTcEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.PBB_ISID).accept(new PbbEntryDeserializer());
        basicInjector.apply(OxmMatchConstants.TUNNEL_ID).accept(new TunnelIdEntryDeserializer());
        experInjector.apply(EncodeConstants.ONF_EXPERIMENTER_ID).apply(EncodeConstants.ONFOXM_ET_TCP_FLAGS).accept(new TcpFlagsEntryDeserializer());
    }
}
Also used : IpProtoEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.IpProtoEntryDeserializer) TunnelIdEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.TunnelIdEntryDeserializer) Icmpv4CodeEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Icmpv4CodeEntryDeserializer) IpEcnEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.IpEcnEntryDeserializer) IpDscpEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.IpDscpEntryDeserializer) TcpSourcePortEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.TcpSourcePortEntryDeserializer) Consumer(java.util.function.Consumer) MatchDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.MatchDeserializer) InPhyPortEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.InPhyPortEntryDeserializer) SctpSourcePortEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.SctpSourcePortEntryDeserializer) MplsTcEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.MplsTcEntryDeserializer) VlanVidEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.VlanVidEntryDeserializer) MplsBosEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.MplsBosEntryDeserializer) Ipv6SourceEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Ipv6SourceEntryDeserializer) Ipv6ExtHeaderEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Ipv6ExtHeaderEntryDeserializer) Ipv6NdTllEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Ipv6NdTllEntryDeserializer) Ipv6NdSllEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Ipv6NdSllEntryDeserializer) UdpSourcePortEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.UdpSourcePortEntryDeserializer) ArpSourceTransportAddressEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.ArpSourceTransportAddressEntryDeserializer) Icmpv6TypeEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Icmpv6TypeEntryDeserializer) Ipv4DestinationEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Ipv4DestinationEntryDeserializer) SctpDestinationPortEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.SctpDestinationPortEntryDeserializer) TcpDestinationPortEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.TcpDestinationPortEntryDeserializer) TcpFlagsEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.TcpFlagsEntryDeserializer) ArpTargetTransportAddressEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.ArpTargetTransportAddressEntryDeserializer) MatchEntryDeserializer(org.opendaylight.openflowplugin.api.openflow.protocol.deserialization.MatchEntryDeserializer) PbbEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.PbbEntryDeserializer) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match) VlanPcpEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.VlanPcpEntryDeserializer) Function(java.util.function.Function) MplsLabelEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.MplsLabelEntryDeserializer) UdpDestinationPortEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.UdpDestinationPortEntryDeserializer) Ipv6DestinationEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Ipv6DestinationEntryDeserializer) EthernetDestinationEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.EthernetDestinationEntryDeserializer) Ipv4SourceEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Ipv4SourceEntryDeserializer) Icmpv4TypeEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Icmpv4TypeEntryDeserializer) MatchPath(org.opendaylight.openflowplugin.extension.api.path.MatchPath) ArpOpEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.ArpOpEntryDeserializer) MetadataEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.MetadataEntryDeserializer) ArpTargetHardwareAddressEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.ArpTargetHardwareAddressEntryDeserializer) Ipv6NdTargetEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Ipv6NdTargetEntryDeserializer) EthernetSourceEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.EthernetSourceEntryDeserializer) EthernetTypeEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.EthernetTypeEntryDeserializer) ArpSourceHardwareAddressEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.ArpSourceHardwareAddressEntryDeserializer) MessageCodeMatchKey(org.opendaylight.openflowplugin.impl.protocol.deserialization.key.MessageCodeMatchKey) InPortEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.InPortEntryDeserializer) Ipv6FlabelEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Ipv6FlabelEntryDeserializer) Icmpv6CodeEntryDeserializer(org.opendaylight.openflowplugin.impl.protocol.deserialization.match.Icmpv6CodeEntryDeserializer)

Example 53 with Tunnel

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel in project openflowplugin by opendaylight.

the class MultipartMatchFieldSerializerInjector method injectSerializers.

/**
 * Injects multipart match field serializers into provided
 * {@link org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider}.
 *
 * @param provider OpenflowJava serializer extension provider
 */
static void injectSerializers(final SerializerExtensionProvider provider) {
    // Inject new message serializers here using injector created by createInjector method
    final Function<Class<? extends MatchField>, Consumer<OFSerializer<SetFieldMatch>>> injector = createInjector(provider, EncodeConstants.OF13_VERSION_ID);
    injector.apply(ArpOp.class).accept(new ArpOpMatchFieldSerializer());
    injector.apply(ArpSha.class).accept(new ArpShaMatchFieldSerializer());
    injector.apply(ArpSpa.class).accept(new ArpSpaMatchFieldSerializer());
    injector.apply(ArpTha.class).accept(new ArpThaMatchFieldSerializer());
    injector.apply(ArpTpa.class).accept(new ArpTpaMatchFieldSerializer());
    injector.apply(EthDst.class).accept(new EthDstMatchFieldSerializer());
    injector.apply(EthSrc.class).accept(new EthSrcMatchFieldSerializer());
    injector.apply(EthType.class).accept(new EthTypeMatchFieldSerializer());
    injector.apply(Icmpv4Code.class).accept(new Icmpv4CodeMatchFieldSerializer());
    injector.apply(Icmpv4Type.class).accept(new Icmpv4TypeMatchFieldSerializer());
    injector.apply(Icmpv6Code.class).accept(new Icmpv6CodeMatchFieldSerializer());
    injector.apply(Icmpv6Type.class).accept(new Icmpv6TypeMatchFieldSerializer());
    injector.apply(InPhyPort.class).accept(new InPhyPortMatchFieldSerializer());
    injector.apply(InPort.class).accept(new InPortMatchFieldSerializer());
    injector.apply(IpDscp.class).accept(new IpDscpMatchFieldSerializer());
    injector.apply(IpEcn.class).accept(new IpEcnMatchFieldSerializer());
    injector.apply(IpProto.class).accept(new IpProtoMatchFieldSerializer());
    injector.apply(Ipv4Dst.class).accept(new Ipv4DstMatchFieldSerializer());
    injector.apply(Ipv4Src.class).accept(new Ipv4SrcMatchFieldSerializer());
    injector.apply(Ipv6Dst.class).accept(new Ipv6DstMatchFieldSerializer());
    injector.apply(Ipv6Exthdr.class).accept(new Ipv6ExtHdrMatchFieldSerializer());
    injector.apply(Ipv6Flabel.class).accept(new Ipv6FlabelMatchFieldSerializer());
    injector.apply(Ipv6NdSll.class).accept(new Ipv6NdSllMatchFieldSerializer());
    injector.apply(Ipv6NdTarget.class).accept(new Ipv6NdTargetMatchFieldSerializer());
    injector.apply(Ipv6NdTll.class).accept(new Ipv6NdTllMatchFieldSerializer());
    injector.apply(Ipv6Src.class).accept(new Ipv6SrcMatchFieldSerializer());
    injector.apply(Metadata.class).accept(new MetadataMatchFieldSerializer());
    injector.apply(MplsBos.class).accept(new MplsBosMatchFieldSerializer());
    injector.apply(MplsLabel.class).accept(new MplsLabelMatchFieldSerializer());
    injector.apply(MplsTc.class).accept(new MplsTcMatchFieldSerializer());
    injector.apply(PbbIsid.class).accept(new PbbIsidMatchFieldSerializer());
    injector.apply(SctpDst.class).accept(new SctpDstMatchFieldSerializer());
    injector.apply(SctpSrc.class).accept(new SctpSrcMatchFieldSerializer());
    injector.apply(TcpDst.class).accept(new TcpDstMatchFieldSerializer());
    injector.apply(TcpFlags.class).accept(new TcpFlagsMatchFieldSerializer());
    injector.apply(TcpSrc.class).accept(new TcpSrcMatchFieldSerializer());
    injector.apply(TunnelId.class).accept(new TunnelIdMatchFieldSerializer());
    // TODO: Finish implementation of Tunnel Ipv4 src and dst
    injector.apply(TunnelIpv4Dst.class).accept(new Ipv4DstMatchFieldSerializer());
    injector.apply(TunnelIpv4Src.class).accept(new Ipv4SrcMatchFieldSerializer());
    injector.apply(UdpDst.class).accept(new UdpDstMatchFieldSerializer());
    injector.apply(UdpSrc.class).accept(new UdpSrcMatchFieldSerializer());
    injector.apply(VlanPcp.class).accept(new VlanPcpMatchFieldSerializer());
    injector.apply(VlanVid.class).accept(new VlanVidMatchFieldSerializer());
}
Also used : ArpSpa(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSpa) UdpDstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.UdpDstMatchFieldSerializer) PbbIsidMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.PbbIsidMatchFieldSerializer) IpProto(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpProto) Ipv6Src(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Src) Ipv6ExtHdrMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6ExtHdrMatchFieldSerializer) ArpSha(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSha) Icmpv6Type(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Type) SctpSrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.SctpSrcMatchFieldSerializer) Ipv4SrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv4SrcMatchFieldSerializer) Ipv6NdSll(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdSll) Icmpv6TypeMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv6TypeMatchFieldSerializer) SctpDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.SctpDst) Icmpv4CodeMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv4CodeMatchFieldSerializer) TunnelIdMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TunnelIdMatchFieldSerializer) Consumer(java.util.function.Consumer) TcpFlagsMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TcpFlagsMatchFieldSerializer) ArpShaMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpShaMatchFieldSerializer) Icmpv4Type(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type) TcpSrc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpSrc) ArpThaMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpThaMatchFieldSerializer) InPort(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPort) VlanVid(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanVid) UdpDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpDst) TunnelIpv4Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Dst) InPhyPortMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.InPhyPortMatchFieldSerializer) TcpDstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TcpDstMatchFieldSerializer) Icmpv6CodeMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv6CodeMatchFieldSerializer) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch) Ipv6NdSllMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6NdSllMatchFieldSerializer) UdpSrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.UdpSrcMatchFieldSerializer) EthType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType) EthTypeMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthTypeMatchFieldSerializer) EthSrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthSrcMatchFieldSerializer) IpEcnMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.IpEcnMatchFieldSerializer) Ipv6DstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6DstMatchFieldSerializer) TcpDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpDst) MplsLabelMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MplsLabelMatchFieldSerializer) Ipv6NdTllMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6NdTllMatchFieldSerializer) IpDscpMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.IpDscpMatchFieldSerializer) MplsTcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MplsTcMatchFieldSerializer) PbbIsid(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.PbbIsid) TunnelIpv4Src(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Src) Ipv4Src(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Src) UdpSrc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpSrc) ArpTpa(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTpa) Metadata(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Metadata) ArpOp(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp) TunnelIpv4Src(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Src) Ipv6FlabelMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6FlabelMatchFieldSerializer) ArpTha(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTha) TunnelId(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelId) VlanPcpMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.VlanPcpMatchFieldSerializer) MatchField(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField) MplsBosMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MplsBosMatchFieldSerializer) Ipv6Exthdr(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Exthdr) Ipv6NdTll(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTll) TcpFlags(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpFlags) InPortMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.InPortMatchFieldSerializer) VlanVidMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.VlanVidMatchFieldSerializer) MplsBos(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsBos) MplsLabel(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsLabel) SctpDstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.SctpDstMatchFieldSerializer) MplsTc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsTc) EthDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthDst) EthDstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.EthDstMatchFieldSerializer) Icmpv6Code(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Code) Ipv4Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Dst) TunnelIpv4Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Dst) Ipv6SrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6SrcMatchFieldSerializer) Ipv6Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Dst) Ipv6NdTarget(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTarget) InPhyPort(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPhyPort) IpProtoMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.IpProtoMatchFieldSerializer) MetadataMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.MetadataMatchFieldSerializer) ArpTpaMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpTpaMatchFieldSerializer) IpEcn(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpEcn) TcpSrcMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.TcpSrcMatchFieldSerializer) Icmpv4Code(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Code) SctpSrc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.SctpSrc) Ipv6NdTargetMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv6NdTargetMatchFieldSerializer) Icmpv4TypeMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Icmpv4TypeMatchFieldSerializer) VlanPcp(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanPcp) ArpOpMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpOpMatchFieldSerializer) EthSrc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthSrc) Ipv6Flabel(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Flabel) Ipv4DstMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.Ipv4DstMatchFieldSerializer) ArpSpaMatchFieldSerializer(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.matchfield.ArpSpaMatchFieldSerializer) IpDscp(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpDscp)

Example 54 with Tunnel

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel in project openflowplugin by opendaylight.

the class MatchConvertor method tunnelMatch.

private static void tunnelMatch(final List<MatchEntry> matchEntryList, final org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Tunnel tunnel) {
    if (tunnel == null) {
        return;
    }
    TunnelIdCaseBuilder tunnelIdCaseBuilder = new TunnelIdCaseBuilder();
    TunnelIdBuilder tunnelIdBuilder = new TunnelIdBuilder();
    boolean hasMask = tunnel.getTunnelMask() != null;
    if (hasMask) {
        tunnelIdBuilder.setMask(ByteUtil.convertBigIntegerToNBytes(tunnel.getTunnelMask(), OFConstants.SIZE_OF_LONG_IN_BYTES));
    }
    tunnelIdBuilder.setTunnelId(ByteUtil.convertBigIntegerToNBytes(tunnel.getTunnelId(), OFConstants.SIZE_OF_LONG_IN_BYTES));
    tunnelIdCaseBuilder.setTunnelId(tunnelIdBuilder.build());
    MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
    matchEntryBuilder.setMatchEntryValue(tunnelIdCaseBuilder.build());
    matchEntryBuilder.setHasMask(hasMask);
    matchEntryBuilder.setOxmMatchField(TunnelId.class);
    matchEntryBuilder.setOxmClass(OpenflowBasicClass.class);
    matchEntryList.add(matchEntryBuilder.build());
}
Also used : TunnelIdBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.tunnel.id._case.TunnelIdBuilder) MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) TunnelIdCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TunnelIdCaseBuilder)

Example 55 with Tunnel

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel in project genius by opendaylight.

the class ItmTunnelEventListener method update.

@Override
public void update(@Nonnull InstanceIdentifier<StateTunnelList> instanceIdentifier, @Nonnull StateTunnelList originalTunnelList, @Nonnull StateTunnelList updatedTunnelList) {
    LOG.trace("Tunnel Interface updated. Old: {} New: {}", originalTunnelList, updatedTunnelList);
    TunnelOperStatus operStatus = updatedTunnelList.getOperState();
    if (!Objects.equals(originalTunnelList.getOperState(), updatedTunnelList.getOperState())) {
        LOG.debug("Tunnel Interface {} changed state to {}", originalTunnelList.getTunnelInterfaceName(), operStatus);
        ItmTunnelUpdateAlarmWorker itmTunnelUpdateAlarmWorker = new ItmTunnelUpdateAlarmWorker(originalTunnelList, updatedTunnelList);
        jobCoordinator.enqueueJob(ITMConstants.ITM_ALARM, itmTunnelUpdateAlarmWorker);
    }
}
Also used : TunnelOperStatus(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.TunnelOperStatus)

Aggregations

BigInteger (java.math.BigInteger)45 ArrayList (java.util.ArrayList)43 IfTunnel (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel)27 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)23 ExecutionException (java.util.concurrent.ExecutionException)19 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)17 Interface (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface)17 TunnelTypeVxlan (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan)17 ParentRefs (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefs)16 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)15 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)14 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)12 List (java.util.List)12 InterfaceKey (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey)12 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)12 Test (org.junit.Test)8 TransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZone)8 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)7 IfTunnelBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnelBuilder)7 TunnelIpv4MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.TunnelIpv4MatchBuilder)7