use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.
the class MultipartReplyMessageFactoryTest method createActionList.
private static List<Action> createActionList() {
final List<Action> actions = new ArrayList<>();
OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
OutputActionBuilder outputBuilder = new OutputActionBuilder();
outputBuilder.setPort(new PortNumber(45L));
outputBuilder.setMaxLength(55);
caseBuilder.setOutputAction(outputBuilder.build());
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(caseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetNwTtlCaseBuilder ttlCaseBuilder = new SetNwTtlCaseBuilder();
SetNwTtlActionBuilder ttlActionBuilder = new SetNwTtlActionBuilder();
ttlActionBuilder.setNwTtl((short) 64);
ttlCaseBuilder.setSetNwTtlAction(ttlActionBuilder.build());
actionBuilder.setActionChoice(ttlCaseBuilder.build());
actions.add(actionBuilder.build());
return actions;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.
the class OF10StatsReplyMessageFactoryTest method createFlowStats.
private static List<FlowStats> createFlowStats() {
FlowStatsBuilder builder = new FlowStatsBuilder();
builder.setTableId((short) 1);
MatchV10Builder matchBuilder = new MatchV10Builder();
matchBuilder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
matchBuilder.setNwSrcMask((short) 0);
matchBuilder.setNwDstMask((short) 0);
matchBuilder.setInPort(58);
matchBuilder.setDlSrc(new MacAddress("01:01:01:01:01:01"));
matchBuilder.setDlDst(new MacAddress("ff:ff:ff:ff:ff:ff"));
matchBuilder.setDlVlan(18);
matchBuilder.setDlVlanPcp((short) 5);
matchBuilder.setDlType(42);
matchBuilder.setNwTos((short) 4);
matchBuilder.setNwProto((short) 7);
matchBuilder.setNwSrc(new Ipv4Address("8.8.8.8"));
matchBuilder.setNwDst(new Ipv4Address("16.16.16.16"));
matchBuilder.setTpSrc(6653);
matchBuilder.setTpDst(6633);
builder.setMatchV10(matchBuilder.build());
builder.setDurationSec(1L);
builder.setDurationNsec(2L);
builder.setPriority(1);
builder.setIdleTimeout(1);
builder.setHardTimeout(1);
builder.setCookie(BigInteger.valueOf(1234L));
builder.setPacketCount(BigInteger.valueOf(1234L));
builder.setByteCount(BigInteger.valueOf(1234L));
final List<Action> actions = new ArrayList<>();
final ActionBuilder actionBuilder = new ActionBuilder();
OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
OutputActionBuilder outputBuilder = new OutputActionBuilder();
outputBuilder.setPort(new PortNumber(42L));
outputBuilder.setMaxLength(50);
caseBuilder.setOutputAction(outputBuilder.build());
actionBuilder.setActionChoice(caseBuilder.build());
actions.add(actionBuilder.build());
builder.setAction(actions);
List<FlowStats> list = new ArrayList<>();
list.add(builder.build());
return list;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.
the class QueueGetConfigReplyMessageFactoryTest method createQueuesList.
private static List<Queues> createQueuesList() {
final List<Queues> queuesList = new ArrayList<>();
QueuesBuilder qb = new QueuesBuilder();
qb.setQueueId(new QueueId(1L));
qb.setPort(new PortNumber(3L));
qb.setQueueProperty(createPropertiesList());
queuesList.add(qb.build());
return queuesList;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.
the class OxmTcpSrcSerializerTest method prepareMatchEntry.
private static MatchEntryBuilder prepareMatchEntry(int value) {
MatchEntryBuilder builder = prepareHeader(false);
TcpSrcCaseBuilder casebuilder = new TcpSrcCaseBuilder();
TcpSrcBuilder valueBuilder = new TcpSrcBuilder();
valueBuilder.setPort(new PortNumber(value));
casebuilder.setTcpSrc(valueBuilder.build());
builder.setMatchEntryValue(casebuilder.build());
return builder;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project openflowplugin by opendaylight.
the class OxmUdpDstSerializerTest method prepareMatchEntry.
private static MatchEntryBuilder prepareMatchEntry(int value) {
MatchEntryBuilder builder = prepareHeader(false);
UdpDstCaseBuilder casebuilder = new UdpDstCaseBuilder();
UdpDstBuilder valueBuilder = new UdpDstBuilder();
valueBuilder.setPort(new PortNumber(value));
casebuilder.setUdpDst(valueBuilder.build());
builder.setMatchEntryValue(casebuilder.build());
return builder;
}
Aggregations