Class: Cisco::OverlayGlobal
Overview
node_utils class for overlay_global
Instance Method Summary
collapse
Methods inherited from NodeUtil
config_get, #config_get, config_get_default, #config_get_default, #config_set, config_set, #node, node, #show
Instance Method Details
#anycast_gateway_mac ⇒ Object
127
128
129
130
131
132
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 127
def anycast_gateway_mac
return nil unless Feature.nv_overlay_evpn_enabled?
mac = config_get('overlay_global', 'anycast_gateway_mac')
Utils.zero_pad_macaddr(mac).nil? ? default_anycast_gateway_mac : mac
end
|
#anycast_gateway_mac=(mac_addr) ⇒ Object
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 134
def anycast_gateway_mac=(mac_addr)
fail TypeError unless mac_addr.is_a?(String)
Feature.nv_overlay_evpn_enable
Feature.fabric_forwarding_enable
if mac_addr == default_anycast_gateway_mac
state = 'no'
mac_addr = ''
else
state = ''
end
config_set('overlay_global', 'anycast_gateway_mac',
state: state, mac_addr: mac_addr)
end
|
#default_anycast_gateway_mac ⇒ Object
149
150
151
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 149
def default_anycast_gateway_mac
config_get_default('overlay_global', 'anycast_gateway_mac')
end
|
#default_dup_host_ip_addr_detection ⇒ Object
65
66
67
68
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 65
def default_dup_host_ip_addr_detection
[default_dup_host_ip_addr_detection_host_moves,
default_dup_host_ip_addr_detection_timeout]
end
|
#default_dup_host_ip_addr_detection_host_moves ⇒ Object
70
71
72
73
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 70
def default_dup_host_ip_addr_detection_host_moves
config_get_default('overlay_global',
'dup_host_ip_addr_detection_host_moves')
end
|
#default_dup_host_ip_addr_detection_timeout ⇒ Object
75
76
77
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 75
def default_dup_host_ip_addr_detection_timeout
config_get_default('overlay_global', 'dup_host_ip_addr_detection_timeout')
end
|
#default_dup_host_mac_detection ⇒ Object
113
114
115
116
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 113
def default_dup_host_mac_detection
[default_dup_host_mac_detection_host_moves,
default_dup_host_mac_detection_timeout]
end
|
#default_dup_host_mac_detection_host_moves ⇒ Object
118
119
120
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 118
def default_dup_host_mac_detection_host_moves
config_get_default('overlay_global', 'dup_host_mac_detection_host_moves')
end
|
#default_dup_host_mac_detection_timeout ⇒ Object
122
123
124
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 122
def default_dup_host_mac_detection_timeout
config_get_default('overlay_global', 'dup_host_mac_detection_timeout')
end
|
#dup_host_ip_addr_detection ⇒ Object
dup-host-ip-addr-detection
33
34
35
36
37
38
39
40
41
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 33
def dup_host_ip_addr_detection
return nil unless Feature.nv_overlay_evpn_enabled?
match = config_get('overlay_global', 'dup_host_ip_addr_detection')
if match.nil?
default_dup_host_ip_addr_detection
else
match.collect(&:to_i)
end
end
|
#dup_host_ip_addr_detection_host_moves ⇒ Object
43
44
45
46
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 43
def dup_host_ip_addr_detection_host_moves
host_moves, _timeout = dup_host_ip_addr_detection
host_moves
end
|
#dup_host_ip_addr_detection_set(host_moves, timeout) ⇒ Object
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 53
def dup_host_ip_addr_detection_set(host_moves, timeout)
Feature.nv_overlay_evpn_enable
if host_moves == default_dup_host_ip_addr_detection_host_moves &&
timeout == default_dup_host_ip_addr_detection_timeout
state = 'no'
else
state = ''
end
set_args = { state: state, host_moves: host_moves, timeout: timeout }
config_set('overlay_global', 'dup_host_ip_addr_detection', set_args)
end
|
#dup_host_ip_addr_detection_timeout ⇒ Object
48
49
50
51
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 48
def dup_host_ip_addr_detection_timeout
_host_moves, timeout = dup_host_ip_addr_detection
timeout
end
|
#dup_host_mac_detection ⇒ Object
80
81
82
83
84
85
86
87
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 80
def dup_host_mac_detection
match = config_get('overlay_global', 'dup_host_mac_detection')
if match.nil?
default_dup_host_mac_detection
else
match.collect(&:to_i)
end
end
|
#dup_host_mac_detection_default ⇒ Object
109
110
111
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 109
def dup_host_mac_detection_default
config_set('overlay_global', 'dup_host_mac_detection_default')
end
|
#dup_host_mac_detection_host_moves ⇒ Object
89
90
91
92
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 89
def dup_host_mac_detection_host_moves
host_moves, _timeout = dup_host_mac_detection
host_moves
end
|
#dup_host_mac_detection_set(host_moves, timeout) ⇒ Object
99
100
101
102
103
104
105
106
107
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 99
def dup_host_mac_detection_set(host_moves, timeout)
set_args = { host_moves: host_moves, timeout: timeout }
if host_moves == default_dup_host_mac_detection_host_moves &&
timeout == default_dup_host_mac_detection_timeout
dup_host_mac_detection_default
else
config_set('overlay_global', 'dup_host_mac_detection', set_args)
end
end
|
#dup_host_mac_detection_timeout ⇒ Object
94
95
96
97
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 94
def dup_host_mac_detection_timeout
_host_moves, timeout = dup_host_mac_detection
timeout
end
|