diff options
-rw-r--r-- | ryu/services/protocols/bgp/bgpspeaker.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ryu/services/protocols/bgp/bgpspeaker.py b/ryu/services/protocols/bgp/bgpspeaker.py index 67bd73c8..8e852ff4 100644 --- a/ryu/services/protocols/bgp/bgpspeaker.py +++ b/ryu/services/protocols/bgp/bgpspeaker.py @@ -61,6 +61,7 @@ from ryu.lib.packet.bgp import RF_IPv4_UC, RF_IPv6_UC OUT_FILTER_RF_IPv4_UC = RF_IPv4_UC OUT_FILTER_RF_IPv6_UC = RF_IPv6_UC +NEIGHBOR_CONF_MED = 'multi_exit_disc' class EventPrefix(object): @@ -372,6 +373,28 @@ class BGPSpeaker(object): bgp_neighbor[neighbors.IP_ADDRESS] = address call('neighbor.delete', **bgp_neighbor) + def neighbor_update(self, address, conf_type, conf_value): + """ This method changes the neighbor configuration. + + ``conf_type`` specifies configuration type which you want to change. + Currently ryu.services.protocols.bgp.bgpspeaker.NEIGHBOR_CONF_MED + can be specified. + + ``conf_value`` specifies value for the configuration type. + + """ + + assert conf_type == NEIGHBOR_CONF_MED + + func_name = 'neighbor.update' + attribute_param = {} + if conf_type == NEIGHBOR_CONF_MED: + attribute_param = {neighbors.MULTI_EXIT_DISC: conf_value} + + param = {neighbors.IP_ADDRESS: address, + neighbors.CHANGES: attribute_param} + call(func_name, **param) + def prefix_add(self, prefix, next_hop=None, route_dist=None, route_family=None): """ This method adds a new prefix to be advertized. |