Class BgpManager
- java.lang.Object
-
- org.opendaylight.netvirt.bgpmanager.BgpManager
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,IBgpManager
@Singleton public class BgpManager extends java.lang.Object implements java.lang.AutoCloseable, IBgpManager
-
-
Constructor Summary
Constructors Constructor Description BgpManager(BgpConfigurationManager bcm, FibDSWriter fibDSWriter, org.opendaylight.controller.md.sal.binding.api.DataBroker dataBroker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAddressFamily(java.lang.String ipAddress, af_afi afi, af_safi safi)
void
addDcgwTep(java.lang.String dcgwIp, java.lang.String tepIp)
void
addEbgpMultihop(java.lang.String ipAddress, int nhops)
void
addNeighbor(java.lang.String ipAddress, long asNum, @Nullable TcpMd5SignaturePasswordType md5Password)
void
addPrefix(java.lang.String rd, java.lang.String macAddress, java.lang.String prefix, java.lang.String nextHop, VrfEntryBase.EncapType encapType, org.opendaylight.yangtools.yang.common.Uint32 vpnLabel, org.opendaylight.yangtools.yang.common.Uint32 l3vni, java.lang.String gatewayMac, RouteOrigin origin)
Adds a route in a BGP neighbour.void
addPrefix(java.lang.String rd, java.lang.String macAddress, java.lang.String prefix, java.util.List<java.lang.String> nextHopList, VrfEntryBase.EncapType encapType, org.opendaylight.yangtools.yang.common.Uint32 vpnLabel, org.opendaylight.yangtools.yang.common.Uint32 l3vni, java.lang.String gatewayMac, RouteOrigin origin)
Adds one or more routes, as many as nexthops provided, in a BGP neighbour.void
addUpdateSource(java.lang.String ipAddress, java.lang.String srcIp)
void
addVrf(java.lang.String rd, java.util.Collection<java.lang.String> importRts, java.util.Collection<java.lang.String> exportRts, AddressFamily addressFamily)
Create one VPN Context per address-family.void
advertisePrefix(java.lang.String rd, java.lang.String macAddress, java.lang.String prefix, java.lang.String nextHop, VrfEntryBase.EncapType encapType, org.opendaylight.yangtools.yang.common.Uint32 vpnLabel, org.opendaylight.yangtools.yang.common.Uint32 l3vni, org.opendaylight.yangtools.yang.common.Uint32 l2vni, java.lang.String gatewayMac)
Advertises a Prefix to a BGP neighbour.void
advertisePrefix(java.lang.String rd, java.lang.String macAddress, java.lang.String prefix, java.util.List<java.lang.String> nextHopList, VrfEntryBase.EncapType encapType, org.opendaylight.yangtools.yang.common.Uint32 vpnLabel, org.opendaylight.yangtools.yang.common.Uint32 l3vni, org.opendaylight.yangtools.yang.common.Uint32 l2vni, java.lang.String gatewayMac)
Advertises a Prefix to a BGP neighbour, using several nexthops.void
bgpRestarted()
void
close()
void
configureGR(int stalepathTime)
void
delDcgwTep(java.lang.String dcgwIp, java.lang.String tepIp)
void
deleteNeighbor(java.lang.String ipAddress)
void
deletePrefix(java.lang.String rd, java.lang.String prefix)
void
deleteVrf(java.lang.String rd, boolean removeFibTable, AddressFamily addressFamily)
Delete onv VPN table.void
delGracefulRestart()
void
delLogging()
void
disableMultipath(af_afi afi, af_safi safi)
void
enableMultipath(af_afi afi, af_safi safi)
void
getAllPeerStatus()
BgpConfigurationManager
getBgpConfigurationManager()
BgpManager
getBgpManager()
long
getCfgReplayEndTime()
long
getCfgReplayStartTime()
Bgp
getConfig()
java.lang.String
getConfigHost()
int
getConfigPort()
long
getConnectTS()
java.lang.String
getDCGwIP()
FibDSWriter
getFibWriter()
long
getLastConnectedTS()
long
getQbgprestartTS()
long
getStaleCleanupTime()
long
getStaleEndTime()
long
getStaleStartTime()
long
getStartTS()
void
init()
boolean
isBgpConnected()
void
sendNotificationEvent(int code, int subcode)
void
setMultipaths(java.lang.String rd, int maxpath)
void
setQbgpLog(java.lang.String fileName, java.lang.String debugLevel)
void
setQbgprestartTS(long qbgprestartTS)
void
startBfd(int detectMult, int minRx, int minTx, boolean multiHop)
void
startBgp(long asn, java.lang.String routerId, int spt, boolean fbit)
void
startConfig(java.lang.String host, int port)
void
stopBfd()
void
stopBgp()
void
stopConfig()
void
withdrawPrefix(java.lang.String rd, java.lang.String prefix)
void
withdrawPrefixIfPresent(java.lang.String rd, java.lang.String prefix)
-
-
-
Constructor Detail
-
BgpManager
@Inject public BgpManager(BgpConfigurationManager bcm, FibDSWriter fibDSWriter, org.opendaylight.controller.md.sal.binding.api.DataBroker dataBroker)
-
-
Method Detail
-
init
@PostConstruct public void init()
-
close
@PreDestroy public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
getBgpConfigurationManager
public BgpConfigurationManager getBgpConfigurationManager()
-
configureGR
public void configureGR(int stalepathTime)
-
delGracefulRestart
public void delGracefulRestart()
-
addNeighbor
public void addNeighbor(java.lang.String ipAddress, long asNum, @Nullable TcpMd5SignaturePasswordType md5Password)
-
addEbgpMultihop
public void addEbgpMultihop(java.lang.String ipAddress, int nhops)
-
addUpdateSource
public void addUpdateSource(java.lang.String ipAddress, java.lang.String srcIp)
-
addAddressFamily
public void addAddressFamily(java.lang.String ipAddress, af_afi afi, af_safi safi)
-
deleteNeighbor
public void deleteNeighbor(java.lang.String ipAddress)
-
addVrf
public void addVrf(java.lang.String rd, java.util.Collection<java.lang.String> importRts, java.util.Collection<java.lang.String> exportRts, AddressFamily addressFamily)
Description copied from interface:IBgpManager
Create one VPN Context per address-family. VPN contexts apply to MPLS or VXLAN overlays. Passing IPv4 or IPv6 will create VPN context for MPLS, with IPv4 or IPv6 (or both) If L2VPN is passed as parameter, then IPv4 EVPN will be set too.- Specified by:
addVrf
in interfaceIBgpManager
- Parameters:
rd
- is the route distinguisher to used for this vrf for the VPN.importRts
- the import rd(s) for this vrfexportRts
- the export rd(s) for this vrfaddressFamily
- is used to pass the nature of the VPN context : IPv4, IPv6, or EVPN.
-
deleteVrf
public void deleteVrf(java.lang.String rd, boolean removeFibTable, AddressFamily addressFamily)
Description copied from interface:IBgpManager
Delete onv VPN table. VPN contexts apply to MPLS or VXLAN overlays. Passing IPv4 or IPv6 will unset VPN context for MPLS, with IPv4 or IPv6 (or both) If L2VPN is passed as parameter, then IPv4 EVPN will be unset too.- Specified by:
deleteVrf
in interfaceIBgpManager
- Parameters:
rd
- the route distinguisher to define the vrf to deleteremoveFibTable
- true to remove to fib tableaddressFamily
- is used to pass the nature of the VPN context : IPv4, IPv6, or EVPN.
-
getAllPeerStatus
public void getAllPeerStatus()
-
addPrefix
public void addPrefix(java.lang.String rd, java.lang.String macAddress, java.lang.String prefix, java.util.List<java.lang.String> nextHopList, VrfEntryBase.EncapType encapType, org.opendaylight.yangtools.yang.common.Uint32 vpnLabel, org.opendaylight.yangtools.yang.common.Uint32 l3vni, java.lang.String gatewayMac, RouteOrigin origin)
Description copied from interface:IBgpManager
Adds one or more routes, as many as nexthops provided, in a BGP neighbour. It persists VrfEntry in datastore and sends the BGP message.- Specified by:
addPrefix
in interfaceIBgpManager
-
addPrefix
public void addPrefix(java.lang.String rd, java.lang.String macAddress, java.lang.String prefix, java.lang.String nextHop, VrfEntryBase.EncapType encapType, org.opendaylight.yangtools.yang.common.Uint32 vpnLabel, org.opendaylight.yangtools.yang.common.Uint32 l3vni, java.lang.String gatewayMac, RouteOrigin origin)
Description copied from interface:IBgpManager
Adds a route in a BGP neighbour. It persists the VrfEntry in Datastore and sends the BGP message.- Specified by:
addPrefix
in interfaceIBgpManager
-
deletePrefix
public void deletePrefix(java.lang.String rd, java.lang.String prefix)
- Specified by:
deletePrefix
in interfaceIBgpManager
-
advertisePrefix
public void advertisePrefix(java.lang.String rd, java.lang.String macAddress, java.lang.String prefix, java.util.List<java.lang.String> nextHopList, VrfEntryBase.EncapType encapType, org.opendaylight.yangtools.yang.common.Uint32 vpnLabel, org.opendaylight.yangtools.yang.common.Uint32 l3vni, org.opendaylight.yangtools.yang.common.Uint32 l2vni, java.lang.String gatewayMac)
Description copied from interface:IBgpManager
Advertises a Prefix to a BGP neighbour, using several nexthops. Only sends the BGP messages, no writing to MD-SAL.- Specified by:
advertisePrefix
in interfaceIBgpManager
-
advertisePrefix
public void advertisePrefix(java.lang.String rd, java.lang.String macAddress, java.lang.String prefix, java.lang.String nextHop, VrfEntryBase.EncapType encapType, org.opendaylight.yangtools.yang.common.Uint32 vpnLabel, org.opendaylight.yangtools.yang.common.Uint32 l3vni, org.opendaylight.yangtools.yang.common.Uint32 l2vni, java.lang.String gatewayMac)
Description copied from interface:IBgpManager
Advertises a Prefix to a BGP neighbour. Only sends the BGP messages, no writing to MD-SAL.- Specified by:
advertisePrefix
in interfaceIBgpManager
-
withdrawPrefix
public void withdrawPrefix(java.lang.String rd, java.lang.String prefix)
- Specified by:
withdrawPrefix
in interfaceIBgpManager
-
withdrawPrefixIfPresent
public void withdrawPrefixIfPresent(java.lang.String rd, java.lang.String prefix)
- Specified by:
withdrawPrefixIfPresent
in interfaceIBgpManager
-
setQbgpLog
public void setQbgpLog(java.lang.String fileName, java.lang.String debugLevel)
- Specified by:
setQbgpLog
in interfaceIBgpManager
-
delLogging
public void delLogging()
-
startBgp
public void startBgp(long asn, java.lang.String routerId, int spt, boolean fbit)
-
stopBgp
public void stopBgp()
-
startConfig
public void startConfig(java.lang.String host, int port)
-
stopConfig
public void stopConfig()
-
getConfig
public Bgp getConfig()
-
startBfd
public void startBfd(int detectMult, int minRx, int minTx, boolean multiHop)
-
stopBfd
public void stopBfd()
-
addDcgwTep
public void addDcgwTep(java.lang.String dcgwIp, java.lang.String tepIp)
-
delDcgwTep
public void delDcgwTep(java.lang.String dcgwIp, java.lang.String tepIp)
-
setMultipaths
public void setMultipaths(java.lang.String rd, int maxpath)
-
getDCGwIP
public java.lang.String getDCGwIP()
- Specified by:
getDCGwIP
in interfaceIBgpManager
-
sendNotificationEvent
public void sendNotificationEvent(int code, int subcode)
- Specified by:
sendNotificationEvent
in interfaceIBgpManager
-
getFibWriter
public FibDSWriter getFibWriter()
-
getConfigHost
public java.lang.String getConfigHost()
-
getConfigPort
public int getConfigPort()
-
bgpRestarted
public void bgpRestarted()
- Specified by:
bgpRestarted
in interfaceIBgpManager
-
getBgpManager
public BgpManager getBgpManager()
-
isBgpConnected
public boolean isBgpConnected()
-
getLastConnectedTS
public long getLastConnectedTS()
-
getConnectTS
public long getConnectTS()
-
getStartTS
public long getStartTS()
-
getQbgprestartTS
public long getQbgprestartTS()
-
setQbgprestartTS
public void setQbgprestartTS(long qbgprestartTS)
- Specified by:
setQbgprestartTS
in interfaceIBgpManager
-
getStaleStartTime
public long getStaleStartTime()
-
getStaleEndTime
public long getStaleEndTime()
-
getCfgReplayStartTime
public long getCfgReplayStartTime()
-
getCfgReplayEndTime
public long getCfgReplayEndTime()
-
getStaleCleanupTime
public long getStaleCleanupTime()
-
-