add port() and get_port_type() methods