当前位置: 首页>>代码示例>>Java>>正文


Java IpPrefix.getIpv6Prefix方法代码示例

本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix.getIpv6Prefix方法的典型用法代码示例。如果您正苦于以下问题:Java IpPrefix.getIpv6Prefix方法的具体用法?Java IpPrefix.getIpv6Prefix怎么用?Java IpPrefix.getIpv6Prefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix的用法示例。


在下文中一共展示了IpPrefix.getIpv6Prefix方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: serializeSubobject

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix; //导入方法依赖的package包/类
@Override
public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
    Preconditions.checkArgument(subobject.getSubobjectType() instanceof IpPrefixCase, "Unknown subobject instance. Passed %s. Needed IpPrefixCase.", subobject.getSubobjectType().getClass());
    final IpPrefixSubobject specObj = ((IpPrefixCase) subobject.getSubobjectType()).getIpPrefix();
    final IpPrefix prefix = specObj.getIpPrefix();
    Preconditions.checkArgument(prefix.getIpv4Prefix() != null || prefix.getIpv6Prefix() != null, "Unknown AbstractPrefix instance. Passed %s.", prefix.getClass());
    if (prefix.getIpv6Prefix() != null) {
        new XROIpv6PrefixSubobjectParser().serializeSubobject(subobject, buffer);
    } else {
        final ByteBuf body = Unpooled.buffer(CONTENT4_LENGTH);
        Preconditions.checkArgument(prefix.getIpv4Prefix() != null, "Ipv4Prefix is mandatory.");
        writeIpv4Prefix(prefix.getIpv4Prefix(), body);
        Preconditions.checkArgument(subobject.getAttribute() != null, "Attribute is mandatory.");
        writeUnsignedByte((short) subobject.getAttribute().getIntValue(), body);
        XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:18,代码来源:XROIpv4PrefixSubobjectParser.java

示例2: serializeSubobject

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix; //导入方法依赖的package包/类
@Override
public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
    Preconditions.checkArgument(subobject.getSubobjectType() instanceof IpPrefixCase, "Unknown subobject instance. Passed %s. Needed IpPrefixCase.", subobject.getSubobjectType().getClass());
    final IpPrefixSubobject specObj = ((IpPrefixCase) subobject.getSubobjectType()).getIpPrefix();
    final IpPrefix prefix = specObj.getIpPrefix();
    Preconditions.checkArgument(prefix.getIpv4Prefix() != null || prefix.getIpv6Prefix() != null, "Unknown AbstractPrefix instance. Passed %s.", prefix.getClass());
    if (prefix.getIpv6Prefix() != null) {
        new EROIpv6PrefixSubobjectParser().serializeSubobject(subobject, buffer);
    } else {
        final ByteBuf body = Unpooled.buffer(CONTENT4_LENGTH);
        Preconditions.checkArgument(prefix.getIpv4Prefix() != null, "Ipv4Prefix is mandatory.");
        writeIpv4Prefix(prefix.getIpv4Prefix(), body);
        body.writeZero(RESERVED);
        EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:17,代码来源:EROIpv4PrefixSubobjectParser.java

示例3: serializeSubobject

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix; //导入方法依赖的package包/类
@Override
public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
    Preconditions.checkArgument(subobject.getSubobjectType() instanceof IpPrefixCase, "Unknown subobject instance. Passed %s. Needed IpPrefixCase.", subobject.getSubobjectType().getClass());
    final IpPrefixSubobject specObj = ((IpPrefixCase) subobject.getSubobjectType()).getIpPrefix();
    final IpPrefix prefix = specObj.getIpPrefix();
    Preconditions.checkArgument(prefix.getIpv4Prefix() != null || prefix.getIpv6Prefix() != null, "Unknown AbstractPrefix instance. Passed %s.", prefix.getClass());
    if (prefix.getIpv6Prefix() != null) {
        new RROIpv6PrefixSubobjectParser().serializeSubobject(subobject, buffer);
    } else {
        final BitArray flags = new BitArray(FLAGS_SIZE);
        flags.set(LPA_F_OFFSET, subobject.isProtectionAvailable());
        flags.set(LPIU_F_OFFSET, subobject.isProtectionInUse());
        final ByteBuf body = Unpooled.buffer(CONTENT4_LENGTH);
        Preconditions.checkArgument(prefix.getIpv4Prefix() != null, "Ipv4Prefix is mandatory.");
        writeIpv4Prefix(prefix.getIpv4Prefix(), body);
        flags.toByteBuf(body);
        RROSubobjectUtil.formatSubobject(TYPE, body, buffer);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:20,代码来源:RROIpv4PrefixSubobjectParser.java

示例4: serializeSubobject

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix; //导入方法依赖的package包/类
@Override
public void serializeSubobject(final SubobjectContainer subobject, final ByteBuf buffer) {
    Preconditions.checkArgument(subobject.getSubobjectType() instanceof IpPrefixCase,
        "Unknown subobject instance. Passed %s. Needed IpPrefixCase.",
        subobject.getSubobjectType().getClass());
    final IpPrefixSubobject specObj = ((IpPrefixCase) subobject.getSubobjectType()).getIpPrefix();
    final IpPrefix prefix = specObj.getIpPrefix();
    Preconditions.checkArgument(prefix.getIpv4Prefix() != null || prefix.getIpv6Prefix() != null,
        "Unknown AbstractPrefix instance. Passed %s.", prefix.getClass());
    if (prefix.getIpv6Prefix() != null) {
        new XROIpv6PrefixSubobjectParser().serializeSubobject(subobject, buffer);
    } else {
        final ByteBuf body = Unpooled.buffer(CONTENT4_LENGTH);
        Preconditions.checkArgument(prefix.getIpv4Prefix() != null, "Ipv4Prefix is mandatory.");
        writeIpv4Prefix(prefix.getIpv4Prefix(), body);
        Preconditions.checkArgument(subobject.getAttribute() != null, "Attribute is mandatory.");
        writeUnsignedByte((short) subobject.getAttribute().getIntValue(), body);
        XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:21,代码来源:XROIpv4PrefixSubobjectParser.java

示例5: serializeSubobject

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix; //导入方法依赖的package包/类
@Override
public void serializeSubobject(final SubobjectContainer subobject, final ByteBuf buffer) {
    Preconditions.checkArgument(subobject.getSubobjectType() instanceof IpPrefixCase,
        "Unknown subobject instance. Passed %s. Needed IpPrefixCase.",
        subobject.getSubobjectType().getClass());
    final IpPrefixSubobject specObj = ((IpPrefixCase) subobject.getSubobjectType()).getIpPrefix();
    final IpPrefix prefix = specObj.getIpPrefix();
    Preconditions.checkArgument(prefix.getIpv4Prefix() != null || prefix.getIpv6Prefix() != null,
        "Unknown AbstractPrefix instance. Passed %s.", prefix.getClass());
    if (prefix.getIpv6Prefix() != null) {
        new EROIpv6PrefixSubobjectParser().serializeSubobject(subobject, buffer);
    } else {
        final ByteBuf body = Unpooled.buffer(CONTENT4_LENGTH);
        Preconditions.checkArgument(prefix.getIpv4Prefix() != null, "Ipv4Prefix is mandatory.");
        writeIpv4Prefix(prefix.getIpv4Prefix(), body);
        body.writeZero(RESERVED);
        EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:20,代码来源:EROIpv4PrefixSubobjectParser.java

示例6: serializeSubobject

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix; //导入方法依赖的package包/类
@Override
public void serializeSubobject(final SubobjectContainer subobject, final ByteBuf buffer) {
    Preconditions.checkArgument(subobject.getSubobjectType() instanceof IpPrefixCase,
        "Unknown subobject instance. Passed %s. Needed IpPrefixCase.",
        subobject.getSubobjectType().getClass());
    final IpPrefixSubobject specObj = ((IpPrefixCase) subobject.getSubobjectType()).getIpPrefix();
    final IpPrefix prefix = specObj.getIpPrefix();
    Preconditions.checkArgument(prefix.getIpv4Prefix() != null || prefix.getIpv6Prefix() != null,
        "Unknown AbstractPrefix instance. Passed %s.", prefix.getClass());
    if (prefix.getIpv6Prefix() != null) {
        new RROIpv6PrefixSubobjectParser().serializeSubobject(subobject, buffer);
    } else {
        final BitArray flags = new BitArray(FLAGS_SIZE);
        flags.set(LPA_F_OFFSET, subobject.isProtectionAvailable());
        flags.set(LPIU_F_OFFSET, subobject.isProtectionInUse());
        final ByteBuf body = Unpooled.buffer(CONTENT4_LENGTH);
        Preconditions.checkArgument(prefix.getIpv4Prefix() != null, "Ipv4Prefix is mandatory.");
        writeIpv4Prefix(prefix.getIpv4Prefix(), body);
        flags.toByteBuf(body);
        RROSubobjectUtil.formatSubobject(TYPE, body, buffer);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:23,代码来源:RROIpv4PrefixSubobjectParser.java

示例7: isNotIpv6AllNetwork

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix; //导入方法依赖的package包/类
protected static boolean isNotIpv6AllNetwork(AllowedAddressPairs aap) {
    IpPrefix ipPrefix = aap.getIpAddress().getIpPrefix();
    if (ipPrefix != null && ipPrefix.getIpv6Prefix() != null
            && ipPrefix.getIpv6Prefix().getValue().equals(AclConstants.IPV6_ALL_NETWORK)) {
        return false;
    }
    return true;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:9,代码来源:AclServiceUtils.java

示例8: serializeTlvBody

import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix; //导入方法依赖的package包/类
@Override
public void serializeTlvBody(final IpPrefix tlv, final ByteBuf body) {
    if (tlv.getIpv4Prefix() != null) {
        ByteBufWriteUtil.writeMinimalPrefix(tlv.getIpv4Prefix(), body);
    } else if (tlv.getIpv6Prefix() != null) {
        ByteBufWriteUtil.writeMinimalPrefix(tlv.getIpv6Prefix(), body);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:9,代码来源:ReachTlvParser.java


注:本文中的org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix.getIpv6Prefix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。