Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
shdasari authored Mar 27, 2020
2 parents 408c930 + 798ce2f commit b384aac
Show file tree
Hide file tree
Showing 63 changed files with 9,404 additions and 417 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
31 changes: 31 additions & 0 deletions clear/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ def pfccounters():
command = "pfcstat -c"
run_command(command)

@cli.command()
def dropcounters():
"""Clear drop counters"""
command = "dropstat -c clear"
run_command(command)

#
# 'clear watermarks
#
Expand Down Expand Up @@ -471,6 +477,7 @@ def line(linenum):
cmd = "consutil clear " + str(linenum)
run_command(cmd)


@cli.group('threshold')
def threshold():
"""Clear threshold breach entries"""
Expand All @@ -484,7 +491,31 @@ def breach(id):
cmd = "thresholdbreach -c -cnt {}".format(id)
else:
cmd = 'thresholdbreach -c'
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__':
Expand Down
Loading

0 comments on commit b384aac

Please sign in to comment.