rmw  master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
network_flow_endpoint.h
Go to the documentation of this file.
1 // Copyright 2020 Ericsson AB
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RMW__NETWORK_FLOW_ENDPOINT_H_
16 #define RMW__NETWORK_FLOW_ENDPOINT_H_
17 
18 #if __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include "rmw/types.h"
24 #include "rmw/visibility_control.h"
25 
28 {
34 
37 {
43 
46 #define RMW_INET_ADDRSTRLEN 48
47 
50 {
51  // Transport protocol
53  // Internet protocol
55  // Port
56  uint16_t transport_port;
57  // Flow label
58  // TODO(anamud): Consider specializing since flow_label is set only at publisher
59  // ... side.
60  uint32_t flow_label;
61  // DSCP (Diff. Services Code Point)
62  // TODO(anamud): Consider specializing since DSCP is set only at publisher
63  // ... side.
64  uint8_t dscp;
65  // Internet address
66  char internet_address[RMW_INET_ADDRSTRLEN];
68 
73 
75 
79 const char *
81  const rmw_transport_protocol_t transport_protocol);
82 
84 
88 const char *
90  const rmw_internet_protocol_t internet_protocol);
91 
93 
104 rmw_ret_t
106  rmw_network_flow_endpoint_t * network_flow_endpoint,
107  const char * internet_address,
108  size_t size);
109 
110 #if __cplusplus
111 }
112 #endif
113 
114 #endif // RMW__NETWORK_FLOW_ENDPOINT_H_
RMW_INTERNET_PROTOCOL_IPV6
@ RMW_INTERNET_PROTOCOL_IPV6
Definition: network_flow_endpoint.h:40
RMW_INTERNET_PROTOCOL_COUNT
@ RMW_INTERNET_PROTOCOL_COUNT
Definition: network_flow_endpoint.h:41
rmw_network_flow_endpoint_t::dscp
uint8_t dscp
Definition: network_flow_endpoint.h:64
RMW_PUBLIC
#define RMW_PUBLIC
Definition: visibility_control.h:48
rmw_network_flow_endpoint_t
struct RMW_PUBLIC_TYPE rmw_network_flow_endpoint_t rmw_network_flow_endpoint_t
Structure that describes network flow endpoint of a publisher or subscription.
RMW_TRANSPORT_PROTOCOL_UDP
@ RMW_TRANSPORT_PROTOCOL_UDP
Definition: network_flow_endpoint.h:30
RMW_INET_ADDRSTRLEN
#define RMW_INET_ADDRSTRLEN
Definition: network_flow_endpoint.h:46
types.h
RMW_TRANSPORT_PROTOCOL_UNKNOWN
@ RMW_TRANSPORT_PROTOCOL_UNKNOWN
Definition: network_flow_endpoint.h:29
RMW_PUBLIC_TYPE
RMW_PUBLIC_TYPE
Type mapping of rcutils log severity types to rmw specific types.
Definition: types.h:540
rmw_network_flow_endpoint_get_transport_protocol_string
const char * rmw_network_flow_endpoint_get_transport_protocol_string(const rmw_transport_protocol_t transport_protocol)
Convert to string variant of transport protocol.
rmw_network_flow_endpoint_t::internet_protocol
rmw_internet_protocol_t internet_protocol
Definition: network_flow_endpoint.h:54
rmw_network_flow_endpoint_get_internet_protocol_string
const char * rmw_network_flow_endpoint_get_internet_protocol_string(const rmw_internet_protocol_t internet_protocol)
Convert to string variant of internet protocol.
RMW_INTERNET_PROTOCOL_IPV4
@ RMW_INTERNET_PROTOCOL_IPV4
Definition: network_flow_endpoint.h:39
RMW_TRANSPORT_PROTOCOL_TCP
@ RMW_TRANSPORT_PROTOCOL_TCP
Definition: network_flow_endpoint.h:31
rmw_transport_protocol_t
rmw_transport_protocol_t
Transport protocol types.
Definition: network_flow_endpoint.h:27
rmw_network_flow_endpoint_t
Structure that describes network flow endpoint of a publisher or subscription.
Definition: network_flow_endpoint.h:49
rmw_ret_t
int32_t rmw_ret_t
Return code for rmw functions.
Definition: ret_types.h:26
visibility_control.h
rmw_internet_protocol_t
rmw_internet_protocol_t
Internet protocol types.
Definition: network_flow_endpoint.h:36
RMW_INTERNET_PROTOCOL_UNKNOWN
@ RMW_INTERNET_PROTOCOL_UNKNOWN
Definition: network_flow_endpoint.h:38
rmw_get_zero_initialized_network_flow_endpoint
rmw_network_flow_endpoint_t rmw_get_zero_initialized_network_flow_endpoint(void)
Return a rmw_network_flow_endpoint_t struct with zero-initialized members.
rmw_network_flow_endpoint_t::flow_label
uint32_t flow_label
Definition: network_flow_endpoint.h:60
rmw_network_flow_endpoint_t::transport_protocol
rmw_transport_protocol_t transport_protocol
Definition: network_flow_endpoint.h:52
rmw_network_flow_endpoint_t::transport_port
uint16_t transport_port
Definition: network_flow_endpoint.h:56
RMW_TRANSPORT_PROTOCOL_COUNT
@ RMW_TRANSPORT_PROTOCOL_COUNT
Definition: network_flow_endpoint.h:32
rmw_network_flow_endpoint_set_internet_address
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)
Set internet address in the rmw_network_flow_endpoint_t struct.