Wiki
Clone wikiaiengine / InteractiveShellPython
Interactive shell
One of the functionalities of the engine is the ability to interact with on real time without unload the main script. Lets see how works:
Create a new PacketDispatcher and the IPv6 stack and connect them.
import pyaiengine if __name__ == '__main__': st = pyaiengine.StackLanIPv6()
st.udp_flows = 163840 st.tcp_flows = 163840
with pyaiengine.PacketDispatcher("eth0") as pd: pd.stack = st pd.enable_shell = True pd.run()
AIEngine 1.2 shell ==> [02/15/14 22:57:12] Processing packets from device eth0 ==> print pd PacketDispatcher(0x19b15f0) statistics Connected to Lan IPv6 network stack Total packets: 77 Total bytes: 5914
Updated