-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add storm_control and dhcp relay props for interface #474
Merged
Merged
Changes from 35 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
5491ff2
Add feature ospf enable
225b679
Merge remote-tracking branch 'upstream/develop' into develop
6a68639
Merge remote-tracking branch 'upstream/develop' into develop
366745b
review comments
f7dd689
Merge remote-tracking branch 'upstream/develop' into develop
462dffc
Merge remote-tracking branch 'upstream/develop' into develop
72fff1a
Fix interface_ospf
8c29b7d
Merge remote-tracking branch 'upstream/develop' into develop
a70dfcb
Merge remote-tracking branch 'upstream/develop' into develop
2cd84e7
Merge remote-tracking branch 'upstream/develop' into develop
9fc2ade
Merge remote-tracking branch 'upstream/develop' into develop
5481697
Merge remote-tracking branch 'upstream/develop' into develop
f273c29
Merge remote-tracking branch 'upstream/develop' into develop
de3ce53
Merge remote-tracking branch 'upstream/develop' into develop
d7f0031
bug fix for vtp
c909ee8
bug fix for resilient mode
19f15a6
version number fix
67bcbda
review comment
608aa2f
Merge remote-tracking branch 'upstream/develop' into develop
e306107
Fix for symmetry not supported
ab3ea3b
review comments
756e146
review comment
7a27075
Merge remote-tracking branch 'upstream/develop' into develop
cc35a56
Merge remote-tracking branch 'upstream/develop' into develop
0511f9b
Merge remote-tracking branch 'upstream/develop' into develop
a74fe9d
Merge remote-tracking branch 'upstream/develop' into develop
5a75e23
storm-control and dhcp relay for intf
299b0d3
Merge remote-tracking branch 'upstream/develop' into hsrp
9b9928c
Merge remote-tracking branch 'upstream/develop' into hsrp
2c64427
exclude 2 storm control props on n7k due to hw limitation
7e1b12f
comments added
befa63a
changelog
69fa806
typo correct
aebf9db
cleanup unsupported tests
aaede51
review comments
7c675ce
remove features added during the minitest
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -420,6 +420,105 @@ def default_ipv4_arp_timeout | |
config_get_default('interface', ipv4_arp_timeout_lookup_string) | ||
end | ||
|
||
def ipv4_dhcp_relay_addr | ||
config_get('interface', 'ipv4_dhcp_relay_addr', name: @name) | ||
end | ||
|
||
def ipv4_dhcp_relay_addr=(list) | ||
cur_list = ipv4_dhcp_relay_addr | ||
# remove the current addresses first | ||
unless cur_list.empty? | ||
cur_list.each do |addr| | ||
config_set('interface', 'ipv4_dhcp_relay_addr', | ||
name: @name, state: 'no', addr: addr) | ||
end | ||
end | ||
Feature.dhcp_enable unless list.empty? | ||
list.each do |addr| | ||
config_set('interface', 'ipv4_dhcp_relay_addr', | ||
name: @name, state: '', addr: addr) | ||
end | ||
end | ||
|
||
def default_ipv4_dhcp_relay_addr | ||
config_get_default('interface', 'ipv4_dhcp_relay_addr') | ||
end | ||
|
||
def ipv4_dhcp_relay_info_trust | ||
config_get('interface', 'ipv4_dhcp_relay_info_trust', name: @name) | ||
end | ||
|
||
def ipv4_dhcp_relay_info_trust=(state) | ||
Feature.dhcp_enable if state | ||
config_set('interface', 'ipv4_dhcp_relay_info_trust', | ||
name: @name, state: state ? '' : 'no') | ||
end | ||
|
||
def default_ipv4_dhcp_relay_info_trust | ||
config_get_default('interface', 'ipv4_dhcp_relay_info_trust') | ||
end | ||
|
||
def ipv4_dhcp_relay_src_addr_hsrp | ||
config_get('interface', 'ipv4_dhcp_relay_src_addr_hsrp', name: @name) | ||
end | ||
|
||
def ipv4_dhcp_relay_src_addr_hsrp=(state) | ||
Feature.dhcp_enable if state | ||
config_set('interface', 'ipv4_dhcp_relay_src_addr_hsrp', | ||
name: @name, state: state ? '' : 'no') | ||
end | ||
|
||
def default_ipv4_dhcp_relay_src_addr_hsrp | ||
config_get_default('interface', 'ipv4_dhcp_relay_src_addr_hsrp') | ||
end | ||
|
||
def ipv4_dhcp_relay_src_intf | ||
intf = config_get('interface', 'ipv4_dhcp_relay_src_intf', name: @name) | ||
return intf unless intf | ||
# Normalize by downcasing and removing white space | ||
intf.downcase.delete(' ') | ||
end | ||
|
||
def ipv4_dhcp_relay_src_intf=(val) | ||
state = val == default_ipv4_dhcp_relay_src_intf ? 'no' : '' | ||
intf = val == default_ipv4_dhcp_relay_src_intf ? '' : val | ||
Feature.dhcp_enable if state.empty? | ||
config_set('interface', 'ipv4_dhcp_relay_src_intf', | ||
name: @name, state: state, intf: intf) | ||
end | ||
|
||
def default_ipv4_dhcp_relay_src_intf | ||
config_get_default('interface', 'ipv4_dhcp_relay_src_intf') | ||
end | ||
|
||
def ipv4_dhcp_relay_subnet_broadcast | ||
config_get('interface', 'ipv4_dhcp_relay_subnet_broadcast', name: @name) | ||
end | ||
|
||
def ipv4_dhcp_relay_subnet_broadcast=(state) | ||
Feature.dhcp_enable if state | ||
config_set('interface', 'ipv4_dhcp_relay_subnet_broadcast', | ||
name: @name, state: state ? '' : 'no') | ||
end | ||
|
||
def default_ipv4_dhcp_relay_subnet_broadcast | ||
config_get_default('interface', 'ipv4_dhcp_relay_subnet_broadcast') | ||
end | ||
|
||
def ipv4_dhcp_smart_relay | ||
config_get('interface', 'ipv4_dhcp_smart_relay', name: @name) | ||
end | ||
|
||
def ipv4_dhcp_smart_relay=(state) | ||
Feature.dhcp_enable if state | ||
config_set('interface', 'ipv4_dhcp_smart_relay', | ||
name: @name, state: state ? '' : 'no') | ||
end | ||
|
||
def default_ipv4_dhcp_smart_relay | ||
config_get_default('interface', 'ipv4_dhcp_smart_relay') | ||
end | ||
|
||
def ipv4_forwarding | ||
config_get('interface', 'ipv4_forwarding', name: @name) | ||
end | ||
|
@@ -526,6 +625,49 @@ def default_ipv6_acl_out | |
config_get_default('interface', 'ipv6_acl_out') | ||
end | ||
|
||
def ipv6_dhcp_relay_addr | ||
config_get('interface', 'ipv6_dhcp_relay_addr', name: @name) | ||
end | ||
|
||
def ipv6_dhcp_relay_addr=(list) | ||
cur_list = ipv6_dhcp_relay_addr | ||
# remove the current addresses first | ||
unless cur_list.empty? | ||
cur_list.each do |addr| | ||
config_set('interface', 'ipv6_dhcp_relay_addr', | ||
name: @name, state: 'no', addr: addr) | ||
end | ||
end | ||
Feature.dhcp_enable unless list.empty? | ||
list.each do |addr| | ||
config_set('interface', 'ipv6_dhcp_relay_addr', | ||
name: @name, state: '', addr: addr) | ||
end | ||
end | ||
|
||
def default_ipv6_dhcp_relay_addr | ||
config_get_default('interface', 'ipv6_dhcp_relay_addr') | ||
end | ||
|
||
def ipv6_dhcp_relay_src_intf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment here and I would also just add a simplified inline comment:
|
||
intf = config_get('interface', 'ipv6_dhcp_relay_src_intf', name: @name) | ||
return intf unless intf | ||
# Normalize by downcasing and removing white space | ||
intf.downcase.delete(' ') | ||
end | ||
|
||
def ipv6_dhcp_relay_src_intf=(val) | ||
state = val == default_ipv6_dhcp_relay_src_intf ? 'no' : '' | ||
intf = val == default_ipv6_dhcp_relay_src_intf ? '' : val | ||
Feature.dhcp_enable if state.empty? | ||
config_set('interface', 'ipv6_dhcp_relay_src_intf', | ||
name: @name, state: state, intf: intf) | ||
end | ||
|
||
def default_ipv6_dhcp_relay_src_intf | ||
config_get_default('interface', 'ipv6_dhcp_relay_src_intf') | ||
end | ||
|
||
def feature_lacp? | ||
config_get('interface', 'feature_lacp') | ||
end | ||
|
@@ -649,6 +791,51 @@ def default_shutdown | |
config_get_default('interface', lookup) | ||
end | ||
|
||
def storm_control_broadcast | ||
config_get('interface', 'storm_control_broadcast', name: @name) | ||
end | ||
|
||
def storm_control_broadcast=(val) | ||
state = val == default_storm_control_broadcast ? 'no' : '' | ||
level = val == default_storm_control_broadcast ? '' : val | ||
config_set('interface', 'storm_control_broadcast', | ||
name: @name, state: state, level: level) | ||
end | ||
|
||
def default_storm_control_broadcast | ||
config_get_default('interface', 'storm_control_broadcast') | ||
end | ||
|
||
def storm_control_multicast | ||
config_get('interface', 'storm_control_multicast', name: @name) | ||
end | ||
|
||
def storm_control_multicast=(val) | ||
state = val == default_storm_control_multicast ? 'no' : '' | ||
level = val == default_storm_control_multicast ? '' : val | ||
config_set('interface', 'storm_control_multicast', | ||
name: @name, state: state, level: level) | ||
end | ||
|
||
def default_storm_control_multicast | ||
config_get_default('interface', 'storm_control_multicast') | ||
end | ||
|
||
def storm_control_unicast | ||
config_get('interface', 'storm_control_unicast', name: @name) | ||
end | ||
|
||
def storm_control_unicast=(val) | ||
state = val == default_storm_control_unicast ? 'no' : '' | ||
level = val == default_storm_control_unicast ? '' : val | ||
config_set('interface', 'storm_control_unicast', | ||
name: @name, state: state, level: level) | ||
end | ||
|
||
def default_storm_control_unicast | ||
config_get_default('interface', 'storm_control_unicast') | ||
end | ||
|
||
def stp_bpdufilter | ||
config_get('interface', 'stp_bpdufilter', name: @name) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly you are trying to downcase and insert whitespace? I suggest you just normalize by downcasing and removing whitespace.
You can do this here and munge it in the type file so the manifest can specify the name in any of these formats.