Listing 7. policy.py, Part II (Instance Definitions)

def blue():
    Service("blue_http", HttpProxy,
            router=TransparentRouter())
    Service("blue_ssh", PlugProxy,
            router=TransparentRouter())
    Listener(SockAddrInet('10.0.1.254', 50080),
             "blue_http")
    Listener(SockAddrInet('10.0.1.254', 50022),
             "blue_ssh")

def purple():
    pass

def red():
    Service("red_http", HttpProxy,
router=DirectedRouter(SockAddrInet('192.168.1.242', 80),
forge_addr=TRUE))
    Listener(SockAddrInet('169.254.1.254', 50080),
             "red_http")

