<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-2022-jp"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Apr 16, 2014, at 3:27 AM, Shiyao Ma <<a href="mailto:i@introo.me">i@introo.me</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div><div><div>Hi.<br><br></div>I am following <a href="https://github.com/noxrepo/pox/blob/carp/pox/forwarding/l2_learning.py#L121">https://github.com/noxrepo/pox/blob/carp/pox/forwarding/l2_learning.py#L121</a><br>
</div>I wonder where is the corresponding source for that event obj (The relevant class definition), so I can know what the event.attr stands for and how many attrs the event has.<br></div></div></div></blockquote><div><br></div><div>This is a PacketIn event handler, so the event object is a PacketIn.  You can either grep the codebase for "class PacketIn", or you can look up the PacketIn event in the POX manual.  It's in a subsection called "PacketIn" under "OpenFlow Events: Responding to Switches".</div><div><br></div><blockquote type="cite"><div dir="ltr"><div>Also, I'd like to know the relevant class for the connection object. <a href="https://github.com/noxrepo/pox/blob/carp/pox/forwarding/l2_learning.py#L86">https://github.com/noxrepo/pox/blob/carp/pox/forwarding/l2_learning.py#L86</a><br></div></div></blockquote><div><br></div><div>The connection object is from a class called Connection.  You can search the codebase for "class Connection", or you can look it up in the manual.  It's in a subsection called "Connection Objects".</div><div><br></div><div><br></div><div>For either or both of these, you could also use Python to find the answers for you.  For example, to find the class of the connection, object, insert the following near line 86 of l2_learning:</div><div><div>import inspect</div><div>print inspect.getsourcefile(type(connection)), inspect.getsourcelines(type(connection))[1]</div><div><br></div><div>Et voila, it'll print out the file and line number of the class.  Or simply insert "help(connection)" to get the whole pydoc for it.  Or save it to a global variable, run the POX "py" module, and then do "help(<global variable name>)" from the commandline.</div></div><div><br></div><div><br></div><div>Hope that helps.</div><div><br></div>-- Murphy</div><div><br><blockquote type="cite"><div dir="ltr">Thanks and regards.<br><div>-- <br><div dir="ltr"><div><br></div><div>$B8cGZ$OG-$G$"$k!#%[!<%`!<%Z!<%8$O(B<a href="http://introo.me/" target="_blank">http://introo.me</a>$B!#(B<br></div></div>
</div></div>
</blockquote></div><br></body></html>