Class FibHelper


  • public final class FibHelper
    extends java.lang.Object
    • Method Detail

      • buildRoutePath

        public static RoutePaths buildRoutePath​(java.lang.String nextHop,
                                                org.opendaylight.yangtools.yang.common.Uint32 label)
      • getVrfEntryBuilder

        public static VrfEntryBuilder getVrfEntryBuilder​(java.lang.String prefix,
                                                         RouteOrigin origin,
                                                         @Nullable java.lang.String parentVpnRd)
      • getVrfEntryBuilder

        public static VrfEntryBuilder getVrfEntryBuilder​(java.lang.String prefix,
                                                         java.util.List<RoutePaths> routePaths,
                                                         RouteOrigin origin,
                                                         @Nullable java.lang.String parentVpnRd)
      • getVrfEntryBuilder

        public static VrfEntryBuilder getVrfEntryBuilder​(java.lang.String prefix,
                                                         org.opendaylight.yangtools.yang.common.Uint32 label,
                                                         java.lang.String nextHop,
                                                         RouteOrigin origin,
                                                         @Nullable java.lang.String parentVpnRd)
      • getVrfEntryBuilder

        public static VrfEntryBuilder getVrfEntryBuilder​(VrfEntry vrfEntry,
                                                         org.opendaylight.yangtools.yang.common.Uint32 label,
                                                         java.util.List<java.lang.String> nextHopList,
                                                         RouteOrigin origin,
                                                         @Nullable java.lang.String parentvpnRd)
      • buildRoutePathId

        public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<RoutePaths> buildRoutePathId​(java.lang.String rd,
                                                                                                              java.lang.String prefix,
                                                                                                              java.lang.String nextHop)
      • isControllerManagedNonInterVpnLinkRoute

        public static boolean isControllerManagedNonInterVpnLinkRoute​(RouteOrigin routeOrigin)
      • isControllerManagedVpnInterfaceRoute

        public static boolean isControllerManagedVpnInterfaceRoute​(RouteOrigin routeOrigin)
      • isControllerManagedNonSelfImportedRoute

        public static boolean isControllerManagedNonSelfImportedRoute​(RouteOrigin routeOrigin)
      • sortIpAddress

        public static void sortIpAddress​(java.util.List<RoutePaths> routePathList)
      • getNextHopListFromRoutePaths

        public static java.util.List<java.lang.String> getNextHopListFromRoutePaths​(VrfEntry vrfEntry)
      • getVrfEntry

        public static com.google.common.base.Optional<VrfEntry> getVrfEntry​(org.opendaylight.controller.md.sal.binding.api.DataBroker broker,
                                                                            java.lang.String rd,
                                                                            java.lang.String ipPrefix)
      • isIpv4Prefix

        public static boolean isIpv4Prefix​(java.lang.String prefix)
        get true if this prefix is an IPv4 version, false otherwise.
        Parameters:
        prefix - the prefix as (x.x.x.x/nn) to find if it is in IP version 4
        Returns:
        true if it is an IPv4 or false if it is not.
      • isIpv6Prefix

        public static boolean isIpv6Prefix​(java.lang.String prefix)
        get true if this prefix is an IPv6 version, false otherwise.
        Parameters:
        prefix - the prefix as ( x:x:x::/nn) to find if it is in IP version 6
        Returns:
        true if it is an IPv4 or false if it is not.
      • getIpFromPrefix

        public static @Nullable java.lang.String getIpFromPrefix​(java.lang.String prefix)
        get String format IP from prefix as x.x.....x/nn.
        Parameters:
        prefix - the prefix as IPv4 or IPv6 as x.....x/nn
        Returns:
        prefix if "/" is unfindable or the IP only as x.x...x from x.x......x/nn
      • isBelongingPrefix

        public static boolean isBelongingPrefix​(java.lang.String prefixToTest,
                                                java.lang.String subnet)
        Return true if this prefix or subnet is belonging the specified subnetwork.
        Parameters:
        prefixToTest - the prefix which could be in the subnet
        subnet - the subnet that have to contain the prefixToTest to return true
        Returns:
        true if the param subnet contained the prefixToTest false otherwise
      • doesPrefixBelongToSubnet

        public static boolean doesPrefixBelongToSubnet​(java.lang.String prefixToTest,
                                                       java.lang.String subnet,
                                                       boolean exactMatch)
        Return true if this prefix or subnet is belonging the specified subnetwork.
        Parameters:
        prefixToTest - the prefix which could be in the subnet
        subnet - the subnet that have to contain the prefixToTest to return true
        exactMatch - boolean set to true if exact match is expected
        Returns:
        true if the param subnet contained the prefixToTest false otherwise
      • packBigInteger

        public static java.math.BigInteger packBigInteger​(byte[] bytes)
        This method converts a byte[] to a BigInteger value.
        Parameters:
        bytes - the byte[] of IP
        Returns:
        (big) integer value of IP_bytes
      • getMaskNetwork

        public static @Nullable java.math.BigInteger getMaskNetwork​(int ipVersion,
                                                                    int mask)
        get the bits cache mask of net for a ip version type.
        Parameters:
        ipVersion - version of ip must be 4 or 6
        mask - the lengh of the mask of net as 24 from this representation 10.1.1.0/24 or 64 for 2001::1/64
        Returns:
        the bit mask of net ex: x.x.x.x/24 return a BigInteger == 0xFFFFFFotherwise null if any error
      • getJobKeyForDcGwLoadBalancingGroup

        public static java.lang.String getJobKeyForDcGwLoadBalancingGroup​(org.opendaylight.yangtools.yang.common.Uint64 dpnId)