Re: [nox-dev] Getting Actions From Events in Python

2011-10-05 Thread Christian Esteve Rothenberg
Hi Derek, did you succeed in implementing the to_python() for the action list in flow_stats? Does someone have a patch for this issue? Thanks, Christian On Fri, Jan 28, 2011 at 11:51, James Murphy McCauley jam...@nau.edu wrote: Yeah, I think this looks like the right direction.  I probably

Re: [nox-dev] Getting Actions From Events in Python

2011-10-05 Thread Murphy McCauley
Derek and I fixed this up quite a while ago. It's one of the commits that got lumped together and doesn't have a good commit message, but it's been in destiny for months now. (One day I may actually fix the commit log for it.) -- Murphy On Oct 5, 2011, at 2:39 PM, Christian Esteve Rothenberg

Re: [nox-dev] Getting Actions From Events in Python

2011-01-28 Thread James Murphy McCauley
Yeah, I think this looks like the right direction. I probably wouldn't have bothered writing a to_python for ofp_action_header since we know it's not used anywhere else, and would have just handled it in the one for Flow_stats itself, but this is not really here nor there. This is a fine use for

[nox-dev] Getting Actions From Events in Python

2011-01-27 Thread Derek Cormier
Hello, I was looking at pyglue.cc and it looks like actions are never included in python events. A comment says to use Flow_stats, but flow stats contains a vector ofp_action_header's. Since actions are variable-length, won't this cut off data when the action is longer than the header? (For

Re: [nox-dev] Getting Actions From Events in Python

2011-01-27 Thread James Murphy McCauley
I believe the issue is that with the to_python() for ofp_flow_stats, we have no idea if the actions actually follow the ofp_flow_stats structure since, for example, someone could have just made an ofp_flow_stats struct and tried to pythonize it. I am not sure if this ever actually happens, but

Re: [nox-dev] Getting Actions From Events in Python

2011-01-27 Thread Derek Cormier
Ok I'll give it a try and submit a patch when I'm finished. Could you please tell me if the following is the right approach? template PyObject* to_python(const ofp_action_header a) { PyObject* dict = PyDict_New(); if (!dict) { return 0; } uint16_t type = ntohs(a.type);

Re: [nox-dev] Getting Actions From Events in Python

2011-01-27 Thread Derek Cormier
Without minding the typos, that is... On 01/28/2011 04:46 PM, Derek Cormier wrote: Ok I'll give it a try and submit a patch when I'm finished. Could you please tell me if the following is the right approach? template PyObject* to_python(const ofp_action_header a) { PyObject* dict =