title: Information about Switches and Ports from OpenFlow (RYU Controller)
body: <p>I am attempting to get some information from OpenFlow for my OpenFlow Application on RYU.</p>
  
  <p>The information that I want to get is given below.</p>
  
  <p>For each SWITCH,I want</p>
  
  <pre><code>        - DPID
          - STATE   (ACTIVE/INACTIVE)
  </code></pre>
  
  <p>For each PORT, I want</p>
  
  <pre><code>         - DPID
           - PORT_NUMBER
           - STATE
           - PORT_STATE
  </code></pre>
  
  <p>Port state - Tracks Port Status message from OF. 1 - ACTIVE.  0 - INACTIVE.OpenFlow 1.0 has 2 types of port status from memory, one concerning whether the port has link and the other concerning whether the port is administratively up. I believe this port status tracks the second type - i.e. port status should be 1 if the port is administratively up even if it doesn't have a link.</p>
  
  <p>Which messages should I listen to to get the above information.Also I tried getting information about ofp_event.EventOFPStateChange.</p>
  
  <p>I tried looking at <a href="http://ryu.readthedocs.org/en/latest/genindex.html" rel="nofollow">http://ryu.readthedocs.org/en/latest/genindex.html</a>
  I couldn't find the information related to ofp_event.EventOFPStateChange.</p>
  
  <p>Any help to point me in the right direction would be highly appreciated.</p>