use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6Builder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction44.
private static InstructionsBuilder createAppyActionInstruction44() {
final List<Action> actionLists = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
final ActionBuilder ab5 = new ActionBuilder();
final SetFieldBuilder setFieldBuilder5 = new SetFieldBuilder();
final ActionBuilder ab6 = new ActionBuilder();
final SetFieldBuilder setFieldBuilder6 = new SetFieldBuilder();
// IPv6
final Ipv6MatchBuilder ipv6Builder = new Ipv6MatchBuilder();
final Ipv6MatchBuilder ipv6Builder1 = new Ipv6MatchBuilder();
final Ipv6MatchBuilder ipv6Builder5 = new Ipv6MatchBuilder();
final Ipv6MatchBuilder ipv6Builder6 = new Ipv6MatchBuilder();
final Ipv6Prefix dstip6 = new Ipv6Prefix("2002::2/128");
final Ipv6Prefix srcip6 = new Ipv6Prefix("2001:0:0:0:0:0:0:1/128");
final Ipv6ExtHeaderBuilder nextheader = new Ipv6ExtHeaderBuilder();
nextheader.setIpv6Exthdr(58);
final Ipv6LabelBuilder ipv6label = new Ipv6LabelBuilder();
final Ipv6FlowLabel label = new Ipv6FlowLabel(10028L);
ipv6label.setIpv6Flabel(label);
ipv6Builder.setIpv6Source(srcip6);
ipv6Builder1.setIpv6Destination(dstip6);
ipv6Builder5.setIpv6ExtHeader(nextheader.build());
ipv6Builder6.setIpv6Label(ipv6label.build());
setFieldBuilder.setLayer3Match(ipv6Builder.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setKey(new ActionKey(0));
actionLists.add(ab.build());
setFieldBuilder1.setLayer3Match(ipv6Builder1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
ab1.setKey(new ActionKey(1));
actionLists.add(ab1.build());
setFieldBuilder5.setLayer3Match(ipv6Builder5.build());
ab5.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder5.build()).build());
ab5.setKey(new ActionKey(5));
actionLists.add(ab5.build());
setFieldBuilder6.setLayer3Match(ipv6Builder6.build());
ab6.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder6.build()).build());
ab6.setKey(new ActionKey(6));
actionLists.add(ab6.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionLists);
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;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6Builder in project openflowplugin by opendaylight.
the class OxmIpv6DstDeserializer method addIpv6DstValue.
private static void addIpv6DstValue(final ByteBuf input, final MatchEntryBuilder builder) {
Ipv6DstCaseBuilder caseBuilder = new Ipv6DstCaseBuilder();
Ipv6DstBuilder ipv6Builder = new Ipv6DstBuilder();
ipv6Builder.setIpv6Address(ByteBufUtils.readIetfIpv6Address(input));
if (builder.isHasMask()) {
ipv6Builder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES));
}
caseBuilder.setIpv6Dst(ipv6Builder.build());
builder.setMatchEntryValue(caseBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6Builder in project openflowplugin by opendaylight.
the class OxmIpv6SrcDeserializer method addIpv6SrcValue.
private static void addIpv6SrcValue(final ByteBuf input, final MatchEntryBuilder builder) {
Ipv6SrcCaseBuilder caseBuilder = new Ipv6SrcCaseBuilder();
Ipv6SrcBuilder ipv6Builder = new Ipv6SrcBuilder();
ipv6Builder.setIpv6Address(ByteBufUtils.readIetfIpv6Address(input));
if (builder.isHasMask()) {
ipv6Builder.setMask(OxmDeserializerHelper.convertMask(input, EncodeConstants.SIZE_OF_IPV6_ADDRESS_IN_BYTES));
}
caseBuilder.setIpv6Src(ipv6Builder.build());
builder.setMatchEntryValue(caseBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6Builder in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method ipAddressToByteArray_ipv6.
/**
* Tests {@link LispAddressUtil#ipAddressToByteArray(Address)} method with ipv6 value.
*/
@Test
public void ipAddressToByteArray_ipv6() {
final Ipv6 expectedIpv6 = new Ipv6Builder().setIpv6(IPV6_ADDRESS_TEST).build();
final byte[] testedAddress = LispAddressUtil.ipAddressToByteArray(expectedIpv6);
assertArrayEquals(IPV6_ADDRESS_BYTES_A_TEST, testedAddress);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6Builder in project lispflowmapping by opendaylight.
the class Ipv6Serializer method deserializeRlocData.
@Override
protected Rloc deserializeRlocData(ByteBuffer buffer) {
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(Ipv6Afi.class);
rb.setVirtualNetworkId(null);
rb.setAddress(new Ipv6Builder().setIpv6(deserializeData(buffer)).build());
return rb.build();
}
Aggregations