diff options
author | Anantha Ramaiah <ananth@ntti3.com> | 2013-11-27 06:59:48 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-11-27 12:17:41 +0900 |
commit | 8ad764f193c68c9ce5741d1ce3267b7ffb7fc51a (patch) | |
tree | 4bc0ab07e30003421bbcd97fe0684b07e4afa6d2 | |
parent | c36e686fef84035396515ae07984f39831abac96 (diff) |
Add support for admin_state (role)
Signed-off-by: Anantha Ramaiah <ananth@ntti3.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/services/protocols/vrrp/event.py | 2 | ||||
-rw-r--r-- | ryu/services/protocols/vrrp/router.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/ryu/services/protocols/vrrp/event.py b/ryu/services/protocols/vrrp/event.py index 49d36924..1eb4426b 100644 --- a/ryu/services/protocols/vrrp/event.py +++ b/ryu/services/protocols/vrrp/event.py @@ -115,6 +115,7 @@ class VRRPConfig(object): advertmisement_interval is in seconds as float. (Not in centiseconds) """ def __init__(self, version=vrrp.VRRP_VERSION_V3, vrid=None, + admin_state=None, priority=vrrp.VRRP_PRIORITY_BACKUP_DEFAULT, ip_addresses=None, advertisement_interval=vrrp.VRRP_MAX_ADVER_INT_DEFAULT_IN_SEC, preempt_mode=True, preempt_delay=0, accept_mode=False): @@ -124,6 +125,7 @@ class VRRPConfig(object): super(VRRPConfig, self).__init__() self.version = version + self.admin_state = admin_state self.vrid = vrid self.priority = priority self.ip_addresses = ip_addresses diff --git a/ryu/services/protocols/vrrp/router.py b/ryu/services/protocols/vrrp/router.py index 601c91b5..88b6ce9f 100644 --- a/ryu/services/protocols/vrrp/router.py +++ b/ryu/services/protocols/vrrp/router.py @@ -657,7 +657,9 @@ class VRRPRouterV3(VRRPRouter): def start(self): self.state_change(vrrp_event.VRRP_STATE_INITIALIZE) - if self.config.address_owner: + # Check role here and change accordingly + # Check config.admin_state + if self.config.address_owner or self.config.admin_state == 'master': self.send_advertisement() # This action should be done router on |