def main():
    'Run AFL repeatedly with externally supplied generated packet from STDIN.'
    application = faucet.Faucet(dpset=dpset.DPSet(), faucet_experimental_api=faucet_experimental_api.FaucetExperimentalAPI())
    application.start()
    if (application.valves_manager is not None):
        for valve in list(application.valves_manager.valves.values()):
            state = valve.dp.dyn_finalized
            valve.dp.dyn_finalized = False
            valve.dp.running = True
            valve.dp.dyn_finalized = state
    while afl.loop(ROUNDS):
        rcv = sys.stdin.read()
        data = None
        try:
            data = bytearray.fromhex(rcv)
        except (ValueError, TypeError):
            continue
        _dp = fake_packet.Datapath(1)
        msg = fake_packet.Message(datapath=_dp, cookie=15243729, port=1, data=data, in_port=1)
        pkt = fake_packet.RyuEvent(msg)
        application.packet_in_handler(pkt)
Run AFL repeatedly with externally supplied generated packet from STDIN.
def main():
    
    application = faucet.Faucet(dpset=dpset.DPSet(), faucet_experimental_api=faucet_experimental_api.FaucetExperimentalAPI())
    application.start()
    if (application.valves_manager is not None):
        for valve in list(application.valves_manager.valves.values()):
            state = valve.dp.dyn_finalized
            valve.dp.dyn_finalized = False
            valve.dp.running = True
            valve.dp.dyn_finalized = state
    while afl.loop(ROUNDS):
        rcv = sys.stdin.read()
        data = None
        try:
            data = bytearray.fromhex(rcv)
        except (ValueError, TypeError):
            continue
        _dp = fake_packet.Datapath(1)
        msg = fake_packet.Message(datapath=_dp, cookie=15243729, port=1, data=data, in_port=1)
        pkt = fake_packet.RyuEvent(msg)
        application.packet_in_handler(pkt)