Class BgpUtil
- java.lang.Object
-
- org.opendaylight.netvirt.bgpmanager.BgpUtil
-
- All Implemented Interfaces:
java.lang.AutoCloseable
@Singleton public class BgpUtil extends java.lang.Object implements java.lang.AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description BgpUtil(org.opendaylight.mdsal.binding.api.DataBroker dataBroker, IFibManager fibManager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTepToElanInstance(java.lang.String rd, java.lang.String tepIp)
void
close()
static encap_type
convertToThriftEncapType(EncapType encapType)
static protocol_type
convertToThriftProtocolType(BgpControlPlaneType protocolType)
<T extends org.opendaylight.yangtools.yang.binding.DataObject>
voiddelete(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
void
deleteTepFromElanInstance(java.lang.String rd, java.lang.String tepIp)
void
disableBfdFlag()
void
enableBfdFlag()
static int
getAFItranslatedfromPrefix(java.lang.String argPrefix)
get a translation from prefix ipv6 to afi
.BfdConfig
getBfdConfig()
DcgwTepList
getDcgwTepConfig()
java.util.List<java.lang.String>
getDcgwTepConfig(java.lang.String dcgwIp)
static java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo>
getDpnTEPsInfos(org.opendaylight.mdsal.binding.api.DataBroker dataBroker)
static LayerType
getLayerType(AddressFamiliesVrf adf)
get layerType used from an AddressFamiliesVrf.VpnInstanceOpDataEntry
getVpnInstanceOpData(java.lang.String rd)
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VpnInstanceOpDataEntry>
getVpnInstanceOpDataIdentifier(java.lang.String rd)
java.lang.String
getVpnNameFromRd(java.lang.String rd)
Vrfs
getVrfFromRd(java.lang.String rd)
get the vrf with the RouterDistinguisher pass in param.void
init()
boolean
isBfdEnabled()
void
removeOrUpdateLBGroups(java.lang.String tepIp, int addRemoveOrUpdate)
void
removeVrfEntry(java.lang.String rd, VrfEntry vrfEntry)
<T extends org.opendaylight.yangtools.yang.binding.DataObject>
voidupdate(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data)
<T extends org.opendaylight.yangtools.yang.binding.DataObject>
voidwrite(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data)
-
-
-
Constructor Detail
-
BgpUtil
@Inject public BgpUtil(org.opendaylight.mdsal.binding.api.DataBroker dataBroker, IFibManager fibManager)
-
-
Method Detail
-
init
@PostConstruct public void init()
-
close
@PreDestroy public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
getAFItranslatedfromPrefix
public static int getAFItranslatedfromPrefix(java.lang.String argPrefix)
get a translation from prefix ipv6 to afi
. "ffff::1/128" sets afi as 2 because is an IPv6 value- Parameters:
argPrefix
- ip address as ipv4 or ipv6- Returns:
- afi 1 for AFI_IP 2 for AFI_IPV6
-
update
public <T extends org.opendaylight.yangtools.yang.binding.DataObject> void update(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data)
-
write
public <T extends org.opendaylight.yangtools.yang.binding.DataObject> void write(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data)
-
delete
public <T extends org.opendaylight.yangtools.yang.binding.DataObject> void delete(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
-
convertToThriftProtocolType
public static protocol_type convertToThriftProtocolType(BgpControlPlaneType protocolType)
-
convertToThriftEncapType
public static encap_type convertToThriftEncapType(EncapType encapType)
-
getVpnInstanceOpData
public VpnInstanceOpDataEntry getVpnInstanceOpData(java.lang.String rd)
-
getVpnInstanceOpDataIdentifier
public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VpnInstanceOpDataEntry> getVpnInstanceOpDataIdentifier(java.lang.String rd)
-
addTepToElanInstance
public void addTepToElanInstance(java.lang.String rd, java.lang.String tepIp)
-
deleteTepFromElanInstance
public void deleteTepFromElanInstance(java.lang.String rd, java.lang.String tepIp)
-
getVpnNameFromRd
public java.lang.String getVpnNameFromRd(java.lang.String rd)
-
getVrfFromRd
public Vrfs getVrfFromRd(java.lang.String rd)
get the vrf with the RouterDistinguisher pass in param.- Parameters:
rd
- is the RouteDistinguisher of vrf- Returns:
- the vrf of rd or null if no exist
-
getLayerType
public static LayerType getLayerType(AddressFamiliesVrf adf)
get layerType used from an AddressFamiliesVrf.- Parameters:
adf
- is the AddressFamiliesVrf from which the layer is asked.- Returns:
- the layerType to reach from the argument addressFamilyVrf or null if not found
-
removeVrfEntry
public void removeVrfEntry(java.lang.String rd, VrfEntry vrfEntry)
-
enableBfdFlag
public void enableBfdFlag()
-
disableBfdFlag
public void disableBfdFlag()
-
isBfdEnabled
public boolean isBfdEnabled()
-
getBfdConfig
public BfdConfig getBfdConfig()
-
getDcgwTepConfig
public DcgwTepList getDcgwTepConfig()
-
getDcgwTepConfig
public java.util.List<java.lang.String> getDcgwTepConfig(java.lang.String dcgwIp)
-
getDpnTEPsInfos
public static java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo> getDpnTEPsInfos(org.opendaylight.mdsal.binding.api.DataBroker dataBroker)
-
removeOrUpdateLBGroups
public void removeOrUpdateLBGroups(java.lang.String tepIp, int addRemoveOrUpdate)
-
-