Example #1
0
def status():
    """
    Display the client list and the MAC blacklist, along with an optional
    message.
    """
    if not is_valid_user(request):
        return redirect(url_for('index'))
    mgr = WirelessAccessManager(EvilMommy.Config)
    msg = request.args['msg']
    return render_template('status.html', 
                           message = msg,
                           clients = mgr.get_dhcp_clients_table(),
                           mac_filters = mgr.get_blacklist())
Example #2
0
def integration_test():
    """
    These only run manually, if you uncomment the last line of this file.
    """

    mgr = WirelessAccessManager(EvilMommy.Config)

    # Get the blacklist, add a MAC address to it, then get the list
    # again to see if it was really added.
    print mgr.get_blacklist()
    print "Adding '00:55:55:55:55:55' to the blacklist"
    mgr.add_to_blacklist('00:55:55:55:55:55')
    print mgr.get_blacklist()

    # Now remove the MAC address and see if it really worked.
    print "Removing '00:55:55:55:55:55' from the blacklist"
    mgr.remove_from_blacklist('00:55:55:55:55:55')
    print mgr.get_blacklist()