On Mar 20, 2013, at 1:04 PM, udita gangwal wrote:

> Now my questions are:
>    1. where are these actions defined for the given rules?

I'm not sure what you mean.

>    2. Suppose I want to extract and display individual elements of the 
> actions, for example, the type or the len entries from the above output, how 
> do I do this? When I try to display f.actions, it gives me an output which 
> looks like the below: [<pox.openflow.libopenflow_01.ofp_action_output object 
> at 0x977d9cc>]. What does this mean?

It's a list with one element.  That one element is of type ofp_action_output, 
which is defined in pox/openflow/libopenflow_01.py.

> And how do I extract the individual entries from this list?

The same way you extract any entry from any list.  For example:

log.info("First action: %s", f.actions[0])

>    3. Suppose I want to modify or add actions, how do I go about it?

Same way you modify or add any action.  How are they added in the first place?  
Send an ofp_flow_mod.  If you want to base them on the ones you got from the 
flow stats, you can certainly reuse the match object and the actions class, but 
this seems like a pretty round-about way of doing it -- you'd essentially be 
installing flow entries, asking the switch which flow entries it has, modifying 
them, and sending them back.  Why not just install the ones you want and skip 
asking the switch?  There may be use cases for that approach, but I am guessing 
the good ones are rare.

-- Murphy

Reply via email to