Skip to content

Commit

Permalink
Merge branch 'master' into ztp_cli
Browse files Browse the repository at this point in the history
  • Loading branch information
rajendra-dendukuri authored Jan 30, 2020
2 parents a4e5ae5 + 17c708b commit 7bc837a
Show file tree
Hide file tree
Showing 44 changed files with 5,344 additions and 210 deletions.
5 changes: 4 additions & 1 deletion acl_loader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,11 @@ def deny_rule(self, table_name):
rule_props = {}
rule_data = {(table_name, "DEFAULT_RULE"): rule_props}
rule_props["PRIORITY"] = str(self.min_priority)
rule_props["ETHER_TYPE"] = str(self.ethertype_map["ETHERTYPE_IPV4"])
rule_props["PACKET_ACTION"] = "DROP"
if 'v6' in table_name.lower():
rule_props["ETHER_TYPE"] = str(self.ethertype_map["ETHERTYPE_IPV6"])
else:
rule_props["ETHER_TYPE"] = str(self.ethertype_map["ETHERTYPE_IPV4"])
return rule_data

def convert_rules(self):
Expand Down
25 changes: 25 additions & 0 deletions clear/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,5 +380,30 @@ def line(linenum):
cmd = "consutil clear " + str(linenum)
run_command(cmd)

#
# 'nat' group ("clear nat ...")
#

@cli.group(cls=AliasedGroup, default_if_no_args=False)
def nat():
"""Clear the nat info"""
pass

# 'statistics' subcommand ("clear nat statistics")
@nat.command()
def statistics():
""" Clear all NAT statistics """

cmd = "natclear -s"
run_command(cmd)

# 'translations' subcommand ("clear nat translations")
@nat.command()
def translations():
""" Clear all NAT translations """

cmd = "natclear -t"
run_command(cmd)

if __name__ == '__main__':
cli()
Loading

0 comments on commit 7bc837a

Please sign in to comment.