ported the code for generate the incoming links.
necessary to implement the function get_porttype_by_in_portname