port-related functions