[Tutor] Turning a "script" into an "application"
Christian Wyglendowski
Christian.Wyglendowski at greenville.edu
Wed Oct 27 00:27:42 CEST 2004
> -----Original Message-----
> From: Bill Mill [mailto:bill.mill at gmail.com]
> Subject: Re: [Tutor] Turning a "script" into an "application"
>
> Christian,
>
> I'm not really sure what you're asking. Do you have more
> concrete questions?
My main question boils down to: what programming/conceptual framework I
should use to turn my script into something resembling an application?
I guess maybe I was a bit vague in my description. First off, the
program watches the network for virus-like patterns of behavior, and
alerts a user via email if it sees it during its capture window.
Here is the basic flow I would like to see in the program:
#RUNNING CONTROLLER
|--> user can change options (captureTime, warnThreshhold,
networkDevice, sleepTime, notifyAddress)
|--> user can start/stop sniffer
|--> user can save capture analysis
|
|_____ #RUNNING SNIFFER (basically a loop)
|--> sniffer runs for captureTime seconds
|--> sniffer analyzes captured data
|--> sniffer saves analysis to memory
|--> depending on analysis, sniffer sends alert via email or
does nothing
|--> sniffer sleeps for sleepTime, then loops
Sorry for the bad ASCII diagram - but hopefully it makes some sense.
> It seems to me that, instead of messing around with threads,
> you may want to write an entirely seperate script to control
> the network script. Pseudocode:
>
> ##############
> #network_script_controller
> #############
> while 1:
> actions = {'1': send_foo_to_network_script, #this is a function
reference
> '2': send_bar_to_network_script #so is this
> #and whatever else menu options you want
> }
> print "Enter one to change foo, or two to change bar"
> msg = raw_input('>')
> actions[msg]()
>
> #############
> #network_script
> ############
> while 1:
> do_my_processing_loop()
> check_for_new_messages()
>
> And you could simply use sockets for communication between
> the two. Is that something like what you're looking for?
Thanks for the idea. Despite not reall knowing what I was asking, you
answered my question pretty well! I had not considered a multi-process
approach but I can see that it could be quite flexible.
> Peace
> Bill Mill
> bill.mill at gmail.com
>
Thanks again.
Christian
http://www.dowski.com
More information about the Tutor
mailing list