use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Builder in project lispflowmapping by opendaylight.
the class LispAddressUtil method toRloc.
public static Rloc toRloc(Ipv6Address address) {
RlocBuilder builder = new RlocBuilder();
builder.setAddressType(Ipv6Afi.class);
builder.setVirtualNetworkId(null);
builder.setAddress((Address) new Ipv6Builder().setIpv6(address).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Builder in project lispflowmapping by opendaylight.
the class LispAddressUtil method toEid.
public static Eid toEid(Ipv6Address address, InstanceIdType vni) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv6Afi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress((Address) new Ipv6Builder().setIpv6(address).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Builder in project lispflowmapping by opendaylight.
the class Ipv6Serializer method deserializeEidData.
@Override
protected Eid deserializeEidData(ByteBuffer buffer, LispAddressSerializerContext ctx) {
EidBuilder eb = new EidBuilder();
eb.setAddressType(Ipv6Afi.class);
eb.setVirtualNetworkId(getVni(ctx));
eb.setAddress(new Ipv6Builder().setIpv6(deserializeData(buffer)).build());
return eb.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Builder in project bgpcep by opendaylight.
the class PCEPEndPointsIpv6ObjectParser method parseObject.
@Override
public Object parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
Preconditions.checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
final EndpointsObjBuilder builder = new EndpointsObjBuilder();
if (!header.isProcessingRule()) {
LOG.debug("Processed bit not set on Endpoints OBJECT, ignoring it.");
return new UnknownObject(PCEPErrors.P_FLAG_NOT_SET, builder.build());
}
if (bytes.readableBytes() != Ipv6Util.IPV6_LENGTH * 2) {
throw new PCEPDeserializerException("Wrong length of array of bytes.");
}
builder.setIgnore(header.isIgnore());
builder.setProcessingRule(header.isProcessingRule());
final Ipv6Builder b = new Ipv6Builder();
b.setSourceIpv6Address(Ipv6Util.addressForByteBuf(bytes));
b.setDestinationIpv6Address(Ipv6Util.addressForByteBuf(bytes));
builder.setAddressFamily(new Ipv6CaseBuilder().setIpv6(b.build()).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Builder in project openflowplugin by opendaylight.
the class OxmIpv6NdTargetDeserializer method addIpv6NdTargetValue.
private static void addIpv6NdTargetValue(final ByteBuf input, final MatchEntryBuilder builder) {
Ipv6NdTargetCaseBuilder caseBuilder = new Ipv6NdTargetCaseBuilder();
Ipv6NdTargetBuilder ipv6Builder = new Ipv6NdTargetBuilder();
ipv6Builder.setIpv6Address(ByteBufUtils.readIetfIpv6Address(input));
caseBuilder.setIpv6NdTarget(ipv6Builder.build());
builder.setMatchEntryValue(caseBuilder.build());
}
Aggregations