Skip to content

Instantly share code, notes, and snippets.

@astory
Created July 3, 2012 19:32
Show Gist options
  • Save astory/3042244 to your computer and use it in GitHub Desktop.
Save astory/3042244 to your computer and use it in GitHub Desktop.
class BottomPolicy(Policy):
"""Policy that drops everything."""
def __init__(self):
pass
def get_physical_rep(self, switch_map, port_map):
return self
def get_actions(self, packet, loc):
return []
def is_bottom(self):
return True
def restrict(self, predicate):
return BottomPolicy()
def __str__(self):
return "BottomPolicy"
def __eq__(self, other):
return isinstance(other, BottomPolicy)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment