use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match in project bgpcep by opendaylight.
the class MatchBgpNeighborSetHandler method matchBgpNeighborSetCondition.
private boolean matchBgpNeighborSetCondition(@Nonnull final PeerId fromPeerId, @Nullable final PeerId toPeerId, final MatchBgpNeighborSet matchBgpNeighborSet) {
final BgpNeighbor from = matchBgpNeighborSet.getFromNeighbor();
Boolean match = null;
if (from != null) {
match = checkMatch(from.getNeighborSet(), fromPeerId, from.getMatchSetOptions());
}
if (match != null && !match) {
return false;
}
final BgpNeighbor to = matchBgpNeighborSet.getToNeighbor();
if (to != null) {
match = checkMatch(to.getNeighborSet(), toPeerId, to.getMatchSetOptions());
}
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match in project bgpcep by opendaylight.
the class Stateful07LSPIdentifierIpv4TlvParser method parseTlv.
@Override
public LspIdentifiers parseTlv(final ByteBuf buffer) throws PCEPDeserializerException {
if (buffer == null) {
return null;
}
Preconditions.checkArgument(buffer.readableBytes() == V4_LENGTH, "Length %s does not match LSP Identifiers Ipv4 tlv length.", buffer.readableBytes());
final Ipv4Builder builder = new Ipv4Builder();
builder.setIpv4TunnelSenderAddress(Ipv4Util.addressForByteBuf(buffer));
final LspId lspId = new LspId((long) buffer.readUnsignedShort());
final TunnelId tunnelId = new TunnelId(buffer.readUnsignedShort());
builder.setIpv4ExtendedTunnelId(new Ipv4ExtendedTunnelId(Ipv4Util.addressForByteBuf(buffer)));
builder.setIpv4TunnelEndpointAddress(Ipv4Util.addressForByteBuf(buffer));
final AddressFamily afi = new Ipv4CaseBuilder().setIpv4(builder.build()).build();
return new LspIdentifiersBuilder().setAddressFamily(afi).setLspId(lspId).setTunnelId(tunnelId).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.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());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.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);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match in project openflowplugin by opendaylight.
the class MultipartReplyTableFeaturesDeserializer method deserialize.
@Override
public MultipartReplyBody deserialize(ByteBuf message) {
final MultipartReplyTableFeaturesBuilder builder = new MultipartReplyTableFeaturesBuilder();
final List<TableFeatures> items = new ArrayList<>();
while (message.readableBytes() > 0) {
final int itemLength = message.readUnsignedShort();
final TableFeaturesBuilder itemBuilder = new TableFeaturesBuilder().setTableId(message.readUnsignedByte());
message.skipBytes(PADDING_IN_MULTIPART_REPLY_TABLE_FEATURES);
final String name = ByteBufUtils.decodeNullTerminatedString(message, MAX_TABLE_NAME_LENGTH);
final byte[] match = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
message.readBytes(match);
final byte[] write = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
message.readBytes(write);
items.add(itemBuilder.setKey(new TableFeaturesKey(itemBuilder.getTableId())).setName(name).setMetadataMatch(new BigInteger(1, match)).setMetadataWrite(new BigInteger(1, write)).setConfig(readTableConfig(message)).setMaxEntries(message.readUnsignedInt()).setTableProperties(readTableProperties(message, itemLength - MULTIPART_REPLY_TABLE_FEATURES_STRUCTURE_LENGTH)).build());
}
return builder.setTableFeatures(items).build();
}
Aggregations