summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/services/protocols/bgp/bgpspeaker.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/ryu/services/protocols/bgp/bgpspeaker.py b/ryu/services/protocols/bgp/bgpspeaker.py
index b4a273c9..67bd73c8 100644
--- a/ryu/services/protocols/bgp/bgpspeaker.py
+++ b/ryu/services/protocols/bgp/bgpspeaker.py
@@ -47,6 +47,7 @@ from ryu.services.protocols.bgp.rtconf.base import CAP_MBGP_IPV4
from ryu.services.protocols.bgp.rtconf.base import CAP_MBGP_IPV6
from ryu.services.protocols.bgp.rtconf.base import CAP_MBGP_VPNV4
from ryu.services.protocols.bgp.rtconf.base import CAP_MBGP_VPNV6
+from ryu.services.protocols.bgp.rtconf.base import MULTI_EXIT_DISC
from ryu.services.protocols.bgp.rtconf.neighbors import DEFAULT_CAP_MBGP_IPV4
from ryu.services.protocols.bgp.rtconf.neighbors import DEFAULT_CAP_MBGP_VPNV4
from ryu.services.protocols.bgp.rtconf.neighbors import DEFAULT_CAP_MBGP_VPNV6
@@ -302,7 +303,7 @@ class BGPSpeaker(object):
enable_ipv4=DEFAULT_CAP_MBGP_IPV4,
enable_vpnv4=DEFAULT_CAP_MBGP_VPNV4,
enable_vpnv6=DEFAULT_CAP_MBGP_VPNV6,
- next_hop=None, password=None):
+ next_hop=None, password=None, multi_exit_disc=None):
""" This method registers a new neighbor. The BGP speaker tries to
establish a bgp session with the peer (accepts a connection
from the peer and also tries to connect to it).
@@ -328,6 +329,11 @@ class BGPSpeaker(object):
``password`` is used for the MD5 authentication if it's
specified. By default, the MD5 authenticaiton is disabled.
+
+ ``multi_exit_disc`` specifies multi exit discriminator (MED) value.
+ The default is None and if not specified, MED value is
+ not sent to the neighbor. It must be an integer.
+
"""
bgp_neighbor = {}
bgp_neighbor[neighbors.IP_ADDRESS] = address
@@ -348,6 +354,10 @@ class BGPSpeaker(object):
else:
# FIXME: should raise an exception
pass
+
+ if multi_exit_disc:
+ bgp_neighbor[MULTI_EXIT_DISC] = multi_exit_disc
+
call('neighbor.create', **bgp_neighbor)
def neighbor_del(self, address):