Add functions to determine how port should be opened based on type.