Hi, > I get a message in return of a request, but the msg.xid is not in > self.waiters, but I supposed that it would be there because > "send_stats_request" of ryu/lib/ofctl_V1_0.py > do it,
ofctl_v1_0.py set the dpid and xid to waiters. https://github.com/osrg/ryu/blob/master/ryu/lib/ofctl_v1_0.py#L247-L249 I think that no error in ofctl_v1_0.py. > if msg.xid not in self.waiters[dp.id <http://dp.id>]: > print "msg.xid no inside self.waiters[dp.id <http://dp.id>]" > print "" > return There is a possibility that reply wait has timed out. If a timeout occurs, xid will be deleted. https://github.com/osrg/ryu/blob/master/ryu/lib/ofctl_v1_0.py#L254 https://github.com/osrg/ryu/blob/master/ryu/lib/ofctl_v1_0.py#L27 On 2015年02月10日 01:32, Marlon Olaya wrote: > Hi Minoru, I implemented the "stats_reply_handler" as you said, but I cant > pass of this section in line 186 of > https://github.com/osrg/ryu/blob/master/ryu/app/ofctl_rest.py#L689-L725 > (ofctl_rest.py > <https://github.com/osrg/ryu/blob/master/ryu/app/ofctl_rest.py#L689-L725%28ofctl_rest.py> > : > > if msg.xid not in self.waiters[dp.id <http://dp.id>]: > print "msg.xid no inside self.waiters[dp.id <http://dp.id>]" > print "" > return > > I get a message in return of a request, but the msg.xid is not in > self.waiters, but I supposed that it would be there because > "send_stats_request" of ryu/lib/ofctl_V1_0.py > do it, > so please help me to understand how can I put the msg.xid inside my waiters? > > > Im doing my best effort, please help me. > > Regards, > Marlon Olaya > > 2015-01-28 22:06 GMT-05:00 Minoru TAKAHASHI <[email protected] > <mailto:[email protected]>>: > > Hi, > > On 2015年01月29日 06:11, Marlon Olaya wrote: > > Hi, I'm triying to get the a flow stat, and i wanna use > get_flow_stats(dp, waiters) from ryu//lib/ofctl_v1_0.py and I use this > function for that: > > > > def statusReq(self, datapath): > > stats =[] > > waiters = {} > > stats= ofctl.get_flow_stats(dp=datapath,waiters=waiters) > > print "Stats of a flow" > > print stats > > return > > > > Im not sure if the code is right, but I get this result when I run the > app: > > > > Stats of a flow > > {'14118357615532992': []} > > > > Can you help me to understad how to use this function correctly please? > > Requires implementation of the "Stats Reply handler". > Please refer to the following code. > https://github.com/osrg/ryu/blob/master/ryu/app/ofctl_rest.py#L689-L725 > (ofctl_rest.py > <https://github.com/osrg/ryu/blob/master/ryu/app/ofctl_rest.py#L689-L725 > (ofctl_rest.py> is an application that uses the ofctl_v1_*.py) > > > Also im not sure about the parameter "waiters" in the definition of the > function, what's the meaning of it? > > "waiters" has a list of xid of StatsReply waiting in each dpid. > Structure of "waiters" are as follows. > > {dpid: {xid: (<ryu.lib.hub.Event object>, msgs)}, dpid: {xid: ....} > > Therefore, the value of each xid will be removed in the following timing. > > * When StatsReply received > https://github.com/osrg/ryu/blob/master/ryu/app/ofctl_rest.py#L724 > * When StatsReply timeout > > https://github.com/osrg/ryu/blob/master/ryu/lib/ofctl_v1_0.py#L252-L254 > > > > > Regards. > > Marlon Olaya > > > > > > > ------------------------------------------------------------------------------ > > Dive into the World of Parallel Programming. The Go Parallel Website, > > sponsored by Intel and developed in partnership with Slashdot Media, is > your > > hub for all things parallel software development, from weekly thought > > leadership blogs to news, videos, case studies, tutorials and more. > Take a > > look and join the conversation now. http://goparallel.sourceforge.net/ > > > > > > > > _______________________________________________ > > Ryu-devel mailing list > > [email protected] <mailto:[email protected]> > > https://lists.sourceforge.net/lists/listinfo/ryu-devel > > > > ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
