apps/bgp-api/src/main/java/org/onosproject/bgp/bgpio/types/attr/BgpAttrRouterIdV4.java
/**
     * Reads the IPv4 Router-ID.
     *
     * @param cb ChannelBuffer
     * @param sType tag type
     * @return object of BgpAttrRouterIdV4
     * @throws BgpParseException while parsing BgpAttrRouterIdV4
     */
Reads the IPv4 Router-ID.
@param cb ChannelBuffer
@param sType tag type
@return object of BgpAttrRouterIdV4
@throws BgpParseException while parsing BgpAttrRouterIdV4
Reads the IPv4 Router - ID . @param cb ChannelBuffer @param sType tag type @return object of BgpAttrRouterIdV4 @throws BgpParseException while parsing BgpAttrRouterIdV4
public static BgpAttrRouterIdV4 read(ChannelBuffer cb, short sType)
            throws BgpParseException {
        short lsAttrLength = cb.readShort();
        if ((lsAttrLength != 4) || (cb.readableBytes() < lsAttrLength)) {
            Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR,
                                   BgpErrorType.ATTRIBUTE_LENGTH_ERROR,
                                   lsAttrLength);
        }
        byte[] ipBytes = new byte[lsAttrLength];
        cb.readBytes(ipBytes, 0, lsAttrLength);
        Ip4Address ip4RouterId = Ip4Address.valueOf(ipBytes);
        return BgpAttrRouterIdV4.of(ip4RouterId, sType);
    }
public static BgpAttrRouterIdV4 read ( ChannelBuffer cb , short sType ) throws BgpParseException { short lsAttrLength = cb . readShort ( ) ; if ( ( lsAttrLength != 4 ) || ( cb . readableBytes ( ) < lsAttrLength ) ) { Validation . validateLen ( BgpErrorType . UPDATE_MESSAGE_ERROR , BgpErrorType . ATTRIBUTE_LENGTH_ERROR , lsAttrLength ) ; } byte [ ] ipBytes = new byte [ lsAttrLength ] ; cb . readBytes ( ipBytes , 0 , lsAttrLength ) ; Ip4Address ip4RouterId = Ip4Address . valueOf ( ipBytes ) ; return BgpAttrRouterIdV4 . of ( ip4RouterId , sType ) ; }
Reads the IPv4 Router-ID.
Reads the IPv4 Router - ID .