I am trying to write a Pox controller using python. The environment is set up using Mininet and the switch type is ovsk (open vswitch). For each individual switch, some of the ports are connected to hosts, some of them are connected with the other peer switches, some might connected to the controller, or routers. I can use "sh ovs-ofctl show " in mininet to get the openflow port number mapping with interface name.
My question is: in the Pox python code, how can I check which ports on a switch are connected to host and which ones are connected to peer switches, controllers or routers?