diff --git a/core/Port.cc b/core/Port.cc index 7b73f9ffc0451283169d9112013728bd134076f4..276ac6c870d4d30e0b13e56315fff328818c5380 100644 --- a/core/Port.cc +++ b/core/Port.cc @@ -503,6 +503,15 @@ boolean PORT::port_is_started() { return is_started; } +PORT* PORT::get_provider_port() { + get_default_destination(); + PORT* p = lookup_by_name(system_mappings[0], TRUE); + if (p == NULL) { + p = lookup_by_name(system_mappings[0], FALSE); + } + return p; +} + alt_status PORT::receive(const COMPONENT_template&, COMPONENT *, Index_Redirect*) { TTCN_Logger::log_matching_problem( diff --git a/core/Port.hh b/core/Port.hh index ee925b46eb3ef1c02919c4437e29abcd13b1c4f3..b7dd4605c2d6c212ea534606b59718dfd73b6458 100644 --- a/core/Port.hh +++ b/core/Port.hh @@ -138,6 +138,12 @@ public: boolean port_is_started(); + // Returns the outer message port it is mapped to + // when the port works in translation mode. Otherwise returns NULL. + // Emits errors when the port is mapped to more than one port or + // has both connections or mappings. + PORT* get_provider_port(); + boolean check_port_state(const CHARSTRING& type) const; static boolean any_check_port_state(const CHARSTRING& type); static boolean all_check_port_state(const CHARSTRING& type);