Skip to content

Commit

Permalink
Get network flows of publishers and subscriptions
Browse files Browse the repository at this point in the history
Signed-off-by: Ananya Muddukrishna <ananya.x.muddukrishna@ericsson.com>
  • Loading branch information
Ananya Muddukrishna committed Jan 21, 2021
1 parent ed8bc55 commit a9077b1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions rmw_implementation/src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "rmw/error_handling.h"
#include "rmw/event.h"
#include "rmw/names_and_types.h"
#include "rmw/get_network_flow.h"
#include "rmw/get_node_info_and_types.h"
#include "rmw/get_service_names_and_types.h"
#include "rmw/get_topic_endpoint_info.h"
Expand Down Expand Up @@ -599,6 +600,22 @@ RMW_INTERFACE_FN(
bool,
rmw_topic_endpoint_info_array_t *))

RMW_INTERFACE_FN(
rmw_publisher_get_network_flow,
rmw_ret_t, RMW_RET_ERROR,
3, ARG_TYPES(
const rmw_publisher_t *,
rcutils_allocator_t *,
rmw_network_flow_array_t *))

RMW_INTERFACE_FN(
rmw_subscription_get_network_flow,
rmw_ret_t, RMW_RET_ERROR,
3, ARG_TYPES(
const rmw_subscription_t *,
rcutils_allocator_t *,
rmw_network_flow_array_t *))

#define GET_SYMBOL(x) symbol_ ## x = get_symbol(#x);

void prefetch_symbols(void)
Expand Down Expand Up @@ -676,6 +693,8 @@ void prefetch_symbols(void)
GET_SYMBOL(rmw_set_log_severity)
GET_SYMBOL(rmw_get_publishers_info_by_topic)
GET_SYMBOL(rmw_get_subscriptions_info_by_topic)
GET_SYMBOL(rmw_publisher_get_network_flow)
GET_SYMBOL(rmw_subscription_get_network_flow)
}

void * symbol_rmw_init = nullptr;
Expand Down Expand Up @@ -775,6 +794,8 @@ unload_library()
symbol_rmw_set_log_severity = nullptr;
symbol_rmw_get_publishers_info_by_topic = nullptr;
symbol_rmw_get_subscriptions_info_by_topic = nullptr;
symbol_rmw_publisher_get_network_flow = nullptr;
symbol_rmw_subscription_get_network_flow = nullptr;
symbol_rmw_init = nullptr;
g_rmw_lib.reset();
}

0 comments on commit a9077b1

Please sign in to comment.