예제 #1
0
def main():
    """ Initialization of the Firewall. This pulls its rules from the file
    defined above. You can change this file pointer, but be sure to 
    change it back before submission! The run-firewall.sh file copies 
    over both this file and the configuration file to the correct 
    location."""

    # Parse the input file - make sure it's valid.
    config = parse_config(policy_file)

    # Get learning switch module
    learningSwitch = ActLikeSwitch()

    # Make Firewall policy
    fwPolicy = make_firewall_policy(config)

    # Return composed policy
    return fwPolicy >> learningSwitch
예제 #2
0
def main():
    """ Initialization of the Firewall. This pulls its rules from the file
            defined above. You can change this file pointer, but be sure to 
            change it back before submission! The run-firewall.sh file copies 
            over both this file and the configuration file to the correct 
            location."""
        
    # Parse the input file - make sure it's valid.
    config = parse_config(policy_file)
    
    # Get learning switch module
    learningSwitch = ActLikeSwitch()
    
    # Make Firewall policy
    fwPolicy = make_firewall_policy(config)
    
    # Return composed policy
    return fwPolicy >> learningSwitch