Class ReachTlvParser

    • Field Detail

      • IP_REACHABILITY_QNAME

        public static final org.opendaylight.yangtools.yang.common.QName IP_REACHABILITY_QNAME
      • IP_REACH_NID

        public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier IP_REACH_NID
    • Constructor Detail

      • ReachTlvParser

        public ReachTlvParser()
    • Method Detail

      • parseTlvBody

        public org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix parseTlvBody​(io.netty.buffer.ByteBuf value)

        IP Reachability TLV serves to convey both an IPV4 or an IPV6 prefix as per RFC7752 Section 3.2.3.2. However, the Length of the IP Reachability TLV could not be used to distinguish the two types of prefixes as it will be the same: for example byteBuffer == [24][192][168][01] could be parsed as IPv4 prefix 192.168.1.0/24 or as IPv6 prefix c0a8:100::/24.

        Thus, we could just verify if the length is greater than 4 bytes. In this case, it is certain that the prefix is IPv6. For a length less than or equal to 4 bytes, the parser assumes that the prefix is IPv4. In addition, the probability that an IS-IS domain advertises an IPv6 prefix with a length lower than /32 is very low.

        Specified by:
        parseTlvBody in interface LinkstateTlvParser<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix>
      • getTlvQName

        public org.opendaylight.yangtools.yang.common.QName getTlvQName()
        Specified by:
        getTlvQName in interface LinkstateTlvParser<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix>
      • serializeTlvBody

        public void serializeTlvBody​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix tlv,
                                     io.netty.buffer.ByteBuf body)
        Specified by:
        serializeTlvBody in interface LinkstateTlvParser.LinkstateTlvSerializer<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix>
      • serializeModel

        public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix serializeModel​(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode prefixDesc)