public final class FibHelper extends Object
Modifier and Type | Method and Description |
---|---|
static RoutePaths |
buildRoutePath(String nextHop,
Long label) |
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<RoutePaths> |
buildRoutePathId(String rd,
String prefix,
String nextHop) |
static boolean |
doesPrefixBelongToSubnet(String prefixToTest,
String subnet,
boolean exactMatch)
Return true if this prefix or subnet is belonging the specified subnetwork.
|
static String |
getIpFromPrefix(String prefix)
get String format IP from prefix as x.x.....x/nn.
|
static BigInteger |
getMaskNetwork(int ipVersion,
int mask)
get the bits cache mask of net for a ip version type.
|
static List<String> |
getNextHopListFromRoutePaths(VrfEntry vrfEntry) |
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<RoutePaths> |
getRoutePathsIdentifier(String rd,
String prefix,
String nh) |
static com.google.common.base.Optional<VrfEntry> |
getVrfEntry(org.opendaylight.controller.md.sal.binding.api.DataBroker broker,
String rd,
String ipPrefix) |
static VrfEntryBuilder |
getVrfEntryBuilder(String prefix,
List<RoutePaths> routePaths,
RouteOrigin origin,
String parentVpnRd) |
static VrfEntryBuilder |
getVrfEntryBuilder(String prefix,
long label,
String nextHop,
RouteOrigin origin,
String parentVpnRd) |
static VrfEntryBuilder |
getVrfEntryBuilder(String prefix,
RouteOrigin origin,
String parentVpnRd) |
static VrfEntryBuilder |
getVrfEntryBuilder(VrfEntry vrfEntry,
long label,
List<String> nextHopList,
RouteOrigin origin,
String parentvpnRd) |
static boolean |
isBelongingPrefix(String prefixToTest,
String subnet)
Return true if this prefix or subnet is belonging the specified subnetwork.
|
static boolean |
isControllerManagedNonInterVpnLinkRoute(RouteOrigin routeOrigin) |
static boolean |
isControllerManagedNonSelfImportedRoute(RouteOrigin routeOrigin) |
static boolean |
isControllerManagedRoute(RouteOrigin routeOrigin) |
static boolean |
isControllerManagedVpnInterfaceRoute(RouteOrigin routeOrigin) |
static boolean |
isIpv4Prefix(String prefix)
get true if this prefix is an IPv4 version, false otherwise.
|
static boolean |
isIpv6Prefix(String prefix)
get true if this prefix is an IPv6 version, false otherwise.
|
static BigInteger |
packBigInteger(byte[] bytes)
This method converts a byte[] to a BigInteger value.
|
static void |
sortIpAddress(List<RoutePaths> routePathList) |
static byte[] |
unpackBigInteger(BigInteger ipBigInteger,
boolean isIpv4)
This methode return the bytes representation from an IP.
|
public static RoutePaths buildRoutePath(String nextHop, Long label)
public static VrfEntryBuilder getVrfEntryBuilder(String prefix, RouteOrigin origin, String parentVpnRd)
public static VrfEntryBuilder getVrfEntryBuilder(String prefix, List<RoutePaths> routePaths, RouteOrigin origin, String parentVpnRd)
public static VrfEntryBuilder getVrfEntryBuilder(String prefix, long label, String nextHop, RouteOrigin origin, String parentVpnRd)
public static VrfEntryBuilder getVrfEntryBuilder(VrfEntry vrfEntry, long label, List<String> nextHopList, RouteOrigin origin, String parentvpnRd)
public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<RoutePaths> buildRoutePathId(String rd, String prefix, String nextHop)
public static boolean isControllerManagedRoute(RouteOrigin routeOrigin)
public static boolean isControllerManagedNonInterVpnLinkRoute(RouteOrigin routeOrigin)
public static boolean isControllerManagedVpnInterfaceRoute(RouteOrigin routeOrigin)
public static boolean isControllerManagedNonSelfImportedRoute(RouteOrigin routeOrigin)
public static void sortIpAddress(List<RoutePaths> routePathList)
public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<RoutePaths> getRoutePathsIdentifier(String rd, String prefix, String nh)
public static List<String> getNextHopListFromRoutePaths(VrfEntry vrfEntry)
public static com.google.common.base.Optional<VrfEntry> getVrfEntry(org.opendaylight.controller.md.sal.binding.api.DataBroker broker, String rd, String ipPrefix)
public static boolean isIpv4Prefix(String prefix)
prefix
- the prefix as (x.x.x.x/nn) to find if it is in IP version 4public static boolean isIpv6Prefix(String prefix)
prefix
- the prefix as ( x:x:x::/nn) to find if it is in IP version 6public static String getIpFromPrefix(String prefix)
prefix
- the prefix as IPv4 or IPv6 as x.....x/nnpublic static boolean isBelongingPrefix(String prefixToTest, String subnet)
prefixToTest
- the prefix which could be in the subnetsubnet
- the subnet that have to contain the prefixToTest to return truepublic static boolean doesPrefixBelongToSubnet(String prefixToTest, String subnet, boolean exactMatch)
prefixToTest
- the prefix which could be in the subnetsubnet
- the subnet that have to contain the prefixToTest to return trueexactMatch
- boolean set to true if exact match is expectedpublic static BigInteger packBigInteger(byte[] bytes)
bytes
- the byte[] of IPpublic static byte[] unpackBigInteger(BigInteger ipBigInteger, boolean isIpv4)
ipBigInteger
- value integer of IP to convertisIpv4
- if is ipv4 setup to true if ipv6 setup to falsepublic static BigInteger getMaskNetwork(int ipVersion, int mask)
ipVersion
- version of ip must be 4 or 6mask
- the lengh of the mask of net as 24 from this representation 10.1.1.0/24 or 64 for 2001::1/64Copyright © 2019 OpenDaylight. All rights reserved.