More work on functions that tell what ports can be used by an input or output.  Bug #8088.