Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Commit

Permalink
new match add and delete methods for countbuckets
Browse files Browse the repository at this point in the history
  • Loading branch information
ngsrinivas committed Mar 5, 2016
1 parent 6f40d17 commit 9780e7f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pyretic/core/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,25 @@ def __eq__(self, other):
# be on names.
return id(self) == id(other)

def add_match(self, match, priority, version):
"""Add a match to list of classifier rules to be queried for counts,
corresponding to a given version of the classifier.
"""
k = self.rule_entry(match, priority, version)
if not k in self.matches:
self.matches[k] = self.match_status()

def delete_match(self, match, priority, version, to_be_deleted=False):
"""If a rule is deleted from the classifier, mark this rule (until we
get the flow_removed message with the counters on it).
"""
k = self.rule_entry(match, priority, version)
if k in self.matches:
if to_be_deleted:
del self.matches[k]
else:
self.matches[k].to_be_deleted = True

################################################################################
# Combinator Policies #
################################################################################
Expand Down

0 comments on commit 9780e7f

Please sign in to comment.