Skip to content

Commit

Permalink
micro-ROS rolling Library auto-update 06-04-2021 07:02 (#11)
Browse files Browse the repository at this point in the history
Co-authored-by: pablogs9 <[email protected]>
  • Loading branch information
github-actions[bot] and pablogs9 authored Apr 6, 2021
1 parent 9171725 commit 8b6cf8d
Show file tree
Hide file tree
Showing 8 changed files with 467 additions and 10 deletions.
16 changes: 8 additions & 8 deletions built_packages
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ https://github.com/ros2/rcpputils.git 9cad93ee6ee700007ed19036aeb1cc5ac54bba00
https://github.com/ros2/rcl_logging.git b56a55864a6ec714baa2a9d23269063a3680b20f
https://github.com/ros2/unique_identifier_msgs.git 80c21658a1b17f0c4e24002552f2426db236985f
https://github.com/ros2/test_interface_files.git d0ee98f449c428fc2afa888b06fea48b87dc6645
https://github.com/ros2/rcl_interfaces.git 46f61365fe0ffc216f8ddb568ef0a3c48b90a125
https://github.com/ros2/rmw_implementation.git bf5888e5f67df382590d6ee05ea2175500ee8b9f
https://github.com/ros2/rcl_interfaces.git b479add52d32a5b828888accd8ee2456e3ac295a
https://github.com/ros2/rmw_implementation.git 04b50eb60ec2758bc289f857c07fbf76047a274e
https://github.com/ros2/example_interfaces.git e3caaaf66bf664afc6c59d88a127f9c15597107e
https://github.com/ros2/rmw.git c71e97a670717cbf755627723a6d7ef5d756c4f4
https://github.com/ros2/rmw.git c52ff6621599add1471d05f31f8731ab5e805da6
https://github.com/ros2/libyaml_vendor.git a98ad5023d3e7e8dd00ce5b0b937ca02a83af481
https://github.com/ros2/common_interfaces.git 618473bef14632e2b3769049df00f69563e4c018
https://github.com/ros2/rcl.git 414fdbd479b83f2b8af8235ad1fa3aeba2b0027f
https://github.com/ros2/common_interfaces.git 8c9a144399fed2a35a409098e7b009c2e6b86446
https://github.com/ros2/rcl.git b5a6c1831114e6fdaeaeb0995679f5715c8db168
https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git 2b5cc410ac5226dc83fd7ebcd36a7643b7c8fbe3
https://github.com/micro-ROS/rmw-microxrcedds.git 57e155ce31053c0c6100c5cb7709707c7e9b0f6f
https://github.com/micro-ROS/rmw-microxrcedds.git bf3c0e1a8e9d71f99901ed663ce4b7ec0ce521dd
https://github.com/micro-ROS/micro_ros_msgs.git 9a3968d4694f516ded8bdbfe23e2a487477bb8b4
https://github.com/micro-ROS/rcutils 5ac69dc43b5ba5cb535ab9a53cc9d34582105a5f
https://github.com/ros2/rclc 905aaf94ac7dac2955cb179e342bf344ef235767
https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing ef9fc548a71de3157ae819895bc438bce5865023
https://github.com/micro-ROS/rcl 2dfc02aeffdda89f0fce7fce0cacc667cd575582
https://github.com/micro-ROS/rcl 84e139429069086181024f401019fb407b8c35d1
https://github.com/micro-ROS/rosidl_typesupport.git fa4e64fc33137dc84cc56be41ce0114f4975ed63
https://github.com/eProsima/Micro-XRCE-DDS-Client.git fee203496d520ffa26c7eeae9d2ffb89be3c6204
https://github.com/eProsima/Micro-CDR.git 2f1a688a9f7ca8379e64a8941bf5ce27bd7b1f94
Expand All @@ -29,5 +29,5 @@ https://github.com/ament/googletest.git f20771076ee2180c07f3f04d1c1e159d006e5fbb
https://github.com/ament/ament_package.git 0506b737d2d202fde4f29b2ff12033d7c568b72c
https://github.com/ament/ament_lint.git 0252120cca1c5ed614b2c0135c6e64b69b9fd455
https://github.com/ament/ament_cmake.git 84719051ef2b26070de484e60b8f060ae7a70b06
https://github.com/ament/ament_index.git d3f84fdeac1d7d75c0b811338c3dba9fc2332c70
https://github.com/ament/ament_index.git 0ec13b1f70903b12d377ae5f1e267e69a1ed68ac
https://github.com/ament/uncrustify_vendor.git 8945c291fbd36d7980f7e4fd641601c277c178ec
136 changes: 136 additions & 0 deletions libmicroros/include/rcl/network_flow_endpoints.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// Copyright 2020 Ericsson AB
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


#ifndef RCL__NETWORK_FLOW_ENDPOINTS_H_
#define RCL__NETWORK_FLOW_ENDPOINTS_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include <rmw/network_flow_endpoint.h>
#include <rmw/network_flow_endpoint_array.h>

#include "rcl/allocator.h"
#include "rcl/arguments.h"
#include "rcl/context.h"
#include "rcl/macros.h"
#include "rcl/publisher.h"
#include "rcl/subscription.h"
#include "rcl/types.h"
#include "rcl/visibility_control.h"

typedef rmw_network_flow_endpoint_t rcl_network_flow_endpoint_t;
typedef rmw_network_flow_endpoint_array_t rcl_network_flow_endpoint_array_t;
typedef rmw_transport_protocol_t rcl_transport_protocol_t;
typedef rmw_internet_protocol_t rcl_internet_protocol_t;

#define rcl_get_zero_initialized_network_flow_endpoint_array \
rmw_get_zero_initialized_network_flow_endpoint_array
#define rcl_network_flow_endpoint_array_fini rmw_network_flow_endpoint_array_fini

#define rcl_network_flow_endpoint_get_transport_protocol_string \
rmw_network_flow_endpoint_get_transport_protocol_string
#define rcl_network_flow_endpoint_get_internet_protocol_string \
rmw_network_flow_endpoint_get_internet_protocol_string

/// Get network flow endpoints of a publisher
/**
* Query the underlying middleware for a given publisher's network flow endpoints
*
* The `publisher` argument must point to a valid publisher.
*
* The `allocator` argument must be a valid allocator.
*
* The `network_flow_endpoint_array` argument must be allocated and zero-initialized.
* The function returns network flow endpoints in the `network_flow_endpoint_array` argument,
* using the allocator to allocate memory for the `network_flow_endpoint_array`
* argument's internal data structures whenever required. The caller is
* reponsible for memory deallocation by passing the `network_flow_endpoint_array`
* argument to `rcl_network_flow_endpoint_array_fini` function.
*
* <hr>
* Attribute | Adherence
* ------------------ | -------------
* Allocates Memory | Yes
* Thread-Safe | No
* Uses Atomics | No
* Lock-Free | Maybe [1]
* <i>[1] implementation may need to protect the data structure with a lock</i>
*
* \param[in] publisher the publisher instance to inspect
* \param[in] allocator allocator to be used when allocating space for network_flow_endpoint_array_t
* \param[out] network_flow_endpoint_array the network flow endpoints
* \return `RCL_RET_OK` if successful, or
* \return `RCL_RET_INVALID_ARGUMENT` if any argument is null, or
* \return `RCL_RET_BAD_ALLOC` if memory allocation fails, or
* \return `RCL_RET_UNSUPPORTED` if not supported, or
* \return `RCL_RET_ERROR` if an unexpected error occurs.
*/
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_publisher_get_network_flow_endpoints(
const rcl_publisher_t * publisher,
rcutils_allocator_t * allocator,
rcl_network_flow_endpoint_array_t * network_flow_endpoint_array);

/// Get network flow endpoints of a subscription
/**
* Query the underlying middleware for a given subscription's network flow endpoints
*
* The `subscription` argument must point to a valid subscription.
*
* The `allocator` argument must be a valid allocator.
*
* The `network_flow_endpoint_array` argument must be allocated and zero-initialized.
* The function returns network flow endpoints in the `network_flow_endpoint_array` argument,
* using the allocator to allocate memory for the `network_flow_endpoint_array`
* argument's internal data structures whenever required. The caller is
* reponsible for memory deallocation by passing the `network_flow_endpoint_array`
* argument to `rcl_network_flow_endpoint_array_fini` function.
*
* <hr>
* Attribute | Adherence
* ------------------ | -------------
* Allocates Memory | Yes
* Thread-Safe | No
* Uses Atomics | No
* Lock-Free | Maybe [1]
* <i>[1] implementation may need to protect the data structure with a lock</i>
*
* \param[in] subscription the subscription instance to inspect
* \param[in] allocator allocator to be used when allocating space for network_flow_endpoint_array_t
* \param[out] network_flow_endpoint_array the network flow endpoints
* \return `RCL_RET_OK` if successful, or
* \return `RCL_RET_INVALID_ARGUMENT` if any argument is null, or
* \return `RCL_RET_BAD_ALLOC` if memory allocation fails, or
* \return `RCL_RET_UNSUPPORTED` if not supported, or
* \return `RCL_RET_ERROR` if an unexpected error occurs.
*/
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_subscription_get_network_flow_endpoints(
const rcl_subscription_t * subscription,
rcutils_allocator_t * allocator,
rcl_network_flow_endpoint_array_t * network_flow_endpoint_array);

#ifdef __cplusplus
}
#endif

#endif // RCL__NETWORK_FLOW_ENDPOINTS_H_
73 changes: 73 additions & 0 deletions libmicroros/include/rmw/get_network_flow_endpoints.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Copyright 2020 Ericsson AB
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RMW__GET_NETWORK_FLOW_ENDPOINTS_H_
#define RMW__GET_NETWORK_FLOW_ENDPOINTS_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include "rmw/network_flow_endpoint_array.h"
#include "rmw/types.h"
#include "rmw/visibility_control.h"

/// Get network flow endpoints of a publisher
/**
* Query the underlying middleware for a given publisher's network flow endpoints
*
* \param[in] publisher the publisher instance to inspect
* \param[in] allocator allocator to be used when allocating space for network_flow_endpoint_array_t
* \param[out] network_flow_endpoint_array the network flow endpoints
* \return `RMW_RET_OK` if successful, or
* \return `RMW_RET_INVALID_ARGUMENT` if any argument is null,
* \return `RMW_RET_BAD_ALLOC` if memory allocation fails, or
* \return `RMW_RET_UNSUPPORTED` if not supported, or
* \return `RMW_RET_ERROR` if an unexpected error occurs.
*/
RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_publisher_get_network_flow_endpoints(
const rmw_publisher_t * publisher,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array);

/// Get network flow endpoints of a subscription
/**
* Query the underlying middleware for a given subscription's network flow endpoints
*
* \param[in] subscription the subscription instance to inspect
* \param[in] allocator allocator to be used when allocating space for network_flow_endpoint_array_t
* \param[out] network_flow_endpoint_array the network flow endpoints
* \return `RMW_RET_OK` if successful, or
* \return `RMW_RET_INVALID_ARGUMENT` if any argument is null, or
* \return `RMW_RET_BAD_ALLOC` if memory allocation fails, or
* \return `RMW_RET_UNSUPPORTED` if not supported, or
* \return `RMW_RET_ERROR` if an unexpected error occurs.
*/
RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_subscription_get_network_flow_endpoints(
const rmw_subscription_t * subscription,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array);

#ifdef __cplusplus
}
#endif

#endif // RMW__GET_NETWORK_FLOW_ENDPOINTS_H_
114 changes: 114 additions & 0 deletions libmicroros/include/rmw/network_flow_endpoint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
// Copyright 2020 Ericsson AB
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RMW__NETWORK_FLOW_ENDPOINT_H_
#define RMW__NETWORK_FLOW_ENDPOINT_H_

#if __cplusplus
extern "C"
{
#endif

#include "rmw/types.h"
#include "rmw/visibility_control.h"

/// Transport protocol types
typedef enum rmw_transport_protocol_t
{
RMW_TRANSPORT_PROTOCOL_UNKNOWN = 0,
RMW_TRANSPORT_PROTOCOL_UDP,
RMW_TRANSPORT_PROTOCOL_TCP,
RMW_TRANSPORT_PROTOCOL_COUNT
} rmw_transport_protocol_t;

/// Internet protocol types
typedef enum rmw_internet_protocol_t
{
RMW_INTERNET_PROTOCOL_UNKNOWN = 0,
RMW_INTERNET_PROTOCOL_IPV4,
RMW_INTERNET_PROTOCOL_IPV6,
RMW_INTERNET_PROTOCOL_COUNT
} rmw_internet_protocol_t;

/// Maximum length of internet address string including terminating null
/// Inspired from linux/inet.h
#define RMW_INET_ADDRSTRLEN 48

/// Structure that describes network flow endpoint of a publisher or subscription
typedef struct RMW_PUBLIC_TYPE rmw_network_flow_endpoint_t
{
// Transport protocol
rmw_transport_protocol_t transport_protocol;
// Internet protocol
rmw_internet_protocol_t internet_protocol;
// Port
uint16_t transport_port;
// Flow label
// TODO(anamud): Consider specializing since flow_label is set only at publisher
// ... side.
uint32_t flow_label;
// DSCP (Diff. Services Code Point)
// TODO(anamud): Consider specializing since DSCP is set only at publisher
// ... side.
uint8_t dscp;
// Internet address
char internet_address[RMW_INET_ADDRSTRLEN];
} rmw_network_flow_endpoint_t;

/// Return a rmw_network_flow_endpoint_t struct with zero-initialized members
RMW_PUBLIC
rmw_network_flow_endpoint_t
rmw_get_zero_initialized_network_flow_endpoint(void);

/// Convert to string variant of transport protocol
/**
* \param[in] transport_protocol transport_protocol_t to be converted
*/
RMW_PUBLIC
const char *
rmw_network_flow_endpoint_get_transport_protocol_string(
const rmw_transport_protocol_t transport_protocol);

/// Convert to string variant of internet protocol
/**
* \param[in] internet_protocol internet_protocol_t to be converted
*/
RMW_PUBLIC
const char *
rmw_network_flow_endpoint_get_internet_protocol_string(
const rmw_internet_protocol_t internet_protocol);

/// Set internet address in the rmw_network_flow_endpoint_t struct
/**
* \param[in] network_flow_endpoint network_flow_endpoint_t to be initialized
* \param[in] internet_address the internet address as C-style string
* \param[in] size size of internet_address excluding terminating null
* \returns `RMW_RET_OK` on successfull initilization, or
* \returns `RMW_RET_INVALID_ARGUMENT` if `network_flow_endpoint` is NULL, or
* \returns `RMW_RET_INVALID_ARGUMENT` if `internet_address` is NULL, or
* \returns `RMW_RET_INVALID_ARGUMENT` if `size` is not less than RMW_INET_ADDRSTRLEN, or
* \returns `RMW_RET_ERROR` when an unspecified error occurs.
*/
RMW_PUBLIC
rmw_ret_t
rmw_network_flow_endpoint_set_internet_address(
rmw_network_flow_endpoint_t * network_flow_endpoint,
const char * internet_address,
size_t size);

#if __cplusplus
}
#endif

#endif // RMW__NETWORK_FLOW_ENDPOINT_H_
Loading

0 comments on commit 8b6cf8d

Please sign in to comment.