datapath: Change listing ports to use an iterator concept.