use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class TcpFlagsEntryDeserializerTest method deserializeEntry.
@Test
public void deserializeEntry() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int tcpFlags = 6;
final int tcpFlagsMask = 5;
writeHeader(in, false);
in.writeInt((int) EncodeConstants.ONF_EXPERIMENTER_ID);
in.writeShort(tcpFlags);
TcpFlagsMatch match = deserialize(in).getTcpFlagsMatch();
assertEquals(tcpFlags, match.getTcpFlags().intValue());
assertEquals(0, in.readableBytes());
writeHeader(in, true);
in.writeInt((int) EncodeConstants.ONF_EXPERIMENTER_ID);
in.writeShort(tcpFlags);
in.writeShort(tcpFlagsMask);
match = deserialize(in).getTcpFlagsMatch();
assertEquals(tcpFlags, match.getTcpFlags().intValue());
assertEquals(tcpFlagsMask, match.getTcpFlagsMask().intValue());
assertEquals(0, in.readableBytes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createInphyportMatch.
private static MatchBuilder createInphyportMatch(final NodeId nodeId) {
final MatchBuilder match = new MatchBuilder();
match.setInPort(new NodeConnectorId(nodeId + ":202"));
match.setInPhyPort(new NodeConnectorId(nodeId + ":10122"));
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createMatch1.
private static MatchBuilder createMatch1() {
final MatchBuilder match = new MatchBuilder();
final Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
final Ipv4Prefix prefix = new Ipv4Prefix(IPV4_PREFIX);
ipv4Match.setIpv4Destination(prefix);
final Ipv4Match i4m = ipv4Match.build();
match.setLayer3Match(i4m);
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createICMPv6Match.
private static MatchBuilder createICMPv6Match() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x86ddL));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
// ipv4 version
final IpMatchBuilder ipmatch = new IpMatchBuilder();
ipmatch.setIpProtocol((short) 58);
match.setIpMatch(ipmatch.build());
// icmpv6
final Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder();
// match
icmpv6match.setIcmpv6Type((short) 135);
icmpv6match.setIcmpv6Code((short) 1);
match.setIcmpv6Match(icmpv6match.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createL4SCTPMatch.
private static MatchBuilder createL4SCTPMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
// ipv4 version
final IpMatchBuilder ipmatch = new IpMatchBuilder();
ipmatch.setIpProtocol((short) 132);
match.setIpMatch(ipmatch.build());
final SctpMatchBuilder sctpmatch = new SctpMatchBuilder();
final PortNumber srcport = new PortNumber(1435);
final PortNumber dstport = new PortNumber(22);
sctpmatch.setSctpSourcePort(srcport);
sctpmatch.setSctpDestinationPort(dstport);
match.setLayer4Match(sctpmatch.build());
return match;
}
Aggregations