[pox-dev] Pox CLI namespace

William Emmanuel S. Yu wyu at ateneo.edu
Thu Oct 4 01:40:27 PDT 2012


This is definitely an easy way to do it. Thanks!
"Sent on the move."

-----Original Message-----
From: Murphy McCauley <murphy.mccauley at gmail.com>
Date: Thu, 4 Oct 2012 01:17:33 
To: <wyu at ateneo.edu>
Cc: <pox-dev at lists.noxrepo.org>
Subject: Re: [pox-dev] Pox CLI namespace

Yeah, that's more or less how I saw it being used.  For reference types, you can also just jam things into Interactive.variables from your own module:
core.Interactive.variables.update({k:v for k,v in globals().iteritems() if k not in core.Interactive.variables})

... which is pretty sloppy, but easy.

-- Murphy

On Oct 4, 2012, at 12:48 AM, William Emmanuel S. Yu wrote:

> Ah I want to share the namespace so best I use the core.Interactive.variables mechanism. So best I wrap my firewall table and helper functions in an object. Then I instanciate it in the of.firewall module then add it to core.Interactive.variables. I guess that should work?
> ------Original Message------
> From: pox-Murphy McCauley
> To: aaa-William Yu
> Cc: pox-dev
> Subject: Re: [pox-dev] Pox CLI namespace
> Sent: Oct 4, 2012 3:43 PM
> 
> Well, you can always "import" your module.
> Additionally, the POX core object is available as "core", so if you put your component there, you can easily get it.
> You can also add whatever variables you want by adding them to core.Interactive.variables.  Check the launch() function of arp_responder for an example.
> 
> -- Murphy
> 
> On Oct 4, 2012, at 12:39 AM, William Emmanuel S. Yu wrote:
> 
>> I ran pox with a CLI using "./pox.py py" and the appropriate module. When I am in the commandline problem I don't get the namespace of my module. I want to be able to run functions in this command line that I defined in my module.
>> 
>> For example, I created a ShowTable() in my module of.firewall. I want to be able to run that function in the CLI.
>> 
>> I am actually writing a "inefficient" firewall with functions used to modify my firewall permissions table.
>> 
>> Thank you!
>> "Sent on the move."
> 
> 
> 
> "Sent on the move."



More information about the pox-dev mailing list