Upload third-party source (skip LFS pointer assets) (part 6)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_alloc.h +156 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_error.h +56 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_impl.h +350 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_listener.h +813 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_qos.h +1021 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_qosdefs.h +184 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_status.h +512 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_rhc.h +109 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_statistics.h +133 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_acknack.h +43 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_builtin_topic_if.h +57 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_cdrstream.h +101 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_cfgelems.h +0 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_cfgunits.h +48 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_config.h +455 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_config_impl.h +37 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_deadline.h +84 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_deliver_locally.h +62 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_domaingv.h +357 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_endpoint.h +237 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_entity.h +134 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_entity_index.h +163 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_entity_match.h +203 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_guid.h +37 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_handshake.h +226 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_iid.h +35 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_ipaddr.h +33 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_keyhash.h +27 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_lifespan.h +61 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_list_genptr.h +103 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_list_tmpl.h +318 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_locator.h +39 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_mcgroup.h +34 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_ownip.h +48 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_participant.h +241 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_plist.h +526 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_plist_generic.h +66 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_pmd.h +51 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_portmapping.h +49 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_proxy_endpoint.h +143 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_proxy_participant.h +109 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_raweth.h +25 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_rhc.h +85 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_security_exchange.h +51 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_security_msg.h +122 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_security_omg.h +1455 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_security_util.h +66 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_serdata.h +348 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_serdata_default.h +182 -0
- third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_serdata_plist.h +76 -0
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_alloc.h
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2019 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
/* TODO: do we really need to expose this as an API? */
|
| 13 |
+
|
| 14 |
+
/** @file
|
| 15 |
+
*
|
| 16 |
+
* @brief DDS C Allocation API
|
| 17 |
+
*
|
| 18 |
+
* This header file defines the public API of allocation convenience functions
|
| 19 |
+
* in the Eclipse Cyclone DDS C language binding.
|
| 20 |
+
*/
|
| 21 |
+
#ifndef DDS_ALLOC_H
|
| 22 |
+
#define DDS_ALLOC_H
|
| 23 |
+
|
| 24 |
+
#include <stddef.h>
|
| 25 |
+
|
| 26 |
+
#include "dds/export.h"
|
| 27 |
+
|
| 28 |
+
#if defined (__cplusplus)
|
| 29 |
+
extern "C" {
|
| 30 |
+
#endif
|
| 31 |
+
|
| 32 |
+
struct dds_topic_descriptor;
|
| 33 |
+
struct dds_sequence;
|
| 34 |
+
|
| 35 |
+
/**
|
| 36 |
+
* @anchor DDS_FREE_KEY_BIT
|
| 37 |
+
* @ingroup alloc
|
| 38 |
+
* @brief Instruction to free all keyfields in sample
|
| 39 |
+
*/
|
| 40 |
+
#define DDS_FREE_KEY_BIT 0x01
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @anchor DDS_FREE_CONTENTS_BIT
|
| 44 |
+
* @ingroup alloc
|
| 45 |
+
* @brief Instruction to free all non-keyfields in sample
|
| 46 |
+
*/
|
| 47 |
+
#define DDS_FREE_CONTENTS_BIT 0x02
|
| 48 |
+
|
| 49 |
+
/**
|
| 50 |
+
* @anchor DDS_FREE_ALL_BIT
|
| 51 |
+
* @ingroup alloc
|
| 52 |
+
* @brief Instruction to free outer sample
|
| 53 |
+
*/
|
| 54 |
+
#define DDS_FREE_ALL_BIT 0x04
|
| 55 |
+
|
| 56 |
+
/**
|
| 57 |
+
* @brief Freeing operation type
|
| 58 |
+
* @ingroup alloc
|
| 59 |
+
* What part of a sample to free
|
| 60 |
+
*/
|
| 61 |
+
typedef enum
|
| 62 |
+
{
|
| 63 |
+
DDS_FREE_ALL = DDS_FREE_KEY_BIT | DDS_FREE_CONTENTS_BIT | DDS_FREE_ALL_BIT, /**< free full sample */
|
| 64 |
+
DDS_FREE_CONTENTS = DDS_FREE_KEY_BIT | DDS_FREE_CONTENTS_BIT, /**< free all sample contents, but leave sample pointer intact */
|
| 65 |
+
DDS_FREE_KEY = DDS_FREE_KEY_BIT /**< free only the keyfields in a sample */
|
| 66 |
+
}
|
| 67 |
+
dds_free_op_t;
|
| 68 |
+
|
| 69 |
+
/**
|
| 70 |
+
* @brief DDS Allocator
|
| 71 |
+
* @ingroup alloc
|
| 72 |
+
* C-Style allocator API
|
| 73 |
+
*/
|
| 74 |
+
typedef struct dds_allocator
|
| 75 |
+
{
|
| 76 |
+
void * (*malloc) (size_t size); /**< behave like C malloc */
|
| 77 |
+
void * (*realloc) (void *ptr, size_t size); /**< behave like C realloc, may be null */
|
| 78 |
+
void (*free) (void *ptr); /**< behave like C free */
|
| 79 |
+
}
|
| 80 |
+
dds_allocator_t;
|
| 81 |
+
|
| 82 |
+
/**
|
| 83 |
+
* @brief Perform an alloc() with the default allocator.
|
| 84 |
+
*
|
| 85 |
+
* @param[in] size number of bytes
|
| 86 |
+
* @returns new pointer or NULL if out of memory
|
| 87 |
+
*/
|
| 88 |
+
DDS_EXPORT void * dds_alloc (size_t size);
|
| 89 |
+
|
| 90 |
+
/**
|
| 91 |
+
* @brief Perform a realloc() with the default allocator.
|
| 92 |
+
*
|
| 93 |
+
* @param[in] ptr previously alloc()'ed pointer
|
| 94 |
+
* @param[in] size new size
|
| 95 |
+
* @return new pointer or NULL if out of memory
|
| 96 |
+
*/
|
| 97 |
+
DDS_EXPORT void * dds_realloc (void * ptr, size_t size);
|
| 98 |
+
|
| 99 |
+
/**
|
| 100 |
+
* @brief Perform a realloc() with the default allocator. Zero out memory.
|
| 101 |
+
*
|
| 102 |
+
* @param[in] ptr previously alloc()'ed pointer
|
| 103 |
+
* @param[in] size new size
|
| 104 |
+
* @return new pointer or NULL if out of memory
|
| 105 |
+
*/
|
| 106 |
+
DDS_EXPORT void * dds_realloc_zero (void * ptr, size_t size);
|
| 107 |
+
|
| 108 |
+
/**
|
| 109 |
+
* @brief Perform a free() on a memory fragment allocated with the default allocator.
|
| 110 |
+
*
|
| 111 |
+
* @param[in] ptr previously alloc()'ed pointer
|
| 112 |
+
*/
|
| 113 |
+
DDS_EXPORT void dds_free (void * ptr);
|
| 114 |
+
|
| 115 |
+
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
| 116 |
+
typedef void * (*dds_alloc_fn_t) (size_t);
|
| 117 |
+
typedef void * (*dds_realloc_fn_t) (void *, size_t);
|
| 118 |
+
typedef void (*dds_free_fn_t) (void *);
|
| 119 |
+
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
| 120 |
+
|
| 121 |
+
/**
|
| 122 |
+
* @brief Allocated a string with size, accounting for the null terminator.
|
| 123 |
+
*
|
| 124 |
+
* @param[in] size number of characters
|
| 125 |
+
* @returns newly allocated string or NULL if out of memory
|
| 126 |
+
*/
|
| 127 |
+
DDS_EXPORT char * dds_string_alloc (size_t size);
|
| 128 |
+
|
| 129 |
+
/**
|
| 130 |
+
* @brief Duplicate a null-terminated string
|
| 131 |
+
*
|
| 132 |
+
* @param[in] str string to duplicate
|
| 133 |
+
* @returns newly allocated duplicate string, or NULL if out of memory
|
| 134 |
+
*/
|
| 135 |
+
DDS_EXPORT char * dds_string_dup (const char * str);
|
| 136 |
+
|
| 137 |
+
/**
|
| 138 |
+
* @brief Free a string, equivalent to dds_free
|
| 139 |
+
*
|
| 140 |
+
* @param[in] str string to free
|
| 141 |
+
*/
|
| 142 |
+
DDS_EXPORT void dds_string_free (char * str);
|
| 143 |
+
|
| 144 |
+
/**
|
| 145 |
+
* @brief Free (parts of) a sample according to the \ref dds_free_op_t
|
| 146 |
+
*
|
| 147 |
+
* @param[in] sample sample to free
|
| 148 |
+
* @param[in] desc topic descriptor of the type this sample was created from.
|
| 149 |
+
* @param[in] op Which parts of the sample to free.
|
| 150 |
+
*/
|
| 151 |
+
DDS_EXPORT void dds_sample_free (void * sample, const struct dds_topic_descriptor * desc, dds_free_op_t op);
|
| 152 |
+
|
| 153 |
+
#if defined (__cplusplus)
|
| 154 |
+
}
|
| 155 |
+
#endif
|
| 156 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_error.h
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2019 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
/** @file
|
| 14 |
+
*
|
| 15 |
+
* @brief DDS C Error API
|
| 16 |
+
*
|
| 17 |
+
* This header file defines the public API of error values and convenience
|
| 18 |
+
* functions in the CycloneDDS C language binding.
|
| 19 |
+
*/
|
| 20 |
+
#ifndef DDS_ERROR_H
|
| 21 |
+
#define DDS_ERROR_H
|
| 22 |
+
|
| 23 |
+
#include "dds/export.h"
|
| 24 |
+
#include "dds/ddsrt/log.h"
|
| 25 |
+
#include "dds/ddsrt/retcode.h"
|
| 26 |
+
|
| 27 |
+
#if defined (__cplusplus)
|
| 28 |
+
extern "C" {
|
| 29 |
+
#endif
|
| 30 |
+
|
| 31 |
+
/* ** DEPRECATED ** */
|
| 32 |
+
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
| 33 |
+
|
| 34 |
+
/* Error masks for returned status values */
|
| 35 |
+
|
| 36 |
+
#define DDS_ERR_NR_MASK 0x000000ff
|
| 37 |
+
#define DDS_ERR_LINE_MASK 0x003fff00
|
| 38 |
+
#define DDS_ERR_FILE_ID_MASK 0x7fc00000
|
| 39 |
+
|
| 40 |
+
/* Error code handling functions */
|
| 41 |
+
|
| 42 |
+
/** Macro to extract error number */
|
| 43 |
+
#define dds_err_nr(e) (e)
|
| 44 |
+
|
| 45 |
+
/** Macro to extract line number */
|
| 46 |
+
#define dds_err_line(e) (0)
|
| 47 |
+
|
| 48 |
+
/** Macro to extract file identifier */
|
| 49 |
+
#define dds_err_file_id(e) (0)
|
| 50 |
+
|
| 51 |
+
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
| 52 |
+
|
| 53 |
+
#if defined (__cplusplus)
|
| 54 |
+
}
|
| 55 |
+
#endif
|
| 56 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_impl.h
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
/* TODO: do we really need to expose all of this as an API? maybe some, but all? */
|
| 13 |
+
|
| 14 |
+
/** @file
|
| 15 |
+
*
|
| 16 |
+
* @brief DDS C Implementation API
|
| 17 |
+
*
|
| 18 |
+
* This header file defines the public API for all kinds of things in the
|
| 19 |
+
* Eclipse Cyclone DDS C language binding.
|
| 20 |
+
*/
|
| 21 |
+
#ifndef DDS_IMPL_H
|
| 22 |
+
#define DDS_IMPL_H
|
| 23 |
+
|
| 24 |
+
#include <stdint.h>
|
| 25 |
+
#include <stdbool.h>
|
| 26 |
+
#include "dds/export.h"
|
| 27 |
+
#include "dds/features.h"
|
| 28 |
+
#include "dds/ddsrt/align.h"
|
| 29 |
+
#include "dds/ddsc/dds_public_alloc.h"
|
| 30 |
+
#include "dds/ddsc/dds_opcodes.h"
|
| 31 |
+
|
| 32 |
+
#if defined (__cplusplus)
|
| 33 |
+
extern "C" {
|
| 34 |
+
#endif
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* @defgroup implementation (Public Implementation Details)
|
| 38 |
+
* @ingroup dds
|
| 39 |
+
* Miscellaneous types and functions that are required to be public, since they are
|
| 40 |
+
* in the output of the IDL compiler, but are not intended for direct use.
|
| 41 |
+
*/
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* @ingroup implementation
|
| 45 |
+
* @brief Datastructure of a Sequence type
|
| 46 |
+
* Container for a sequence of bytes. The general model of this type is also used in IDL output,
|
| 47 |
+
* where the uint8_t * _buffer is replaced by the appropriate subtype of what is contained.
|
| 48 |
+
*/
|
| 49 |
+
typedef struct dds_sequence
|
| 50 |
+
{
|
| 51 |
+
uint32_t _maximum; /**< Allocated space in _buffer */
|
| 52 |
+
uint32_t _length; /**< Used space in _buffer */
|
| 53 |
+
uint8_t * _buffer; /**< Sequence of bytes */
|
| 54 |
+
bool _release; /**< Whether a CycloneDDS _free method should free the contained buffer.
|
| 55 |
+
if you put in your own allocated _buffer set this to false to avoid
|
| 56 |
+
CycloneDDS calling free() on it. */
|
| 57 |
+
}
|
| 58 |
+
dds_sequence_t;
|
| 59 |
+
|
| 60 |
+
/**
|
| 61 |
+
* @ingroup implementation
|
| 62 |
+
* @brief Key Descriptor
|
| 63 |
+
* Used to describe a named key field in a type with the offset from the start of a struct.
|
| 64 |
+
*/
|
| 65 |
+
typedef struct dds_key_descriptor
|
| 66 |
+
{
|
| 67 |
+
const char * m_name; /**< name of keyfield */
|
| 68 |
+
uint32_t m_offset; /**< offset from pointer */
|
| 69 |
+
uint32_t m_idx; /**< m_idx'th key of type */
|
| 70 |
+
}
|
| 71 |
+
dds_key_descriptor_t;
|
| 72 |
+
|
| 73 |
+
/**
|
| 74 |
+
* @defgroup topic_definition (Topic Definition)
|
| 75 |
+
* @ingroup implementation
|
| 76 |
+
* Topic definitions are output by the IDL compiler and have an
|
| 77 |
+
* implementation-private definition. The only thing exposed on the
|
| 78 |
+
* API is a pointer to the "dds_topic_descriptor_t" struct type.
|
| 79 |
+
*/
|
| 80 |
+
|
| 81 |
+
/**
|
| 82 |
+
* @ingroup topic_definition
|
| 83 |
+
* @brief Simple sized byte container to hold serialized type info
|
| 84 |
+
* Holds XTypes information (TypeInformation, TypeMapping) for a
|
| 85 |
+
* type
|
| 86 |
+
*/
|
| 87 |
+
struct dds_type_meta_ser
|
| 88 |
+
{
|
| 89 |
+
unsigned char * data; /**< data pointer */
|
| 90 |
+
uint32_t sz; /**< data size */
|
| 91 |
+
};
|
| 92 |
+
|
| 93 |
+
/**
|
| 94 |
+
* @anchor DDS_DATA_REPRESENTATION_XCDR1
|
| 95 |
+
* @ingroup topic_definition
|
| 96 |
+
* @brief Data representation XCDR1
|
| 97 |
+
* Type can be represented using XCDR1
|
| 98 |
+
*/
|
| 99 |
+
#define DDS_DATA_REPRESENTATION_XCDR1 0
|
| 100 |
+
|
| 101 |
+
/**
|
| 102 |
+
* @anchor DDS_DATA_REPRESENTATION_XML
|
| 103 |
+
* @ingroup topic_definition
|
| 104 |
+
* @brief Data representation XML
|
| 105 |
+
* Type can be represented using XML
|
| 106 |
+
*/
|
| 107 |
+
#define DDS_DATA_REPRESENTATION_XML 1
|
| 108 |
+
|
| 109 |
+
/**
|
| 110 |
+
* @anchor DDS_DATA_REPRESENTATION_XCDR2
|
| 111 |
+
* @ingroup topic_definition
|
| 112 |
+
* @brief Data representation XCDR2
|
| 113 |
+
* Type can be represented using XCDR2
|
| 114 |
+
*/
|
| 115 |
+
#define DDS_DATA_REPRESENTATION_XCDR2 2
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
/**
|
| 119 |
+
* @anchor DDS_DATA_REPRESENTATION_FLAG_XCDR1
|
| 120 |
+
* @ingroup topic_definition
|
| 121 |
+
* @brief Data representation XCDR1 flag
|
| 122 |
+
* Type can be represented using XCDR1, preshifted
|
| 123 |
+
*/
|
| 124 |
+
#define DDS_DATA_REPRESENTATION_FLAG_XCDR1 (1u << DDS_DATA_REPRESENTATION_XCDR1)
|
| 125 |
+
|
| 126 |
+
/**
|
| 127 |
+
* @anchor DDS_DATA_REPRESENTATION_FLAG_XML
|
| 128 |
+
* @ingroup topic_definition
|
| 129 |
+
* @brief Data representation XML flag
|
| 130 |
+
* Type can be represented using XML, preshifted
|
| 131 |
+
*/
|
| 132 |
+
#define DDS_DATA_REPRESENTATION_FLAG_XML (1u << DDS_DATA_REPRESENTATION_XML)
|
| 133 |
+
|
| 134 |
+
/**
|
| 135 |
+
* @anchor DDS_DATA_REPRESENTATION_FLAG_XCDR2
|
| 136 |
+
* @ingroup topic_definition
|
| 137 |
+
* @brief Data representation XCDR2 flag
|
| 138 |
+
* Type can be represented using XCDR2, preshifted
|
| 139 |
+
*/
|
| 140 |
+
#define DDS_DATA_REPRESENTATION_FLAG_XCDR2 (1u << DDS_DATA_REPRESENTATION_XCDR2)
|
| 141 |
+
|
| 142 |
+
/**
|
| 143 |
+
* @anchor DDS_DATA_REPRESENTATION_RESTRICT_DEFAULT
|
| 144 |
+
* @ingroup topic_definition
|
| 145 |
+
* @brief Default datarepresentation flag, XCDR1 and XCDR2 flags
|
| 146 |
+
*/
|
| 147 |
+
#define DDS_DATA_REPRESENTATION_RESTRICT_DEFAULT (DDS_DATA_REPRESENTATION_FLAG_XCDR1 | DDS_DATA_REPRESENTATION_FLAG_XCDR2)
|
| 148 |
+
|
| 149 |
+
/**
|
| 150 |
+
* @brief Topic Descriptor
|
| 151 |
+
* @ingroup topic_definition
|
| 152 |
+
* @warning Unstable/Private API
|
| 153 |
+
* Contains all meta information about a type, usually produced by the IDL compiler
|
| 154 |
+
* Since this type is not intended for public consumption it can change without warning.
|
| 155 |
+
*/
|
| 156 |
+
typedef struct dds_topic_descriptor
|
| 157 |
+
{
|
| 158 |
+
const uint32_t m_size; /**< Size of topic type */
|
| 159 |
+
const uint32_t m_align; /**< Alignment of topic type */
|
| 160 |
+
const uint32_t m_flagset; /**< Flags */
|
| 161 |
+
const uint32_t m_nkeys; /**< Number of keys (can be 0) */
|
| 162 |
+
const char * m_typename; /**< Type name */
|
| 163 |
+
const dds_key_descriptor_t * m_keys; /**< Key descriptors (NULL iff m_nkeys 0) */
|
| 164 |
+
const uint32_t m_nops; /**< Number of ops in m_ops */
|
| 165 |
+
const uint32_t * m_ops; /**< Marshalling meta data */
|
| 166 |
+
const char * m_meta; /**< XML topic description meta data */
|
| 167 |
+
struct dds_type_meta_ser type_information; /**< XCDR2 serialized TypeInformation, only present if flag DDS_TOPIC_XTYPES_METADATA is set */
|
| 168 |
+
struct dds_type_meta_ser type_mapping; /**< XCDR2 serialized TypeMapping: maps type-id to type object and minimal to complete type id,
|
| 169 |
+
only present if flag DDS_TOPIC_XTYPES_METADATA is set */
|
| 170 |
+
const uint32_t restrict_data_representation; /**< restrictions on the data representations allowed for the top-level type for this topic,
|
| 171 |
+
only present if flag DDS_TOPIC_RESTRICT_DATA_REPRESENTATION */
|
| 172 |
+
}
|
| 173 |
+
dds_topic_descriptor_t;
|
| 174 |
+
|
| 175 |
+
/**
|
| 176 |
+
* @defgroup reading_masks (Reading Masks)
|
| 177 |
+
* @ingroup conditions
|
| 178 |
+
* Masks for read condition, read, take: there is only one mask here,
|
| 179 |
+
* which combines the sample, view and instance states.
|
| 180 |
+
*/
|
| 181 |
+
|
| 182 |
+
/**
|
| 183 |
+
* @anchor DDS_READ_SAMPLE_STATE
|
| 184 |
+
* @ingroup reading_masks
|
| 185 |
+
* @brief Samples that were already returned once by a read/take operation
|
| 186 |
+
*/
|
| 187 |
+
#define DDS_READ_SAMPLE_STATE 1u
|
| 188 |
+
|
| 189 |
+
/**
|
| 190 |
+
* @anchor DDS_NOT_READ_SAMPLE_STATE
|
| 191 |
+
* @ingroup reading_masks
|
| 192 |
+
* @brief Samples that have not been returned by a read/take operation yet
|
| 193 |
+
*/
|
| 194 |
+
#define DDS_NOT_READ_SAMPLE_STATE 2u
|
| 195 |
+
|
| 196 |
+
/**
|
| 197 |
+
* @anchor DDS_ANY_SAMPLE_STATE
|
| 198 |
+
* @ingroup reading_masks
|
| 199 |
+
* @brief Samples \ref DDS_READ_SAMPLE_STATE or \ref DDS_NOT_READ_SAMPLE_STATE
|
| 200 |
+
*/
|
| 201 |
+
#define DDS_ANY_SAMPLE_STATE (1u | 2u)
|
| 202 |
+
|
| 203 |
+
|
| 204 |
+
/**
|
| 205 |
+
* @anchor DDS_NEW_VIEW_STATE
|
| 206 |
+
* @ingroup reading_masks
|
| 207 |
+
* @brief Samples that belong to a new instance (unique key value)
|
| 208 |
+
*/
|
| 209 |
+
#define DDS_NEW_VIEW_STATE 4u
|
| 210 |
+
|
| 211 |
+
/**
|
| 212 |
+
* @anchor DDS_NOT_NEW_VIEW_STATE
|
| 213 |
+
* @ingroup reading_masks
|
| 214 |
+
* @brief Samples that belong to an existing instance (previously received key value)
|
| 215 |
+
*/
|
| 216 |
+
#define DDS_NOT_NEW_VIEW_STATE 8u
|
| 217 |
+
|
| 218 |
+
/**
|
| 219 |
+
* @anchor DDS_ANY_VIEW_STATE
|
| 220 |
+
* @ingroup reading_masks
|
| 221 |
+
* @brief Samples \ref DDS_NEW_VIEW_STATE or \ref DDS_NOT_NEW_VIEW_STATE
|
| 222 |
+
*/
|
| 223 |
+
#define DDS_ANY_VIEW_STATE (4u | 8u)
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
/**
|
| 227 |
+
* @anchor DDS_ALIVE_INSTANCE_STATE
|
| 228 |
+
* @ingroup reading_masks
|
| 229 |
+
* @brief Samples that belong to a write
|
| 230 |
+
*/
|
| 231 |
+
#define DDS_ALIVE_INSTANCE_STATE 16u
|
| 232 |
+
|
| 233 |
+
/**
|
| 234 |
+
* @anchor DDS_NOT_ALIVE_DISPOSED_INSTANCE_STATE
|
| 235 |
+
* @ingroup reading_masks
|
| 236 |
+
* @brief Samples that belong to a (write)dispose
|
| 237 |
+
*/
|
| 238 |
+
#define DDS_NOT_ALIVE_DISPOSED_INSTANCE_STATE 32u
|
| 239 |
+
|
| 240 |
+
/**
|
| 241 |
+
* @anchor DDS_NOT_ALIVE_NO_WRITERS_INSTANCE_STATE
|
| 242 |
+
* @ingroup reading_masks
|
| 243 |
+
* @brief Samples that belong a writer that is gone
|
| 244 |
+
*/
|
| 245 |
+
#define DDS_NOT_ALIVE_NO_WRITERS_INSTANCE_STATE 64u
|
| 246 |
+
|
| 247 |
+
/**
|
| 248 |
+
* @anchor DDS_ANY_INSTANCE_STATE
|
| 249 |
+
* @ingroup reading_masks
|
| 250 |
+
* @brief Samples \ref DDS_ALIVE_INSTANCE_STATE, \ref DDS_NOT_ALIVE_DISPOSED_INSTANCE_STATE or \ref DDS_NOT_ALIVE_NO_WRITERS_INSTANCE_STATE
|
| 251 |
+
*/
|
| 252 |
+
#define DDS_ANY_INSTANCE_STATE (16u | 32u | 64u)
|
| 253 |
+
|
| 254 |
+
/**
|
| 255 |
+
* @anchor DDS_ANY_STATE
|
| 256 |
+
* @ingroup reading_masks
|
| 257 |
+
* @brief Any and all samples
|
| 258 |
+
* Equivalen to \ref DDS_ANY_SAMPLE_STATE | \ref DDS_ANY_VIEW_STATE | \ref DDS_ANY_INSTANCE_STATE
|
| 259 |
+
*/
|
| 260 |
+
#define DDS_ANY_STATE (DDS_ANY_SAMPLE_STATE | DDS_ANY_VIEW_STATE | DDS_ANY_INSTANCE_STATE)
|
| 261 |
+
|
| 262 |
+
/**
|
| 263 |
+
* @anchor DDS_DOMAIN_DEFAULT
|
| 264 |
+
* @ingroup domain
|
| 265 |
+
* @brief Select the default domain
|
| 266 |
+
*/
|
| 267 |
+
#define DDS_DOMAIN_DEFAULT ((uint32_t) 0xffffffffu)
|
| 268 |
+
|
| 269 |
+
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
| 270 |
+
#define DDS_HANDLE_NIL 0
|
| 271 |
+
#define DDS_ENTITY_NIL 0
|
| 272 |
+
#endif
|
| 273 |
+
|
| 274 |
+
/**
|
| 275 |
+
* @brief DDS Entity Kind constants
|
| 276 |
+
* @ingroup internal
|
| 277 |
+
* @warning Unstable/Private API
|
| 278 |
+
* Used throughout the library to indicate what entity is what.
|
| 279 |
+
*/
|
| 280 |
+
typedef enum dds_entity_kind
|
| 281 |
+
{
|
| 282 |
+
DDS_KIND_DONTCARE, /**< Retrieving any entity */
|
| 283 |
+
DDS_KIND_TOPIC, /**< Topic entity */
|
| 284 |
+
DDS_KIND_PARTICIPANT, /**< Domain Participant entity */
|
| 285 |
+
DDS_KIND_READER, /**< Reader entity */
|
| 286 |
+
DDS_KIND_WRITER, /**< Writer entity */
|
| 287 |
+
DDS_KIND_SUBSCRIBER, /**< Subscriber entity */
|
| 288 |
+
DDS_KIND_PUBLISHER, /**< Publisher entity */
|
| 289 |
+
DDS_KIND_COND_READ, /**< ReadCondition entity */
|
| 290 |
+
DDS_KIND_COND_QUERY, /**< QueryCondition entity */
|
| 291 |
+
DDS_KIND_COND_GUARD, /**< GuardCondition entity */
|
| 292 |
+
DDS_KIND_WAITSET, /**< WaitSet entity */
|
| 293 |
+
DDS_KIND_DOMAIN, /**< Domain entity */
|
| 294 |
+
DDS_KIND_CYCLONEDDS /**< CycloneDDS library entity */
|
| 295 |
+
} dds_entity_kind_t;
|
| 296 |
+
/**
|
| 297 |
+
* @anchor DDS_KIND_MAX
|
| 298 |
+
* @ingroup internal
|
| 299 |
+
* @brief Max entity kind, used for loops.
|
| 300 |
+
*/
|
| 301 |
+
#define DDS_KIND_MAX DDS_KIND_CYCLONEDDS
|
| 302 |
+
|
| 303 |
+
/**
|
| 304 |
+
* @ingroup internal
|
| 305 |
+
* @warning Private API
|
| 306 |
+
* @brief Instance handles are uint64_t behind the scenes
|
| 307 |
+
*/
|
| 308 |
+
typedef uint64_t dds_instance_handle_t;
|
| 309 |
+
|
| 310 |
+
/**
|
| 311 |
+
* @ingroup domain
|
| 312 |
+
* @brief Domain IDs are 32 bit unsigned integers.
|
| 313 |
+
*/
|
| 314 |
+
typedef uint32_t dds_domainid_t;
|
| 315 |
+
|
| 316 |
+
/**
|
| 317 |
+
* @ingroup topic
|
| 318 |
+
* @brief Scope for dds_find_topic()
|
| 319 |
+
*/
|
| 320 |
+
typedef enum dds_find_scope
|
| 321 |
+
{
|
| 322 |
+
DDS_FIND_SCOPE_GLOBAL, /**< locate the topic anywhere CycloneDDS knows about */
|
| 323 |
+
DDS_FIND_SCOPE_LOCAL_DOMAIN, /**< locate the topic locally within domain boundaries */
|
| 324 |
+
DDS_FIND_SCOPE_PARTICIPANT /**< locate the topic within the current participant */
|
| 325 |
+
}
|
| 326 |
+
dds_find_scope_t;
|
| 327 |
+
|
| 328 |
+
/**
|
| 329 |
+
* @ingroup builtintopic
|
| 330 |
+
* @brief Type identifier kind for getting endpoint type identifier
|
| 331 |
+
*/
|
| 332 |
+
typedef enum dds_typeid_kind
|
| 333 |
+
{
|
| 334 |
+
DDS_TYPEID_MINIMAL, /**< XTypes Minimal Type ID */
|
| 335 |
+
DDS_TYPEID_COMPLETE /**< XTypes Complete Type ID */
|
| 336 |
+
}
|
| 337 |
+
dds_typeid_kind_t;
|
| 338 |
+
|
| 339 |
+
/**
|
| 340 |
+
* @brief Enable or disable write batching.
|
| 341 |
+
* Overrides default configuration setting for write batching (Internal/WriteBatch).
|
| 342 |
+
*
|
| 343 |
+
* @param[in] enable Enables or disables write batching for all writers.
|
| 344 |
+
*/
|
| 345 |
+
DDS_EXPORT void dds_write_set_batch (bool enable);
|
| 346 |
+
|
| 347 |
+
#if defined (__cplusplus)
|
| 348 |
+
}
|
| 349 |
+
#endif
|
| 350 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_listener.h
ADDED
|
@@ -0,0 +1,813 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* @defgroup listener (Listener API)
|
| 15 |
+
* @ingroup dds
|
| 16 |
+
*
|
| 17 |
+
* This defines the public API of listeners in the
|
| 18 |
+
* Eclipse Cyclone DDS C language binding.
|
| 19 |
+
*/
|
| 20 |
+
#ifndef _DDS_PUBLIC_LISTENER_H_
|
| 21 |
+
#define _DDS_PUBLIC_LISTENER_H_
|
| 22 |
+
|
| 23 |
+
#include "dds/export.h"
|
| 24 |
+
#include "dds/ddsc/dds_public_impl.h"
|
| 25 |
+
#include "dds/ddsc/dds_public_status.h"
|
| 26 |
+
|
| 27 |
+
#if defined (__cplusplus)
|
| 28 |
+
extern "C" {
|
| 29 |
+
#endif
|
| 30 |
+
|
| 31 |
+
/* Listener callbacks */
|
| 32 |
+
typedef void (*dds_on_inconsistent_topic_fn) (dds_entity_t topic, const dds_inconsistent_topic_status_t status, void* arg);
|
| 33 |
+
typedef void (*dds_on_liveliness_lost_fn) (dds_entity_t writer, const dds_liveliness_lost_status_t status, void* arg);
|
| 34 |
+
typedef void (*dds_on_offered_deadline_missed_fn) (dds_entity_t writer, const dds_offered_deadline_missed_status_t status, void* arg);
|
| 35 |
+
typedef void (*dds_on_offered_incompatible_qos_fn) (dds_entity_t writer, const dds_offered_incompatible_qos_status_t status, void* arg);
|
| 36 |
+
typedef void (*dds_on_data_on_readers_fn) (dds_entity_t subscriber, void* arg);
|
| 37 |
+
typedef void (*dds_on_sample_lost_fn) (dds_entity_t reader, const dds_sample_lost_status_t status, void* arg);
|
| 38 |
+
typedef void (*dds_on_data_available_fn) (dds_entity_t reader, void* arg);
|
| 39 |
+
typedef void (*dds_on_sample_rejected_fn) (dds_entity_t reader, const dds_sample_rejected_status_t status, void* arg);
|
| 40 |
+
typedef void (*dds_on_liveliness_changed_fn) (dds_entity_t reader, const dds_liveliness_changed_status_t status, void* arg);
|
| 41 |
+
typedef void (*dds_on_requested_deadline_missed_fn) (dds_entity_t reader, const dds_requested_deadline_missed_status_t status, void* arg);
|
| 42 |
+
typedef void (*dds_on_requested_incompatible_qos_fn) (dds_entity_t reader, const dds_requested_incompatible_qos_status_t status, void* arg);
|
| 43 |
+
typedef void (*dds_on_publication_matched_fn) (dds_entity_t writer, const dds_publication_matched_status_t status, void* arg);
|
| 44 |
+
typedef void (*dds_on_subscription_matched_fn) (dds_entity_t reader, const dds_subscription_matched_status_t status, void* arg);
|
| 45 |
+
|
| 46 |
+
/**
|
| 47 |
+
* @anchor DDS_LUNSET
|
| 48 |
+
* @ingroup internal
|
| 49 |
+
* @brief Default initial value (nullptr) for listener functions.
|
| 50 |
+
*/
|
| 51 |
+
#define DDS_LUNSET 0
|
| 52 |
+
|
| 53 |
+
/**
|
| 54 |
+
* @brief DDS Listener struct (opaque)
|
| 55 |
+
* @ingroup listener
|
| 56 |
+
*/
|
| 57 |
+
struct dds_listener;
|
| 58 |
+
|
| 59 |
+
/**
|
| 60 |
+
* @brief DDS Listener type (opaque)
|
| 61 |
+
* @ingroup listener
|
| 62 |
+
*/
|
| 63 |
+
typedef struct dds_listener dds_listener_t;
|
| 64 |
+
|
| 65 |
+
/**
|
| 66 |
+
* @ingroup listener
|
| 67 |
+
* @brief Allocate memory and initializes to default values (@ref DDS_LUNSET) of a listener
|
| 68 |
+
*
|
| 69 |
+
* @param[in] arg optional pointer that will be passed on to the listener callbacks
|
| 70 |
+
*
|
| 71 |
+
* @returns Returns a pointer to the allocated memory for dds_listener_t structure.
|
| 72 |
+
*/
|
| 73 |
+
DDS_EXPORT dds_listener_t* dds_create_listener(void* arg);
|
| 74 |
+
|
| 75 |
+
/**
|
| 76 |
+
* @ingroup deprecated
|
| 77 |
+
* @deprecated use \ref dds_create_listener instead.
|
| 78 |
+
* Allocate memory and initializes to default values (@ref DDS_LUNSET) of a listener
|
| 79 |
+
*
|
| 80 |
+
* @param[in] arg optional pointer that will be passed on to the listener callbacks
|
| 81 |
+
*
|
| 82 |
+
* @return Returns a pointer to the allocated memory for dds_listener_t structure.
|
| 83 |
+
*/
|
| 84 |
+
DDS_DEPRECATED_EXPORT dds_listener_t* dds_listener_create (void* arg);
|
| 85 |
+
|
| 86 |
+
/**
|
| 87 |
+
* @ingroup listener
|
| 88 |
+
* @brief Delete the memory allocated to listener structure
|
| 89 |
+
*
|
| 90 |
+
* @param[in] listener pointer to the listener struct to delete
|
| 91 |
+
*/
|
| 92 |
+
DDS_EXPORT void dds_delete_listener (dds_listener_t * __restrict listener);
|
| 93 |
+
DDS_DEPRECATED_EXPORT void dds_listener_delete (dds_listener_t * __restrict listener);
|
| 94 |
+
|
| 95 |
+
/**
|
| 96 |
+
* @ingroup listener
|
| 97 |
+
* @brief Reset the listener structure contents to @ref DDS_LUNSET
|
| 98 |
+
*
|
| 99 |
+
* @param[in,out] listener pointer to the listener struct to reset
|
| 100 |
+
*/
|
| 101 |
+
DDS_EXPORT void dds_reset_listener (dds_listener_t * __restrict listener);
|
| 102 |
+
DDS_DEPRECATED_EXPORT void dds_listener_reset (dds_listener_t * __restrict listener);
|
| 103 |
+
|
| 104 |
+
/**
|
| 105 |
+
* @ingroup listener
|
| 106 |
+
* @brief Copy the listener callbacks from source to destination
|
| 107 |
+
*
|
| 108 |
+
* @param[in,out] dst The pointer to the destination listener structure, where the content is to copied
|
| 109 |
+
* @param[in] src The pointer to the source listener structure to be copied
|
| 110 |
+
*/
|
| 111 |
+
DDS_EXPORT void dds_copy_listener (dds_listener_t * __restrict dst, const dds_listener_t * __restrict src);
|
| 112 |
+
DDS_DEPRECATED_EXPORT void dds_listener_copy (dds_listener_t * __restrict dst, const dds_listener_t * __restrict src);
|
| 113 |
+
|
| 114 |
+
/**
|
| 115 |
+
* @ingroup listener
|
| 116 |
+
* @brief Copy the listener callbacks from source to destination, unless already set
|
| 117 |
+
*
|
| 118 |
+
* Any listener callbacks already set in @p dst (including NULL) are skipped, only
|
| 119 |
+
* those set to DDS_LUNSET are copied from @p src.
|
| 120 |
+
*
|
| 121 |
+
* @param[in,out] dst The pointer to the destination listener structure, where the content is merged
|
| 122 |
+
* @param[in] src The pointer to the source listener structure to be copied
|
| 123 |
+
*/
|
| 124 |
+
DDS_EXPORT void dds_merge_listener (dds_listener_t * __restrict dst, const dds_listener_t * __restrict src);
|
| 125 |
+
DDS_DEPRECATED_EXPORT void dds_listener_merge (dds_listener_t * __restrict dst, const dds_listener_t * __restrict src);
|
| 126 |
+
|
| 127 |
+
/************************************************************************************************
|
| 128 |
+
* Setters
|
| 129 |
+
************************************************************************************************/
|
| 130 |
+
|
| 131 |
+
/**
|
| 132 |
+
* @defgroup listener_setters (Setters)
|
| 133 |
+
* @ingroup listener
|
| 134 |
+
*/
|
| 135 |
+
|
| 136 |
+
/**
|
| 137 |
+
* @ingroup listener_setters
|
| 138 |
+
* @brief Set the data_available callback and argument in the listener structure.
|
| 139 |
+
*
|
| 140 |
+
* @param[in,out] listener listener structure to update
|
| 141 |
+
* @param[in] callback the callback to set or a null pointer
|
| 142 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 143 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 144 |
+
*
|
| 145 |
+
* @retval DDS_RETCODE_OK success
|
| 146 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 147 |
+
*/
|
| 148 |
+
DDS_EXPORT dds_return_t dds_lset_data_available_arg (dds_listener_t * __restrict listener, dds_on_data_available_fn callback, void *arg, bool reset_on_invoke);
|
| 149 |
+
|
| 150 |
+
/**
|
| 151 |
+
* @ingroup listener_setters
|
| 152 |
+
* @brief Set the data_on_readers callback and argument in the listener structure.
|
| 153 |
+
*
|
| 154 |
+
* @param[in,out] listener listener structure to update
|
| 155 |
+
* @param[in] callback the callback to set or a null pointer
|
| 156 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 157 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 158 |
+
*
|
| 159 |
+
* @retval DDS_RETCODE_OK success
|
| 160 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 161 |
+
*/
|
| 162 |
+
DDS_EXPORT dds_return_t dds_lset_data_on_readers_arg (dds_listener_t * __restrict listener, dds_on_data_on_readers_fn callback, void *arg, bool reset_on_invoke);
|
| 163 |
+
|
| 164 |
+
/**
|
| 165 |
+
* @ingroup listener_setters
|
| 166 |
+
* @brief Set the inconsistent_topic callback and argument in the listener structure.
|
| 167 |
+
*
|
| 168 |
+
* @param[in,out] listener listener structure to update
|
| 169 |
+
* @param[in] callback the callback to set or a null pointer
|
| 170 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 171 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 172 |
+
*
|
| 173 |
+
* @retval DDS_RETCODE_OK success
|
| 174 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 175 |
+
*/
|
| 176 |
+
DDS_EXPORT dds_return_t dds_lset_inconsistent_topic_arg (dds_listener_t * __restrict listener, dds_on_inconsistent_topic_fn callback, void *arg, bool reset_on_invoke);
|
| 177 |
+
|
| 178 |
+
/**
|
| 179 |
+
* @ingroup listener_setters
|
| 180 |
+
* @brief Set the liveliness_changed callback and argument in the listener structure.
|
| 181 |
+
*
|
| 182 |
+
* @param[in,out] listener listener structure to update
|
| 183 |
+
* @param[in] callback the callback to set or a null pointer
|
| 184 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 185 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 186 |
+
*
|
| 187 |
+
* @retval DDS_RETCODE_OK success
|
| 188 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 189 |
+
*/
|
| 190 |
+
DDS_EXPORT dds_return_t dds_lset_liveliness_changed_arg (dds_listener_t * __restrict listener, dds_on_liveliness_changed_fn callback, void *arg, bool reset_on_invoke);
|
| 191 |
+
|
| 192 |
+
/**
|
| 193 |
+
* @ingroup listener_setters
|
| 194 |
+
* @brief Set the liveliness_lost callback and argument in the listener structure.
|
| 195 |
+
*
|
| 196 |
+
* @param[in,out] listener listener structure to update
|
| 197 |
+
* @param[in] callback the callback to set or a null pointer
|
| 198 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 199 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 200 |
+
*
|
| 201 |
+
* @retval DDS_RETCODE_OK success
|
| 202 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 203 |
+
*/
|
| 204 |
+
DDS_EXPORT dds_return_t dds_lset_liveliness_lost_arg (dds_listener_t * __restrict listener, dds_on_liveliness_lost_fn callback, void *arg, bool reset_on_invoke);
|
| 205 |
+
|
| 206 |
+
/**
|
| 207 |
+
* @ingroup listener_setters
|
| 208 |
+
* @brief Set the offered_deadline_missed callback and argument in the listener structure.
|
| 209 |
+
*
|
| 210 |
+
* @param[in,out] listener listener structure to update
|
| 211 |
+
* @param[in] callback the callback to set or a null pointer
|
| 212 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 213 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 214 |
+
*
|
| 215 |
+
* @retval DDS_RETCODE_OK success
|
| 216 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 217 |
+
*/
|
| 218 |
+
DDS_EXPORT dds_return_t dds_lset_offered_deadline_missed_arg (dds_listener_t * __restrict listener, dds_on_offered_deadline_missed_fn callback, void *arg, bool reset_on_invoke);
|
| 219 |
+
|
| 220 |
+
/**
|
| 221 |
+
* @ingroup listener_setters
|
| 222 |
+
* @brief Set the offered_incompatible_qos callback and argument in the listener structure.
|
| 223 |
+
*
|
| 224 |
+
* @param[in,out] listener listener structure to update
|
| 225 |
+
* @param[in] callback the callback to set or a null pointer
|
| 226 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 227 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 228 |
+
*
|
| 229 |
+
* @retval DDS_RETCODE_OK success
|
| 230 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 231 |
+
*/
|
| 232 |
+
DDS_EXPORT dds_return_t dds_lset_offered_incompatible_qos_arg (dds_listener_t * __restrict listener, dds_on_offered_incompatible_qos_fn callback, void *arg, bool reset_on_invoke);
|
| 233 |
+
|
| 234 |
+
/**
|
| 235 |
+
* @ingroup listener_setters
|
| 236 |
+
* @brief Set the publication_matched callback and argument in the listener structure.
|
| 237 |
+
*
|
| 238 |
+
* @param[in,out] listener listener structure to update
|
| 239 |
+
* @param[in] callback the callback to set or a null pointer
|
| 240 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 241 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 242 |
+
*
|
| 243 |
+
* @retval DDS_RETCODE_OK success
|
| 244 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 245 |
+
*/
|
| 246 |
+
DDS_EXPORT dds_return_t dds_lset_publication_matched_arg (dds_listener_t * __restrict listener, dds_on_publication_matched_fn callback, void *arg, bool reset_on_invoke);
|
| 247 |
+
|
| 248 |
+
/**
|
| 249 |
+
* @ingroup listener_setters
|
| 250 |
+
* @brief Set the requested_deadline_missed callback and argument in the listener structure.
|
| 251 |
+
*
|
| 252 |
+
* @param[in,out] listener listener structure to update
|
| 253 |
+
* @param[in] callback the callback to set or a null pointer
|
| 254 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 255 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 256 |
+
*
|
| 257 |
+
* @retval DDS_RETCODE_OK success
|
| 258 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 259 |
+
*/
|
| 260 |
+
DDS_EXPORT dds_return_t dds_lset_requested_deadline_missed_arg (dds_listener_t * __restrict listener, dds_on_requested_deadline_missed_fn callback, void *arg, bool reset_on_invoke);
|
| 261 |
+
|
| 262 |
+
/**
|
| 263 |
+
* @ingroup listener_setters
|
| 264 |
+
* @brief Set the requested_incompatible_qos callback and argument in the listener structure.
|
| 265 |
+
*
|
| 266 |
+
* @param[in,out] listener listener structure to update
|
| 267 |
+
* @param[in] callback the callback to set or a null pointer
|
| 268 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 269 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 270 |
+
*
|
| 271 |
+
* @retval DDS_RETCODE_OK success
|
| 272 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 273 |
+
*/
|
| 274 |
+
DDS_EXPORT dds_return_t dds_lset_requested_incompatible_qos_arg (dds_listener_t * __restrict listener, dds_on_requested_incompatible_qos_fn callback, void *arg, bool reset_on_invoke);
|
| 275 |
+
|
| 276 |
+
/**
|
| 277 |
+
* @ingroup listener_setters
|
| 278 |
+
* @brief Set the sample_lost callback and argument in the listener structure.
|
| 279 |
+
*
|
| 280 |
+
* @param[in,out] listener listener structure to update
|
| 281 |
+
* @param[in] callback the callback to set or a null pointer
|
| 282 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 283 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 284 |
+
*
|
| 285 |
+
* @retval DDS_RETCODE_OK success
|
| 286 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 287 |
+
*/
|
| 288 |
+
DDS_EXPORT dds_return_t dds_lset_sample_lost_arg (dds_listener_t * __restrict listener, dds_on_sample_lost_fn callback, void *arg, bool reset_on_invoke);
|
| 289 |
+
|
| 290 |
+
/**
|
| 291 |
+
* @ingroup listener_setters
|
| 292 |
+
* @brief Set the sample_rejected callback and argument in the listener structure.
|
| 293 |
+
*
|
| 294 |
+
* @param[in,out] listener listener structure to update
|
| 295 |
+
* @param[in] callback the callback to set or a null pointer
|
| 296 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 297 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 298 |
+
*
|
| 299 |
+
* @retval DDS_RETCODE_OK success
|
| 300 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 301 |
+
*/
|
| 302 |
+
DDS_EXPORT dds_return_t dds_lset_sample_rejected_arg (dds_listener_t * __restrict listener, dds_on_sample_rejected_fn callback, void *arg, bool reset_on_invoke);
|
| 303 |
+
|
| 304 |
+
/**
|
| 305 |
+
* @ingroup listener_setters
|
| 306 |
+
* @brief Set the subscription_matched callback and argument in the listener structure.
|
| 307 |
+
*
|
| 308 |
+
* @param[in,out] listener listener structure to update
|
| 309 |
+
* @param[in] callback the callback to set or a null pointer
|
| 310 |
+
* @param[in] arg callback argument that is passed uninterpreted to the callback function
|
| 311 |
+
* @param[in] reset_on_invoke whether or not the status should be cleared when the listener callback is invoked
|
| 312 |
+
*
|
| 313 |
+
* @retval DDS_RETCODE_OK success
|
| 314 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 315 |
+
*/
|
| 316 |
+
DDS_EXPORT dds_return_t dds_lset_subscription_matched_arg (dds_listener_t * __restrict listener, dds_on_subscription_matched_fn callback, void *arg, bool reset_on_invoke);
|
| 317 |
+
|
| 318 |
+
/**
|
| 319 |
+
* @ingroup listener_setters
|
| 320 |
+
* @brief Set the inconsistent_topic callback in the listener structure.
|
| 321 |
+
*
|
| 322 |
+
* Equivalent to calling @ref dds_lset_inconsistent_topic_arg with arg set to the argument passed in
|
| 323 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 324 |
+
*
|
| 325 |
+
* @param[in,out] listener listener structure to update
|
| 326 |
+
* @param[in] callback the callback to set or a null pointer
|
| 327 |
+
*/
|
| 328 |
+
DDS_EXPORT void dds_lset_inconsistent_topic (dds_listener_t * __restrict listener, dds_on_inconsistent_topic_fn callback);
|
| 329 |
+
|
| 330 |
+
/**
|
| 331 |
+
* @ingroup listener_setters
|
| 332 |
+
* @brief Set the liveliness_lost callback in the listener structure.
|
| 333 |
+
*
|
| 334 |
+
* Equivalent to calling @ref dds_lset_liveliness_lost_arg with arg set to the argument passed in
|
| 335 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 336 |
+
*
|
| 337 |
+
* @param[in,out] listener listener structure to update
|
| 338 |
+
* @param[in] callback the callback to set or a null pointer
|
| 339 |
+
*/
|
| 340 |
+
DDS_EXPORT void dds_lset_liveliness_lost (dds_listener_t * __restrict listener, dds_on_liveliness_lost_fn callback);
|
| 341 |
+
|
| 342 |
+
/**
|
| 343 |
+
* @ingroup listener_setters
|
| 344 |
+
* @brief Set the offered_deadline_missed callback in the listener structure.
|
| 345 |
+
*
|
| 346 |
+
* Equivalent to calling @ref dds_lset_offered_deadline_missed_arg with arg set to the argument passed in
|
| 347 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 348 |
+
*
|
| 349 |
+
* @param[in,out] listener listener structure to update
|
| 350 |
+
* @param[in] callback the callback to set or a null pointer
|
| 351 |
+
*/
|
| 352 |
+
DDS_EXPORT void dds_lset_offered_deadline_missed (dds_listener_t * __restrict listener, dds_on_offered_deadline_missed_fn callback);
|
| 353 |
+
|
| 354 |
+
/**
|
| 355 |
+
* @ingroup listener_setters
|
| 356 |
+
* @brief Set the offered_incompatible_qos callback in the listener structure.
|
| 357 |
+
*
|
| 358 |
+
* Equivalent to calling @ref dds_lset_offered_incompatible_qos_arg with arg set to the argument passed in
|
| 359 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 360 |
+
*
|
| 361 |
+
* @param[in,out] listener listener structure to update
|
| 362 |
+
* @param[in] callback the callback to set or a null pointer
|
| 363 |
+
*/
|
| 364 |
+
DDS_EXPORT void dds_lset_offered_incompatible_qos (dds_listener_t * __restrict listener, dds_on_offered_incompatible_qos_fn callback);
|
| 365 |
+
|
| 366 |
+
/**
|
| 367 |
+
* @ingroup listener_setters
|
| 368 |
+
* @brief Set the data_on_readers callback in the listener structure.
|
| 369 |
+
*
|
| 370 |
+
* Equivalent to calling @ref dds_lset_data_on_readers_arg with arg set to the argument passed in
|
| 371 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 372 |
+
*
|
| 373 |
+
* @param[in,out] listener listener structure to update
|
| 374 |
+
* @param[in] callback the callback to set or a null pointer
|
| 375 |
+
*/
|
| 376 |
+
DDS_EXPORT void dds_lset_data_on_readers (dds_listener_t * __restrict listener, dds_on_data_on_readers_fn callback);
|
| 377 |
+
|
| 378 |
+
/**
|
| 379 |
+
* @ingroup listener_setters
|
| 380 |
+
* @brief Set the sample_lost callback in the listener structure.
|
| 381 |
+
*
|
| 382 |
+
* Equivalent to calling @ref dds_lset_sample_lost_arg with arg set to the argument passed in
|
| 383 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 384 |
+
*
|
| 385 |
+
* @param[in,out] listener listener structure to update
|
| 386 |
+
* @param[in] callback the callback to set or a null pointer
|
| 387 |
+
*/
|
| 388 |
+
DDS_EXPORT void dds_lset_sample_lost (dds_listener_t * __restrict listener, dds_on_sample_lost_fn callback);
|
| 389 |
+
|
| 390 |
+
/**
|
| 391 |
+
* @ingroup listener_setters
|
| 392 |
+
* @brief Set the data_available callback in the listener structure.
|
| 393 |
+
*
|
| 394 |
+
* Equivalent to calling @ref dds_lset_data_available_arg with arg set to the argument passed in
|
| 395 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 396 |
+
*
|
| 397 |
+
* @param[in,out] listener listener structure to update
|
| 398 |
+
* @param[in] callback the callback to set or a null pointer
|
| 399 |
+
*/
|
| 400 |
+
DDS_EXPORT void dds_lset_data_available (dds_listener_t * __restrict listener, dds_on_data_available_fn callback);
|
| 401 |
+
|
| 402 |
+
/**
|
| 403 |
+
* @ingroup listener_setters
|
| 404 |
+
* @brief Set the sample_rejected callback in the listener structure.
|
| 405 |
+
*
|
| 406 |
+
* Equivalent to calling @ref dds_lset_sample_rejected_arg with arg set to the argument passed in
|
| 407 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 408 |
+
*
|
| 409 |
+
* @param[in,out] listener listener structure to update
|
| 410 |
+
* @param[in] callback the callback to set or a null pointer
|
| 411 |
+
*/
|
| 412 |
+
DDS_EXPORT void dds_lset_sample_rejected (dds_listener_t * __restrict listener, dds_on_sample_rejected_fn callback);
|
| 413 |
+
|
| 414 |
+
/**
|
| 415 |
+
* @ingroup listener_setters
|
| 416 |
+
* @brief Set the liveliness_changed callback in the listener structure.
|
| 417 |
+
*
|
| 418 |
+
* Equivalent to calling @ref dds_lset_liveliness_changed_arg with arg set to the argument passed in
|
| 419 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 420 |
+
*
|
| 421 |
+
* @param[in,out] listener listener structure to update
|
| 422 |
+
* @param[in] callback the callback to set or a null pointer
|
| 423 |
+
*/
|
| 424 |
+
DDS_EXPORT void dds_lset_liveliness_changed (dds_listener_t * __restrict listener, dds_on_liveliness_changed_fn callback);
|
| 425 |
+
|
| 426 |
+
/**
|
| 427 |
+
* @ingroup listener_setters
|
| 428 |
+
* @brief Set the requested_deadline_missed callback in the listener structure.
|
| 429 |
+
*
|
| 430 |
+
* Equivalent to calling @ref dds_lset_requested_deadline_missed_arg with arg set to the argument passed in
|
| 431 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 432 |
+
*
|
| 433 |
+
* @param[in,out] listener listener structure to update
|
| 434 |
+
* @param[in] callback the callback to set or a null pointer
|
| 435 |
+
*/
|
| 436 |
+
DDS_EXPORT void dds_lset_requested_deadline_missed (dds_listener_t * __restrict listener, dds_on_requested_deadline_missed_fn callback);
|
| 437 |
+
|
| 438 |
+
/**
|
| 439 |
+
* @ingroup listener_setters
|
| 440 |
+
* @brief Set the requested_incompatible_qos callback in the listener structure.
|
| 441 |
+
*
|
| 442 |
+
* Equivalent to calling @ref dds_lset_requested_incompatible_qos_arg with arg set to the argument passed in
|
| 443 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 444 |
+
*
|
| 445 |
+
* @param[in,out] listener listener structure to update
|
| 446 |
+
* @param[in] callback the callback to set or a null pointer
|
| 447 |
+
*/
|
| 448 |
+
DDS_EXPORT void dds_lset_requested_incompatible_qos (dds_listener_t * __restrict listener, dds_on_requested_incompatible_qos_fn callback);
|
| 449 |
+
|
| 450 |
+
/**
|
| 451 |
+
* @ingroup listener_setters
|
| 452 |
+
* @brief Set the publication_matched callback in the listener structure.
|
| 453 |
+
*
|
| 454 |
+
* Equivalent to calling @ref dds_lset_publication_matched_arg with arg set to the argument passed in
|
| 455 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 456 |
+
*
|
| 457 |
+
* @param[in,out] listener listener structure to update
|
| 458 |
+
* @param[in] callback the callback to set or a null pointer
|
| 459 |
+
*/
|
| 460 |
+
DDS_EXPORT void dds_lset_publication_matched (dds_listener_t * __restrict listener, dds_on_publication_matched_fn callback);
|
| 461 |
+
|
| 462 |
+
/**
|
| 463 |
+
* @ingroup listener_setters
|
| 464 |
+
* @brief Set the subscription_matched callback in the listener structure.
|
| 465 |
+
*
|
| 466 |
+
* Equivalent to calling @ref dds_lset_subscription_matched_arg with arg set to the argument passed in
|
| 467 |
+
* dds_create_listener() and reset_on_invoke to true, and throwing away the result.
|
| 468 |
+
*
|
| 469 |
+
* @param[in,out] listener listener structure to update
|
| 470 |
+
* @param[in] callback the callback to set or a null pointer
|
| 471 |
+
*/
|
| 472 |
+
DDS_EXPORT void dds_lset_subscription_matched (dds_listener_t * __restrict listener, dds_on_subscription_matched_fn callback);
|
| 473 |
+
|
| 474 |
+
|
| 475 |
+
/************************************************************************************************
|
| 476 |
+
* Getters
|
| 477 |
+
************************************************************************************************/
|
| 478 |
+
|
| 479 |
+
/**
|
| 480 |
+
* @defgroup listener_getters (Getters)
|
| 481 |
+
* @ingroup listener
|
| 482 |
+
*/
|
| 483 |
+
|
| 484 |
+
/**
|
| 485 |
+
* @ingroup listener_getters
|
| 486 |
+
* @brief Get the data_available callback from the listener structure.
|
| 487 |
+
*
|
| 488 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 489 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 490 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 491 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 492 |
+
*
|
| 493 |
+
* @retval DDS_RETCODE_OK if successful
|
| 494 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 495 |
+
*/
|
| 496 |
+
DDS_EXPORT dds_return_t dds_lget_data_available_arg (const dds_listener_t * __restrict listener, dds_on_data_available_fn *callback, void **arg, bool *reset_on_invoke);
|
| 497 |
+
|
| 498 |
+
/**
|
| 499 |
+
* @ingroup listener_getters
|
| 500 |
+
* @brief Get the data_on_readers callback from the listener structure.
|
| 501 |
+
*
|
| 502 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 503 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 504 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 505 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 506 |
+
*
|
| 507 |
+
* @retval DDS_RETCODE_OK if successful
|
| 508 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 509 |
+
*/
|
| 510 |
+
DDS_EXPORT dds_return_t dds_lget_data_on_readers_arg (const dds_listener_t * __restrict listener, dds_on_data_on_readers_fn *callback, void **arg, bool *reset_on_invoke);
|
| 511 |
+
|
| 512 |
+
/**
|
| 513 |
+
* @ingroup listener_getters
|
| 514 |
+
* @brief Get the inconsistent_topic callback from the listener structure.
|
| 515 |
+
*
|
| 516 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 517 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 518 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 519 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 520 |
+
*
|
| 521 |
+
* @retval DDS_RETCODE_OK if successful
|
| 522 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 523 |
+
*/
|
| 524 |
+
DDS_EXPORT dds_return_t dds_lget_inconsistent_topic_arg (const dds_listener_t * __restrict listener, dds_on_inconsistent_topic_fn *callback, void **arg, bool *reset_on_invoke);
|
| 525 |
+
|
| 526 |
+
/**
|
| 527 |
+
* @ingroup listener_getters
|
| 528 |
+
* @brief Get the liveliness_changed callback from the listener structure.
|
| 529 |
+
*
|
| 530 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 531 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 532 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 533 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 534 |
+
*
|
| 535 |
+
* @retval DDS_RETCODE_OK if successful
|
| 536 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 537 |
+
*/
|
| 538 |
+
DDS_EXPORT dds_return_t dds_lget_liveliness_changed_arg (const dds_listener_t * __restrict listener, dds_on_liveliness_changed_fn *callback, void **arg, bool *reset_on_invoke);
|
| 539 |
+
|
| 540 |
+
/**
|
| 541 |
+
* @ingroup listener_getters
|
| 542 |
+
* @brief Get the liveliness_lost callback from the listener structure.
|
| 543 |
+
*
|
| 544 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 545 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 546 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 547 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 548 |
+
*
|
| 549 |
+
* @retval DDS_RETCODE_OK if successful
|
| 550 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 551 |
+
*/
|
| 552 |
+
DDS_EXPORT dds_return_t dds_lget_liveliness_lost_arg (const dds_listener_t * __restrict listener, dds_on_liveliness_lost_fn *callback, void **arg, bool *reset_on_invoke);
|
| 553 |
+
|
| 554 |
+
/**
|
| 555 |
+
* @ingroup listener_getters
|
| 556 |
+
* @brief Get the offered_deadline_missed callback from the listener structure.
|
| 557 |
+
*
|
| 558 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 559 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 560 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 561 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 562 |
+
*
|
| 563 |
+
* @retval DDS_RETCODE_OK if successful
|
| 564 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 565 |
+
*/
|
| 566 |
+
DDS_EXPORT dds_return_t dds_lget_offered_deadline_missed_arg (const dds_listener_t * __restrict listener, dds_on_offered_deadline_missed_fn *callback, void **arg, bool *reset_on_invoke);
|
| 567 |
+
|
| 568 |
+
/**
|
| 569 |
+
* @ingroup listener_getters
|
| 570 |
+
* @brief Get the offered_incompatible_qos callback from the listener structure.
|
| 571 |
+
*
|
| 572 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 573 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 574 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 575 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 576 |
+
*
|
| 577 |
+
* @retval DDS_RETCODE_OK if successful
|
| 578 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 579 |
+
*/
|
| 580 |
+
DDS_EXPORT dds_return_t dds_lget_offered_incompatible_qos_arg (const dds_listener_t * __restrict listener, dds_on_offered_incompatible_qos_fn *callback, void **arg, bool *reset_on_invoke);
|
| 581 |
+
|
| 582 |
+
/**
|
| 583 |
+
* @ingroup listener_getters
|
| 584 |
+
* @brief Get the publication_matched callback from the listener structure.
|
| 585 |
+
*
|
| 586 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 587 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 588 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 589 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 590 |
+
*
|
| 591 |
+
* @retval DDS_RETCODE_OK if successful
|
| 592 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 593 |
+
*/
|
| 594 |
+
DDS_EXPORT dds_return_t dds_lget_publication_matched_arg (const dds_listener_t * __restrict listener, dds_on_publication_matched_fn *callback, void **arg, bool *reset_on_invoke);
|
| 595 |
+
|
| 596 |
+
/**
|
| 597 |
+
* @ingroup listener_getters
|
| 598 |
+
* @brief Get the subscription_matched callback from the listener structure.
|
| 599 |
+
*
|
| 600 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 601 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 602 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 603 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 604 |
+
*
|
| 605 |
+
* @retval DDS_RETCODE_OK if successful
|
| 606 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 607 |
+
*/
|
| 608 |
+
DDS_EXPORT dds_return_t dds_lget_requested_deadline_missed_arg (const dds_listener_t * __restrict listener, dds_on_requested_deadline_missed_fn *callback, void **arg, bool *reset_on_invoke);
|
| 609 |
+
|
| 610 |
+
/**
|
| 611 |
+
* @ingroup listener_getters
|
| 612 |
+
* @brief Get the requested_incompatible_qos callback from the listener structure.
|
| 613 |
+
*
|
| 614 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 615 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 616 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 617 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 618 |
+
*
|
| 619 |
+
* @retval DDS_RETCODE_OK if successful
|
| 620 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 621 |
+
*/
|
| 622 |
+
DDS_EXPORT dds_return_t dds_lget_requested_incompatible_qos_arg (const dds_listener_t * __restrict listener, dds_on_requested_incompatible_qos_fn *callback, void **arg, bool *reset_on_invoke);
|
| 623 |
+
|
| 624 |
+
/**
|
| 625 |
+
* @ingroup listener_getters
|
| 626 |
+
* @brief Get the sample_lost callback from the listener structure.
|
| 627 |
+
*
|
| 628 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 629 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 630 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 631 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 632 |
+
*
|
| 633 |
+
* @retval DDS_RETCODE_OK if successful
|
| 634 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 635 |
+
*/
|
| 636 |
+
DDS_EXPORT dds_return_t dds_lget_sample_lost_arg (const dds_listener_t * __restrict listener, dds_on_sample_lost_fn *callback, void **arg, bool *reset_on_invoke);
|
| 637 |
+
|
| 638 |
+
/**
|
| 639 |
+
* @ingroup listener_getters
|
| 640 |
+
* @brief Get the sample_rejected callback from the listener structure.
|
| 641 |
+
*
|
| 642 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 643 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 644 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 645 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 646 |
+
*
|
| 647 |
+
* @retval DDS_RETCODE_OK if successful
|
| 648 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 649 |
+
*/
|
| 650 |
+
DDS_EXPORT dds_return_t dds_lget_sample_rejected_arg (const dds_listener_t * __restrict listener, dds_on_sample_rejected_fn *callback, void **arg, bool *reset_on_invoke);
|
| 651 |
+
|
| 652 |
+
/**
|
| 653 |
+
* @ingroup listener_getters
|
| 654 |
+
* @brief Get the subscription_matched callback from the listener structure.
|
| 655 |
+
*
|
| 656 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 657 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 658 |
+
* @param[out] arg Callback argument pointer; may be a null pointer
|
| 659 |
+
* @param[out] reset_on_invoke Whether the status is reset by listener invocation; may be a null pointer
|
| 660 |
+
*
|
| 661 |
+
* @retval DDS_RETCODE_OK if successful
|
| 662 |
+
* @retval DDS_RETCODE_BAD_PARAMETER listener is a null pointer
|
| 663 |
+
*/
|
| 664 |
+
DDS_EXPORT dds_return_t dds_lget_subscription_matched_arg (const dds_listener_t * __restrict listener, dds_on_subscription_matched_fn *callback, void **arg, bool *reset_on_invoke);
|
| 665 |
+
|
| 666 |
+
/**
|
| 667 |
+
* @ingroup listener_getters
|
| 668 |
+
* @brief Get the inconsistent_topic callback from the listener structure
|
| 669 |
+
*
|
| 670 |
+
* Equivalent to calling @ref dds_lget_inconsistent_topic_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 671 |
+
*
|
| 672 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 673 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 674 |
+
*/
|
| 675 |
+
DDS_EXPORT void dds_lget_inconsistent_topic (const dds_listener_t * __restrict listener, dds_on_inconsistent_topic_fn *callback);
|
| 676 |
+
|
| 677 |
+
/**
|
| 678 |
+
* @ingroup listener_getters
|
| 679 |
+
* @brief Get the liveliness_lost callback from the listener structure.
|
| 680 |
+
*
|
| 681 |
+
* Equivalent to calling @ref dds_lget_liveliness_lost_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 682 |
+
*
|
| 683 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 684 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 685 |
+
*/
|
| 686 |
+
DDS_EXPORT void dds_lget_liveliness_lost (const dds_listener_t * __restrict listener, dds_on_liveliness_lost_fn *callback);
|
| 687 |
+
|
| 688 |
+
/**
|
| 689 |
+
* @ingroup listener_getters
|
| 690 |
+
* @brief Get the offered_deadline_missed callback from the listener structure.
|
| 691 |
+
*
|
| 692 |
+
* Equivalent to calling @ref dds_lget_offered_deadline_missed_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 693 |
+
*
|
| 694 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 695 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 696 |
+
*/
|
| 697 |
+
DDS_EXPORT void dds_lget_offered_deadline_missed (const dds_listener_t * __restrict listener, dds_on_offered_deadline_missed_fn *callback);
|
| 698 |
+
|
| 699 |
+
/**
|
| 700 |
+
* @ingroup listener_getters
|
| 701 |
+
* @brief Get the offered_incompatible_qos callback from the listener structure.
|
| 702 |
+
*
|
| 703 |
+
* Equivalent to calling @ref dds_lget_offered_incompatible_qos_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 704 |
+
*
|
| 705 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 706 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 707 |
+
*/
|
| 708 |
+
DDS_EXPORT void dds_lget_offered_incompatible_qos (const dds_listener_t * __restrict listener, dds_on_offered_incompatible_qos_fn *callback);
|
| 709 |
+
|
| 710 |
+
/**
|
| 711 |
+
* @ingroup listener_getters
|
| 712 |
+
* @brief Get the data_on_readers callback from the listener structure.
|
| 713 |
+
*
|
| 714 |
+
* Equivalent to calling @ref dds_lget_data_on_readers_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 715 |
+
*
|
| 716 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 717 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 718 |
+
*/
|
| 719 |
+
DDS_EXPORT void dds_lget_data_on_readers (const dds_listener_t * __restrict listener, dds_on_data_on_readers_fn *callback);
|
| 720 |
+
|
| 721 |
+
/**
|
| 722 |
+
* @ingroup listener_getters
|
| 723 |
+
* @brief Get the sample_lost callback from the listener structure.
|
| 724 |
+
*
|
| 725 |
+
* Equivalent to calling @ref dds_lget_sample_lost_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 726 |
+
*
|
| 727 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 728 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 729 |
+
*/
|
| 730 |
+
DDS_EXPORT void dds_lget_sample_lost (const dds_listener_t *__restrict listener, dds_on_sample_lost_fn *callback);
|
| 731 |
+
|
| 732 |
+
/**
|
| 733 |
+
* @ingroup listener_getters
|
| 734 |
+
* @brief Get the data_available callback from the listener structure.
|
| 735 |
+
*
|
| 736 |
+
* Equivalent to calling @ref dds_lget_data_available_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 737 |
+
*
|
| 738 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 739 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 740 |
+
*/
|
| 741 |
+
DDS_EXPORT void dds_lget_data_available (const dds_listener_t *__restrict listener, dds_on_data_available_fn *callback);
|
| 742 |
+
|
| 743 |
+
/**
|
| 744 |
+
* @ingroup listener_getters
|
| 745 |
+
* @brief Get the sample_rejected callback from the listener structure.
|
| 746 |
+
*
|
| 747 |
+
* Equivalent to calling @ref dds_lget_sample_rejected_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 748 |
+
*
|
| 749 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 750 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 751 |
+
*/
|
| 752 |
+
DDS_EXPORT void dds_lget_sample_rejected (const dds_listener_t *__restrict listener, dds_on_sample_rejected_fn *callback);
|
| 753 |
+
|
| 754 |
+
/**
|
| 755 |
+
* @ingroup listener_getters
|
| 756 |
+
* @brief Get the liveliness_changed callback from the listener structure.
|
| 757 |
+
*
|
| 758 |
+
* Equivalent to calling @ref dds_lget_liveliness_changed_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 759 |
+
*
|
| 760 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 761 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 762 |
+
*/
|
| 763 |
+
DDS_EXPORT void dds_lget_liveliness_changed (const dds_listener_t * __restrict listener, dds_on_liveliness_changed_fn *callback);
|
| 764 |
+
|
| 765 |
+
/**
|
| 766 |
+
* @ingroup listener_getters
|
| 767 |
+
* @brief Get the requested_deadline_missed callback from the listener structure.
|
| 768 |
+
*
|
| 769 |
+
* Equivalent to calling @ref dds_lget_requested_deadline_missed_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 770 |
+
*
|
| 771 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 772 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 773 |
+
*/
|
| 774 |
+
DDS_EXPORT void dds_lget_requested_deadline_missed (const dds_listener_t * __restrict listener, dds_on_requested_deadline_missed_fn *callback);
|
| 775 |
+
|
| 776 |
+
/**
|
| 777 |
+
* @ingroup listener_getters
|
| 778 |
+
* @brief Get the requested_incompatible_qos callback from the listener structure.
|
| 779 |
+
*
|
| 780 |
+
* Equivalent to calling @ref dds_lget_requested_incompatible_qos_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 781 |
+
*
|
| 782 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 783 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 784 |
+
*/
|
| 785 |
+
DDS_EXPORT void dds_lget_requested_incompatible_qos (const dds_listener_t * __restrict listener, dds_on_requested_incompatible_qos_fn *callback);
|
| 786 |
+
|
| 787 |
+
/**
|
| 788 |
+
* @ingroup listener_getters
|
| 789 |
+
* @brief Get the publication_matched callback from the listener structure.
|
| 790 |
+
*
|
| 791 |
+
* Equivalent to calling @ref dds_lget_publication_matched_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 792 |
+
*
|
| 793 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 794 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 795 |
+
*/
|
| 796 |
+
DDS_EXPORT void dds_lget_publication_matched (const dds_listener_t * __restrict listener, dds_on_publication_matched_fn *callback);
|
| 797 |
+
|
| 798 |
+
/**
|
| 799 |
+
* @ingroup listener_getters
|
| 800 |
+
* @brief Get the subscription_matched callback from the listener structure.
|
| 801 |
+
*
|
| 802 |
+
* Equivalent to calling @ref dds_lget_subscription_matched_arg with arg and reset_on_invoke set to a null pointer and throwing away the result.
|
| 803 |
+
*
|
| 804 |
+
* @param[in] listener The pointer to the listener structure, where the callback will be retrieved from
|
| 805 |
+
* @param[out] callback Callback function; may be a null pointer
|
| 806 |
+
*/
|
| 807 |
+
DDS_EXPORT void dds_lget_subscription_matched (const dds_listener_t * __restrict listener, dds_on_subscription_matched_fn *callback);
|
| 808 |
+
|
| 809 |
+
#if defined (__cplusplus)
|
| 810 |
+
}
|
| 811 |
+
#endif
|
| 812 |
+
|
| 813 |
+
#endif /*_DDS_PUBLIC_LISTENER_H_*/
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_qos.h
ADDED
|
@@ -0,0 +1,1021 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* @defgroup qos (DDS C QoS API)
|
| 15 |
+
* @ingroup dds
|
| 16 |
+
*
|
| 17 |
+
* This defines the public API of QoS and Policies in the
|
| 18 |
+
* Eclipse Cyclone DDS C language binding.
|
| 19 |
+
*/
|
| 20 |
+
#ifndef DDS_QOS_H
|
| 21 |
+
#define DDS_QOS_H
|
| 22 |
+
|
| 23 |
+
#include "dds/export.h"
|
| 24 |
+
#include "dds/ddsc/dds_public_qosdefs.h"
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* @anchor DDS_HAS_PROPERTY_LIST_QOS
|
| 28 |
+
* @ingroup qos
|
| 29 |
+
* @brief Whether or not the "property list" QoS setting is supported in this version. If it is,
|
| 30 |
+
* the "dds.sec." properties are treated specially, preventing the accidental creation of
|
| 31 |
+
* an non-secure participant by an implementation built without support for DDS Security.
|
| 32 |
+
*/
|
| 33 |
+
#define DDS_HAS_PROPERTY_LIST_QOS 1
|
| 34 |
+
|
| 35 |
+
#if defined (__cplusplus)
|
| 36 |
+
extern "C" {
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
/**
|
| 40 |
+
* @ingroup qos
|
| 41 |
+
* @brief Allocate memory and initialize default QoS-policies
|
| 42 |
+
*
|
| 43 |
+
* @returns - Pointer to the initialized dds_qos_t structure, NULL if unsuccessful.
|
| 44 |
+
*/
|
| 45 |
+
DDS_EXPORT
|
| 46 |
+
dds_qos_t * dds_create_qos (void);
|
| 47 |
+
|
| 48 |
+
/**
|
| 49 |
+
* @ingroup deprecated
|
| 50 |
+
* @deprecated use \ref dds_create_qos instead.
|
| 51 |
+
* Allocate memory and initialize default QoS-policies
|
| 52 |
+
*
|
| 53 |
+
* @returns - Pointer to the initialized dds_qos_t structure, NULL if unsuccessful.
|
| 54 |
+
*/
|
| 55 |
+
DDS_DEPRECATED_EXPORT
|
| 56 |
+
dds_qos_t * dds_qos_create (void);
|
| 57 |
+
|
| 58 |
+
/**
|
| 59 |
+
* @ingroup qos
|
| 60 |
+
* @brief Delete memory allocated to QoS-policies structure
|
| 61 |
+
*
|
| 62 |
+
* @param[in] qos - Pointer to dds_qos_t structure
|
| 63 |
+
*/
|
| 64 |
+
DDS_EXPORT void
|
| 65 |
+
dds_delete_qos (dds_qos_t * __restrict qos);
|
| 66 |
+
|
| 67 |
+
DDS_DEPRECATED_EXPORT void
|
| 68 |
+
dds_qos_delete (dds_qos_t * __restrict qos);
|
| 69 |
+
|
| 70 |
+
/**
|
| 71 |
+
* @ingroup qos
|
| 72 |
+
* @brief Reset a QoS-policies structure to default values
|
| 73 |
+
*
|
| 74 |
+
* @param[in,out] qos - Pointer to the dds_qos_t structure
|
| 75 |
+
*/
|
| 76 |
+
DDS_EXPORT void
|
| 77 |
+
dds_reset_qos(dds_qos_t * __restrict qos);
|
| 78 |
+
|
| 79 |
+
DDS_DEPRECATED_EXPORT
|
| 80 |
+
void dds_qos_reset (dds_qos_t * __restrict qos
|
| 81 |
+
);
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* @ingroup qos
|
| 85 |
+
* @brief Copy all QoS-policies from one structure to another
|
| 86 |
+
*
|
| 87 |
+
* @param[in,out] dst - Pointer to the destination dds_qos_t structure
|
| 88 |
+
* @param[in] src - Pointer to the source dds_qos_t structure
|
| 89 |
+
*
|
| 90 |
+
* @returns - Return-code indicating success or failure
|
| 91 |
+
*/
|
| 92 |
+
DDS_EXPORT dds_return_t
|
| 93 |
+
dds_copy_qos (dds_qos_t * __restrict dst, const dds_qos_t * __restrict src);
|
| 94 |
+
|
| 95 |
+
DDS_DEPRECATED_EXPORT dds_return_t
|
| 96 |
+
dds_qos_copy (dds_qos_t * __restrict dst, const dds_qos_t * __restrict src);
|
| 97 |
+
|
| 98 |
+
/**
|
| 99 |
+
* @ingroup qos
|
| 100 |
+
* @brief Copy all QoS-policies from one structure to another, unless already set
|
| 101 |
+
*
|
| 102 |
+
* Policies are copied from src to dst, unless src already has the policy set to a non-default value.
|
| 103 |
+
*
|
| 104 |
+
* @param[in,out] dst - Pointer to the destination qos structure
|
| 105 |
+
* @param[in] src - Pointer to the source qos structure
|
| 106 |
+
*/
|
| 107 |
+
DDS_EXPORT void
|
| 108 |
+
dds_merge_qos (dds_qos_t * __restrict dst, const dds_qos_t * __restrict src);
|
| 109 |
+
|
| 110 |
+
DDS_DEPRECATED_EXPORT void
|
| 111 |
+
dds_qos_merge (dds_qos_t * __restrict dst, const dds_qos_t * __restrict src);
|
| 112 |
+
|
| 113 |
+
/**
|
| 114 |
+
* @ingroup qos
|
| 115 |
+
* @brief Copy all QoS-policies from one structure to another, unless already set
|
| 116 |
+
*
|
| 117 |
+
* Policies are copied from src to dst, unless src already has the policy set to a non-default value.
|
| 118 |
+
*
|
| 119 |
+
* @param[in,out] a - Pointer to the destination qos structure
|
| 120 |
+
* @param[in] b - Pointer to the source qos structure
|
| 121 |
+
*
|
| 122 |
+
* @returns whether the copy was successful.
|
| 123 |
+
*/
|
| 124 |
+
DDS_EXPORT bool
|
| 125 |
+
dds_qos_equal (const dds_qos_t * __restrict a, const dds_qos_t * __restrict b);
|
| 126 |
+
|
| 127 |
+
/**
|
| 128 |
+
* @defgroup qos_setters (Qos Setters)
|
| 129 |
+
* @ingroup qos
|
| 130 |
+
*/
|
| 131 |
+
|
| 132 |
+
/**
|
| 133 |
+
* @ingroup qos_setters
|
| 134 |
+
* @brief Set the userdata of a qos structure.
|
| 135 |
+
*
|
| 136 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the userdata
|
| 137 |
+
* @param[in] value - Pointer to the userdata
|
| 138 |
+
* @param[in] sz - Size of userdata stored in value
|
| 139 |
+
*/
|
| 140 |
+
DDS_EXPORT void
|
| 141 |
+
dds_qset_userdata (
|
| 142 |
+
dds_qos_t * __restrict qos,
|
| 143 |
+
const void * __restrict value,
|
| 144 |
+
size_t sz);
|
| 145 |
+
|
| 146 |
+
/**
|
| 147 |
+
* @ingroup qos_setters
|
| 148 |
+
* @brief Set the topicdata of a qos structure.
|
| 149 |
+
*
|
| 150 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the topicdata
|
| 151 |
+
* @param[in] value - Pointer to the topicdata
|
| 152 |
+
* @param[in] sz - Size of the topicdata stored in value
|
| 153 |
+
*/
|
| 154 |
+
DDS_EXPORT void
|
| 155 |
+
dds_qset_topicdata (
|
| 156 |
+
dds_qos_t * __restrict qos,
|
| 157 |
+
const void * __restrict value,
|
| 158 |
+
size_t sz);
|
| 159 |
+
|
| 160 |
+
/**
|
| 161 |
+
* @ingroup qos_setters
|
| 162 |
+
* @brief Set the groupdata of a qos structure.
|
| 163 |
+
*
|
| 164 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the groupdata
|
| 165 |
+
* @param[in] value - Pointer to the group data
|
| 166 |
+
* @param[in] sz - Size of groupdata stored in value
|
| 167 |
+
*/
|
| 168 |
+
DDS_EXPORT void
|
| 169 |
+
dds_qset_groupdata (
|
| 170 |
+
dds_qos_t * __restrict qos,
|
| 171 |
+
const void * __restrict value,
|
| 172 |
+
size_t sz);
|
| 173 |
+
|
| 174 |
+
/**
|
| 175 |
+
* @ingroup qos_setters
|
| 176 |
+
* @brief Set the durability policy of a qos structure.
|
| 177 |
+
*
|
| 178 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 179 |
+
* @param[in] kind - Durability kind value
|
| 180 |
+
*/
|
| 181 |
+
DDS_EXPORT void
|
| 182 |
+
dds_qset_durability (dds_qos_t * __restrict qos, dds_durability_kind_t kind);
|
| 183 |
+
|
| 184 |
+
/**
|
| 185 |
+
* @ingroup qos_setters
|
| 186 |
+
* @brief Set the history policy of a qos structure.
|
| 187 |
+
*
|
| 188 |
+
* Note that depth is only relevant for keep last. If you want limited history for keep all, use dds_qset_resource_limits().
|
| 189 |
+
*
|
| 190 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 191 |
+
* @param[in] kind - History kind value
|
| 192 |
+
* @param[in] depth - History depth value
|
| 193 |
+
*/
|
| 194 |
+
DDS_EXPORT void
|
| 195 |
+
dds_qset_history (
|
| 196 |
+
dds_qos_t * __restrict qos,
|
| 197 |
+
dds_history_kind_t kind,
|
| 198 |
+
int32_t depth);
|
| 199 |
+
|
| 200 |
+
/**
|
| 201 |
+
* @ingroup qos_setters
|
| 202 |
+
* @brief Set the resource limits policy of a qos structure.
|
| 203 |
+
*
|
| 204 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 205 |
+
* @param[in] max_samples - Number of samples resource-limit value
|
| 206 |
+
* @param[in] max_instances - Number of instances resource-limit value
|
| 207 |
+
* @param[in] max_samples_per_instance - Number of samples per instance resource-limit value
|
| 208 |
+
*/
|
| 209 |
+
DDS_EXPORT void
|
| 210 |
+
dds_qset_resource_limits (
|
| 211 |
+
dds_qos_t * __restrict qos,
|
| 212 |
+
int32_t max_samples,
|
| 213 |
+
int32_t max_instances,
|
| 214 |
+
int32_t max_samples_per_instance);
|
| 215 |
+
|
| 216 |
+
/**
|
| 217 |
+
* @ingroup qos_setters
|
| 218 |
+
* @brief Set the presentation policy of a qos structure.
|
| 219 |
+
*
|
| 220 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 221 |
+
* @param[in] access_scope - Access-scope kind
|
| 222 |
+
* @param[in] coherent_access - Coherent access enable value
|
| 223 |
+
* @param[in] ordered_access - Ordered access enable value
|
| 224 |
+
*/
|
| 225 |
+
DDS_EXPORT void
|
| 226 |
+
dds_qset_presentation (
|
| 227 |
+
dds_qos_t * __restrict qos,
|
| 228 |
+
dds_presentation_access_scope_kind_t access_scope,
|
| 229 |
+
bool coherent_access,
|
| 230 |
+
bool ordered_access);
|
| 231 |
+
|
| 232 |
+
/**
|
| 233 |
+
* @ingroup qos_setters
|
| 234 |
+
* @brief Set the lifespan policy of a qos structure.
|
| 235 |
+
*
|
| 236 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 237 |
+
* @param[in] lifespan - Lifespan duration (expiration time relative to source timestamp of a sample)
|
| 238 |
+
*/
|
| 239 |
+
DDS_EXPORT void
|
| 240 |
+
dds_qset_lifespan (
|
| 241 |
+
dds_qos_t * __restrict qos,
|
| 242 |
+
dds_duration_t lifespan);
|
| 243 |
+
|
| 244 |
+
/**
|
| 245 |
+
* @ingroup qos_setters
|
| 246 |
+
* @brief Set the deadline policy of a qos structure.
|
| 247 |
+
*
|
| 248 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 249 |
+
* @param[in] deadline - Deadline duration
|
| 250 |
+
*/
|
| 251 |
+
DDS_EXPORT void
|
| 252 |
+
dds_qset_deadline (
|
| 253 |
+
dds_qos_t * __restrict qos,
|
| 254 |
+
dds_duration_t deadline);
|
| 255 |
+
|
| 256 |
+
/**
|
| 257 |
+
* @ingroup qos_setters
|
| 258 |
+
* @brief Set the latency-budget policy of a qos structure
|
| 259 |
+
*
|
| 260 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 261 |
+
* @param[in] duration - Latency budget duration
|
| 262 |
+
*/
|
| 263 |
+
DDS_EXPORT void
|
| 264 |
+
dds_qset_latency_budget (
|
| 265 |
+
dds_qos_t * __restrict qos,
|
| 266 |
+
dds_duration_t duration);
|
| 267 |
+
|
| 268 |
+
/**
|
| 269 |
+
* @ingroup qos_setters
|
| 270 |
+
* @brief Set the ownership policy of a qos structure
|
| 271 |
+
*
|
| 272 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 273 |
+
* @param[in] kind - Ownership kind
|
| 274 |
+
*/
|
| 275 |
+
DDS_EXPORT void
|
| 276 |
+
dds_qset_ownership (
|
| 277 |
+
dds_qos_t * __restrict qos,
|
| 278 |
+
dds_ownership_kind_t kind);
|
| 279 |
+
|
| 280 |
+
/**
|
| 281 |
+
* @ingroup qos_setters
|
| 282 |
+
* @brief Set the ownership strength policy of a qos structure
|
| 283 |
+
*
|
| 284 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 285 |
+
* @param[in] value - Ownership strength value
|
| 286 |
+
*/
|
| 287 |
+
DDS_EXPORT void
|
| 288 |
+
dds_qset_ownership_strength (dds_qos_t * __restrict qos, int32_t value);
|
| 289 |
+
|
| 290 |
+
/**
|
| 291 |
+
* @ingroup qos_setters
|
| 292 |
+
* @brief Set the liveliness policy of a qos structure
|
| 293 |
+
*
|
| 294 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 295 |
+
* @param[in] kind - Liveliness kind
|
| 296 |
+
* @param[in] lease_duration - Lease duration
|
| 297 |
+
*/
|
| 298 |
+
DDS_EXPORT void
|
| 299 |
+
dds_qset_liveliness (
|
| 300 |
+
dds_qos_t * __restrict qos,
|
| 301 |
+
dds_liveliness_kind_t kind,
|
| 302 |
+
dds_duration_t lease_duration);
|
| 303 |
+
|
| 304 |
+
/**
|
| 305 |
+
* @ingroup qos_setters
|
| 306 |
+
* @brief Set the time-based filter policy of a qos structure
|
| 307 |
+
*
|
| 308 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 309 |
+
* @param[in] minimum_separation - Minimum duration between sample delivery for an instance
|
| 310 |
+
*/
|
| 311 |
+
DDS_EXPORT void
|
| 312 |
+
dds_qset_time_based_filter (
|
| 313 |
+
dds_qos_t * __restrict qos,
|
| 314 |
+
dds_duration_t minimum_separation);
|
| 315 |
+
|
| 316 |
+
/**
|
| 317 |
+
* @ingroup qos_setters
|
| 318 |
+
* @brief Set the partition policy of a qos structure
|
| 319 |
+
*
|
| 320 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 321 |
+
* @param[in] n - Number of partitions stored in ps
|
| 322 |
+
* @param[in] ps - Pointer to string(s) storing partition name(s)
|
| 323 |
+
*/
|
| 324 |
+
DDS_EXPORT void
|
| 325 |
+
dds_qset_partition (
|
| 326 |
+
dds_qos_t * __restrict qos,
|
| 327 |
+
uint32_t n,
|
| 328 |
+
const char ** __restrict ps);
|
| 329 |
+
|
| 330 |
+
/**
|
| 331 |
+
* @ingroup qos_setters
|
| 332 |
+
* @brief Convenience function to set the partition policy of a qos structure to a
|
| 333 |
+
* single name. Name may be a null pointer.
|
| 334 |
+
*
|
| 335 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 336 |
+
* @param[in] name - Pointer to the name
|
| 337 |
+
*/
|
| 338 |
+
DDS_EXPORT void
|
| 339 |
+
dds_qset_partition1 (
|
| 340 |
+
dds_qos_t * __restrict qos,
|
| 341 |
+
const char * __restrict name);
|
| 342 |
+
|
| 343 |
+
/**
|
| 344 |
+
* @ingroup qos_setters
|
| 345 |
+
* @brief Set the reliability policy of a qos structure
|
| 346 |
+
*
|
| 347 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 348 |
+
* @param[in] kind - Reliability kind
|
| 349 |
+
* @param[in] max_blocking_time - Max blocking duration applied when kind is reliable. This is how long the writer will block when its history is full.
|
| 350 |
+
*/
|
| 351 |
+
DDS_EXPORT void
|
| 352 |
+
dds_qset_reliability (
|
| 353 |
+
dds_qos_t * __restrict qos,
|
| 354 |
+
dds_reliability_kind_t kind,
|
| 355 |
+
dds_duration_t max_blocking_time);
|
| 356 |
+
|
| 357 |
+
/**
|
| 358 |
+
* @ingroup qos_setters
|
| 359 |
+
* @brief Set the transport-priority policy of a qos structure
|
| 360 |
+
*
|
| 361 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 362 |
+
* @param[in] value - Priority value
|
| 363 |
+
*/
|
| 364 |
+
DDS_EXPORT void
|
| 365 |
+
dds_qset_transport_priority (dds_qos_t * __restrict qos, int32_t value);
|
| 366 |
+
|
| 367 |
+
/**
|
| 368 |
+
* @ingroup qos_setters
|
| 369 |
+
* @brief Set the destination-order policy of a qos structure
|
| 370 |
+
*
|
| 371 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 372 |
+
* @param[in] kind - Destination-order kind
|
| 373 |
+
*/
|
| 374 |
+
DDS_EXPORT void
|
| 375 |
+
dds_qset_destination_order (
|
| 376 |
+
dds_qos_t * __restrict qos,
|
| 377 |
+
dds_destination_order_kind_t kind);
|
| 378 |
+
|
| 379 |
+
/**
|
| 380 |
+
* @ingroup qos_setters
|
| 381 |
+
* @brief Set the writer data-lifecycle policy of a qos structure
|
| 382 |
+
*
|
| 383 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 384 |
+
* @param[in] autodispose - Automatic disposal of unregistered instances
|
| 385 |
+
*/
|
| 386 |
+
DDS_EXPORT void
|
| 387 |
+
dds_qset_writer_data_lifecycle (dds_qos_t * __restrict qos, bool autodispose);
|
| 388 |
+
|
| 389 |
+
/**
|
| 390 |
+
* @ingroup qos_setters
|
| 391 |
+
* @brief Set the reader data-lifecycle policy of a qos structure
|
| 392 |
+
*
|
| 393 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 394 |
+
* @param[in] autopurge_nowriter_samples_delay - Delay for purging of samples from instances in a no-writers state
|
| 395 |
+
* @param[in] autopurge_disposed_samples_delay - Delay for purging of samples from disposed instances
|
| 396 |
+
*/
|
| 397 |
+
DDS_EXPORT void
|
| 398 |
+
dds_qset_reader_data_lifecycle (
|
| 399 |
+
dds_qos_t * __restrict qos,
|
| 400 |
+
dds_duration_t autopurge_nowriter_samples_delay,
|
| 401 |
+
dds_duration_t autopurge_disposed_samples_delay);
|
| 402 |
+
|
| 403 |
+
/**
|
| 404 |
+
* @ingroup qos_setters
|
| 405 |
+
* @brief Set the durability-service policy of a qos structure
|
| 406 |
+
*
|
| 407 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 408 |
+
* @param[in] service_cleanup_delay - Delay for purging of abandoned instances from the durability service
|
| 409 |
+
* @param[in] history_kind - History policy kind applied by the durability service
|
| 410 |
+
* @param[in] history_depth - History policy depth applied by the durability service
|
| 411 |
+
* @param[in] max_samples - Number of samples resource-limit policy applied by the durability service
|
| 412 |
+
* @param[in] max_instances - Number of instances resource-limit policy applied by the durability service
|
| 413 |
+
* @param[in] max_samples_per_instance - Number of samples per instance resource-limit policy applied by the durability service
|
| 414 |
+
*/
|
| 415 |
+
DDS_EXPORT void
|
| 416 |
+
dds_qset_durability_service (
|
| 417 |
+
dds_qos_t * __restrict qos,
|
| 418 |
+
dds_duration_t service_cleanup_delay,
|
| 419 |
+
dds_history_kind_t history_kind,
|
| 420 |
+
int32_t history_depth,
|
| 421 |
+
int32_t max_samples,
|
| 422 |
+
int32_t max_instances,
|
| 423 |
+
int32_t max_samples_per_instance);
|
| 424 |
+
|
| 425 |
+
/**
|
| 426 |
+
* @ingroup qos_setters
|
| 427 |
+
* @brief Set the ignore-local policy of a qos structure
|
| 428 |
+
*
|
| 429 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 430 |
+
* @param[in] ignore - True if readers and writers owned by the same participant should be ignored
|
| 431 |
+
*/
|
| 432 |
+
DDS_EXPORT void
|
| 433 |
+
dds_qset_ignorelocal (
|
| 434 |
+
dds_qos_t * __restrict qos,
|
| 435 |
+
dds_ignorelocal_kind_t ignore);
|
| 436 |
+
|
| 437 |
+
/**
|
| 438 |
+
* @ingroup qos_setters
|
| 439 |
+
* @brief Stores a property with the provided name and string value in a qos structure.
|
| 440 |
+
*
|
| 441 |
+
* In the case a property with the provided name already exists in the qos structure,
|
| 442 |
+
* the value for this entry is overwritten with the provided string value. If more than
|
| 443 |
+
* one property with the provided name exists, only the value of the first of these
|
| 444 |
+
* properties is updated.
|
| 445 |
+
*
|
| 446 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the property
|
| 447 |
+
* @param[in] name - Pointer to name of the property
|
| 448 |
+
* @param[in] value - Pointer to a (null-terminated) string that will be stored
|
| 449 |
+
*/
|
| 450 |
+
DDS_EXPORT void
|
| 451 |
+
dds_qset_prop (
|
| 452 |
+
dds_qos_t * __restrict qos,
|
| 453 |
+
const char * name,
|
| 454 |
+
const char * value);
|
| 455 |
+
|
| 456 |
+
/**
|
| 457 |
+
* @ingroup qos_setters
|
| 458 |
+
* @brief Removes the property with the provided name from a qos structure.
|
| 459 |
+
*
|
| 460 |
+
* In case more than one property exists with this name, only the first property
|
| 461 |
+
* is removed.
|
| 462 |
+
*
|
| 463 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that contains the property
|
| 464 |
+
* @param[in] name - Pointer to name of the property
|
| 465 |
+
*/
|
| 466 |
+
DDS_EXPORT void
|
| 467 |
+
dds_qunset_prop (
|
| 468 |
+
dds_qos_t * __restrict qos,
|
| 469 |
+
const char * name);
|
| 470 |
+
|
| 471 |
+
/**
|
| 472 |
+
* @ingroup qos_setters
|
| 473 |
+
* @brief Stores the provided binary data as a property in a qos structure
|
| 474 |
+
*
|
| 475 |
+
* In the case a property with the provided name already exists in the qos structure,
|
| 476 |
+
* the value for this entry is overwritten with the provided data. If more than one
|
| 477 |
+
* property with the provided name exists, only the value of the first of these
|
| 478 |
+
* properties is updated.
|
| 479 |
+
*
|
| 480 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the property
|
| 481 |
+
* @param[in] name - Pointer to name of the property
|
| 482 |
+
* @param[in] value - Pointer to data to be stored in the property
|
| 483 |
+
* @param[in] sz - Size of the data
|
| 484 |
+
*/
|
| 485 |
+
DDS_EXPORT void
|
| 486 |
+
dds_qset_bprop (
|
| 487 |
+
dds_qos_t * __restrict qos,
|
| 488 |
+
const char * name,
|
| 489 |
+
const void * value,
|
| 490 |
+
const size_t sz);
|
| 491 |
+
|
| 492 |
+
/**
|
| 493 |
+
* @ingroup qos_setters
|
| 494 |
+
* @brief Removes the binary property with the provided name from a qos structure.
|
| 495 |
+
*
|
| 496 |
+
* In case more than one binary property exists with this name, only the first binary
|
| 497 |
+
* property is removed.
|
| 498 |
+
*
|
| 499 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that contains the binary property
|
| 500 |
+
* @param[in] name - Pointer to name of the property
|
| 501 |
+
*/
|
| 502 |
+
DDS_EXPORT void
|
| 503 |
+
dds_qunset_bprop (
|
| 504 |
+
dds_qos_t * __restrict qos,
|
| 505 |
+
const char * name);
|
| 506 |
+
|
| 507 |
+
/**
|
| 508 |
+
* @ingroup qos_setters
|
| 509 |
+
* @brief Set the type consistency enforcement policy of a qos structure
|
| 510 |
+
*
|
| 511 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 512 |
+
* @param[in] kind - Type consistency policy kind
|
| 513 |
+
* @param[in] ignore_sequence_bounds - Ignore sequence bounds in type assignability checking
|
| 514 |
+
* @param[in] ignore_string_bounds - Ignore string bounds in type assignability checking
|
| 515 |
+
* @param[in] ignore_member_names - Ignore member names in type assignability checking
|
| 516 |
+
* @param[in] prevent_type_widening - Prevent type widening in type assignability checking
|
| 517 |
+
* @param[in] force_type_validation - Force type validation in assignability checking
|
| 518 |
+
*/
|
| 519 |
+
DDS_EXPORT void
|
| 520 |
+
dds_qset_type_consistency (
|
| 521 |
+
dds_qos_t * __restrict qos,
|
| 522 |
+
dds_type_consistency_kind_t kind,
|
| 523 |
+
bool ignore_sequence_bounds,
|
| 524 |
+
bool ignore_string_bounds,
|
| 525 |
+
bool ignore_member_names,
|
| 526 |
+
bool prevent_type_widening,
|
| 527 |
+
bool force_type_validation);
|
| 528 |
+
|
| 529 |
+
/**
|
| 530 |
+
* @ingroup qos_setters
|
| 531 |
+
* @brief Set the data representation of a qos structure
|
| 532 |
+
*
|
| 533 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
|
| 534 |
+
* @param[in] n - Number of data representation values
|
| 535 |
+
* @param[in] values - Data representation values
|
| 536 |
+
*/
|
| 537 |
+
DDS_EXPORT void
|
| 538 |
+
dds_qset_data_representation (
|
| 539 |
+
dds_qos_t * __restrict qos,
|
| 540 |
+
uint32_t n,
|
| 541 |
+
const dds_data_representation_id_t *values);
|
| 542 |
+
|
| 543 |
+
/**
|
| 544 |
+
* @ingroup qos_setters
|
| 545 |
+
* @brief Set the entity name.
|
| 546 |
+
*
|
| 547 |
+
* When using this QoS to initialize a participant, publisher, subscriber, reader or writer
|
| 548 |
+
* it will take the name set here. This name is visible over discovery and can be used
|
| 549 |
+
* to make sense of network in tooling.
|
| 550 |
+
*
|
| 551 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the entity name.
|
| 552 |
+
* @param[in] name - Pointer to the entity name to set.
|
| 553 |
+
*/
|
| 554 |
+
DDS_EXPORT void
|
| 555 |
+
dds_qset_entity_name (
|
| 556 |
+
dds_qos_t * __restrict qos,
|
| 557 |
+
const char * name);
|
| 558 |
+
|
| 559 |
+
|
| 560 |
+
/**
|
| 561 |
+
* @defgroup qos_getters (QoS Getters)
|
| 562 |
+
* @ingroup qos
|
| 563 |
+
*/
|
| 564 |
+
|
| 565 |
+
/**
|
| 566 |
+
* @ingroup qos_getters
|
| 567 |
+
* @brief Get the userdata from a qos structure
|
| 568 |
+
*
|
| 569 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 570 |
+
* @param[in,out] value - Pointer that will store the userdata. If sz = 0, then a null pointer, else it is a pointer to an allocated buffer of sz+1 bytes where the last byte is always 0
|
| 571 |
+
* @param[in,out] sz - Pointer that will store the size of userdata
|
| 572 |
+
*
|
| 573 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 574 |
+
*/
|
| 575 |
+
DDS_EXPORT bool dds_qget_userdata (const dds_qos_t * __restrict qos, void **value, size_t *sz);
|
| 576 |
+
|
| 577 |
+
/**
|
| 578 |
+
* @ingroup qos_getters
|
| 579 |
+
* @brief Get the topicdata from a qos structure
|
| 580 |
+
*
|
| 581 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 582 |
+
* @param[in,out] value - Pointer that will store the topicdata. If sz = 0, then a null pointer, else it is a pointer to an allocated buffer of sz+1 bytes where the last byte is always 0
|
| 583 |
+
* @param[in,out] sz - Pointer that will store the size of topicdata
|
| 584 |
+
*
|
| 585 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 586 |
+
*/
|
| 587 |
+
DDS_EXPORT bool dds_qget_topicdata (const dds_qos_t * __restrict qos, void **value, size_t *sz);
|
| 588 |
+
|
| 589 |
+
/**
|
| 590 |
+
* @ingroup qos_getters
|
| 591 |
+
* @brief Get the groupdata from a qos structure
|
| 592 |
+
*
|
| 593 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 594 |
+
* @param[in,out] value - Pointer that will store the groupdata. If sz = 0, then a null pointer, else it is a pointer to an allocated buffer of sz+1 bytes where the last byte is always 0
|
| 595 |
+
* @param[in,out] sz - Pointer that will store the size of groupdata
|
| 596 |
+
*
|
| 597 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 598 |
+
*/
|
| 599 |
+
DDS_EXPORT bool dds_qget_groupdata (const dds_qos_t * __restrict qos, void **value, size_t *sz);
|
| 600 |
+
|
| 601 |
+
/**
|
| 602 |
+
* @ingroup qos_getters
|
| 603 |
+
* @brief Get the durability policy from a qos structure
|
| 604 |
+
*
|
| 605 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 606 |
+
* @param[in,out] kind - Pointer that will store the durability kind
|
| 607 |
+
*
|
| 608 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 609 |
+
*/
|
| 610 |
+
DDS_EXPORT bool dds_qget_durability (const dds_qos_t * __restrict qos, dds_durability_kind_t *kind);
|
| 611 |
+
|
| 612 |
+
/**
|
| 613 |
+
* @ingroup qos_getters
|
| 614 |
+
* @brief Get the history policy from a qos structure
|
| 615 |
+
*
|
| 616 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 617 |
+
* @param[in,out] kind - Pointer that will store the history kind (optional)
|
| 618 |
+
* @param[in,out] depth - Pointer that will store the history depth (optional)
|
| 619 |
+
*
|
| 620 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 621 |
+
*/
|
| 622 |
+
DDS_EXPORT bool dds_qget_history (const dds_qos_t * __restrict qos, dds_history_kind_t *kind, int32_t *depth);
|
| 623 |
+
|
| 624 |
+
/**
|
| 625 |
+
* @ingroup qos_getters
|
| 626 |
+
* @brief Get the resource-limits policy from a qos structure
|
| 627 |
+
*
|
| 628 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 629 |
+
* @param[in,out] max_samples - Pointer that will store the number of samples resource-limit (optional)
|
| 630 |
+
* @param[in,out] max_instances - Pointer that will store the number of instances resource-limit (optional)
|
| 631 |
+
* @param[in,out] max_samples_per_instance - Pointer that will store the number of samples per instance resource-limit (optional)
|
| 632 |
+
*
|
| 633 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 634 |
+
*/
|
| 635 |
+
DDS_EXPORT bool
|
| 636 |
+
dds_qget_resource_limits (
|
| 637 |
+
const dds_qos_t * __restrict qos,
|
| 638 |
+
int32_t *max_samples,
|
| 639 |
+
int32_t *max_instances,
|
| 640 |
+
int32_t *max_samples_per_instance);
|
| 641 |
+
|
| 642 |
+
/**
|
| 643 |
+
* @ingroup qos_getters
|
| 644 |
+
* @brief Get the presentation policy from a qos structure
|
| 645 |
+
*
|
| 646 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 647 |
+
* @param[in,out] access_scope - Pointer that will store access scope kind (optional)
|
| 648 |
+
* @param[in,out] coherent_access - Pointer that will store coherent access enable value (optional)
|
| 649 |
+
* @param[in,out] ordered_access - Pointer that will store orderede access enable value (optional)
|
| 650 |
+
*
|
| 651 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 652 |
+
*/
|
| 653 |
+
DDS_EXPORT bool
|
| 654 |
+
dds_qget_presentation (
|
| 655 |
+
const dds_qos_t * __restrict qos,
|
| 656 |
+
dds_presentation_access_scope_kind_t *access_scope,
|
| 657 |
+
bool *coherent_access,
|
| 658 |
+
bool *ordered_access);
|
| 659 |
+
|
| 660 |
+
/**
|
| 661 |
+
* @ingroup qos_getters
|
| 662 |
+
* @brief Get the lifespan policy from a qos structure
|
| 663 |
+
*
|
| 664 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 665 |
+
* @param[in,out] lifespan - Pointer that will store lifespan duration
|
| 666 |
+
*
|
| 667 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 668 |
+
*/
|
| 669 |
+
DDS_EXPORT bool
|
| 670 |
+
dds_qget_lifespan (
|
| 671 |
+
const dds_qos_t * __restrict qos,
|
| 672 |
+
dds_duration_t *lifespan);
|
| 673 |
+
|
| 674 |
+
/**
|
| 675 |
+
* @ingroup qos_getters
|
| 676 |
+
* @brief Get the deadline policy from a qos structure
|
| 677 |
+
*
|
| 678 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 679 |
+
* @param[in,out] deadline - Pointer that will store deadline duration
|
| 680 |
+
*
|
| 681 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 682 |
+
*/
|
| 683 |
+
DDS_EXPORT bool
|
| 684 |
+
dds_qget_deadline (
|
| 685 |
+
const dds_qos_t * __restrict qos,
|
| 686 |
+
dds_duration_t *deadline);
|
| 687 |
+
|
| 688 |
+
/**
|
| 689 |
+
* @ingroup qos_getters
|
| 690 |
+
* @brief Get the latency-budget policy from a qos structure
|
| 691 |
+
*
|
| 692 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 693 |
+
* @param[in,out] duration - Pointer that will store latency-budget duration
|
| 694 |
+
*
|
| 695 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 696 |
+
*/
|
| 697 |
+
DDS_EXPORT bool
|
| 698 |
+
dds_qget_latency_budget (
|
| 699 |
+
const dds_qos_t * __restrict qos,
|
| 700 |
+
dds_duration_t *duration);
|
| 701 |
+
|
| 702 |
+
/**
|
| 703 |
+
* @ingroup qos_getters
|
| 704 |
+
* @brief Get the ownership policy from a qos structure
|
| 705 |
+
*
|
| 706 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 707 |
+
* @param[in,out] kind - Pointer that will store the ownership kind
|
| 708 |
+
*
|
| 709 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 710 |
+
*/
|
| 711 |
+
DDS_EXPORT bool
|
| 712 |
+
dds_qget_ownership (
|
| 713 |
+
const dds_qos_t * __restrict qos,
|
| 714 |
+
dds_ownership_kind_t *kind);
|
| 715 |
+
|
| 716 |
+
/**
|
| 717 |
+
* @ingroup qos_getters
|
| 718 |
+
* @brief Get the ownership strength qos policy
|
| 719 |
+
*
|
| 720 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 721 |
+
* @param[in,out] value - Pointer that will store the ownership strength value
|
| 722 |
+
*
|
| 723 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 724 |
+
*/
|
| 725 |
+
DDS_EXPORT bool
|
| 726 |
+
dds_qget_ownership_strength (
|
| 727 |
+
const dds_qos_t * __restrict qos,
|
| 728 |
+
int32_t *value);
|
| 729 |
+
|
| 730 |
+
/**
|
| 731 |
+
* @ingroup qos_getters
|
| 732 |
+
* @brief Get the liveliness qos policy
|
| 733 |
+
*
|
| 734 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 735 |
+
* @param[in,out] kind - Pointer that will store the liveliness kind (optional)
|
| 736 |
+
* @param[in,out] lease_duration - Pointer that will store the liveliness lease duration (optional)
|
| 737 |
+
*
|
| 738 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 739 |
+
*/
|
| 740 |
+
DDS_EXPORT bool
|
| 741 |
+
dds_qget_liveliness (
|
| 742 |
+
const dds_qos_t * __restrict qos,
|
| 743 |
+
dds_liveliness_kind_t *kind,
|
| 744 |
+
dds_duration_t *lease_duration);
|
| 745 |
+
|
| 746 |
+
/**
|
| 747 |
+
* @ingroup qos_getters
|
| 748 |
+
* @brief Get the time-based filter qos policy
|
| 749 |
+
*
|
| 750 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 751 |
+
* @param[in,out] minimum_separation - Pointer that will store the minimum separation duration (optional)
|
| 752 |
+
*
|
| 753 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 754 |
+
*/
|
| 755 |
+
DDS_EXPORT bool
|
| 756 |
+
dds_qget_time_based_filter (
|
| 757 |
+
const dds_qos_t * __restrict qos,
|
| 758 |
+
dds_duration_t *minimum_separation);
|
| 759 |
+
|
| 760 |
+
/**
|
| 761 |
+
* @ingroup qos_getters
|
| 762 |
+
* @brief Get the partition qos policy
|
| 763 |
+
*
|
| 764 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 765 |
+
* @param[in,out] n - Pointer that will store the number of partitions (optional)
|
| 766 |
+
* @param[in,out] ps - Pointer that will store the string(s) containing partition name(s) (optional)
|
| 767 |
+
*
|
| 768 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 769 |
+
*/
|
| 770 |
+
DDS_EXPORT bool
|
| 771 |
+
dds_qget_partition (
|
| 772 |
+
const dds_qos_t * __restrict qos,
|
| 773 |
+
uint32_t *n,
|
| 774 |
+
char ***ps);
|
| 775 |
+
|
| 776 |
+
/**
|
| 777 |
+
* @ingroup qos_getters
|
| 778 |
+
* @brief Get the reliability qos policy
|
| 779 |
+
*
|
| 780 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 781 |
+
* @param[in,out] kind - Pointer that will store the reliability kind (optional)
|
| 782 |
+
* @param[in,out] max_blocking_time - Pointer that will store the max blocking time for reliable reliability (optional)
|
| 783 |
+
*
|
| 784 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 785 |
+
*/
|
| 786 |
+
DDS_EXPORT bool
|
| 787 |
+
dds_qget_reliability (
|
| 788 |
+
const dds_qos_t * __restrict qos,
|
| 789 |
+
dds_reliability_kind_t *kind,
|
| 790 |
+
dds_duration_t *max_blocking_time);
|
| 791 |
+
|
| 792 |
+
/**
|
| 793 |
+
* @ingroup qos_getters
|
| 794 |
+
* @brief Get the transport priority qos policy
|
| 795 |
+
*
|
| 796 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 797 |
+
* @param[in,out] value - Pointer that will store the transport priority value
|
| 798 |
+
*
|
| 799 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 800 |
+
*/
|
| 801 |
+
DDS_EXPORT bool
|
| 802 |
+
dds_qget_transport_priority (
|
| 803 |
+
const dds_qos_t * __restrict qos,
|
| 804 |
+
int32_t *value);
|
| 805 |
+
|
| 806 |
+
/**
|
| 807 |
+
* @ingroup qos_getters
|
| 808 |
+
* @brief Get the destination-order qos policy
|
| 809 |
+
*
|
| 810 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 811 |
+
* @param[in,out] kind - Pointer that will store the destination-order kind
|
| 812 |
+
*
|
| 813 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 814 |
+
*/
|
| 815 |
+
DDS_EXPORT bool
|
| 816 |
+
dds_qget_destination_order (
|
| 817 |
+
const dds_qos_t * __restrict qos,
|
| 818 |
+
dds_destination_order_kind_t *kind);
|
| 819 |
+
|
| 820 |
+
/**
|
| 821 |
+
* @ingroup qos_getters
|
| 822 |
+
* @brief Get the writer data-lifecycle qos policy
|
| 823 |
+
*
|
| 824 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 825 |
+
* @param[in,out] autodispose - Pointer that will store the autodispose unregistered instances enable value
|
| 826 |
+
*
|
| 827 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 828 |
+
*/
|
| 829 |
+
DDS_EXPORT bool
|
| 830 |
+
dds_qget_writer_data_lifecycle (
|
| 831 |
+
const dds_qos_t * __restrict qos,
|
| 832 |
+
bool *autodispose);
|
| 833 |
+
|
| 834 |
+
/**
|
| 835 |
+
* @ingroup qos_getters
|
| 836 |
+
* @brief Get the reader data-lifecycle qos policy
|
| 837 |
+
*
|
| 838 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 839 |
+
* @param[in,out] autopurge_nowriter_samples_delay - Pointer that will store the delay for auto-purging samples from instances in a no-writer state (optional)
|
| 840 |
+
* @param[in,out] autopurge_disposed_samples_delay - Pointer that will store the delay for auto-purging of disposed instances (optional)
|
| 841 |
+
*
|
| 842 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 843 |
+
*/
|
| 844 |
+
DDS_EXPORT bool
|
| 845 |
+
dds_qget_reader_data_lifecycle (
|
| 846 |
+
const dds_qos_t * __restrict qos,
|
| 847 |
+
dds_duration_t *autopurge_nowriter_samples_delay,
|
| 848 |
+
dds_duration_t *autopurge_disposed_samples_delay);
|
| 849 |
+
|
| 850 |
+
/**
|
| 851 |
+
* @ingroup qos_getters
|
| 852 |
+
* @brief Get the durability-service qos policy values.
|
| 853 |
+
*
|
| 854 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 855 |
+
* @param[in,out] service_cleanup_delay - Pointer that will store the delay for purging of abandoned instances from the durability service (optional)
|
| 856 |
+
* @param[in,out] history_kind - Pointer that will store history policy kind applied by the durability service (optional)
|
| 857 |
+
* @param[in,out] history_depth - Pointer that will store history policy depth applied by the durability service (optional)
|
| 858 |
+
* @param[in,out] max_samples - Pointer that will store number of samples resource-limit policy applied by the durability service (optional)
|
| 859 |
+
* @param[in,out] max_instances - Pointer that will store number of instances resource-limit policy applied by the durability service (optional)
|
| 860 |
+
* @param[in,out] max_samples_per_instance - Pointer that will store number of samples per instance resource-limit policy applied by the durability service (optional)
|
| 861 |
+
*
|
| 862 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 863 |
+
*/
|
| 864 |
+
DDS_EXPORT bool
|
| 865 |
+
dds_qget_durability_service (
|
| 866 |
+
const dds_qos_t * __restrict qos,
|
| 867 |
+
dds_duration_t *service_cleanup_delay,
|
| 868 |
+
dds_history_kind_t *history_kind,
|
| 869 |
+
int32_t *history_depth,
|
| 870 |
+
int32_t *max_samples,
|
| 871 |
+
int32_t *max_instances,
|
| 872 |
+
int32_t *max_samples_per_instance);
|
| 873 |
+
|
| 874 |
+
/**
|
| 875 |
+
* @ingroup qos_getters
|
| 876 |
+
* @brief Get the ignore-local qos policy
|
| 877 |
+
*
|
| 878 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 879 |
+
* @param[in,out] ignore - Pointer that will store whether to ignore readers/writers owned by the same participant (optional)
|
| 880 |
+
*
|
| 881 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 882 |
+
*/
|
| 883 |
+
DDS_EXPORT bool
|
| 884 |
+
dds_qget_ignorelocal (
|
| 885 |
+
const dds_qos_t * __restrict qos,
|
| 886 |
+
dds_ignorelocal_kind_t *ignore);
|
| 887 |
+
|
| 888 |
+
/**
|
| 889 |
+
* @ingroup qos_getters
|
| 890 |
+
* @brief Gets the names of the properties from a qos structure.
|
| 891 |
+
*
|
| 892 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that contains properties
|
| 893 |
+
* @param[in,out] n - Pointer to number of property names that are returned (optional)
|
| 894 |
+
* @param[in,out] names - Pointer that will store the string(s) containing property name(s) (optional). This function will allocate the memory for the list of names and for the strings containing the names; the caller gets ownership of the allocated memory
|
| 895 |
+
*
|
| 896 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 897 |
+
*/
|
| 898 |
+
DDS_EXPORT bool
|
| 899 |
+
dds_qget_propnames (
|
| 900 |
+
const dds_qos_t * __restrict qos,
|
| 901 |
+
uint32_t * n,
|
| 902 |
+
char *** names);
|
| 903 |
+
|
| 904 |
+
/**
|
| 905 |
+
* @ingroup qos_getters
|
| 906 |
+
* @brief Get the value of the property with the provided name from a qos structure.
|
| 907 |
+
*
|
| 908 |
+
* In case more than one property exists with this name, the value for the first
|
| 909 |
+
* property with this name will be returned.
|
| 910 |
+
*
|
| 911 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that contains the property
|
| 912 |
+
* @param[in] name - Pointer to name of the property
|
| 913 |
+
* @param[in,out] value - Pointer to a string that will store the value of the property. The memory for storing the string value will be allocated by this function and the caller gets ownership of the allocated memory
|
| 914 |
+
*
|
| 915 |
+
* @returns - false iff any of the arguments is invalid, the qos is not present in the qos object or there was no property found with the provided name
|
| 916 |
+
*/
|
| 917 |
+
DDS_EXPORT bool
|
| 918 |
+
dds_qget_prop (
|
| 919 |
+
const dds_qos_t * __restrict qos,
|
| 920 |
+
const char * name,
|
| 921 |
+
char ** value);
|
| 922 |
+
|
| 923 |
+
/**
|
| 924 |
+
* @ingroup qos_getters
|
| 925 |
+
* @brief Gets the names of the binary properties from a qos structure.
|
| 926 |
+
*
|
| 927 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that contains binary properties
|
| 928 |
+
* @param[in,out] n - Pointer to number of binary property names that are returned (optional)
|
| 929 |
+
* @param[in,out] names - Pointer that will store the string(s) containing binary property name(s) (optional). This function will allocate the memory for the list of names and for the strings containing the names; the caller gets ownership of the allocated memory
|
| 930 |
+
*
|
| 931 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 932 |
+
*/
|
| 933 |
+
DDS_EXPORT bool
|
| 934 |
+
dds_qget_bpropnames (
|
| 935 |
+
const dds_qos_t * __restrict qos,
|
| 936 |
+
uint32_t * n,
|
| 937 |
+
char *** names);
|
| 938 |
+
|
| 939 |
+
/**
|
| 940 |
+
* @ingroup qos_getters
|
| 941 |
+
* @brief Get the value of the binary property with the provided name from a qos structure.
|
| 942 |
+
*
|
| 943 |
+
* In case more than one binary property exists with this name, the value for the first
|
| 944 |
+
* binary property with this name will be returned.
|
| 945 |
+
*
|
| 946 |
+
* @param[in,out] qos - Pointer to a dds_qos_t structure that contains the property
|
| 947 |
+
* @param[in] name - Pointer to name of the binary property
|
| 948 |
+
* @param[in,out] value - Pointer to a buffer that will store the value of the property. If sz = 0 then a NULL pointer. The memory for storing the value will be allocated by this function and the caller gets ownership of the allocated memory
|
| 949 |
+
* @param[in,out] sz - Pointer that will store the size of the returned buffer.
|
| 950 |
+
*
|
| 951 |
+
* @returns - false iff any of the arguments is invalid, the qos is not present in the qos object or there was no binary property found with the provided name
|
| 952 |
+
*/
|
| 953 |
+
DDS_EXPORT bool
|
| 954 |
+
dds_qget_bprop (
|
| 955 |
+
const dds_qos_t * __restrict qos,
|
| 956 |
+
const char * name,
|
| 957 |
+
void ** value,
|
| 958 |
+
size_t * sz);
|
| 959 |
+
|
| 960 |
+
/**
|
| 961 |
+
* @ingroup qos_getters
|
| 962 |
+
* @brief Get the type consistency enforcement qos policy values.
|
| 963 |
+
*
|
| 964 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 965 |
+
* @param[in,out] kind - Pointer that will store the type consistency enforcement kind (optional)
|
| 966 |
+
* @param[in,out] ignore_sequence_bounds - Pointer that will store the boolean value for ignoring sequence bounds in type assignability checking (optional)
|
| 967 |
+
* @param[in,out] ignore_string_bounds - Pointer that will store the boolean value for ignoring string bounds in type assignability checking (optional)
|
| 968 |
+
* @param[in,out] ignore_member_names - Pointer that will store the boolean value for ignoring member names in type assignability checking (optional)
|
| 969 |
+
* @param[in,out] prevent_type_widening - Pointer that will store the boolean value to prevent type widening in type assignability checking (optional)
|
| 970 |
+
* @param[in,out] force_type_validation - Pointer that will store the boolean value to force type validation in assignability checking (optional)
|
| 971 |
+
*
|
| 972 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 973 |
+
*/
|
| 974 |
+
DDS_EXPORT bool
|
| 975 |
+
dds_qget_type_consistency (
|
| 976 |
+
const dds_qos_t * __restrict qos,
|
| 977 |
+
dds_type_consistency_kind_t *kind,
|
| 978 |
+
bool *ignore_sequence_bounds,
|
| 979 |
+
bool *ignore_string_bounds,
|
| 980 |
+
bool *ignore_member_names,
|
| 981 |
+
bool *prevent_type_widening,
|
| 982 |
+
bool *force_type_validation);
|
| 983 |
+
|
| 984 |
+
/**
|
| 985 |
+
* @ingroup qos_getters
|
| 986 |
+
* @brief Get the data representation qos policy value.
|
| 987 |
+
*
|
| 988 |
+
* Returns the data representation values that are set in the provided QoS object
|
| 989 |
+
* and stores the number of values in out parameter 'n'. In case the 'values' parameter
|
| 990 |
+
* is provided, this function will allocate a buffer that contains the data representation
|
| 991 |
+
* values, and set 'values' to point to this buffer. It is the responsibility of the caller
|
| 992 |
+
* to free the memory of this buffer.
|
| 993 |
+
*
|
| 994 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the policy
|
| 995 |
+
* @param[in,out] n - Pointer that will store the number of data representation values
|
| 996 |
+
* @param[in,out] values - Pointer that will store the data representation values (optional)
|
| 997 |
+
*
|
| 998 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 999 |
+
*/
|
| 1000 |
+
DDS_EXPORT bool
|
| 1001 |
+
dds_qget_data_representation (
|
| 1002 |
+
const dds_qos_t * __restrict qos,
|
| 1003 |
+
uint32_t *n,
|
| 1004 |
+
dds_data_representation_id_t **values);
|
| 1005 |
+
|
| 1006 |
+
/**
|
| 1007 |
+
* @ingroup qos_getters
|
| 1008 |
+
* @brief Get the entity name from a qos structure
|
| 1009 |
+
*
|
| 1010 |
+
* @param[in] qos - Pointer to a dds_qos_t structure storing the entity name
|
| 1011 |
+
* @param[in,out] name - Pointer to a string that will store the returned entity name
|
| 1012 |
+
*
|
| 1013 |
+
* @returns - false iff any of the arguments is invalid or the qos is not present in the qos object
|
| 1014 |
+
* or if a buffer to store the name could not be allocated.
|
| 1015 |
+
*/
|
| 1016 |
+
DDS_EXPORT bool dds_qget_entity_name (const dds_qos_t * __restrict qos, char **name);
|
| 1017 |
+
|
| 1018 |
+
#if defined (__cplusplus)
|
| 1019 |
+
}
|
| 1020 |
+
#endif
|
| 1021 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_qosdefs.h
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef DDS_QOSDEFS_H
|
| 14 |
+
#define DDS_QOSDEFS_H
|
| 15 |
+
|
| 16 |
+
#include <stdint.h>
|
| 17 |
+
|
| 18 |
+
#if defined (__cplusplus)
|
| 19 |
+
extern "C" {
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* @anchor DDS_LENGTH_UNLIMITED
|
| 24 |
+
* @ingroup qos
|
| 25 |
+
* @brief Used for indicating unlimited length in dds_qset_resource_limits()
|
| 26 |
+
*/
|
| 27 |
+
#define DDS_LENGTH_UNLIMITED -1
|
| 28 |
+
|
| 29 |
+
/**
|
| 30 |
+
* @brief Qos Policy IDs
|
| 31 |
+
* @ingroup internal
|
| 32 |
+
* Used internally to mark the QoS policy type
|
| 33 |
+
*/
|
| 34 |
+
typedef enum dds_qos_policy_id {
|
| 35 |
+
DDS_INVALID_QOS_POLICY_ID, /**< Invalid Policy */
|
| 36 |
+
DDS_USERDATA_QOS_POLICY_ID, /**< Userdata policy dds_qset_userdata() */
|
| 37 |
+
DDS_DURABILITY_QOS_POLICY_ID, /**< Durability policy dds_qset_durability() */
|
| 38 |
+
DDS_PRESENTATION_QOS_POLICY_ID, /**< Presentation policy dds_qset_presentation() */
|
| 39 |
+
DDS_DEADLINE_QOS_POLICY_ID, /**< Deadline policy dds_qset_deadline() */
|
| 40 |
+
DDS_LATENCYBUDGET_QOS_POLICY_ID, /**< LatencyBudget policy dds_qset_latency_budget() */
|
| 41 |
+
DDS_OWNERSHIP_QOS_POLICY_ID, /**< Ownership policy dds_qset_ownership() */
|
| 42 |
+
DDS_OWNERSHIPSTRENGTH_QOS_POLICY_ID, /**< OwnershipStrength policy dds_qset_ownership_strength() */
|
| 43 |
+
DDS_LIVELINESS_QOS_POLICY_ID, /**< Liveliness policy dds_qset_liveliness() */
|
| 44 |
+
DDS_TIMEBASEDFILTER_QOS_POLICY_ID, /**< TimeBasedFilter policy dds_qset_time_based_filter() */
|
| 45 |
+
DDS_PARTITION_QOS_POLICY_ID, /**< Partition policy dds_qset_partition() */
|
| 46 |
+
DDS_RELIABILITY_QOS_POLICY_ID, /**< Reliability policy dds_qset_reliability() */
|
| 47 |
+
DDS_DESTINATIONORDER_QOS_POLICY_ID, /**< DestinationOrder policy dds_qset_destination_order() */
|
| 48 |
+
DDS_HISTORY_QOS_POLICY_ID, /**< History policy dds_qset_history() */
|
| 49 |
+
DDS_RESOURCELIMITS_QOS_POLICY_ID, /**< ResourceLimits policy dds_qset_resource_limits() */
|
| 50 |
+
DDS_ENTITYFACTORY_QOS_POLICY_ID, /**< EntityFactory policy */
|
| 51 |
+
DDS_WRITERDATALIFECYCLE_QOS_POLICY_ID, /**< WriterDataLifecycle policy dds_qset_writer_data_lifecycle() */
|
| 52 |
+
DDS_READERDATALIFECYCLE_QOS_POLICY_ID, /**< ReaderDataLifecycle policy dds_qset_reader_data_lifecycle() */
|
| 53 |
+
DDS_TOPICDATA_QOS_POLICY_ID, /**< Topicdata policy dds_qset_topicdata() */
|
| 54 |
+
DDS_GROUPDATA_QOS_POLICY_ID, /**< Groupdata policy dds_qset_groupdata() */
|
| 55 |
+
DDS_TRANSPORTPRIORITY_QOS_POLICY_ID, /**< TransportPriority policy dds_qset_transport_priority() */
|
| 56 |
+
DDS_LIFESPAN_QOS_POLICY_ID, /**< Livespan policy dds_qset_lifespan() */
|
| 57 |
+
DDS_DURABILITYSERVICE_QOS_POLICY_ID, /**< DurabilityService policy dds_qset_durability_service() */
|
| 58 |
+
DDS_PROPERTY_QOS_POLICY_ID, /**< Property policy dds_qset_property() */
|
| 59 |
+
DDS_TYPE_CONSISTENCY_ENFORCEMENT_QOS_POLICY_ID, /**< TypeConsistencyEnforcement policy dds_qset_type_consistency_enforcements() */
|
| 60 |
+
DDS_DATA_REPRESENTATION_QOS_POLICY_ID /**< DataRepresentation policy dds_qset_data_representation() */
|
| 61 |
+
} dds_qos_policy_id_t;
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
/**
|
| 65 |
+
* @brief QoS datatype
|
| 66 |
+
* @ingroup qos
|
| 67 |
+
* QoS structure is opaque
|
| 68 |
+
*/
|
| 69 |
+
typedef struct dds_qos dds_qos_t;
|
| 70 |
+
|
| 71 |
+
/**
|
| 72 |
+
* @brief Durability QoS: Applies to Topic, DataReader, DataWriter
|
| 73 |
+
* @ingroup qos
|
| 74 |
+
*/
|
| 75 |
+
typedef enum dds_durability_kind
|
| 76 |
+
{
|
| 77 |
+
DDS_DURABILITY_VOLATILE, /**< Volatile durability */
|
| 78 |
+
DDS_DURABILITY_TRANSIENT_LOCAL, /**< Transient Local durability */
|
| 79 |
+
DDS_DURABILITY_TRANSIENT, /**< Transient durability */
|
| 80 |
+
DDS_DURABILITY_PERSISTENT /**< Persistent durability */
|
| 81 |
+
}
|
| 82 |
+
dds_durability_kind_t;
|
| 83 |
+
|
| 84 |
+
/**
|
| 85 |
+
* @brief History QoS: Applies to Topic, DataReader, DataWriter
|
| 86 |
+
* @ingroup qos
|
| 87 |
+
*/
|
| 88 |
+
typedef enum dds_history_kind
|
| 89 |
+
{
|
| 90 |
+
DDS_HISTORY_KEEP_LAST, /**< Keep Last history */
|
| 91 |
+
DDS_HISTORY_KEEP_ALL /**< Keep All history */
|
| 92 |
+
}
|
| 93 |
+
dds_history_kind_t;
|
| 94 |
+
|
| 95 |
+
/**
|
| 96 |
+
* @brief Ownership QoS: Applies to Topic, DataReader, DataWriter
|
| 97 |
+
* @ingroup qos
|
| 98 |
+
*/
|
| 99 |
+
typedef enum dds_ownership_kind
|
| 100 |
+
{
|
| 101 |
+
DDS_OWNERSHIP_SHARED, /**< Shared Ownership */
|
| 102 |
+
DDS_OWNERSHIP_EXCLUSIVE /**< Exclusive Ownership */
|
| 103 |
+
}
|
| 104 |
+
dds_ownership_kind_t;
|
| 105 |
+
|
| 106 |
+
/**
|
| 107 |
+
* @brief Liveliness QoS: Applies to Topic, DataReader, DataWriter
|
| 108 |
+
* @ingroup qos
|
| 109 |
+
*/
|
| 110 |
+
typedef enum dds_liveliness_kind
|
| 111 |
+
{
|
| 112 |
+
DDS_LIVELINESS_AUTOMATIC, /**< Automatic liveliness */
|
| 113 |
+
DDS_LIVELINESS_MANUAL_BY_PARTICIPANT, /**< Manual by Participant liveliness */
|
| 114 |
+
DDS_LIVELINESS_MANUAL_BY_TOPIC /**< Manual by Topic liveliness */
|
| 115 |
+
}
|
| 116 |
+
dds_liveliness_kind_t;
|
| 117 |
+
|
| 118 |
+
/**
|
| 119 |
+
* @brief Reliability QoS: Applies to Topic, DataReader, DataWriter
|
| 120 |
+
* @ingroup qos
|
| 121 |
+
*/
|
| 122 |
+
typedef enum dds_reliability_kind
|
| 123 |
+
{
|
| 124 |
+
DDS_RELIABILITY_BEST_EFFORT, /**< Best Effort reliability */
|
| 125 |
+
DDS_RELIABILITY_RELIABLE /**< Reliable reliability */
|
| 126 |
+
}
|
| 127 |
+
dds_reliability_kind_t;
|
| 128 |
+
|
| 129 |
+
/**
|
| 130 |
+
* @brief DestinationOrder QoS: Applies to Topic, DataReader, DataWriter
|
| 131 |
+
* @ingroup qos
|
| 132 |
+
*/
|
| 133 |
+
typedef enum dds_destination_order_kind
|
| 134 |
+
{
|
| 135 |
+
DDS_DESTINATIONORDER_BY_RECEPTION_TIMESTAMP, /**< order by reception timestamp */
|
| 136 |
+
DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP /**< order by source timestamp */
|
| 137 |
+
}
|
| 138 |
+
dds_destination_order_kind_t;
|
| 139 |
+
|
| 140 |
+
/**
|
| 141 |
+
* @brief Presentation QoS: Applies to Publisher, Subscriber
|
| 142 |
+
* @ingroup qos
|
| 143 |
+
*/
|
| 144 |
+
typedef enum dds_presentation_access_scope_kind
|
| 145 |
+
{
|
| 146 |
+
DDS_PRESENTATION_INSTANCE, /**< presentation scope per instance */
|
| 147 |
+
DDS_PRESENTATION_TOPIC, /**< presentation scope per topic */
|
| 148 |
+
DDS_PRESENTATION_GROUP /**< presentation scope per group */
|
| 149 |
+
}
|
| 150 |
+
dds_presentation_access_scope_kind_t;
|
| 151 |
+
|
| 152 |
+
/**
|
| 153 |
+
* @brief Ignore-local QoS: Applies to DataReader, DataWriter
|
| 154 |
+
* @ingroup qos
|
| 155 |
+
*/
|
| 156 |
+
typedef enum dds_ignorelocal_kind
|
| 157 |
+
{
|
| 158 |
+
DDS_IGNORELOCAL_NONE, /**< Don't ignore local data */
|
| 159 |
+
DDS_IGNORELOCAL_PARTICIPANT, /**< Ignore local data from same participant */
|
| 160 |
+
DDS_IGNORELOCAL_PROCESS /**< Ignore local data from same process */
|
| 161 |
+
}
|
| 162 |
+
dds_ignorelocal_kind_t;
|
| 163 |
+
|
| 164 |
+
/**
|
| 165 |
+
* @brief Type-consistency QoS: Applies to DataReader, DataWriter
|
| 166 |
+
* @ingroup qos
|
| 167 |
+
*/
|
| 168 |
+
typedef enum dds_type_consistency_kind
|
| 169 |
+
{
|
| 170 |
+
DDS_TYPE_CONSISTENCY_DISALLOW_TYPE_COERCION, /**< Do not allow type coercion */
|
| 171 |
+
DDS_TYPE_CONSISTENCY_ALLOW_TYPE_COERCION /**< Allow type coercion */
|
| 172 |
+
}
|
| 173 |
+
dds_type_consistency_kind_t;
|
| 174 |
+
|
| 175 |
+
/**
|
| 176 |
+
* @brief Data Representation QoS: Applies to Topic, DataReader, DataWriter
|
| 177 |
+
* @ingroup qos
|
| 178 |
+
*/
|
| 179 |
+
typedef int16_t dds_data_representation_id_t;
|
| 180 |
+
|
| 181 |
+
#if defined (__cplusplus)
|
| 182 |
+
}
|
| 183 |
+
#endif
|
| 184 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_public_status.h
ADDED
|
@@ -0,0 +1,512 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2019 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* @defgroup dcps_status (DDS C Communication Status API)
|
| 15 |
+
* @ingroup dds
|
| 16 |
+
* This defines the public API of the Communication Status in the
|
| 17 |
+
* Eclipse Cyclone DDS C language binding. Listeners are implemented
|
| 18 |
+
* as structs containing callback functions that take listener status types
|
| 19 |
+
* as arguments.
|
| 20 |
+
*/
|
| 21 |
+
#ifndef DDS_STATUS_H
|
| 22 |
+
#define DDS_STATUS_H
|
| 23 |
+
|
| 24 |
+
#include "dds/export.h"
|
| 25 |
+
|
| 26 |
+
#if defined (__cplusplus)
|
| 27 |
+
extern "C" {
|
| 28 |
+
#endif
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* @ingroup dcps_status
|
| 32 |
+
* @brief DCPS_Status_OfferedDeadlineMissed
|
| 33 |
+
* DOC_TODO
|
| 34 |
+
*/
|
| 35 |
+
typedef struct dds_offered_deadline_missed_status
|
| 36 |
+
{
|
| 37 |
+
uint32_t total_count; /**< DOC_TODO */
|
| 38 |
+
int32_t total_count_change; /**< DOC_TODO */
|
| 39 |
+
dds_instance_handle_t last_instance_handle; /**< DOC_TODO */
|
| 40 |
+
}
|
| 41 |
+
dds_offered_deadline_missed_status_t;
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* @ingroup dcps_status
|
| 45 |
+
* @brief DCPS_Status_OfferedIncompatibleQoS
|
| 46 |
+
* DOC_TODO
|
| 47 |
+
*/
|
| 48 |
+
typedef struct dds_offered_incompatible_qos_status
|
| 49 |
+
{
|
| 50 |
+
uint32_t total_count; /**< DOC_TODO */
|
| 51 |
+
int32_t total_count_change; /**< DOC_TODO */
|
| 52 |
+
uint32_t last_policy_id; /**< DOC_TODO */
|
| 53 |
+
}
|
| 54 |
+
dds_offered_incompatible_qos_status_t;
|
| 55 |
+
|
| 56 |
+
/**
|
| 57 |
+
* @ingroup dcps_status
|
| 58 |
+
* @brief DCPS_Status_PublicationMatched
|
| 59 |
+
* DOC_TODO
|
| 60 |
+
*/
|
| 61 |
+
typedef struct dds_publication_matched_status
|
| 62 |
+
{
|
| 63 |
+
uint32_t total_count; /**< DOC_TODO */
|
| 64 |
+
int32_t total_count_change; /**< DOC_TODO */
|
| 65 |
+
uint32_t current_count; /**< DOC_TODO */
|
| 66 |
+
int32_t current_count_change; /**< DOC_TODO */
|
| 67 |
+
dds_instance_handle_t last_subscription_handle; /**< DOC_TODO */
|
| 68 |
+
}
|
| 69 |
+
dds_publication_matched_status_t;
|
| 70 |
+
|
| 71 |
+
/**
|
| 72 |
+
* @ingroup dcps_status
|
| 73 |
+
* @brief DCPS_Status_LivelinessLost
|
| 74 |
+
* DOC_TODO
|
| 75 |
+
*/
|
| 76 |
+
typedef struct dds_liveliness_lost_status
|
| 77 |
+
{
|
| 78 |
+
uint32_t total_count; /**< DOC_TODO */
|
| 79 |
+
int32_t total_count_change; /**< DOC_TODO */
|
| 80 |
+
}
|
| 81 |
+
dds_liveliness_lost_status_t;
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* @ingroup dcps_status
|
| 85 |
+
* @brief DCPS_Status_SubscriptionMatched
|
| 86 |
+
* DOC_TODO
|
| 87 |
+
*/
|
| 88 |
+
typedef struct dds_subscription_matched_status
|
| 89 |
+
{
|
| 90 |
+
uint32_t total_count; /**< DOC_TODO */
|
| 91 |
+
int32_t total_count_change; /**< DOC_TODO */
|
| 92 |
+
uint32_t current_count; /**< DOC_TODO */
|
| 93 |
+
int32_t current_count_change; /**< DOC_TODO */
|
| 94 |
+
dds_instance_handle_t last_publication_handle; /**< DOC_TODO */
|
| 95 |
+
}
|
| 96 |
+
dds_subscription_matched_status_t;
|
| 97 |
+
|
| 98 |
+
/**
|
| 99 |
+
* @ingroup dcps_status
|
| 100 |
+
* @brief Rejected Status
|
| 101 |
+
* DOC_TODO
|
| 102 |
+
*/
|
| 103 |
+
typedef enum
|
| 104 |
+
{
|
| 105 |
+
DDS_NOT_REJECTED, /**< DOC_TODO */
|
| 106 |
+
DDS_REJECTED_BY_INSTANCES_LIMIT, /**< DOC_TODO */
|
| 107 |
+
DDS_REJECTED_BY_SAMPLES_LIMIT, /**< DOC_TODO */
|
| 108 |
+
DDS_REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT /**< DOC_TODO */
|
| 109 |
+
}
|
| 110 |
+
dds_sample_rejected_status_kind;
|
| 111 |
+
|
| 112 |
+
/**
|
| 113 |
+
* @ingroup dcps_status
|
| 114 |
+
* @brief DCPS_Status_SampleRejected
|
| 115 |
+
* DOC_TODO
|
| 116 |
+
*/
|
| 117 |
+
typedef struct dds_sample_rejected_status
|
| 118 |
+
{
|
| 119 |
+
uint32_t total_count; /**< DOC_TODO */
|
| 120 |
+
int32_t total_count_change; /**< DOC_TODO */
|
| 121 |
+
dds_sample_rejected_status_kind last_reason; /**< DOC_TODO */
|
| 122 |
+
dds_instance_handle_t last_instance_handle; /**< DOC_TODO */
|
| 123 |
+
}
|
| 124 |
+
dds_sample_rejected_status_t;
|
| 125 |
+
|
| 126 |
+
/**
|
| 127 |
+
* @ingroup dcps_status
|
| 128 |
+
* @brief DCPS_Status_LivelinessChanged
|
| 129 |
+
* DOC_TODO
|
| 130 |
+
*/
|
| 131 |
+
typedef struct dds_liveliness_changed_status
|
| 132 |
+
{
|
| 133 |
+
uint32_t alive_count; /**< DOC_TODO */
|
| 134 |
+
uint32_t not_alive_count; /**< DOC_TODO */
|
| 135 |
+
int32_t alive_count_change; /**< DOC_TODO */
|
| 136 |
+
int32_t not_alive_count_change; /**< DOC_TODO */
|
| 137 |
+
dds_instance_handle_t last_publication_handle; /**< DOC_TODO */
|
| 138 |
+
}
|
| 139 |
+
dds_liveliness_changed_status_t;
|
| 140 |
+
|
| 141 |
+
/**
|
| 142 |
+
* @ingroup dcps_status
|
| 143 |
+
* @brief DCPS_Status_RequestedDeadlineMissed
|
| 144 |
+
* DOC_TODO
|
| 145 |
+
*/
|
| 146 |
+
typedef struct dds_requested_deadline_missed_status
|
| 147 |
+
{
|
| 148 |
+
uint32_t total_count; /**< DOC_TODO */
|
| 149 |
+
int32_t total_count_change; /**< DOC_TODO */
|
| 150 |
+
dds_instance_handle_t last_instance_handle; /**< DOC_TODO */
|
| 151 |
+
}
|
| 152 |
+
dds_requested_deadline_missed_status_t;
|
| 153 |
+
|
| 154 |
+
/**
|
| 155 |
+
* @ingroup dcps_status
|
| 156 |
+
* @brief DCPS_Status_RequestedIncompatibleQoS
|
| 157 |
+
* DOC_TODO
|
| 158 |
+
*/
|
| 159 |
+
typedef struct dds_requested_incompatible_qos_status
|
| 160 |
+
{
|
| 161 |
+
uint32_t total_count; /**< DOC_TODO */
|
| 162 |
+
int32_t total_count_change; /**< DOC_TODO */
|
| 163 |
+
uint32_t last_policy_id; /**< DOC_TODO */
|
| 164 |
+
}
|
| 165 |
+
dds_requested_incompatible_qos_status_t;
|
| 166 |
+
|
| 167 |
+
/**
|
| 168 |
+
* @ingroup dcps_status
|
| 169 |
+
* @brief DCPS_Status_SampleLost
|
| 170 |
+
* DOC_TODO
|
| 171 |
+
*/
|
| 172 |
+
typedef struct dds_sample_lost_status
|
| 173 |
+
{
|
| 174 |
+
uint32_t total_count; /**< DOC_TODO */
|
| 175 |
+
int32_t total_count_change; /**< DOC_TODO */
|
| 176 |
+
}
|
| 177 |
+
dds_sample_lost_status_t;
|
| 178 |
+
|
| 179 |
+
/**
|
| 180 |
+
* @ingroup dcps_status
|
| 181 |
+
* @brief DCPS_Status_InconsistentTopic
|
| 182 |
+
* DOC_TODO
|
| 183 |
+
*/
|
| 184 |
+
typedef struct dds_inconsistent_topic_status
|
| 185 |
+
{
|
| 186 |
+
uint32_t total_count; /**< DOC_TODO */
|
| 187 |
+
int32_t total_count_change; /**< DOC_TODO */
|
| 188 |
+
}
|
| 189 |
+
dds_inconsistent_topic_status_t;
|
| 190 |
+
|
| 191 |
+
|
| 192 |
+
/**
|
| 193 |
+
* @defgroup dcps_status_getters (DCPS Status Getters)
|
| 194 |
+
* @ingroup dcps_status
|
| 195 |
+
* get_<status> APIs return the status of an entity and resets the status
|
| 196 |
+
*/
|
| 197 |
+
|
| 198 |
+
/**
|
| 199 |
+
* @ingroup dcps_status_getters
|
| 200 |
+
* @brief Get INCONSISTENT_TOPIC status
|
| 201 |
+
*
|
| 202 |
+
* This operation gets the status value corresponding to INCONSISTENT_TOPIC
|
| 203 |
+
* and reset the status. The value can be obtained, only if the status is enabled for an entity.
|
| 204 |
+
* NULL value for status is allowed and it will reset the trigger value when status is enabled.
|
| 205 |
+
*
|
| 206 |
+
* @param[in] topic The entity to get the status
|
| 207 |
+
* @param[out] status The pointer to @ref dds_inconsistent_topic_status_t to get the status
|
| 208 |
+
*
|
| 209 |
+
* @returns 0 - Success
|
| 210 |
+
* @returns <0 - Failure
|
| 211 |
+
*
|
| 212 |
+
* @retval DDS_RETCODE_ERROR
|
| 213 |
+
* An internal error has occurred.
|
| 214 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 215 |
+
* One of the given arguments is not valid.
|
| 216 |
+
* @retval DDS_RETCODE_ILLEGAL_OPERATION
|
| 217 |
+
* The operation is invoked on an inappropriate object.
|
| 218 |
+
* @retval DDS_RETCODE_ALREADY_DELETED
|
| 219 |
+
* The entity has already been deleted.
|
| 220 |
+
*/
|
| 221 |
+
DDS_EXPORT dds_return_t
|
| 222 |
+
dds_get_inconsistent_topic_status (
|
| 223 |
+
dds_entity_t topic,
|
| 224 |
+
dds_inconsistent_topic_status_t * status);
|
| 225 |
+
|
| 226 |
+
/**
|
| 227 |
+
* @ingroup dcps_status_getters
|
| 228 |
+
* @brief Get PUBLICATION_MATCHED status
|
| 229 |
+
*
|
| 230 |
+
* This operation gets the status value corresponding to PUBLICATION_MATCHED
|
| 231 |
+
* and reset the status. The value can be obtained, only if the status is enabled for an entity.
|
| 232 |
+
* NULL value for status is allowed and it will reset the trigger value when status is enabled.
|
| 233 |
+
*
|
| 234 |
+
* @param[in] writer The entity to get the status
|
| 235 |
+
* @param[out] status The pointer to @ref dds_publication_matched_status_t to get the status
|
| 236 |
+
*
|
| 237 |
+
* @returns 0 - Success
|
| 238 |
+
* @returns <0 - Failure
|
| 239 |
+
*
|
| 240 |
+
* @retval DDS_RETCODE_ERROR
|
| 241 |
+
* An internal error has occurred.
|
| 242 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 243 |
+
* One of the given arguments is not valid.
|
| 244 |
+
* @retval DDS_RETCODE_ILLEGAL_OPERATION
|
| 245 |
+
* The operation is invoked on an inappropriate object.
|
| 246 |
+
* @retval DDS_RETCODE_ALREADY_DELETED
|
| 247 |
+
* The entity has already been deleted.
|
| 248 |
+
*/
|
| 249 |
+
DDS_EXPORT dds_return_t
|
| 250 |
+
dds_get_publication_matched_status (
|
| 251 |
+
dds_entity_t writer,
|
| 252 |
+
dds_publication_matched_status_t * status);
|
| 253 |
+
|
| 254 |
+
/**
|
| 255 |
+
* @ingroup dcps_status_getters
|
| 256 |
+
* @brief Get LIVELINESS_LOST status
|
| 257 |
+
*
|
| 258 |
+
* This operation gets the status value corresponding to LIVELINESS_LOST
|
| 259 |
+
* and reset the status. The value can be obtained, only if the status is enabled for an entity.
|
| 260 |
+
* NULL value for status is allowed and it will reset the trigger value when status is enabled.
|
| 261 |
+
*
|
| 262 |
+
* @param[in] writer The entity to get the status
|
| 263 |
+
* @param[out] status The pointer to @ref dds_liveliness_lost_status_t to get the status
|
| 264 |
+
*
|
| 265 |
+
* @returns 0 - Success
|
| 266 |
+
* @returns <0 - Failure
|
| 267 |
+
*
|
| 268 |
+
* @retval DDS_RETCODE_ERROR
|
| 269 |
+
* An internal error has occurred.
|
| 270 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 271 |
+
* One of the given arguments is not valid.
|
| 272 |
+
* @retval DDS_RETCODE_ILLEGAL_OPERATION
|
| 273 |
+
* The operation is invoked on an inappropriate object.
|
| 274 |
+
* @retval DDS_RETCODE_ALREADY_DELETED
|
| 275 |
+
* The entity has already been deleted.
|
| 276 |
+
*/
|
| 277 |
+
DDS_EXPORT dds_return_t
|
| 278 |
+
dds_get_liveliness_lost_status (
|
| 279 |
+
dds_entity_t writer,
|
| 280 |
+
dds_liveliness_lost_status_t * status);
|
| 281 |
+
|
| 282 |
+
/**
|
| 283 |
+
* @ingroup dcps_status_getters
|
| 284 |
+
* @brief Get OFFERED_DEADLINE_MISSED status
|
| 285 |
+
*
|
| 286 |
+
* This operation gets the status value corresponding to OFFERED_DEADLINE_MISSED
|
| 287 |
+
* and reset the status. The value can be obtained, only if the status is enabled for an entity.
|
| 288 |
+
* NULL value for status is allowed and it will reset the trigger value when status is enabled.
|
| 289 |
+
*
|
| 290 |
+
* @param[in] writer The entity to get the status
|
| 291 |
+
* @param[out] status The pointer to @ref dds_offered_deadline_missed_status_t to get the status
|
| 292 |
+
*
|
| 293 |
+
* @returns 0 - Success
|
| 294 |
+
* @returns <0 - Failure
|
| 295 |
+
*
|
| 296 |
+
* @retval DDS_RETCODE_ERROR
|
| 297 |
+
* An internal error has occurred.
|
| 298 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 299 |
+
* One of the given arguments is not valid.
|
| 300 |
+
* @retval DDS_RETCODE_ILLEGAL_OPERATION
|
| 301 |
+
* The operation is invoked on an inappropriate object.
|
| 302 |
+
* @retval DDS_RETCODE_ALREADY_DELETED
|
| 303 |
+
* The entity has already been deleted.
|
| 304 |
+
*/
|
| 305 |
+
DDS_EXPORT dds_return_t
|
| 306 |
+
dds_get_offered_deadline_missed_status(
|
| 307 |
+
dds_entity_t writer,
|
| 308 |
+
dds_offered_deadline_missed_status_t *status);
|
| 309 |
+
|
| 310 |
+
/**
|
| 311 |
+
* @ingroup dcps_status_getters
|
| 312 |
+
* @brief Get OFFERED_INCOMPATIBLE_QOS status
|
| 313 |
+
*
|
| 314 |
+
* This operation gets the status value corresponding to OFFERED_INCOMPATIBLE_QOS
|
| 315 |
+
* and reset the status. The value can be obtained, only if the status is enabled for an entity.
|
| 316 |
+
* NULL value for status is allowed and it will reset the trigger value when status is enabled.
|
| 317 |
+
*
|
| 318 |
+
* @param[in] writer The writer entity to get the status
|
| 319 |
+
* @param[out] status The pointer to @ref dds_offered_incompatible_qos_status_t to get the status
|
| 320 |
+
*
|
| 321 |
+
* @returns 0 - Success
|
| 322 |
+
* @returns <0 - Failure
|
| 323 |
+
*
|
| 324 |
+
* @retval DDS_RETCODE_ERROR
|
| 325 |
+
* An internal error has occurred.
|
| 326 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 327 |
+
* One of the given arguments is not valid.
|
| 328 |
+
* @retval DDS_RETCODE_ILLEGAL_OPERATION
|
| 329 |
+
* The operation is invoked on an inappropriate object.
|
| 330 |
+
* @retval DDS_RETCODE_ALREADY_DELETED
|
| 331 |
+
* The entity has already been deleted.
|
| 332 |
+
*/
|
| 333 |
+
DDS_EXPORT dds_return_t
|
| 334 |
+
dds_get_offered_incompatible_qos_status (
|
| 335 |
+
dds_entity_t writer,
|
| 336 |
+
dds_offered_incompatible_qos_status_t * status);
|
| 337 |
+
|
| 338 |
+
/**
|
| 339 |
+
* @ingroup dcps_status_getters
|
| 340 |
+
* @brief Get SUBSCRIPTION_MATCHED status
|
| 341 |
+
*
|
| 342 |
+
* This operation gets the status value corresponding to SUBSCRIPTION_MATCHED
|
| 343 |
+
* and reset the status. The value can be obtained, only if the status is enabled for an entity.
|
| 344 |
+
* NULL value for status is allowed and it will reset the trigger value when status is enabled.
|
| 345 |
+
*
|
| 346 |
+
* @param[in] reader The reader entity to get the status
|
| 347 |
+
* @param[out] status The pointer to @ref dds_subscription_matched_status_t to get the status
|
| 348 |
+
*
|
| 349 |
+
* @returns 0 - Success
|
| 350 |
+
* @returns <0 - Failure
|
| 351 |
+
*
|
| 352 |
+
* @retval DDS_RETCODE_ERROR
|
| 353 |
+
* An internal error has occurred.
|
| 354 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 355 |
+
* One of the given arguments is not valid.
|
| 356 |
+
* @retval DDS_RETCODE_ILLEGAL_OPERATION
|
| 357 |
+
* The operation is invoked on an inappropriate object.
|
| 358 |
+
* @retval DDS_RETCODE_ALREADY_DELETED
|
| 359 |
+
* The entity has already been deleted.
|
| 360 |
+
*/
|
| 361 |
+
DDS_EXPORT dds_return_t
|
| 362 |
+
dds_get_subscription_matched_status (
|
| 363 |
+
dds_entity_t reader,
|
| 364 |
+
dds_subscription_matched_status_t * status);
|
| 365 |
+
|
| 366 |
+
/**
|
| 367 |
+
* @ingroup dcps_status_getters
|
| 368 |
+
* @brief Get LIVELINESS_CHANGED status
|
| 369 |
+
*
|
| 370 |
+
* This operation gets the status value corresponding to LIVELINESS_CHANGED
|
| 371 |
+
* and reset the status. The value can be obtained, only if the status is enabled for an entity.
|
| 372 |
+
* NULL value for status is allowed and it will reset the trigger value when status is enabled.
|
| 373 |
+
*
|
| 374 |
+
* @param[in] reader The entity to get the status
|
| 375 |
+
* @param[out] status The pointer to @ref dds_liveliness_changed_status_t to get the status
|
| 376 |
+
*
|
| 377 |
+
* @returns 0 - Success
|
| 378 |
+
* @returns <0 - Failure
|
| 379 |
+
*
|
| 380 |
+
* @retval DDS_RETCODE_ERROR
|
| 381 |
+
* An internal error has occurred.
|
| 382 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 383 |
+
* One of the given arguments is not valid.
|
| 384 |
+
* @retval DDS_RETCODE_ILLEGAL_OPERATION
|
| 385 |
+
* The operation is invoked on an inappropriate object.
|
| 386 |
+
* @retval DDS_RETCODE_ALREADY_DELETED
|
| 387 |
+
* The entity has already been deleted.
|
| 388 |
+
*/
|
| 389 |
+
DDS_EXPORT dds_return_t
|
| 390 |
+
dds_get_liveliness_changed_status (
|
| 391 |
+
dds_entity_t reader,
|
| 392 |
+
dds_liveliness_changed_status_t * status);
|
| 393 |
+
|
| 394 |
+
/**
|
| 395 |
+
* @ingroup dcps_status_getters
|
| 396 |
+
* @brief Get SAMPLE_REJECTED status
|
| 397 |
+
*
|
| 398 |
+
* This operation gets the status value corresponding to SAMPLE_REJECTED
|
| 399 |
+
* and reset the status. The value can be obtained, only if the status is enabled for an entity.
|
| 400 |
+
* NULL value for status is allowed and it will reset the trigger value when status is enabled.
|
| 401 |
+
*
|
| 402 |
+
* @param[in] reader The entity to get the status
|
| 403 |
+
* @param[out] status The pointer to @ref dds_sample_rejected_status_t to get the status
|
| 404 |
+
*
|
| 405 |
+
* @returns 0 - Success
|
| 406 |
+
* @returns <0 - Failure
|
| 407 |
+
*
|
| 408 |
+
* @retval DDS_RETCODE_ERROR
|
| 409 |
+
* An internal error has occurred.
|
| 410 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 411 |
+
* One of the given arguments is not valid.
|
| 412 |
+
* @retval DDS_RETCODE_ILLEGAL_OPERATION
|
| 413 |
+
* The operation is invoked on an inappropriate object.
|
| 414 |
+
* @retval DDS_RETCODE_ALREADY_DELETED
|
| 415 |
+
* The entity has already been deleted.
|
| 416 |
+
*/
|
| 417 |
+
DDS_EXPORT dds_return_t
|
| 418 |
+
dds_get_sample_rejected_status (
|
| 419 |
+
dds_entity_t reader,
|
| 420 |
+
dds_sample_rejected_status_t * status);
|
| 421 |
+
|
| 422 |
+
/**
|
| 423 |
+
* @ingroup dcps_status_getters
|
| 424 |
+
* @brief Get SAMPLE_LOST status
|
| 425 |
+
*
|
| 426 |
+
* This operation gets the status value corresponding to SAMPLE_LOST
|
| 427 |
+
* and reset the status. The value can be obtained, only if the status is enabled for an entity.
|
| 428 |
+
* NULL value for status is allowed and it will reset the trigger value when status is enabled.
|
| 429 |
+
*
|
| 430 |
+
* @param[in] reader The entity to get the status
|
| 431 |
+
* @param[out] status The pointer to @ref dds_sample_lost_status_t to get the status
|
| 432 |
+
*
|
| 433 |
+
* @returns A dds_return_t indicating success or failure
|
| 434 |
+
*
|
| 435 |
+
* @retval DDS_RETCODE_OK
|
| 436 |
+
* Success
|
| 437 |
+
* @retval DDS_RETCODE_ERROR
|
| 438 |
+
* An internal error has occurred.
|
| 439 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 440 |
+
* One of the given arguments is not valid.
|
| 441 |
+
* @retval DDS_RETCODE_ILLEGAL_OPERATION
|
| 442 |
+
* The operation is invoked on an inappropriate object.
|
| 443 |
+
* @retval DDS_RETCODE_ALREADY_DELETED
|
| 444 |
+
* The entity has already been deleted.
|
| 445 |
+
*/
|
| 446 |
+
DDS_EXPORT dds_return_t
|
| 447 |
+
dds_get_sample_lost_status (
|
| 448 |
+
dds_entity_t reader,
|
| 449 |
+
dds_sample_lost_status_t * status);
|
| 450 |
+
|
| 451 |
+
/**
|
| 452 |
+
* @ingroup dcps_status_getters
|
| 453 |
+
* @brief Get REQUESTED_DEADLINE_MISSED status
|
| 454 |
+
*
|
| 455 |
+
* This operation gets the status value corresponding to REQUESTED_DEADLINE_MISSED
|
| 456 |
+
* and reset the status. The value can be obtained, only if the status is enabled for an entity.
|
| 457 |
+
* NULL value for status is allowed and it will reset the trigger value when status is enabled.
|
| 458 |
+
*
|
| 459 |
+
* @param[in] reader The entity to get the status
|
| 460 |
+
* @param[out] status The pointer to @ref dds_requested_deadline_missed_status_t to get the status
|
| 461 |
+
*
|
| 462 |
+
* @returns A dds_return_t indicating success or failure
|
| 463 |
+
*
|
| 464 |
+
* @retval DDS_RETCODE_OK
|
| 465 |
+
* Success
|
| 466 |
+
* @retval DDS_RETCODE_ERROR
|
| 467 |
+
* An internal error has occurred.
|
| 468 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 469 |
+
* One of the given arguments is not valid.
|
| 470 |
+
* @retval DDS_RETCODE_ILLEGAL_OPERATION
|
| 471 |
+
* The operation is invoked on an inappropriate object.
|
| 472 |
+
* @retval DDS_RETCODE_ALREADY_DELETED
|
| 473 |
+
* The entity has already been deleted.
|
| 474 |
+
*/
|
| 475 |
+
DDS_EXPORT dds_return_t
|
| 476 |
+
dds_get_requested_deadline_missed_status (
|
| 477 |
+
dds_entity_t reader,
|
| 478 |
+
dds_requested_deadline_missed_status_t * status);
|
| 479 |
+
|
| 480 |
+
/**
|
| 481 |
+
* @ingroup dcps_status_getters
|
| 482 |
+
* @brief Get REQUESTED_INCOMPATIBLE_QOS status
|
| 483 |
+
*
|
| 484 |
+
* This operation gets the status value corresponding to REQUESTED_INCOMPATIBLE_QOS
|
| 485 |
+
* and reset the status. The value can be obtained, only if the status is enabled for an entity.
|
| 486 |
+
* NULL value for status is allowed and it will reset the trigger value when status is enabled.
|
| 487 |
+
*
|
| 488 |
+
* @param[in] reader The entity to get the status
|
| 489 |
+
* @param[out] status The pointer to @ref dds_requested_incompatible_qos_status_t to get the status
|
| 490 |
+
*
|
| 491 |
+
* @returns A dds_return_t indicating success or failure
|
| 492 |
+
*
|
| 493 |
+
* @retval DDS_RETCODE_OK
|
| 494 |
+
* Success
|
| 495 |
+
* @retval DDS_RETCODE_ERROR
|
| 496 |
+
* An internal error has occurred.
|
| 497 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 498 |
+
* One of the given arguments is not valid.
|
| 499 |
+
* @retval DDS_RETCODE_ILLEGAL_OPERATION
|
| 500 |
+
* The operation is invoked on an inappropriate object.
|
| 501 |
+
* @retval DDS_RETCODE_ALREADY_DELETED
|
| 502 |
+
* The entity has already been deleted.
|
| 503 |
+
*/
|
| 504 |
+
DDS_EXPORT dds_return_t
|
| 505 |
+
dds_get_requested_incompatible_qos_status (
|
| 506 |
+
dds_entity_t reader,
|
| 507 |
+
dds_requested_incompatible_qos_status_t * status);
|
| 508 |
+
|
| 509 |
+
#if defined (__cplusplus)
|
| 510 |
+
}
|
| 511 |
+
#endif
|
| 512 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_rhc.h
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef _DDS_RHC_H_
|
| 13 |
+
#define _DDS_RHC_H_
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsrt/static_assert.h"
|
| 16 |
+
#include "dds/ddsi/ddsi_rhc.h"
|
| 17 |
+
|
| 18 |
+
#ifndef DOXYGEN_SHOULD_SKIP_THIS /** DOC_TODO we should document the rhc */
|
| 19 |
+
|
| 20 |
+
#define NO_STATE_MASK_SET (DDS_ANY_STATE + 1)
|
| 21 |
+
|
| 22 |
+
#if defined (__cplusplus)
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
struct dds_rhc;
|
| 27 |
+
struct dds_readcond;
|
| 28 |
+
struct dds_reader;
|
| 29 |
+
struct ddsi_tkmap;
|
| 30 |
+
|
| 31 |
+
typedef dds_return_t (*dds_rhc_associate_t) (struct dds_rhc *rhc, struct dds_reader *reader, const struct ddsi_sertype *type, struct ddsi_tkmap *tkmap);
|
| 32 |
+
typedef int32_t (*dds_rhc_read_take_t) (struct dds_rhc *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, struct dds_readcond *cond);
|
| 33 |
+
typedef int32_t (*dds_rhc_read_take_cdr_t) (struct dds_rhc *rhc, bool lock, struct ddsi_serdata **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t sample_states, uint32_t view_states, uint32_t instance_states, dds_instance_handle_t handle);
|
| 34 |
+
|
| 35 |
+
typedef bool (*dds_rhc_add_readcondition_t) (struct dds_rhc *rhc, struct dds_readcond *cond);
|
| 36 |
+
typedef void (*dds_rhc_remove_readcondition_t) (struct dds_rhc *rhc, struct dds_readcond *cond);
|
| 37 |
+
|
| 38 |
+
typedef uint32_t (*dds_rhc_lock_samples_t) (struct dds_rhc *rhc);
|
| 39 |
+
|
| 40 |
+
struct dds_rhc_ops {
|
| 41 |
+
/* A copy of DDSI rhc ops comes first so we can use either interface without
|
| 42 |
+
additional indirections */
|
| 43 |
+
struct ddsi_rhc_ops rhc_ops;
|
| 44 |
+
dds_rhc_read_take_t read;
|
| 45 |
+
dds_rhc_read_take_t take;
|
| 46 |
+
dds_rhc_read_take_cdr_t readcdr;
|
| 47 |
+
dds_rhc_read_take_cdr_t takecdr;
|
| 48 |
+
dds_rhc_add_readcondition_t add_readcondition;
|
| 49 |
+
dds_rhc_remove_readcondition_t remove_readcondition;
|
| 50 |
+
dds_rhc_lock_samples_t lock_samples;
|
| 51 |
+
dds_rhc_associate_t associate;
|
| 52 |
+
};
|
| 53 |
+
|
| 54 |
+
struct dds_rhc {
|
| 55 |
+
union {
|
| 56 |
+
const struct dds_rhc_ops *ops;
|
| 57 |
+
struct ddsi_rhc rhc;
|
| 58 |
+
} common;
|
| 59 |
+
};
|
| 60 |
+
|
| 61 |
+
DDSRT_STATIC_ASSERT (offsetof (struct dds_rhc, common.ops) == offsetof (struct ddsi_rhc, ops));
|
| 62 |
+
|
| 63 |
+
DDS_INLINE_EXPORT inline dds_return_t dds_rhc_associate (struct dds_rhc *rhc, struct dds_reader *reader, const struct ddsi_sertype *type, struct ddsi_tkmap *tkmap) {
|
| 64 |
+
return rhc->common.ops->associate (rhc, reader, type, tkmap);
|
| 65 |
+
}
|
| 66 |
+
DDS_INLINE_EXPORT inline bool dds_rhc_store (struct dds_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk) {
|
| 67 |
+
return rhc->common.ops->rhc_ops.store (&rhc->common.rhc, wrinfo, sample, tk);
|
| 68 |
+
}
|
| 69 |
+
DDS_INLINE_EXPORT inline void dds_rhc_unregister_wr (struct dds_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo) {
|
| 70 |
+
rhc->common.ops->rhc_ops.unregister_wr (&rhc->common.rhc, wrinfo);
|
| 71 |
+
}
|
| 72 |
+
DDS_INLINE_EXPORT inline void dds_rhc_relinquish_ownership (struct dds_rhc * __restrict rhc, const uint64_t wr_iid) {
|
| 73 |
+
rhc->common.ops->rhc_ops.relinquish_ownership (&rhc->common.rhc, wr_iid);
|
| 74 |
+
}
|
| 75 |
+
DDS_INLINE_EXPORT inline void dds_rhc_set_qos (struct dds_rhc *rhc, const struct dds_qos *qos) {
|
| 76 |
+
rhc->common.ops->rhc_ops.set_qos (&rhc->common.rhc, qos);
|
| 77 |
+
}
|
| 78 |
+
DDS_INLINE_EXPORT inline void dds_rhc_free (struct dds_rhc *rhc) {
|
| 79 |
+
rhc->common.ops->rhc_ops.free (&rhc->common.rhc);
|
| 80 |
+
}
|
| 81 |
+
DDS_INLINE_EXPORT inline int32_t dds_rhc_read (struct dds_rhc *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, struct dds_readcond *cond) {
|
| 82 |
+
return (rhc->common.ops->read) (rhc, lock, values, info_seq, max_samples, mask, handle, cond);
|
| 83 |
+
}
|
| 84 |
+
DDS_INLINE_EXPORT inline int32_t dds_rhc_take (struct dds_rhc *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, struct dds_readcond *cond) {
|
| 85 |
+
return rhc->common.ops->take (rhc, lock, values, info_seq, max_samples, mask, handle, cond);
|
| 86 |
+
}
|
| 87 |
+
DDS_INLINE_EXPORT inline int32_t dds_rhc_readcdr (struct dds_rhc *rhc, bool lock, struct ddsi_serdata **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t sample_states, uint32_t view_states, uint32_t instance_states, dds_instance_handle_t handle) {
|
| 88 |
+
return rhc->common.ops->readcdr (rhc, lock, values, info_seq, max_samples, sample_states, view_states, instance_states, handle);
|
| 89 |
+
}
|
| 90 |
+
DDS_INLINE_EXPORT inline int32_t dds_rhc_takecdr (struct dds_rhc *rhc, bool lock, struct ddsi_serdata **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t sample_states, uint32_t view_states, uint32_t instance_states, dds_instance_handle_t handle) {
|
| 91 |
+
return rhc->common.ops->takecdr (rhc, lock, values, info_seq, max_samples, sample_states, view_states, instance_states, handle);
|
| 92 |
+
}
|
| 93 |
+
DDS_INLINE_EXPORT inline bool dds_rhc_add_readcondition (struct dds_rhc *rhc, struct dds_readcond *cond) {
|
| 94 |
+
return rhc->common.ops->add_readcondition (rhc, cond);
|
| 95 |
+
}
|
| 96 |
+
DDS_INLINE_EXPORT inline void dds_rhc_remove_readcondition (struct dds_rhc *rhc, struct dds_readcond *cond) {
|
| 97 |
+
rhc->common.ops->remove_readcondition (rhc, cond);
|
| 98 |
+
}
|
| 99 |
+
DDS_INLINE_EXPORT inline uint32_t dds_rhc_lock_samples (struct dds_rhc *rhc) {
|
| 100 |
+
return rhc->common.ops->lock_samples (rhc);
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
DDS_EXPORT void dds_reader_data_available_cb (struct dds_reader *rd);
|
| 104 |
+
|
| 105 |
+
#if defined (__cplusplus)
|
| 106 |
+
}
|
| 107 |
+
#endif
|
| 108 |
+
#endif
|
| 109 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsc/dds_statistics.h
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef DDS_STATISTICS_H
|
| 14 |
+
#define DDS_STATISTICS_H
|
| 15 |
+
|
| 16 |
+
/**
|
| 17 |
+
* @defgroup statistics (DDS Statistics)
|
| 18 |
+
* @ingroup dds
|
| 19 |
+
* @warning Unstable API
|
| 20 |
+
*
|
| 21 |
+
* A quick-and-dirty provisional interface
|
| 22 |
+
*/
|
| 23 |
+
|
| 24 |
+
#include "dds/dds.h"
|
| 25 |
+
#include "dds/ddsrt/attributes.h"
|
| 26 |
+
#include "dds/export.h"
|
| 27 |
+
|
| 28 |
+
#if defined (__cplusplus)
|
| 29 |
+
extern "C" {
|
| 30 |
+
#endif
|
| 31 |
+
|
| 32 |
+
/**
|
| 33 |
+
* @brief Kind of statistical value
|
| 34 |
+
* @ingroup statistics
|
| 35 |
+
*/
|
| 36 |
+
enum dds_stat_kind {
|
| 37 |
+
DDS_STAT_KIND_UINT32, /**< value is a 32-bit unsigned integer */
|
| 38 |
+
DDS_STAT_KIND_UINT64, /**< value is a 64-bit unsigned integer */
|
| 39 |
+
DDS_STAT_KIND_LENGTHTIME /**< value is integral(length(t) dt) */
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @brief KeyValue statistics entry
|
| 44 |
+
* @ingroup statistics
|
| 45 |
+
*/
|
| 46 |
+
struct dds_stat_keyvalue {
|
| 47 |
+
const char *name; /**< name, memory owned by library */
|
| 48 |
+
enum dds_stat_kind kind; /**< value type */
|
| 49 |
+
union {
|
| 50 |
+
uint32_t u32; /**< used if kind == DDS_STAT_KIND_UINT32 */
|
| 51 |
+
uint64_t u64; /**< used if kind == DDS_STAT_KIND_UINT64 */
|
| 52 |
+
uint64_t lengthtime; /**< used if kind == DDS_STAT_KIND_LENGTHTIME */
|
| 53 |
+
} u; /**< value */
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
/**
|
| 57 |
+
* @brief Statistics container
|
| 58 |
+
* @ingroup statistics
|
| 59 |
+
*/
|
| 60 |
+
struct dds_statistics {
|
| 61 |
+
dds_entity_t entity; /**< handle of entity to which this set of values applies */
|
| 62 |
+
uint64_t opaque; /**< internal data */
|
| 63 |
+
dds_time_t time; /**< time stamp of latest call to dds_refresh_statistics() */
|
| 64 |
+
size_t count; /**< number of key-value pairs */
|
| 65 |
+
struct dds_stat_keyvalue kv[]; /**< data */
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* @brief Allocate a new statistics object for entity
|
| 70 |
+
* @ingroup statistics
|
| 71 |
+
*
|
| 72 |
+
* This allocates and populates a newly allocated `struct dds_statistics` for the
|
| 73 |
+
* specified entity.
|
| 74 |
+
*
|
| 75 |
+
* @param[in] entity the handle of the entity
|
| 76 |
+
*
|
| 77 |
+
* @returns a newly allocated and populated statistics structure or NULL if entity is
|
| 78 |
+
* invalid or doesn't support any statistics.
|
| 79 |
+
*/
|
| 80 |
+
DDS_EXPORT struct dds_statistics *dds_create_statistics (dds_entity_t entity);
|
| 81 |
+
|
| 82 |
+
/**
|
| 83 |
+
* @brief Update a previously created statistics structure with current values
|
| 84 |
+
* @ingroup statistics
|
| 85 |
+
*
|
| 86 |
+
* Only the time stamp and the values (and "opaque") may change. The set of keys and the
|
| 87 |
+
* types of the values do not change.
|
| 88 |
+
*
|
| 89 |
+
* @param[in,out] stat statistics structure to update the values of
|
| 90 |
+
*
|
| 91 |
+
* @returns success or an error indication
|
| 92 |
+
*
|
| 93 |
+
* @retval DDS_RETCODE_OK
|
| 94 |
+
* the data was successfully updated
|
| 95 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 96 |
+
* stats is a null pointer or the referenced entity no longer exists
|
| 97 |
+
* @retval DDS_RETCODE_PRECONDITION_NOT_MET
|
| 98 |
+
* library was deinitialized
|
| 99 |
+
*/
|
| 100 |
+
DDS_EXPORT dds_return_t dds_refresh_statistics (struct dds_statistics *stat);
|
| 101 |
+
|
| 102 |
+
/**
|
| 103 |
+
* @brief Free a previously created statistics object
|
| 104 |
+
* @ingroup statistics
|
| 105 |
+
*
|
| 106 |
+
* This frees the statistics object. Passing a null pointer is a no-op. The operation
|
| 107 |
+
* succeeds also if the referenced entity no longer exists.
|
| 108 |
+
*
|
| 109 |
+
* @param[in] stat statistics object to free
|
| 110 |
+
*/
|
| 111 |
+
DDS_EXPORT void dds_delete_statistics (struct dds_statistics *stat);
|
| 112 |
+
|
| 113 |
+
/**
|
| 114 |
+
* @brief Lookup a specific value by name
|
| 115 |
+
* @ingroup statistics
|
| 116 |
+
*
|
| 117 |
+
* This looks up the specified name in the list of keys in `stat` and returns the address
|
| 118 |
+
* of the key-value pair if present, a null pointer if not. If `stat` is a null pointer,
|
| 119 |
+
* it returns a null pointer.
|
| 120 |
+
*
|
| 121 |
+
* @param[in] stat statistics object to lookup a name in (or NULL)
|
| 122 |
+
* @param[in] name name to look for
|
| 123 |
+
*
|
| 124 |
+
* @returns The address of the key-value pair inside `stat`, or NULL if `stat` is NULL or
|
| 125 |
+
* `name` does not match a key in `stat.
|
| 126 |
+
*/
|
| 127 |
+
DDS_EXPORT const struct dds_stat_keyvalue *dds_lookup_statistic (const struct dds_statistics *stat, const char *name)
|
| 128 |
+
ddsrt_nonnull ((2));
|
| 129 |
+
|
| 130 |
+
#if defined (__cplusplus)
|
| 131 |
+
}
|
| 132 |
+
#endif
|
| 133 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_acknack.h
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_ACKNACK_H
|
| 13 |
+
#define DDSI_ACKNACK_H
|
| 14 |
+
|
| 15 |
+
#include <stddef.h>
|
| 16 |
+
#include <stdbool.h>
|
| 17 |
+
|
| 18 |
+
#include "dds/ddsrt/time.h"
|
| 19 |
+
#include "dds/ddsi/q_xevent.h"
|
| 20 |
+
#include "dds/ddsi/ddsi_entity.h"
|
| 21 |
+
#include "dds/ddsi/q_protocol.h"
|
| 22 |
+
|
| 23 |
+
#if defined (__cplusplus)
|
| 24 |
+
extern "C" {
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
enum add_AckNack_result {
|
| 28 |
+
AANR_SUPPRESSED_ACK, //!< sending nothing: too short a time since the last ACK
|
| 29 |
+
AANR_ACK, //!< sending an ACK and there's nothing to NACK
|
| 30 |
+
AANR_SUPPRESSED_NACK, //!< sending an ACK even though there are things to NACK
|
| 31 |
+
AANR_NACK, //!< sending a NACK, possibly also a NACKFRAG
|
| 32 |
+
AANR_NACKFRAG_ONLY //!< sending only a NACKFRAG
|
| 33 |
+
};
|
| 34 |
+
|
| 35 |
+
void sched_acknack_if_needed (struct xevent *ev, struct ddsi_proxy_writer *pwr, struct ddsi_pwr_rd_match *rwn, ddsrt_mtime_t tnow, bool avoid_suppressed_nack);
|
| 36 |
+
|
| 37 |
+
struct nn_xmsg *make_and_resched_acknack (struct xevent *ev, struct ddsi_proxy_writer *pwr, struct ddsi_pwr_rd_match *rwn, ddsrt_mtime_t tnow, bool avoid_suppressed_nack);
|
| 38 |
+
|
| 39 |
+
#if defined (__cplusplus)
|
| 40 |
+
}
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
#endif /* DDSI_ACKNACK_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_builtin_topic_if.h
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2019 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef _DDSI_BUILTIN_TOPIC_IF_H_
|
| 13 |
+
#define _DDSI_BUILTIN_TOPIC_IF_H_
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsi/ddsi_vendor.h"
|
| 16 |
+
|
| 17 |
+
#if defined (__cplusplus)
|
| 18 |
+
extern "C" {
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
struct ddsi_entity_common;
|
| 22 |
+
struct ddsi_tkmap_instance;
|
| 23 |
+
struct ddsi_sertype;
|
| 24 |
+
struct ddsi_guid;
|
| 25 |
+
struct ddsi_topic_definition;
|
| 26 |
+
|
| 27 |
+
struct ddsi_builtin_topic_interface {
|
| 28 |
+
void *arg;
|
| 29 |
+
|
| 30 |
+
bool (*builtintopic_is_builtintopic) (const struct ddsi_sertype *type, void *arg);
|
| 31 |
+
bool (*builtintopic_is_visible) (const struct ddsi_guid *guid, nn_vendorid_t vendorid, void *arg);
|
| 32 |
+
struct ddsi_tkmap_instance * (*builtintopic_get_tkmap_entry) (const struct ddsi_guid *guid, void *arg);
|
| 33 |
+
void (*builtintopic_write_endpoint) (const struct ddsi_entity_common *e, ddsrt_wctime_t timestamp, bool alive, void *arg);
|
| 34 |
+
void (*builtintopic_write_topic) (const struct ddsi_topic_definition *tpd, ddsrt_wctime_t timestamp, bool alive, void *arg);
|
| 35 |
+
};
|
| 36 |
+
|
| 37 |
+
DDS_INLINE_EXPORT inline bool builtintopic_is_visible (const struct ddsi_builtin_topic_interface *btif, const struct ddsi_guid *guid, nn_vendorid_t vendorid) {
|
| 38 |
+
return btif ? btif->builtintopic_is_visible (guid, vendorid, btif->arg) : false;
|
| 39 |
+
}
|
| 40 |
+
DDS_INLINE_EXPORT inline bool builtintopic_is_builtintopic (const struct ddsi_builtin_topic_interface *btif, const struct ddsi_sertype *type) {
|
| 41 |
+
return btif ? btif->builtintopic_is_builtintopic (type, btif->arg) : false;
|
| 42 |
+
}
|
| 43 |
+
DDS_INLINE_EXPORT inline struct ddsi_tkmap_instance *builtintopic_get_tkmap_entry (const struct ddsi_builtin_topic_interface *btif, const struct ddsi_guid *guid) {
|
| 44 |
+
return btif ? btif->builtintopic_get_tkmap_entry (guid, btif->arg) : NULL;
|
| 45 |
+
}
|
| 46 |
+
DDS_INLINE_EXPORT inline void builtintopic_write_endpoint (const struct ddsi_builtin_topic_interface *btif, const struct ddsi_entity_common *e, ddsrt_wctime_t timestamp, bool alive) {
|
| 47 |
+
if (btif) btif->builtintopic_write_endpoint (e, timestamp, alive, btif->arg);
|
| 48 |
+
}
|
| 49 |
+
DDS_INLINE_EXPORT inline void builtintopic_write_topic (const struct ddsi_builtin_topic_interface *btif, const struct ddsi_topic_definition *tpd, ddsrt_wctime_t timestamp, bool alive) {
|
| 50 |
+
if (btif) btif->builtintopic_write_topic (tpd, timestamp, alive, btif->arg);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
#if defined (__cplusplus)
|
| 54 |
+
}
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_cdrstream.h
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_CDRSTREAM_H
|
| 13 |
+
#define DDSI_CDRSTREAM_H
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsrt/static_assert.h"
|
| 16 |
+
#include "dds/ddsi/ddsi_serdata.h"
|
| 17 |
+
#include "dds/ddsi/ddsi_serdata_default.h"
|
| 18 |
+
|
| 19 |
+
#if defined (__cplusplus)
|
| 20 |
+
extern "C" {
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
#define DDSI_CDRSTREAM_MAX_NESTING_DEPTH 32 /* maximum level of nesting for key extraction */
|
| 24 |
+
|
| 25 |
+
typedef struct dds_istream {
|
| 26 |
+
const unsigned char *m_buffer;
|
| 27 |
+
uint32_t m_size; /* Buffer size */
|
| 28 |
+
uint32_t m_index; /* Read/write offset from start of buffer */
|
| 29 |
+
uint32_t m_xcdr_version; /* XCDR version of the data */
|
| 30 |
+
} dds_istream_t;
|
| 31 |
+
|
| 32 |
+
typedef struct dds_ostream {
|
| 33 |
+
unsigned char *m_buffer;
|
| 34 |
+
uint32_t m_size; /* Buffer size */
|
| 35 |
+
uint32_t m_index; /* Read/write offset from start of buffer */
|
| 36 |
+
uint32_t m_xcdr_version; /* XCDR version to use for serializing data */
|
| 37 |
+
} dds_ostream_t;
|
| 38 |
+
|
| 39 |
+
typedef struct dds_ostreamBE {
|
| 40 |
+
dds_ostream_t x;
|
| 41 |
+
} dds_ostreamBE_t;
|
| 42 |
+
|
| 43 |
+
typedef struct dds_ostreamLE {
|
| 44 |
+
dds_ostream_t x;
|
| 45 |
+
} dds_ostreamLE_t;
|
| 46 |
+
|
| 47 |
+
DDSRT_STATIC_ASSERT (offsetof (dds_ostreamLE_t, x) == 0);
|
| 48 |
+
DDSRT_STATIC_ASSERT (offsetof (dds_ostreamBE_t, x) == 0);
|
| 49 |
+
|
| 50 |
+
DDS_EXPORT void dds_istream_init (dds_istream_t * __restrict st, uint32_t size, const void * __restrict input, uint32_t xcdr_version);
|
| 51 |
+
DDS_EXPORT void dds_istream_fini (dds_istream_t * __restrict st);
|
| 52 |
+
DDS_EXPORT void dds_ostream_init (dds_ostream_t * __restrict st, uint32_t size, uint32_t xcdr_version);
|
| 53 |
+
DDS_EXPORT void dds_ostream_fini (dds_ostream_t * __restrict st);
|
| 54 |
+
DDS_EXPORT void dds_ostreamLE_init (dds_ostreamLE_t * __restrict st, uint32_t size, uint32_t xcdr_version);
|
| 55 |
+
DDS_EXPORT void dds_ostreamLE_fini (dds_ostreamLE_t * __restrict st);
|
| 56 |
+
DDS_EXPORT void dds_ostreamBE_init (dds_ostreamBE_t * __restrict st, uint32_t size, uint32_t xcdr_version);
|
| 57 |
+
DDS_EXPORT void dds_ostreamBE_fini (dds_ostreamBE_t * __restrict st);
|
| 58 |
+
|
| 59 |
+
// *actual_size is set to the actual size of the data (*actual_size <= size) on successful return
|
| 60 |
+
DDS_EXPORT bool dds_stream_normalize (void * __restrict data, uint32_t size, bool bswap, uint32_t xcdr_version, const struct ddsi_sertype_default * __restrict type, bool just_key, uint32_t * __restrict actual_size) ddsrt_attribute_warn_unused_result ddsrt_nonnull_all;
|
| 61 |
+
DDS_EXPORT const uint32_t *dds_stream_normalize_data (char * __restrict data, uint32_t * __restrict off, uint32_t size, bool bswap, uint32_t xcdr_version, const uint32_t * __restrict ops) ddsrt_attribute_warn_unused_result ddsrt_nonnull_all;
|
| 62 |
+
|
| 63 |
+
DDS_EXPORT const uint32_t *dds_stream_write (dds_ostream_t * __restrict os, const char * __restrict data, const uint32_t * __restrict ops);
|
| 64 |
+
DDS_EXPORT const uint32_t *dds_stream_writeLE (dds_ostreamLE_t * __restrict os, const char * __restrict data, const uint32_t * __restrict ops);
|
| 65 |
+
DDS_EXPORT const uint32_t *dds_stream_writeBE (dds_ostreamBE_t * __restrict os, const char * __restrict data, const uint32_t * __restrict ops);
|
| 66 |
+
DDS_EXPORT const uint32_t * dds_stream_write_with_byte_order (dds_ostream_t * __restrict os, const char * __restrict data, const uint32_t * __restrict ops, enum ddsrt_byte_order_selector bo);
|
| 67 |
+
DDS_EXPORT bool dds_stream_write_sample (dds_ostream_t * __restrict os, const void * __restrict data, const struct ddsi_sertype_default * __restrict type);
|
| 68 |
+
DDS_EXPORT bool dds_stream_write_sampleLE (dds_ostreamLE_t * __restrict os, const void * __restrict data, const struct ddsi_sertype_default * __restrict type);
|
| 69 |
+
DDS_EXPORT bool dds_stream_write_sampleBE (dds_ostreamBE_t * __restrict os, const void * __restrict data, const struct ddsi_sertype_default * __restrict type);
|
| 70 |
+
DDS_EXPORT void dds_stream_read_sample (dds_istream_t * __restrict is, void * __restrict data, const struct ddsi_sertype_default * __restrict type);
|
| 71 |
+
DDS_EXPORT void dds_stream_free_sample (void * __restrict data, const uint32_t * __restrict ops);
|
| 72 |
+
|
| 73 |
+
DDS_EXPORT uint32_t dds_stream_countops (const uint32_t * __restrict ops, uint32_t nkeys, const dds_key_descriptor_t * __restrict keys);
|
| 74 |
+
DDS_EXPORT size_t dds_stream_check_optimize (const struct ddsi_sertype_default_desc * __restrict desc, uint32_t xcdr_version);
|
| 75 |
+
DDS_EXPORT void dds_istream_from_serdata_default (dds_istream_t * __restrict s, const struct ddsi_serdata_default * __restrict d);
|
| 76 |
+
DDS_EXPORT void dds_ostream_from_serdata_default (dds_ostream_t * __restrict s, const struct ddsi_serdata_default * __restrict d);
|
| 77 |
+
DDS_EXPORT void dds_ostream_add_to_serdata_default (dds_ostream_t * __restrict s, struct ddsi_serdata_default ** __restrict d);
|
| 78 |
+
|
| 79 |
+
DDS_EXPORT void dds_stream_write_key (dds_ostream_t * __restrict os, const char * __restrict sample, const struct ddsi_sertype_default * __restrict type);
|
| 80 |
+
DDS_EXPORT void dds_stream_write_keyBE (dds_ostreamBE_t * __restrict os, const char * __restrict sample, const struct ddsi_sertype_default * __restrict type);
|
| 81 |
+
DDS_EXPORT bool dds_stream_extract_key_from_data (dds_istream_t * __restrict is, dds_ostream_t * __restrict os, const struct ddsi_sertype_default * __restrict type);
|
| 82 |
+
DDS_EXPORT void dds_stream_extract_key_from_key (dds_istream_t * __restrict is, dds_ostream_t * __restrict os, const struct ddsi_sertype_default * __restrict type);
|
| 83 |
+
DDS_EXPORT bool dds_stream_extract_keyBE_from_data (dds_istream_t * __restrict is, dds_ostreamBE_t * __restrict os, const struct ddsi_sertype_default * __restrict type);
|
| 84 |
+
DDS_EXPORT void dds_stream_extract_keyBE_from_key (dds_istream_t * __restrict is, dds_ostreamBE_t * __restrict os, const struct ddsi_sertype_default * __restrict type);
|
| 85 |
+
|
| 86 |
+
DDS_EXPORT const uint32_t *dds_stream_read (dds_istream_t * __restrict is, char * __restrict data, const uint32_t * __restrict ops);
|
| 87 |
+
DDS_EXPORT void dds_stream_read_key (dds_istream_t * __restrict is, char * __restrict sample, const struct ddsi_sertype_default * __restrict type);
|
| 88 |
+
|
| 89 |
+
DDS_EXPORT size_t dds_stream_print_key (dds_istream_t * __restrict is, const struct ddsi_sertype_default * __restrict type, char * __restrict buf, size_t size);
|
| 90 |
+
|
| 91 |
+
DDS_EXPORT size_t dds_stream_print_sample (dds_istream_t * __restrict is, const struct ddsi_sertype_default * __restrict type, char * __restrict buf, size_t size);
|
| 92 |
+
|
| 93 |
+
DDS_EXPORT uint16_t dds_stream_minimum_xcdr_version (const uint32_t * __restrict ops);
|
| 94 |
+
DDS_EXPORT uint32_t dds_stream_type_nesting_depth (const uint32_t * __restrict ops);
|
| 95 |
+
DDS_EXPORT bool dds_stream_extensibility (const uint32_t * __restrict ops, enum ddsi_sertype_extensibility *ext);
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
#if defined (__cplusplus)
|
| 99 |
+
}
|
| 100 |
+
#endif
|
| 101 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_cfgelems.h
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_cfgunits.h
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_CFGUNITS_H
|
| 13 |
+
#define DDSI_CFGUNITS_H
|
| 14 |
+
|
| 15 |
+
static const struct cfgunit cfgunits[] = {
|
| 16 |
+
UNIT("bandwidth",
|
| 17 |
+
DESCRIPTION(
|
| 18 |
+
"<p>The unit must be specified explicitly. Recognised units: "
|
| 19 |
+
"<i>X</i>b/s, <i>X</i>bps for bits/s or <i>X</i>B/s, <i>X</i>Bps for "
|
| 20 |
+
"bytes/s; where <i>X</i> is an optional prefix: k for 10<sup>3</sup>, "
|
| 21 |
+
"Ki for 2<sup>10</sup>, M for 10<sup>6</sup>, Mi for 2<sup>20</sup>, "
|
| 22 |
+
"G for 10<sup>9</sup>, Gi for 2<sup>30</sup>.</p>"),
|
| 23 |
+
PATTERN(
|
| 24 |
+
"0|(\\d+(\\.\\d*)?([Ee][\\-+]?\\d+)?|\\.\\d+([Ee][\\-+]?\\d+)?) *([kMG]i?)?[Bb][p/]s")),
|
| 25 |
+
UNIT("duration",
|
| 26 |
+
DESCRIPTION(
|
| 27 |
+
"<p>The unit must be specified explicitly. Recognised units: ns, us, ms, "
|
| 28 |
+
"s, min, hr, day.</p>"),
|
| 29 |
+
PATTERN(
|
| 30 |
+
"0|(\\d+(\\.\\d*)?([Ee][\\-+]?\\d+)?|\\.\\d+([Ee][\\-+]?\\d+)?) *([num]?s|min|hr|day)")),
|
| 31 |
+
UNIT("duration_inf",
|
| 32 |
+
DESCRIPTION(
|
| 33 |
+
"<p>Valid values are finite durations with an explicit unit or the "
|
| 34 |
+
"keyword 'inf' for infinity. Recognised units: ns, us, ms, s, min, hr, "
|
| 35 |
+
"day.</p>"),
|
| 36 |
+
PATTERN(
|
| 37 |
+
"inf|0|(\\d+(\\.\\d*)?([Ee][\\-+]?\\d+)?|\\.\\d+([Ee][\\-+]?\\d+)?) *([num]?s|min|hr|day)")),
|
| 38 |
+
UNIT("memsize",
|
| 39 |
+
DESCRIPTION(
|
| 40 |
+
"<p>The unit must be specified explicitly. Recognised units: B (bytes), "
|
| 41 |
+
"kB & KiB (2<sup>10</sup> bytes), MB & MiB (2<sup>20</sup> bytes), GB & "
|
| 42 |
+
"GiB (2<sup>30</sup> bytes).</p>"),
|
| 43 |
+
PATTERN(
|
| 44 |
+
"0|(\\d+(\\.\\d*)?([Ee][\\-+]?\\d+)?|\\.\\d+([Ee][\\-+]?\\d+)?) *([kMG]i?)?B")),
|
| 45 |
+
END_MARKER
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
#endif /* DDSI_CFGUNITS_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_config.h
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_CONFIG_H
|
| 13 |
+
#define DDSI_CONFIG_H
|
| 14 |
+
|
| 15 |
+
#include <stdio.h>
|
| 16 |
+
|
| 17 |
+
#include "dds/export.h"
|
| 18 |
+
#include "dds/features.h"
|
| 19 |
+
#include "dds/ddsrt/sched.h"
|
| 20 |
+
#include "dds/ddsrt/random.h"
|
| 21 |
+
#include "dds/ddsi/ddsi_portmapping.h"
|
| 22 |
+
#include "dds/ddsi/ddsi_locator.h"
|
| 23 |
+
|
| 24 |
+
#if defined (__cplusplus)
|
| 25 |
+
extern "C" {
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
struct ddsi_config;
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* @brief Default-initialize a configuration (unstable)
|
| 32 |
+
*
|
| 33 |
+
* @param[out] cfg The configuration struct to be initialized.
|
| 34 |
+
*/
|
| 35 |
+
DDS_EXPORT void ddsi_config_init_default (struct ddsi_config *cfg);
|
| 36 |
+
|
| 37 |
+
enum ddsi_standards_conformance {
|
| 38 |
+
DDSI_SC_PEDANTIC,
|
| 39 |
+
DDSI_SC_STRICT,
|
| 40 |
+
DDSI_SC_LAX
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
#define DDSI_SC_PEDANTIC_P(config) ((config).standards_conformance <= DDSI_SC_PEDANTIC)
|
| 44 |
+
#define DDSI_SC_STRICT_P(config) ((config).standards_conformance <= DDSI_SC_STRICT)
|
| 45 |
+
|
| 46 |
+
enum ddsi_besmode {
|
| 47 |
+
DDSI_BESMODE_FULL,
|
| 48 |
+
DDSI_BESMODE_WRITERS,
|
| 49 |
+
DDSI_BESMODE_MINIMAL
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
enum ddsi_retransmit_merging {
|
| 53 |
+
DDSI_REXMIT_MERGE_NEVER,
|
| 54 |
+
DDSI_REXMIT_MERGE_ADAPTIVE,
|
| 55 |
+
DDSI_REXMIT_MERGE_ALWAYS
|
| 56 |
+
};
|
| 57 |
+
|
| 58 |
+
enum ddsi_boolean_default {
|
| 59 |
+
DDSI_BOOLDEF_DEFAULT,
|
| 60 |
+
DDSI_BOOLDEF_FALSE,
|
| 61 |
+
DDSI_BOOLDEF_TRUE
|
| 62 |
+
};
|
| 63 |
+
|
| 64 |
+
#ifdef DDS_HAS_SHM
|
| 65 |
+
enum ddsi_shm_loglevel {
|
| 66 |
+
DDSI_SHM_OFF = 0,
|
| 67 |
+
DDSI_SHM_FATAL,
|
| 68 |
+
DDSI_SHM_ERROR,
|
| 69 |
+
DDSI_SHM_WARN,
|
| 70 |
+
DDSI_SHM_INFO,
|
| 71 |
+
DDSI_SHM_DEBUG,
|
| 72 |
+
DDSI_SHM_VERBOSE
|
| 73 |
+
};
|
| 74 |
+
#endif
|
| 75 |
+
|
| 76 |
+
#define DDSI_PARTICIPANT_INDEX_AUTO -1
|
| 77 |
+
#define DDSI_PARTICIPANT_INDEX_NONE -2
|
| 78 |
+
|
| 79 |
+
/* ddsi_config_listelem must be an overlay for all used listelem types */
|
| 80 |
+
struct ddsi_config_listelem {
|
| 81 |
+
struct ddsi_config_listelem *next;
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
#ifdef DDS_HAS_NETWORK_PARTITIONS
|
| 85 |
+
struct networkpartition_address {
|
| 86 |
+
struct networkpartition_address *next;
|
| 87 |
+
ddsi_locator_t loc;
|
| 88 |
+
};
|
| 89 |
+
|
| 90 |
+
struct ddsi_config_networkpartition_listelem {
|
| 91 |
+
struct ddsi_config_networkpartition_listelem *next;
|
| 92 |
+
char *name;
|
| 93 |
+
char *address_string;
|
| 94 |
+
struct networkpartition_address *uc_addresses;
|
| 95 |
+
struct networkpartition_address *asm_addresses;
|
| 96 |
+
#ifdef DDS_HAS_SSM
|
| 97 |
+
struct networkpartition_address *ssm_addresses;
|
| 98 |
+
#endif
|
| 99 |
+
};
|
| 100 |
+
|
| 101 |
+
struct ddsi_config_ignoredpartition_listelem {
|
| 102 |
+
struct ddsi_config_ignoredpartition_listelem *next;
|
| 103 |
+
char *DCPSPartitionTopic;
|
| 104 |
+
};
|
| 105 |
+
|
| 106 |
+
struct ddsi_config_partitionmapping_listelem {
|
| 107 |
+
struct ddsi_config_partitionmapping_listelem *next;
|
| 108 |
+
char *networkPartition;
|
| 109 |
+
char *DCPSPartitionTopic;
|
| 110 |
+
struct ddsi_config_networkpartition_listelem *partition;
|
| 111 |
+
};
|
| 112 |
+
#endif /* DDS_HAS_NETWORK_PARTITIONS */
|
| 113 |
+
|
| 114 |
+
#ifdef DDS_HAS_NETWORK_CHANNELS
|
| 115 |
+
struct ddsi_config_channel_listelem {
|
| 116 |
+
struct ddsi_config_channel_listelem *next;
|
| 117 |
+
char *name;
|
| 118 |
+
int priority;
|
| 119 |
+
int64_t resolution;
|
| 120 |
+
#ifdef DDS_HAS_BANDWIDTH_LIMITING
|
| 121 |
+
uint32_t data_bandwidth_limit;
|
| 122 |
+
uint32_t auxiliary_bandwidth_limit;
|
| 123 |
+
#endif
|
| 124 |
+
int diffserv_field;
|
| 125 |
+
struct thread_state *channel_reader_thrst; /* keeping an handle to the running thread for this channel */
|
| 126 |
+
struct nn_dqueue *dqueue; /* The handle of teh delivery queue servicing incoming data for this channel*/
|
| 127 |
+
struct xeventq *evq; /* The handle of the event queue servicing this channel*/
|
| 128 |
+
uint32_t queueId; /* the index of the networkqueue serviced by this channel*/
|
| 129 |
+
struct ddsi_tran_conn * transmit_conn; /* the connection used for sending data out via this channel */
|
| 130 |
+
};
|
| 131 |
+
#endif /* DDS_HAS_NETWORK_CHANNELS */
|
| 132 |
+
|
| 133 |
+
struct ddsi_config_maybe_int32 {
|
| 134 |
+
int isdefault;
|
| 135 |
+
int32_t value;
|
| 136 |
+
};
|
| 137 |
+
|
| 138 |
+
struct ddsi_config_maybe_uint32 {
|
| 139 |
+
int isdefault;
|
| 140 |
+
uint32_t value;
|
| 141 |
+
};
|
| 142 |
+
|
| 143 |
+
struct ddsi_config_thread_properties_listelem {
|
| 144 |
+
struct ddsi_config_thread_properties_listelem *next;
|
| 145 |
+
char *name;
|
| 146 |
+
ddsrt_sched_t sched_class;
|
| 147 |
+
struct ddsi_config_maybe_int32 schedule_priority;
|
| 148 |
+
struct ddsi_config_maybe_uint32 stack_size;
|
| 149 |
+
};
|
| 150 |
+
|
| 151 |
+
struct ddsi_config_peer_listelem
|
| 152 |
+
{
|
| 153 |
+
struct ddsi_config_peer_listelem *next;
|
| 154 |
+
char *peer;
|
| 155 |
+
};
|
| 156 |
+
|
| 157 |
+
struct ddsi_config_prune_deleted_ppant {
|
| 158 |
+
int64_t delay;
|
| 159 |
+
int enforce_delay;
|
| 160 |
+
};
|
| 161 |
+
|
| 162 |
+
/* allow multicast bits (default depends on network type): */
|
| 163 |
+
#define DDSI_AMC_FALSE 0u
|
| 164 |
+
#define DDSI_AMC_SPDP 1u
|
| 165 |
+
#define DDSI_AMC_ASM 2u
|
| 166 |
+
#ifdef DDS_HAS_SSM
|
| 167 |
+
#define DDSI_AMC_SSM 4u
|
| 168 |
+
#define DDSI_AMC_TRUE (DDSI_AMC_SPDP | DDSI_AMC_ASM | DDSI_AMC_SSM)
|
| 169 |
+
#else
|
| 170 |
+
#define DDSI_AMC_TRUE (DDSI_AMC_SPDP | DDSI_AMC_ASM)
|
| 171 |
+
#endif
|
| 172 |
+
#define DDSI_AMC_DEFAULT 0x80000000u
|
| 173 |
+
|
| 174 |
+
/* FIXME: this should be fully dynamic ... but this is easier for a quick hack */
|
| 175 |
+
enum ddsi_transport_selector {
|
| 176 |
+
DDSI_TRANS_DEFAULT, /* actually UDP, but this is so we can tell what has been set */
|
| 177 |
+
DDSI_TRANS_UDP,
|
| 178 |
+
DDSI_TRANS_UDP6,
|
| 179 |
+
DDSI_TRANS_TCP,
|
| 180 |
+
DDSI_TRANS_TCP6,
|
| 181 |
+
DDSI_TRANS_RAWETH,
|
| 182 |
+
DDSI_TRANS_NONE /* FIXME: see FIXME above ... :( */
|
| 183 |
+
};
|
| 184 |
+
|
| 185 |
+
enum ddsi_many_sockets_mode {
|
| 186 |
+
DDSI_MSM_NO_UNICAST,
|
| 187 |
+
DDSI_MSM_SINGLE_UNICAST,
|
| 188 |
+
DDSI_MSM_MANY_UNICAST
|
| 189 |
+
};
|
| 190 |
+
|
| 191 |
+
#ifdef DDS_HAS_SECURITY
|
| 192 |
+
struct ddsi_plugin_library_properties {
|
| 193 |
+
char *library_path;
|
| 194 |
+
char *library_init;
|
| 195 |
+
char *library_finalize;
|
| 196 |
+
};
|
| 197 |
+
|
| 198 |
+
struct ddsi_authentication_properties {
|
| 199 |
+
char *identity_certificate;
|
| 200 |
+
char *identity_ca;
|
| 201 |
+
char *private_key;
|
| 202 |
+
char *password;
|
| 203 |
+
char *trusted_ca_dir;
|
| 204 |
+
char *crl;
|
| 205 |
+
int include_optional_fields;
|
| 206 |
+
};
|
| 207 |
+
|
| 208 |
+
struct ddsi_access_control_properties {
|
| 209 |
+
char *permissions;
|
| 210 |
+
char *permissions_ca;
|
| 211 |
+
char *governance;
|
| 212 |
+
};
|
| 213 |
+
|
| 214 |
+
struct ddsi_config_omg_security {
|
| 215 |
+
struct ddsi_authentication_properties authentication_properties;
|
| 216 |
+
struct ddsi_access_control_properties access_control_properties;
|
| 217 |
+
struct ddsi_plugin_library_properties authentication_plugin;
|
| 218 |
+
struct ddsi_plugin_library_properties access_control_plugin;
|
| 219 |
+
struct ddsi_plugin_library_properties cryptography_plugin;
|
| 220 |
+
};
|
| 221 |
+
|
| 222 |
+
struct ddsi_config_omg_security_listelem {
|
| 223 |
+
struct ddsi_config_omg_security_listelem *next;
|
| 224 |
+
struct ddsi_config_omg_security cfg;
|
| 225 |
+
};
|
| 226 |
+
#endif /* DDS_HAS_SECURITY */
|
| 227 |
+
|
| 228 |
+
#ifdef DDS_HAS_SSL
|
| 229 |
+
struct ddsi_config_ssl_min_version {
|
| 230 |
+
int major;
|
| 231 |
+
int minor;
|
| 232 |
+
};
|
| 233 |
+
#endif
|
| 234 |
+
|
| 235 |
+
struct ddsi_config_socket_buf_size {
|
| 236 |
+
struct ddsi_config_maybe_uint32 min, max;
|
| 237 |
+
};
|
| 238 |
+
|
| 239 |
+
struct ddsi_config_network_interface {
|
| 240 |
+
int automatic;
|
| 241 |
+
char *name;
|
| 242 |
+
char *address;
|
| 243 |
+
int prefer_multicast;
|
| 244 |
+
int presence_required;
|
| 245 |
+
enum ddsi_boolean_default multicast;
|
| 246 |
+
struct ddsi_config_maybe_int32 priority;
|
| 247 |
+
};
|
| 248 |
+
|
| 249 |
+
struct ddsi_config_network_interface_listelem {
|
| 250 |
+
struct ddsi_config_network_interface_listelem *next;
|
| 251 |
+
struct ddsi_config_network_interface cfg;
|
| 252 |
+
};
|
| 253 |
+
|
| 254 |
+
enum ddsi_config_entity_naming_mode {
|
| 255 |
+
DDSI_ENTITY_NAMING_DEFAULT_EMPTY,
|
| 256 |
+
DDSI_ENTITY_NAMING_DEFAULT_FANCY
|
| 257 |
+
};
|
| 258 |
+
|
| 259 |
+
/* Expensive checks (compiled in when NDEBUG not defined, enabled only if flag set in xchecks) */
|
| 260 |
+
#define DDSI_XCHECK_WHC 1u
|
| 261 |
+
#define DDSI_XCHECK_RHC 2u
|
| 262 |
+
#define DDSI_XCHECK_XEV 4u
|
| 263 |
+
|
| 264 |
+
struct ddsi_config
|
| 265 |
+
{
|
| 266 |
+
int valid;
|
| 267 |
+
uint32_t tracemask;
|
| 268 |
+
uint32_t enabled_xchecks;
|
| 269 |
+
char *pcap_file;
|
| 270 |
+
|
| 271 |
+
/* interfaces */
|
| 272 |
+
struct ddsi_config_network_interface_listelem *network_interfaces;
|
| 273 |
+
|
| 274 |
+
/* deprecated interface support */
|
| 275 |
+
char *depr_networkAddressString;
|
| 276 |
+
int depr_prefer_multicast;
|
| 277 |
+
char *depr_assumeMulticastCapable;
|
| 278 |
+
|
| 279 |
+
char **networkRecvAddressStrings;
|
| 280 |
+
uint32_t allowMulticast;
|
| 281 |
+
char *externalAddressString;
|
| 282 |
+
char *externalMaskString;
|
| 283 |
+
FILE *tracefp;
|
| 284 |
+
char *tracefile;
|
| 285 |
+
int tracingAppendToFile;
|
| 286 |
+
enum ddsi_transport_selector transport_selector;
|
| 287 |
+
enum ddsi_boolean_default compat_use_ipv6;
|
| 288 |
+
enum ddsi_boolean_default compat_tcp_enable;
|
| 289 |
+
int dontRoute;
|
| 290 |
+
int enableMulticastLoopback;
|
| 291 |
+
uint32_t domainId;
|
| 292 |
+
struct ddsi_config_maybe_uint32 extDomainId; // domain id advertised in discovery
|
| 293 |
+
char *domainTag;
|
| 294 |
+
int participantIndex;
|
| 295 |
+
int maxAutoParticipantIndex;
|
| 296 |
+
char *spdpMulticastAddressString;
|
| 297 |
+
char *defaultMulticastAddressString;
|
| 298 |
+
int64_t spdp_interval;
|
| 299 |
+
int64_t spdp_response_delay_max;
|
| 300 |
+
int64_t lease_duration;
|
| 301 |
+
int64_t const_hb_intv_sched;
|
| 302 |
+
int64_t const_hb_intv_sched_min;
|
| 303 |
+
int64_t const_hb_intv_sched_max;
|
| 304 |
+
int64_t const_hb_intv_min;
|
| 305 |
+
enum ddsi_retransmit_merging retransmit_merging;
|
| 306 |
+
int64_t retransmit_merging_period;
|
| 307 |
+
int squash_participants;
|
| 308 |
+
int liveliness_monitoring;
|
| 309 |
+
int noprogress_log_stacktraces;
|
| 310 |
+
int64_t liveliness_monitoring_interval;
|
| 311 |
+
int prioritize_retransmit;
|
| 312 |
+
enum ddsi_boolean_default multiple_recv_threads;
|
| 313 |
+
unsigned recv_thread_stop_maxretries;
|
| 314 |
+
|
| 315 |
+
unsigned primary_reorder_maxsamples;
|
| 316 |
+
unsigned secondary_reorder_maxsamples;
|
| 317 |
+
|
| 318 |
+
unsigned delivery_queue_maxsamples;
|
| 319 |
+
|
| 320 |
+
uint16_t fragment_size;
|
| 321 |
+
uint32_t max_msg_size;
|
| 322 |
+
uint32_t max_rexmit_msg_size;
|
| 323 |
+
uint32_t init_transmit_extra_pct;
|
| 324 |
+
uint32_t max_rexmit_burst_size;
|
| 325 |
+
|
| 326 |
+
int publish_uc_locators; /* Publish discovery unicast locators */
|
| 327 |
+
int enable_uc_locators; /* If false, don't even try to create a unicast socket */
|
| 328 |
+
|
| 329 |
+
#ifdef DDS_HAS_TOPIC_DISCOVERY
|
| 330 |
+
int enable_topic_discovery_endpoints;
|
| 331 |
+
#endif
|
| 332 |
+
|
| 333 |
+
/* TCP transport configuration */
|
| 334 |
+
int tcp_nodelay;
|
| 335 |
+
int tcp_port;
|
| 336 |
+
int64_t tcp_read_timeout;
|
| 337 |
+
int64_t tcp_write_timeout;
|
| 338 |
+
int tcp_use_peeraddr_for_unicast;
|
| 339 |
+
|
| 340 |
+
#ifdef DDS_HAS_SSL
|
| 341 |
+
/* SSL support for TCP */
|
| 342 |
+
int ssl_enable;
|
| 343 |
+
int ssl_verify;
|
| 344 |
+
int ssl_verify_client;
|
| 345 |
+
int ssl_self_signed;
|
| 346 |
+
char * ssl_keystore;
|
| 347 |
+
char * ssl_rand_file;
|
| 348 |
+
char * ssl_key_pass;
|
| 349 |
+
char * ssl_ciphers;
|
| 350 |
+
struct ddsi_config_ssl_min_version ssl_min_version;
|
| 351 |
+
#endif
|
| 352 |
+
|
| 353 |
+
#ifdef DDS_HAS_NETWORK_CHANNELS
|
| 354 |
+
struct ddsi_config_channel_listelem *channels;
|
| 355 |
+
struct ddsi_config_channel_listelem *max_channel; /* channel with highest prio; always computed */
|
| 356 |
+
#endif /* DDS_HAS_NETWORK_CHANNELS */
|
| 357 |
+
#ifdef DDS_HAS_NETWORK_PARTITIONS
|
| 358 |
+
struct ddsi_config_networkpartition_listelem *networkPartitions;
|
| 359 |
+
unsigned nof_networkPartitions;
|
| 360 |
+
struct ddsi_config_ignoredpartition_listelem *ignoredPartitions;
|
| 361 |
+
struct ddsi_config_partitionmapping_listelem *partitionMappings;
|
| 362 |
+
#endif /* DDS_HAS_NETWORK_PARTITIONS */
|
| 363 |
+
struct ddsi_config_peer_listelem *peers;
|
| 364 |
+
struct ddsi_config_thread_properties_listelem *thread_properties;
|
| 365 |
+
|
| 366 |
+
/* debug/test/undoc features: */
|
| 367 |
+
int xmit_lossiness; /**<< fraction of packets to drop on xmit, in units of 1e-3 */
|
| 368 |
+
uint32_t rmsg_chunk_size; /**<< size of a chunk in the receive buffer */
|
| 369 |
+
uint32_t rbuf_size; /* << size of a single receiver buffer */
|
| 370 |
+
enum ddsi_besmode besmode;
|
| 371 |
+
int meas_hb_to_ack_latency;
|
| 372 |
+
int unicast_response_to_spdp_messages;
|
| 373 |
+
int synchronous_delivery_priority_threshold;
|
| 374 |
+
int64_t synchronous_delivery_latency_bound;
|
| 375 |
+
|
| 376 |
+
/* Write cache */
|
| 377 |
+
|
| 378 |
+
int whc_batch;
|
| 379 |
+
uint32_t whc_lowwater_mark;
|
| 380 |
+
uint32_t whc_highwater_mark;
|
| 381 |
+
struct ddsi_config_maybe_uint32 whc_init_highwater_mark;
|
| 382 |
+
int whc_adaptive;
|
| 383 |
+
|
| 384 |
+
unsigned defrag_unreliable_maxsamples;
|
| 385 |
+
unsigned defrag_reliable_maxsamples;
|
| 386 |
+
unsigned accelerate_rexmit_block_size;
|
| 387 |
+
int64_t responsiveness_timeout;
|
| 388 |
+
uint32_t max_participants;
|
| 389 |
+
int64_t writer_linger_duration;
|
| 390 |
+
int multicast_ttl;
|
| 391 |
+
struct ddsi_config_socket_buf_size socket_rcvbuf_size;
|
| 392 |
+
struct ddsi_config_socket_buf_size socket_sndbuf_size;
|
| 393 |
+
int64_t ack_delay;
|
| 394 |
+
int64_t nack_delay;
|
| 395 |
+
int64_t preemptive_ack_delay;
|
| 396 |
+
int64_t schedule_time_rounding;
|
| 397 |
+
int64_t auto_resched_nack_delay;
|
| 398 |
+
int64_t ds_grace_period;
|
| 399 |
+
#ifdef DDS_HAS_BANDWIDTH_LIMITING
|
| 400 |
+
uint32_t auxiliary_bandwidth_limit; /* bytes/second */
|
| 401 |
+
#endif
|
| 402 |
+
uint32_t max_queued_rexmit_bytes;
|
| 403 |
+
unsigned max_queued_rexmit_msgs;
|
| 404 |
+
unsigned ddsi2direct_max_threads;
|
| 405 |
+
int late_ack_mode;
|
| 406 |
+
int retry_on_reject_besteffort;
|
| 407 |
+
int generate_keyhash;
|
| 408 |
+
uint32_t max_sample_size;
|
| 409 |
+
|
| 410 |
+
/* compability options */
|
| 411 |
+
enum ddsi_standards_conformance standards_conformance;
|
| 412 |
+
int explicitly_publish_qos_set_to_default;
|
| 413 |
+
enum ddsi_many_sockets_mode many_sockets_mode;
|
| 414 |
+
int assume_rti_has_pmd_endpoints;
|
| 415 |
+
|
| 416 |
+
struct ddsi_portmapping ports;
|
| 417 |
+
|
| 418 |
+
int monitor_port;
|
| 419 |
+
|
| 420 |
+
int enable_control_topic;
|
| 421 |
+
int initial_deaf;
|
| 422 |
+
int initial_mute;
|
| 423 |
+
int64_t initial_deaf_mute_reset;
|
| 424 |
+
|
| 425 |
+
int use_multicast_if_mreqn;
|
| 426 |
+
struct ddsi_config_prune_deleted_ppant prune_deleted_ppant;
|
| 427 |
+
int redundant_networking;
|
| 428 |
+
|
| 429 |
+
#ifdef DDS_HAS_SECURITY
|
| 430 |
+
struct ddsi_config_omg_security_listelem *omg_security_configuration;
|
| 431 |
+
#endif
|
| 432 |
+
|
| 433 |
+
#ifdef DDS_HAS_SHM
|
| 434 |
+
int enable_shm;
|
| 435 |
+
char *shm_locator;
|
| 436 |
+
char *iceoryx_service;
|
| 437 |
+
enum ddsi_shm_loglevel shm_log_lvl;
|
| 438 |
+
#endif
|
| 439 |
+
|
| 440 |
+
enum ddsi_config_entity_naming_mode entity_naming_mode;
|
| 441 |
+
ddsrt_prng_seed_t entity_naming_seed;
|
| 442 |
+
|
| 443 |
+
#if defined (__cplusplus)
|
| 444 |
+
public:
|
| 445 |
+
ddsi_config() {
|
| 446 |
+
ddsi_config_init_default (this);
|
| 447 |
+
}
|
| 448 |
+
#endif
|
| 449 |
+
};
|
| 450 |
+
|
| 451 |
+
#if defined (__cplusplus)
|
| 452 |
+
}
|
| 453 |
+
#endif
|
| 454 |
+
|
| 455 |
+
#endif /* DDSI_CONFIG_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_config_impl.h
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef NN_CONFIG_H
|
| 13 |
+
#define NN_CONFIG_H
|
| 14 |
+
|
| 15 |
+
#include <stdio.h>
|
| 16 |
+
|
| 17 |
+
#include "dds/ddsrt/attributes.h"
|
| 18 |
+
#include "dds/ddsi/ddsi_config.h"
|
| 19 |
+
|
| 20 |
+
#if defined (__cplusplus)
|
| 21 |
+
extern "C" {
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
struct cfgst;
|
| 25 |
+
struct ddsrt_log_cfg;
|
| 26 |
+
|
| 27 |
+
struct cfgst *ddsi_config_init (const char *config, struct ddsi_config *cfg, uint32_t domid) ddsrt_nonnull((1,2));
|
| 28 |
+
void ddsi_config_print_cfgst (struct cfgst *cfgst, const struct ddsrt_log_cfg *logcfg);
|
| 29 |
+
void ddsi_config_print_rawconfig (const struct ddsi_config *cfg, const struct ddsrt_log_cfg *logcfg);
|
| 30 |
+
void ddsi_config_free_source_info (struct cfgst *cfgst);
|
| 31 |
+
void ddsi_config_fini (struct cfgst *cfgst);
|
| 32 |
+
|
| 33 |
+
#if defined (__cplusplus)
|
| 34 |
+
}
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
#endif /* NN_CONFIG_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_deadline.h
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_DEADLINE_H
|
| 13 |
+
#define DDSI_DEADLINE_H
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsrt/circlist.h"
|
| 16 |
+
#include "dds/ddsrt/time.h"
|
| 17 |
+
#include "dds/ddsi/ddsi_domaingv.h"
|
| 18 |
+
#include "dds/ddsi/q_xevent.h"
|
| 19 |
+
|
| 20 |
+
#if defined (__cplusplus)
|
| 21 |
+
extern "C" {
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
typedef ddsrt_mtime_t (*deadline_missed_cb_t)(void *hc, ddsrt_mtime_t tnow);
|
| 25 |
+
|
| 26 |
+
struct deadline_adm {
|
| 27 |
+
struct ddsrt_circlist list; /* linked list for deadline missed */
|
| 28 |
+
struct xevent *evt; /* xevent that triggers when deadline expires for an instance */
|
| 29 |
+
deadline_missed_cb_t deadline_missed_cb; /* callback for deadline missed; this cb can use deadline_next_missed_locked to get next instance that has a missed deadline */
|
| 30 |
+
size_t list_offset; /* offset of deadline_adm element in whc or rhc */
|
| 31 |
+
size_t elem_offset; /* offset of deadline_elem element in whc or rhc instance */
|
| 32 |
+
dds_duration_t dur; /* deadline duration */
|
| 33 |
+
};
|
| 34 |
+
|
| 35 |
+
struct deadline_elem {
|
| 36 |
+
struct ddsrt_circlist_elem e;
|
| 37 |
+
ddsrt_mtime_t t_deadline;
|
| 38 |
+
};
|
| 39 |
+
|
| 40 |
+
DDS_EXPORT void deadline_init (const struct ddsi_domaingv *gv, struct deadline_adm *deadline_adm, size_t list_offset, size_t elem_offset, deadline_missed_cb_t deadline_missed_cb);
|
| 41 |
+
DDS_EXPORT void deadline_stop (const struct deadline_adm *deadline_adm);
|
| 42 |
+
DDS_EXPORT void deadline_clear (struct deadline_adm *deadline_adm);
|
| 43 |
+
DDS_EXPORT void deadline_fini (const struct deadline_adm *deadline_adm);
|
| 44 |
+
DDS_EXPORT ddsrt_mtime_t deadline_next_missed_locked (struct deadline_adm *deadline_adm, ddsrt_mtime_t tnow, void **instance);
|
| 45 |
+
DDS_EXPORT void deadline_register_instance_real (struct deadline_adm *deadline_adm, struct deadline_elem *elem, ddsrt_mtime_t tprev, ddsrt_mtime_t tnow);
|
| 46 |
+
DDS_EXPORT void deadline_unregister_instance_real (struct deadline_adm *deadline_adm, struct deadline_elem *elem);
|
| 47 |
+
DDS_EXPORT void deadline_renew_instance_real (struct deadline_adm *deadline_adm, struct deadline_elem *elem);
|
| 48 |
+
|
| 49 |
+
DDS_INLINE_EXPORT inline void deadline_register_instance_locked (struct deadline_adm *deadline_adm, struct deadline_elem *elem, ddsrt_mtime_t tnow)
|
| 50 |
+
{
|
| 51 |
+
if (deadline_adm->dur != DDS_INFINITY)
|
| 52 |
+
deadline_register_instance_real (deadline_adm, elem, tnow, tnow);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
DDS_INLINE_EXPORT inline void deadline_reregister_instance_locked (struct deadline_adm *deadline_adm, struct deadline_elem *elem, ddsrt_mtime_t tnow)
|
| 56 |
+
{
|
| 57 |
+
if (deadline_adm->dur != DDS_INFINITY)
|
| 58 |
+
deadline_register_instance_real (deadline_adm, elem, elem->t_deadline, tnow);
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
DDS_INLINE_EXPORT inline void deadline_unregister_instance_locked (struct deadline_adm *deadline_adm, struct deadline_elem *elem)
|
| 62 |
+
{
|
| 63 |
+
if (deadline_adm->dur != DDS_INFINITY)
|
| 64 |
+
{
|
| 65 |
+
assert (elem->t_deadline.v != DDS_NEVER);
|
| 66 |
+
deadline_unregister_instance_real (deadline_adm, elem);
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
DDS_INLINE_EXPORT inline void deadline_renew_instance_locked (struct deadline_adm *deadline_adm, struct deadline_elem *elem)
|
| 71 |
+
{
|
| 72 |
+
if (deadline_adm->dur != DDS_INFINITY)
|
| 73 |
+
{
|
| 74 |
+
assert (elem->t_deadline.v != DDS_NEVER);
|
| 75 |
+
deadline_renew_instance_real (deadline_adm, elem);
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
#if defined (__cplusplus)
|
| 80 |
+
}
|
| 81 |
+
#endif
|
| 82 |
+
|
| 83 |
+
#endif /* DDSI_DEADLINE_H */
|
| 84 |
+
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_deliver_locally.h
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_DELIVER_LOCALLY_H
|
| 13 |
+
#define DDSI_DELIVER_LOCALLY_H
|
| 14 |
+
|
| 15 |
+
#include <stdint.h>
|
| 16 |
+
#include <stdbool.h>
|
| 17 |
+
|
| 18 |
+
#include "dds/export.h"
|
| 19 |
+
#include "dds/ddsrt/retcode.h"
|
| 20 |
+
#include "dds/ddsrt/avl.h"
|
| 21 |
+
#include "dds/ddsi/ddsi_guid.h"
|
| 22 |
+
|
| 23 |
+
#if defined (__cplusplus)
|
| 24 |
+
extern "C" {
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
struct ddsi_domaingv;
|
| 28 |
+
struct ddsi_tkmap_instance;
|
| 29 |
+
struct ddsi_sertype;
|
| 30 |
+
struct ddsi_serdata;
|
| 31 |
+
struct entity_index;
|
| 32 |
+
struct ddsi_reader;
|
| 33 |
+
struct ddsi_entity_common;
|
| 34 |
+
struct ddsi_writer_info;
|
| 35 |
+
struct ddsi_local_reader_ary;
|
| 36 |
+
|
| 37 |
+
typedef struct ddsi_serdata * (*deliver_locally_makesample_t) (struct ddsi_tkmap_instance **tk, struct ddsi_domaingv *gv, struct ddsi_sertype const * const type, void *vsourceinfo);
|
| 38 |
+
typedef struct ddsi_reader * (*deliver_locally_first_reader_t) (struct entity_index *entity_index, struct ddsi_entity_common *source_entity, ddsrt_avl_iter_t *it);
|
| 39 |
+
typedef struct ddsi_reader * (*deliver_locally_next_reader_t) (struct entity_index *entity_index, ddsrt_avl_iter_t *it);
|
| 40 |
+
|
| 41 |
+
/** return:
|
| 42 |
+
- DDS_RETCODE_OK to try again immediately
|
| 43 |
+
- DDS_RETCODE_TRY_AGAIN to complete restart the operation later
|
| 44 |
+
- anything else: error to be returned from deliver_locally_xxx */
|
| 45 |
+
typedef dds_return_t (*deliver_locally_on_failure_fastpath_t) (struct ddsi_entity_common *source_entity, bool source_entity_locked, struct ddsi_local_reader_ary *fastpath_rdary, void *vsourceinfo);
|
| 46 |
+
|
| 47 |
+
struct deliver_locally_ops {
|
| 48 |
+
deliver_locally_makesample_t makesample;
|
| 49 |
+
deliver_locally_first_reader_t first_reader;
|
| 50 |
+
deliver_locally_next_reader_t next_reader;
|
| 51 |
+
deliver_locally_on_failure_fastpath_t on_failure_fastpath;
|
| 52 |
+
};
|
| 53 |
+
|
| 54 |
+
dds_return_t deliver_locally_one (struct ddsi_domaingv *gv, struct ddsi_entity_common *source_entity, bool source_entity_locked, const ddsi_guid_t *rdguid, const struct ddsi_writer_info *wrinfo, const struct deliver_locally_ops * __restrict ops, void *vsourceinfo);
|
| 55 |
+
|
| 56 |
+
dds_return_t deliver_locally_allinsync (struct ddsi_domaingv *gv, struct ddsi_entity_common *source_entity, bool source_entity_locked, struct ddsi_local_reader_ary *fastpath_rdary, const struct ddsi_writer_info *wrinfo, const struct deliver_locally_ops * __restrict ops, void *vsourceinfo);
|
| 57 |
+
|
| 58 |
+
#if defined (__cplusplus)
|
| 59 |
+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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_DOMAINGV_H
|
| 13 |
+
#define DDSI_DOMAINGV_H
|
| 14 |
+
|
| 15 |
+
#include <stdio.h>
|
| 16 |
+
|
| 17 |
+
#include "dds/export.h"
|
| 18 |
+
#include "dds/features.h"
|
| 19 |
+
|
| 20 |
+
#include "dds/ddsrt/atomics.h"
|
| 21 |
+
#include "dds/ddsrt/sockets.h"
|
| 22 |
+
#include "dds/ddsrt/sync.h"
|
| 23 |
+
#include "dds/ddsrt/fibheap.h"
|
| 24 |
+
#include "dds/ddsrt/avl.h"
|
| 25 |
+
#include "dds/ddsrt/random.h"
|
| 26 |
+
|
| 27 |
+
#include "dds/ddsi/ddsi_plist.h"
|
| 28 |
+
#include "dds/ddsi/ddsi_ownip.h"
|
| 29 |
+
#include "dds/ddsi/q_protocol.h"
|
| 30 |
+
#include "dds/ddsi/q_sockwaitset.h"
|
| 31 |
+
#include "dds/ddsi/ddsi_config_impl.h"
|
| 32 |
+
|
| 33 |
+
#if defined (__cplusplus)
|
| 34 |
+
extern "C" {
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
struct nn_xmsgpool;
|
| 38 |
+
struct serdatapool;
|
| 39 |
+
struct nn_dqueue;
|
| 40 |
+
struct nn_reorder;
|
| 41 |
+
struct nn_defrag;
|
| 42 |
+
struct addrset;
|
| 43 |
+
struct xeventq;
|
| 44 |
+
struct gcreq_queue;
|
| 45 |
+
struct entity_index;
|
| 46 |
+
struct lease;
|
| 47 |
+
struct ddsi_tran_conn;
|
| 48 |
+
struct ddsi_tran_listener;
|
| 49 |
+
struct ddsi_tran_factory;
|
| 50 |
+
struct debug_monitor;
|
| 51 |
+
struct ddsi_tkmap;
|
| 52 |
+
struct dds_security_context;
|
| 53 |
+
struct dds_security_match_index;
|
| 54 |
+
struct ddsi_hsadmin;
|
| 55 |
+
|
| 56 |
+
typedef struct config_in_addr_node {
|
| 57 |
+
ddsi_locator_t loc;
|
| 58 |
+
struct config_in_addr_node *next;
|
| 59 |
+
} config_in_addr_node;
|
| 60 |
+
|
| 61 |
+
enum recvips_mode {
|
| 62 |
+
RECVIPS_MODE_ALL, /* all MC capable interfaces */
|
| 63 |
+
RECVIPS_MODE_ANY, /* kernel-default interface */
|
| 64 |
+
RECVIPS_MODE_PREFERRED, /* selected interface only */
|
| 65 |
+
RECVIPS_MODE_NONE, /* no interfaces at all */
|
| 66 |
+
RECVIPS_MODE_SOME /* explicit list of interfaces; only one requiring recvips */
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
enum recv_thread_mode {
|
| 70 |
+
RTM_SINGLE,
|
| 71 |
+
RTM_MANY
|
| 72 |
+
};
|
| 73 |
+
|
| 74 |
+
struct recv_thread_arg {
|
| 75 |
+
enum recv_thread_mode mode;
|
| 76 |
+
struct nn_rbufpool *rbpool;
|
| 77 |
+
struct ddsi_domaingv *gv;
|
| 78 |
+
union {
|
| 79 |
+
struct {
|
| 80 |
+
const ddsi_locator_t *loc;
|
| 81 |
+
struct ddsi_tran_conn *conn;
|
| 82 |
+
} single;
|
| 83 |
+
struct {
|
| 84 |
+
os_sockWaitset ws;
|
| 85 |
+
} many;
|
| 86 |
+
} u;
|
| 87 |
+
};
|
| 88 |
+
|
| 89 |
+
struct deleted_participants_admin;
|
| 90 |
+
|
| 91 |
+
struct ddsi_domaingv {
|
| 92 |
+
volatile int terminate;
|
| 93 |
+
volatile int deaf;
|
| 94 |
+
volatile int mute;
|
| 95 |
+
|
| 96 |
+
struct ddsrt_log_cfg logconfig;
|
| 97 |
+
struct ddsi_config config;
|
| 98 |
+
|
| 99 |
+
struct ddsi_tkmap * m_tkmap;
|
| 100 |
+
|
| 101 |
+
/* Hash tables for participants, readers, writers, proxy
|
| 102 |
+
participants, proxy readers and proxy writers by GUID. */
|
| 103 |
+
struct entity_index *entity_index;
|
| 104 |
+
|
| 105 |
+
/* Timed events admin */
|
| 106 |
+
struct xeventq *xevents;
|
| 107 |
+
|
| 108 |
+
/* Queue for garbage collection requests */
|
| 109 |
+
struct gcreq_queue *gcreq_queue;
|
| 110 |
+
|
| 111 |
+
/* Lease junk */
|
| 112 |
+
ddsrt_mutex_t leaseheap_lock;
|
| 113 |
+
ddsrt_fibheap_t leaseheap;
|
| 114 |
+
|
| 115 |
+
/* Transport factories & selected factory */
|
| 116 |
+
struct ddsi_tran_factory *ddsi_tran_factories;
|
| 117 |
+
struct ddsi_tran_factory *m_factory;
|
| 118 |
+
|
| 119 |
+
/* Connections for multicast discovery & data, and those that correspond
|
| 120 |
+
to the one DDSI participant index that the DDSI2 service uses. The
|
| 121 |
+
DCPS participant of DDSI2 itself will be mirrored in a DDSI
|
| 122 |
+
participant, and in multi-socket mode that one gets its own
|
| 123 |
+
socket. */
|
| 124 |
+
struct ddsi_tran_conn * disc_conn_mc;
|
| 125 |
+
struct ddsi_tran_conn * data_conn_mc;
|
| 126 |
+
struct ddsi_tran_conn * disc_conn_uc;
|
| 127 |
+
struct ddsi_tran_conn * data_conn_uc;
|
| 128 |
+
|
| 129 |
+
/* Connection used for all output (for connectionless transports), this
|
| 130 |
+
used to simply be data_conn_uc, but:
|
| 131 |
+
|
| 132 |
+
- Windows has a quirk that makes multicast delivery within a machine
|
| 133 |
+
utterly unreliable if the transmitting socket is bound to 0.0.0.0
|
| 134 |
+
(despite all sockets having multicast interfaces set correctly),
|
| 135 |
+
but apparently only in the presence of sockets transmitting to the
|
| 136 |
+
same multicast group that have been bound to non-0.0.0.0 ...
|
| 137 |
+
- At least Fast-RTPS and Connext fail to honour the set of advertised
|
| 138 |
+
addresses and substitute 127.0.0.1 for the advertised IP address and
|
| 139 |
+
expect it to work.
|
| 140 |
+
- Fast-RTPS (at least) binds the socket it uses for transmitting
|
| 141 |
+
multicasts to non-0.0.0.0
|
| 142 |
+
|
| 143 |
+
So binding to 0.0.0.0 means the unicasts from Fast-RTPS & Connext will
|
| 144 |
+
arrive but the multicasts from Cyclone get dropped often on Windows
|
| 145 |
+
when trying to interoperate; and binding to the IP address means
|
| 146 |
+
unicast messages from the others fail to arrive (because they fail to
|
| 147 |
+
arrive).
|
| 148 |
+
|
| 149 |
+
The only work around is to use a separate socket for sending. It is
|
| 150 |
+
rather sad that Cyclone needs to work around the bugs of the others,
|
| 151 |
+
but it seems the only way to get the users what they expect. */
|
| 152 |
+
#define MAX_XMIT_CONNS 4
|
| 153 |
+
struct ddsi_tran_conn * xmit_conns[MAX_XMIT_CONNS];
|
| 154 |
+
ddsi_xlocator_t intf_xlocators[MAX_XMIT_CONNS];
|
| 155 |
+
|
| 156 |
+
/* TCP listener */
|
| 157 |
+
struct ddsi_tran_listener * listener;
|
| 158 |
+
|
| 159 |
+
/* In many sockets mode, the receive threads maintain a local array
|
| 160 |
+
with participant GUIDs and sockets, participant_set_generation is
|
| 161 |
+
used to notify them. */
|
| 162 |
+
ddsrt_atomic_uint32_t participant_set_generation;
|
| 163 |
+
|
| 164 |
+
/* nparticipants is used primarily for limiting the number of active
|
| 165 |
+
participants, but also during shutdown to determine when it is
|
| 166 |
+
safe to stop the GC thread. */
|
| 167 |
+
ddsrt_mutex_t participant_set_lock;
|
| 168 |
+
ddsrt_cond_t participant_set_cond;
|
| 169 |
+
uint32_t nparticipants;
|
| 170 |
+
|
| 171 |
+
/* For participants without (some) built-in writers, we fall back to
|
| 172 |
+
this participant, which is the first one created with all
|
| 173 |
+
built-in writers present. It MUST be created before any in need
|
| 174 |
+
of it pops up! */
|
| 175 |
+
struct ddsi_participant *privileged_pp;
|
| 176 |
+
ddsrt_mutex_t privileged_pp_lock;
|
| 177 |
+
|
| 178 |
+
/* For tracking (recently) deleted participants */
|
| 179 |
+
struct deleted_participants_admin *deleted_participants;
|
| 180 |
+
|
| 181 |
+
/* GUID to be used in next call to new_participant; also protected
|
| 182 |
+
by privileged_pp_lock */
|
| 183 |
+
struct ddsi_guid ppguid_base;
|
| 184 |
+
|
| 185 |
+
/* number of selected interfaces. */
|
| 186 |
+
int n_interfaces;
|
| 187 |
+
struct nn_interface interfaces[MAX_XMIT_CONNS];
|
| 188 |
+
/* whether we're using a link-local address (and therefore
|
| 189 |
+
only listening to multicasts on that interface) */
|
| 190 |
+
int using_link_local_intf;
|
| 191 |
+
|
| 192 |
+
/* Addressing: actual own (preferred) IP address, IP address
|
| 193 |
+
advertised in discovery messages (so that an external IP address on
|
| 194 |
+
a NAT may be advertised), and the DDSI multi-cast address. */
|
| 195 |
+
enum recvips_mode recvips_mode;
|
| 196 |
+
struct config_in_addr_node *recvips;
|
| 197 |
+
ddsi_locator_t extmask;
|
| 198 |
+
|
| 199 |
+
/* Locators */
|
| 200 |
+
|
| 201 |
+
ddsi_locator_t loc_spdp_mc;
|
| 202 |
+
ddsi_locator_t loc_meta_mc;
|
| 203 |
+
ddsi_locator_t loc_meta_uc;
|
| 204 |
+
ddsi_locator_t loc_default_mc;
|
| 205 |
+
ddsi_locator_t loc_default_uc;
|
| 206 |
+
#ifdef DDS_HAS_SHM
|
| 207 |
+
ddsi_locator_t loc_iceoryx_addr;
|
| 208 |
+
#endif
|
| 209 |
+
|
| 210 |
+
/*
|
| 211 |
+
Initial discovery address set, and the current discovery address
|
| 212 |
+
set. These are the addresses that SPDP pings get sent to.
|
| 213 |
+
*/
|
| 214 |
+
struct addrset *as_disc;
|
| 215 |
+
|
| 216 |
+
ddsrt_mutex_t lock;
|
| 217 |
+
|
| 218 |
+
/* Receive thread. (We can only has one for now, cos of the signal
|
| 219 |
+
trigger socket.) Receive buffer pool is per receive thread,
|
| 220 |
+
it is only a global variable because it needs to be freed way later
|
| 221 |
+
than the receive thread itself terminates */
|
| 222 |
+
#define MAX_RECV_THREADS 3
|
| 223 |
+
uint32_t n_recv_threads;
|
| 224 |
+
struct recv_thread {
|
| 225 |
+
const char *name;
|
| 226 |
+
struct thread_state *thrst;
|
| 227 |
+
struct recv_thread_arg arg;
|
| 228 |
+
} recv_threads[MAX_RECV_THREADS];
|
| 229 |
+
|
| 230 |
+
/* Listener thread for connection based transports */
|
| 231 |
+
struct thread_state *listen_ts;
|
| 232 |
+
|
| 233 |
+
/* Flag cleared when stopping (receive threads). FIXME. */
|
| 234 |
+
ddsrt_atomic_uint32_t rtps_keepgoing;
|
| 235 |
+
|
| 236 |
+
/* Start time of the DDSI2 service, for logging relative time stamps,
|
| 237 |
+
should I ever so desire. */
|
| 238 |
+
ddsrt_wctime_t tstart;
|
| 239 |
+
|
| 240 |
+
/* Default QoSs for participant, readers and writers (needed for
|
| 241 |
+
eliminating default values in outgoing discovery packets, and for
|
| 242 |
+
supplying values for missing QoS settings in incoming discovery
|
| 243 |
+
packets); plus the actual QoSs needed for the builtin
|
| 244 |
+
endpoints. */
|
| 245 |
+
ddsi_plist_t default_local_plist_pp;
|
| 246 |
+
dds_qos_t spdp_endpoint_xqos;
|
| 247 |
+
dds_qos_t builtin_endpoint_xqos_rd;
|
| 248 |
+
dds_qos_t builtin_endpoint_xqos_wr;
|
| 249 |
+
#ifdef DDS_HAS_TYPE_DISCOVERY
|
| 250 |
+
dds_qos_t builtin_volatile_xqos_rd;
|
| 251 |
+
dds_qos_t builtin_volatile_xqos_wr;
|
| 252 |
+
#endif
|
| 253 |
+
#ifdef DDS_HAS_SECURITY
|
| 254 |
+
dds_qos_t builtin_secure_volatile_xqos_rd;
|
| 255 |
+
dds_qos_t builtin_secure_volatile_xqos_wr;
|
| 256 |
+
dds_qos_t builtin_stateless_xqos_rd;
|
| 257 |
+
dds_qos_t builtin_stateless_xqos_wr;
|
| 258 |
+
#endif
|
| 259 |
+
|
| 260 |
+
/* SPDP packets get very special treatment (they're the only packets
|
| 261 |
+
we accept from writers we don't know) and have their very own
|
| 262 |
+
do-nothing defragmentation and reordering thingummies, as well as a
|
| 263 |
+
global mutex to in lieu of the proxy writer lock. */
|
| 264 |
+
ddsrt_mutex_t spdp_lock;
|
| 265 |
+
struct nn_defrag *spdp_defrag;
|
| 266 |
+
struct nn_reorder *spdp_reorder;
|
| 267 |
+
|
| 268 |
+
/* Built-in stuff other than SPDP gets funneled through the builtins
|
| 269 |
+
delivery queue; currently just SEDP and PMD */
|
| 270 |
+
struct nn_dqueue *builtins_dqueue;
|
| 271 |
+
|
| 272 |
+
struct debug_monitor *debmon;
|
| 273 |
+
|
| 274 |
+
#ifndef DDS_HAS_NETWORK_CHANNELS
|
| 275 |
+
uint32_t networkQueueId;
|
| 276 |
+
struct thread_state *channel_reader_thrst;
|
| 277 |
+
|
| 278 |
+
/* Application data gets its own delivery queue */
|
| 279 |
+
struct nn_dqueue *user_dqueue;
|
| 280 |
+
#endif
|
| 281 |
+
|
| 282 |
+
/* Transmit side: pools for the serializer & transmit messages and a
|
| 283 |
+
transmit queue*/
|
| 284 |
+
struct serdatapool *serpool;
|
| 285 |
+
struct nn_xmsgpool *xmsgpool;
|
| 286 |
+
struct ddsi_sertype *spdp_type; /* key = participant GUID */
|
| 287 |
+
struct ddsi_sertype *sedp_reader_type; /* key = endpoint GUID */
|
| 288 |
+
struct ddsi_sertype *sedp_writer_type; /* key = endpoint GUID */
|
| 289 |
+
struct ddsi_sertype *sedp_topic_type; /* key = topic GUID */
|
| 290 |
+
struct ddsi_sertype *pmd_type; /* participant message data */
|
| 291 |
+
#ifdef DDS_HAS_TYPE_DISCOVERY
|
| 292 |
+
struct ddsi_sertype *tl_svc_request_type; /* TypeLookup service request, no key */
|
| 293 |
+
struct ddsi_sertype *tl_svc_reply_type; /* TypeLookup service reply, no key */
|
| 294 |
+
#endif
|
| 295 |
+
#ifdef DDS_HAS_SECURITY
|
| 296 |
+
struct ddsi_sertype *spdp_secure_type; /* key = participant GUID */
|
| 297 |
+
struct ddsi_sertype *sedp_reader_secure_type; /* key = endpoint GUID */
|
| 298 |
+
struct ddsi_sertype *sedp_writer_secure_type; /* key = endpoint GUID */
|
| 299 |
+
struct ddsi_sertype *pmd_secure_type; /* participant message data */
|
| 300 |
+
struct ddsi_sertype *pgm_stateless_type; /* participant generic message */
|
| 301 |
+
struct ddsi_sertype *pgm_volatile_type; /* participant generic message */
|
| 302 |
+
#endif
|
| 303 |
+
|
| 304 |
+
ddsrt_mutex_t sendq_lock;
|
| 305 |
+
ddsrt_cond_t sendq_cond;
|
| 306 |
+
unsigned sendq_length;
|
| 307 |
+
struct nn_xpack *sendq_head;
|
| 308 |
+
struct nn_xpack *sendq_tail;
|
| 309 |
+
int sendq_stop;
|
| 310 |
+
struct thread_state *sendq_ts;
|
| 311 |
+
bool sendq_running;
|
| 312 |
+
ddsrt_mutex_t sendq_running_lock;
|
| 313 |
+
|
| 314 |
+
/* File for dumping captured packets, NULL if disabled */
|
| 315 |
+
FILE *pcap_fp;
|
| 316 |
+
ddsrt_mutex_t pcap_lock;
|
| 317 |
+
|
| 318 |
+
struct ddsi_builtin_topic_interface *builtin_topic_interface;
|
| 319 |
+
|
| 320 |
+
struct nn_group_membership *mship;
|
| 321 |
+
|
| 322 |
+
ddsrt_mutex_t sertypes_lock;
|
| 323 |
+
struct ddsrt_hh *sertypes;
|
| 324 |
+
|
| 325 |
+
#ifdef DDS_HAS_TYPE_DISCOVERY
|
| 326 |
+
ddsrt_mutex_t typelib_lock;
|
| 327 |
+
ddsrt_avl_tree_t typelib;
|
| 328 |
+
ddsrt_avl_tree_t typedeps;
|
| 329 |
+
ddsrt_avl_tree_t typedeps_reverse;
|
| 330 |
+
ddsrt_cond_t typelib_resolved_cond;
|
| 331 |
+
#endif
|
| 332 |
+
#ifdef DDS_HAS_TOPIC_DISCOVERY
|
| 333 |
+
ddsrt_mutex_t topic_defs_lock;
|
| 334 |
+
struct ddsrt_hh *topic_defs;
|
| 335 |
+
#endif
|
| 336 |
+
|
| 337 |
+
ddsrt_mutex_t new_topic_lock;
|
| 338 |
+
ddsrt_cond_t new_topic_cond;
|
| 339 |
+
uint32_t new_topic_version;
|
| 340 |
+
|
| 341 |
+
/* security globals */
|
| 342 |
+
#ifdef DDS_HAS_SECURITY
|
| 343 |
+
struct dds_security_context *security_context;
|
| 344 |
+
struct ddsi_hsadmin *hsadmin;
|
| 345 |
+
bool handshake_include_optional;
|
| 346 |
+
#endif
|
| 347 |
+
|
| 348 |
+
/* naming */
|
| 349 |
+
ddsrt_mutex_t naming_lock;
|
| 350 |
+
ddsrt_prng_t naming_rng;
|
| 351 |
+
};
|
| 352 |
+
|
| 353 |
+
#if defined (__cplusplus)
|
| 354 |
+
}
|
| 355 |
+
#endif
|
| 356 |
+
|
| 357 |
+
#endif /* DDSI_DOMAINGV_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_endpoint.h
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_ENDPOINT_H
|
| 13 |
+
#define DDSI_ENDPOINT_H
|
| 14 |
+
|
| 15 |
+
#include "dds/export.h"
|
| 16 |
+
#include "dds/features.h"
|
| 17 |
+
|
| 18 |
+
#include "dds/ddsrt/fibheap.h"
|
| 19 |
+
|
| 20 |
+
#if defined (__cplusplus)
|
| 21 |
+
extern "C" {
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
struct ddsi_participant;
|
| 25 |
+
struct ddsi_type_pair;
|
| 26 |
+
struct ddsi_entity_common;
|
| 27 |
+
struct ddsi_endpoint_common;
|
| 28 |
+
struct dds_qos;
|
| 29 |
+
|
| 30 |
+
/* Liveliness changed is more complicated than just add/remove. Encode the event
|
| 31 |
+
in ddsi_status_cb_data_t::extra and ignore ddsi_status_cb_data_t::add */
|
| 32 |
+
enum ddsi_liveliness_changed_data_extra {
|
| 33 |
+
DDSI_LIVELINESS_CHANGED_ADD_ALIVE,
|
| 34 |
+
DDSI_LIVELINESS_CHANGED_ADD_NOT_ALIVE,
|
| 35 |
+
DDSI_LIVELINESS_CHANGED_REMOVE_NOT_ALIVE,
|
| 36 |
+
DDSI_LIVELINESS_CHANGED_REMOVE_ALIVE,
|
| 37 |
+
DDSI_LIVELINESS_CHANGED_ALIVE_TO_NOT_ALIVE,
|
| 38 |
+
DDSI_LIVELINESS_CHANGED_NOT_ALIVE_TO_ALIVE
|
| 39 |
+
};
|
| 40 |
+
|
| 41 |
+
struct ddsi_endpoint_common {
|
| 42 |
+
struct ddsi_participant *pp;
|
| 43 |
+
ddsi_guid_t group_guid;
|
| 44 |
+
#ifdef DDS_HAS_TYPE_DISCOVERY
|
| 45 |
+
struct ddsi_type_pair *type_pair;
|
| 46 |
+
#endif
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
+
enum ddsi_writer_state {
|
| 50 |
+
WRST_OPERATIONAL, /* normal situation */
|
| 51 |
+
WRST_INTERRUPT, /* will be deleted, unblock throttle_writer but do not do anything further */
|
| 52 |
+
WRST_LINGERING, /* writer deletion has been requested but still has unack'd data */
|
| 53 |
+
WRST_DELETING /* writer is actually being deleted (removed from hash table) */
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
typedef ddsrt_atomic_uint64_t seq_xmit_t;
|
| 57 |
+
|
| 58 |
+
struct ldur_fhnode {
|
| 59 |
+
ddsrt_fibheap_node_t heapnode;
|
| 60 |
+
dds_duration_t ldur;
|
| 61 |
+
};
|
| 62 |
+
|
| 63 |
+
struct ddsi_writer
|
| 64 |
+
{
|
| 65 |
+
struct ddsi_entity_common e;
|
| 66 |
+
struct ddsi_endpoint_common c;
|
| 67 |
+
ddsi_status_cb_t status_cb;
|
| 68 |
+
void * status_cb_entity;
|
| 69 |
+
ddsrt_cond_t throttle_cond; /* used to trigger a transmit thread blocked in throttle_writer() or wait_for_acks() */
|
| 70 |
+
seqno_t seq; /* last sequence number (transmitted seqs are 1 ... seq, 0 when nothing published yet) */
|
| 71 |
+
seqno_t cs_seq; /* 1st seq in coherent set (or 0) */
|
| 72 |
+
seq_xmit_t seq_xmit; /* last sequence number actually transmitted */
|
| 73 |
+
seqno_t min_local_readers_reject_seq; /* mimum of local_readers->last_deliv_seq */
|
| 74 |
+
nn_count_t hbcount; /* last hb seq number */
|
| 75 |
+
nn_count_t hbfragcount; /* last hb frag seq number */
|
| 76 |
+
int throttling; /* non-zero when some thread is waiting for the WHC to shrink */
|
| 77 |
+
struct hbcontrol hbcontrol; /* controls heartbeat timing, piggybacking */
|
| 78 |
+
struct dds_qos *xqos;
|
| 79 |
+
enum ddsi_writer_state state;
|
| 80 |
+
unsigned reliable: 1; /* iff 1, writer is reliable <=> heartbeat_xevent != NULL */
|
| 81 |
+
unsigned handle_as_transient_local: 1; /* controls whether data is retained in WHC */
|
| 82 |
+
unsigned force_md5_keyhash: 1; /* iff 1, when keyhash has to be hashed, no matter the size */
|
| 83 |
+
unsigned retransmitting: 1; /* iff 1, this writer is currently retransmitting */
|
| 84 |
+
unsigned alive: 1; /* iff 1, the writer is alive (lease for this writer is not expired); field may be modified only when holding both wr->e.lock and wr->c.pp->e.lock */
|
| 85 |
+
unsigned test_ignore_acknack : 1; /* iff 1, the writer ignores all arriving ACKNACK messages */
|
| 86 |
+
unsigned test_suppress_retransmit : 1; /* iff 1, the writer does not respond to retransmit requests */
|
| 87 |
+
unsigned test_suppress_heartbeat : 1; /* iff 1, the writer suppresses all periodic heartbeats */
|
| 88 |
+
unsigned test_drop_outgoing_data : 1; /* iff 1, the writer drops outgoing data, forcing the readers to request a retransmit */
|
| 89 |
+
#ifdef DDS_HAS_SHM
|
| 90 |
+
unsigned has_iceoryx : 1;
|
| 91 |
+
#endif
|
| 92 |
+
#ifdef DDS_HAS_SSM
|
| 93 |
+
unsigned supports_ssm: 1;
|
| 94 |
+
struct addrset *ssm_as;
|
| 95 |
+
#endif
|
| 96 |
+
uint32_t alive_vclock; /* virtual clock counting transitions between alive/not-alive */
|
| 97 |
+
const struct ddsi_sertype * type; /* type of the data written by this writer */
|
| 98 |
+
struct addrset *as; /* set of addresses to publish to */
|
| 99 |
+
struct xevent *heartbeat_xevent; /* timed event for "periodically" publishing heartbeats when unack'd data present, NULL <=> unreliable */
|
| 100 |
+
struct ldur_fhnode *lease_duration; /* fibheap node to keep lease duration for this writer, NULL in case of automatic liveliness with inifite duration */
|
| 101 |
+
struct whc *whc; /* WHC tracking history, T-L durability service history + samples by sequence number for retransmit */
|
| 102 |
+
uint32_t whc_low, whc_high; /* watermarks for WHC in bytes (counting only unack'd data) */
|
| 103 |
+
ddsrt_etime_t t_rexmit_start;
|
| 104 |
+
ddsrt_etime_t t_rexmit_end; /* time of last 1->0 transition of "retransmitting" */
|
| 105 |
+
ddsrt_etime_t t_whc_high_upd; /* time "whc_high" was last updated for controlled ramp-up of throughput */
|
| 106 |
+
uint32_t init_burst_size_limit; /* derived from reader's receive_buffer_size */
|
| 107 |
+
uint32_t rexmit_burst_size_limit; /* derived from reader's receive_buffer_size */
|
| 108 |
+
uint32_t num_readers; /* total number of matching PROXY readers */
|
| 109 |
+
uint32_t num_reliable_readers; /* number of matching reliable PROXY readers */
|
| 110 |
+
uint32_t num_readers_requesting_keyhash; /* also +1 for protected keys and config override for generating keyhash */
|
| 111 |
+
ddsrt_avl_tree_t readers; /* all matching PROXY readers, see struct ddsi_wr_prd_match */
|
| 112 |
+
ddsrt_avl_tree_t local_readers; /* all matching LOCAL readers, see struct ddsi_wr_rd_match */
|
| 113 |
+
#ifdef DDS_HAS_NETWORK_PARTITIONS
|
| 114 |
+
const struct ddsi_config_networkpartition_listelem *network_partition;
|
| 115 |
+
#endif
|
| 116 |
+
uint32_t num_acks_received; /* cum received ACKNACKs with no request for retransmission */
|
| 117 |
+
uint32_t num_nacks_received; /* cum received ACKNACKs that did request retransmission */
|
| 118 |
+
uint32_t throttle_count; /* cum times transmitting was throttled (whc hitting high-level mark) */
|
| 119 |
+
uint32_t throttle_tracing;
|
| 120 |
+
uint32_t rexmit_count; /* cum samples retransmitted (counting events; 1 sample can be counted many times) */
|
| 121 |
+
uint32_t rexmit_lost_count; /* cum samples lost but retransmit requested (also counting events) */
|
| 122 |
+
uint64_t rexmit_bytes; /* cum bytes queued for retransmit */
|
| 123 |
+
uint64_t time_throttled; /* cum time in throttled state */
|
| 124 |
+
uint64_t time_retransmit; /* cum time in retransmitting state */
|
| 125 |
+
struct xeventq *evq; /* timed event queue to be used by this writer */
|
| 126 |
+
struct ddsi_local_reader_ary rdary; /* LOCAL readers for fast-pathing; if not fast-pathed, fall back to scanning local_readers */
|
| 127 |
+
struct lease *lease; /* for liveliness administration (writer can only become inactive when using manual liveliness) */
|
| 128 |
+
#ifdef DDS_HAS_SECURITY
|
| 129 |
+
struct ddsi_writer_sec_attributes *sec_attr;
|
| 130 |
+
#endif
|
| 131 |
+
};
|
| 132 |
+
|
| 133 |
+
struct ddsi_local_orphan_writer {
|
| 134 |
+
struct ddsi_writer wr;
|
| 135 |
+
};
|
| 136 |
+
|
| 137 |
+
struct ddsi_reader
|
| 138 |
+
{
|
| 139 |
+
struct ddsi_entity_common e;
|
| 140 |
+
struct ddsi_endpoint_common c;
|
| 141 |
+
ddsi_status_cb_t status_cb;
|
| 142 |
+
void * status_cb_entity;
|
| 143 |
+
struct ddsi_rhc * rhc; /* reader history, tracks registrations and data */
|
| 144 |
+
struct dds_qos *xqos;
|
| 145 |
+
unsigned reliable: 1; /* 1 iff reader is reliable */
|
| 146 |
+
unsigned handle_as_transient_local: 1; /* 1 iff reader wants historical data from proxy writers */
|
| 147 |
+
unsigned request_keyhash: 1; /* really controlled by the sertype */
|
| 148 |
+
#ifdef DDS_HAS_SSM
|
| 149 |
+
unsigned favours_ssm: 1; /* iff 1, this reader favours SSM */
|
| 150 |
+
#endif
|
| 151 |
+
#ifdef DDS_HAS_SHM
|
| 152 |
+
unsigned has_iceoryx : 1;
|
| 153 |
+
#endif
|
| 154 |
+
nn_count_t init_acknack_count; /* initial value for "count" (i.e. ACK seq num) for newly matched proxy writers */
|
| 155 |
+
#ifdef DDS_HAS_NETWORK_PARTITIONS
|
| 156 |
+
struct networkpartition_address *uc_as;
|
| 157 |
+
struct networkpartition_address *mc_as;
|
| 158 |
+
#endif
|
| 159 |
+
const struct ddsi_sertype * type; /* type of the data read by this reader */
|
| 160 |
+
uint32_t num_writers; /* total number of matching PROXY writers */
|
| 161 |
+
ddsrt_avl_tree_t writers; /* all matching PROXY writers, see struct ddsi_rd_pwr_match */
|
| 162 |
+
ddsrt_avl_tree_t local_writers; /* all matching LOCAL writers, see struct ddsi_rd_wr_match */
|
| 163 |
+
ddsi2direct_directread_cb_t ddsi2direct_cb;
|
| 164 |
+
void *ddsi2direct_cbarg;
|
| 165 |
+
#ifdef DDS_HAS_SECURITY
|
| 166 |
+
struct ddsi_reader_sec_attributes *sec_attr;
|
| 167 |
+
#endif
|
| 168 |
+
};
|
| 169 |
+
|
| 170 |
+
DDS_EXPORT extern const ddsrt_avl_treedef_t ddsi_wr_readers_treedef;
|
| 171 |
+
DDS_EXPORT extern const ddsrt_avl_treedef_t ddsi_wr_local_readers_treedef;
|
| 172 |
+
DDS_EXPORT extern const ddsrt_avl_treedef_t ddsi_rd_writers_treedef;
|
| 173 |
+
DDS_EXPORT extern const ddsrt_avl_treedef_t ddsi_rd_local_writers_treedef;
|
| 174 |
+
|
| 175 |
+
DDS_INLINE_EXPORT inline seqno_t ddsi_writer_read_seq_xmit (const struct ddsi_writer *wr)
|
| 176 |
+
{
|
| 177 |
+
return ddsrt_atomic_ld64 (&wr->seq_xmit);
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
DDS_INLINE_EXPORT inline void ddsi_writer_update_seq_xmit (struct ddsi_writer *wr, seqno_t nv)
|
| 181 |
+
{
|
| 182 |
+
uint64_t ov;
|
| 183 |
+
do {
|
| 184 |
+
ov = ddsrt_atomic_ld64 (&wr->seq_xmit);
|
| 185 |
+
if (nv <= ov) break;
|
| 186 |
+
} while (!ddsrt_atomic_cas64 (&wr->seq_xmit, ov, nv));
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
// generic
|
| 190 |
+
bool ddsi_is_local_orphan_endpoint (const struct ddsi_entity_common *e);
|
| 191 |
+
int ddsi_is_keyed_endpoint_entityid (ddsi_entityid_t id);
|
| 192 |
+
int ddsi_is_builtin_volatile_endpoint (ddsi_entityid_t id);
|
| 193 |
+
|
| 194 |
+
DDS_EXPORT int ddsi_is_builtin_endpoint (ddsi_entityid_t id, nn_vendorid_t vendorid);
|
| 195 |
+
|
| 196 |
+
// writer
|
| 197 |
+
dds_return_t ddsi_new_writer_guid (struct ddsi_writer **wr_out, const struct ddsi_guid *guid, const struct ddsi_guid *group_guid, struct ddsi_participant *pp, const char *topic_name, const struct ddsi_sertype *type, const struct dds_qos *xqos, struct whc *whc, ddsi_status_cb_t status_cb, void *status_entity);
|
| 198 |
+
int ddsi_is_writer_entityid (ddsi_entityid_t id);
|
| 199 |
+
void ddsi_deliver_historical_data (const struct ddsi_writer *wr, const struct ddsi_reader *rd);
|
| 200 |
+
unsigned ddsi_remove_acked_messages (struct ddsi_writer *wr, struct whc_state *whcst, struct whc_node **deferred_free_list);
|
| 201 |
+
seqno_t ddsi_writer_max_drop_seq (const struct ddsi_writer *wr);
|
| 202 |
+
int ddsi_writer_must_have_hb_scheduled (const struct ddsi_writer *wr, const struct whc_state *whcst);
|
| 203 |
+
void ddsi_writer_set_retransmitting (struct ddsi_writer *wr);
|
| 204 |
+
void ddsi_writer_clear_retransmitting (struct ddsi_writer *wr);
|
| 205 |
+
dds_return_t ddsi_delete_writer_nolinger (struct ddsi_domaingv *gv, const struct ddsi_guid *guid);
|
| 206 |
+
void ddsi_writer_get_alive_state (struct ddsi_writer *wr, struct ddsi_alive_state *st);
|
| 207 |
+
void ddsi_rebuild_writer_addrset (struct ddsi_writer *wr);
|
| 208 |
+
void ddsi_writer_set_alive_may_unlock (struct ddsi_writer *wr, bool notify);
|
| 209 |
+
int ddsi_writer_set_notalive (struct ddsi_writer *wr, bool notify);
|
| 210 |
+
|
| 211 |
+
DDS_EXPORT struct ddsi_local_orphan_writer *ddsi_new_local_orphan_writer (struct ddsi_domaingv *gv, ddsi_entityid_t entityid, const char *topic_name, struct ddsi_sertype *type, const struct dds_qos *xqos, struct whc *whc);
|
| 212 |
+
DDS_EXPORT void ddsi_delete_local_orphan_writer (struct ddsi_local_orphan_writer *wr);
|
| 213 |
+
DDS_EXPORT dds_return_t ddsi_new_writer (struct ddsi_writer **wr_out, struct ddsi_guid *wrguid, const struct ddsi_guid *group_guid, struct ddsi_participant *pp, const char *topic_name, const struct ddsi_sertype *type, const struct dds_qos *xqos, struct whc * whc, ddsi_status_cb_t status_cb, void *status_cb_arg);
|
| 214 |
+
DDS_EXPORT void ddsi_update_writer_qos (struct ddsi_writer *wr, const struct dds_qos *xqos);
|
| 215 |
+
DDS_EXPORT void ddsi_make_writer_info(struct ddsi_writer_info *wrinfo, const struct ddsi_entity_common *e, const struct dds_qos *xqos, uint32_t statusinfo);
|
| 216 |
+
DDS_EXPORT dds_return_t ddsi_writer_wait_for_acks (struct ddsi_writer *wr, const ddsi_guid_t *rdguid, dds_time_t abstimeout);
|
| 217 |
+
DDS_EXPORT dds_return_t ddsi_unblock_throttled_writer (struct ddsi_domaingv *gv, const struct ddsi_guid *guid);
|
| 218 |
+
DDS_EXPORT dds_return_t ddsi_delete_writer (struct ddsi_domaingv *gv, const struct ddsi_guid *guid);
|
| 219 |
+
|
| 220 |
+
// reader
|
| 221 |
+
dds_return_t ddsi_new_reader_guid (struct ddsi_reader **rd_out, const struct ddsi_guid *guid, const struct ddsi_guid *group_guid, struct ddsi_participant *pp, const char *topic_name, const struct ddsi_sertype *type, const struct dds_qos *xqos, struct ddsi_rhc *rhc, ddsi_status_cb_t status_cb, void * status_entity);
|
| 222 |
+
int ddsi_is_reader_entityid (ddsi_entityid_t id);
|
| 223 |
+
void ddsi_reader_update_notify_wr_alive_state (struct ddsi_reader *rd, const struct ddsi_writer *wr, const struct ddsi_alive_state *alive_state);
|
| 224 |
+
void ddsi_reader_update_notify_pwr_alive_state (struct ddsi_reader *rd, const struct ddsi_proxy_writer *pwr, const struct ddsi_alive_state *alive_state);
|
| 225 |
+
void ddsi_reader_update_notify_pwr_alive_state_guid (const struct ddsi_guid *rd_guid, const struct ddsi_proxy_writer *pwr, const struct ddsi_alive_state *alive_state);
|
| 226 |
+
void ddsi_update_reader_init_acknack_count (const ddsrt_log_cfg_t *logcfg, const struct entity_index *entidx, const struct ddsi_guid *rd_guid, nn_count_t count);
|
| 227 |
+
|
| 228 |
+
DDS_EXPORT dds_return_t ddsi_new_reader (struct ddsi_reader **rd_out, struct ddsi_guid *rdguid, const struct ddsi_guid *group_guid, struct ddsi_participant *pp, const char *topic_name, const struct ddsi_sertype *type, const struct dds_qos *xqos, struct ddsi_rhc * rhc, ddsi_status_cb_t status_cb, void *status_cb_arg);
|
| 229 |
+
DDS_EXPORT void ddsi_update_reader_qos (struct ddsi_reader *rd, const struct dds_qos *xqos);
|
| 230 |
+
DDS_EXPORT dds_return_t ddsi_delete_reader (struct ddsi_domaingv *gv, const struct ddsi_guid *guid);
|
| 231 |
+
|
| 232 |
+
|
| 233 |
+
#if defined (__cplusplus)
|
| 234 |
+
}
|
| 235 |
+
#endif
|
| 236 |
+
|
| 237 |
+
#endif /* DDSI_ENDPOINT_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_entity.h
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_ENTITY_H
|
| 13 |
+
#define DDSI_ENTITY_H
|
| 14 |
+
|
| 15 |
+
#include "dds/export.h"
|
| 16 |
+
#include "dds/features.h"
|
| 17 |
+
|
| 18 |
+
#include "dds/ddsrt/atomics.h"
|
| 19 |
+
#include "dds/ddsrt/avl.h"
|
| 20 |
+
#include "dds/ddsrt/fibheap.h"
|
| 21 |
+
#include "dds/ddsrt/sync.h"
|
| 22 |
+
#include "dds/ddsi/q_rtps.h"
|
| 23 |
+
#include "dds/ddsi/ddsi_plist.h"
|
| 24 |
+
#include "dds/ddsi/q_protocol.h"
|
| 25 |
+
#include "dds/ddsi/q_lat_estim.h"
|
| 26 |
+
#include "dds/ddsi/q_hbcontrol.h"
|
| 27 |
+
#include "dds/ddsi/q_feature_check.h"
|
| 28 |
+
#include "dds/ddsi/q_inverse_uint32_set.h"
|
| 29 |
+
#include "dds/ddsi/ddsi_typelib.h"
|
| 30 |
+
#include "dds/ddsi/ddsi_serdata_default.h"
|
| 31 |
+
#include "dds/ddsi/ddsi_handshake.h"
|
| 32 |
+
#include "dds/ddsi/ddsi_typelookup.h"
|
| 33 |
+
#include "dds/ddsi/ddsi_tran.h"
|
| 34 |
+
#include "dds/ddsi/ddsi_list_genptr.h"
|
| 35 |
+
#include "dds/ddsi/q_gc.h"
|
| 36 |
+
#include "dds/ddsi/q_lease.h"
|
| 37 |
+
|
| 38 |
+
#if defined (__cplusplus)
|
| 39 |
+
extern "C" {
|
| 40 |
+
#endif
|
| 41 |
+
|
| 42 |
+
struct whc_node;
|
| 43 |
+
struct ddsi_plist;
|
| 44 |
+
struct nn_rsample_info;
|
| 45 |
+
struct nn_rdata;
|
| 46 |
+
struct ddsi_tkmap_instance;
|
| 47 |
+
struct ddsi_writer_info;
|
| 48 |
+
struct entity_index;
|
| 49 |
+
|
| 50 |
+
typedef void (*ddsi2direct_directread_cb_t) (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, void *arg);
|
| 51 |
+
|
| 52 |
+
enum ddsi_entity_kind {
|
| 53 |
+
DDSI_EK_PARTICIPANT,
|
| 54 |
+
DDSI_EK_PROXY_PARTICIPANT,
|
| 55 |
+
DDSI_EK_TOPIC,
|
| 56 |
+
DDSI_EK_WRITER,
|
| 57 |
+
DDSI_EK_PROXY_WRITER,
|
| 58 |
+
DDSI_EK_READER,
|
| 59 |
+
DDSI_EK_PROXY_READER
|
| 60 |
+
};
|
| 61 |
+
|
| 62 |
+
typedef struct ddsi_status_cb_data
|
| 63 |
+
{
|
| 64 |
+
int raw_status_id;
|
| 65 |
+
uint32_t extra;
|
| 66 |
+
uint64_t handle;
|
| 67 |
+
bool add;
|
| 68 |
+
} ddsi_status_cb_data_t;
|
| 69 |
+
|
| 70 |
+
typedef void (*ddsi_status_cb_t) (void *entity, const ddsi_status_cb_data_t *data);
|
| 71 |
+
|
| 72 |
+
typedef struct ddsi_type_pair
|
| 73 |
+
#ifdef DDS_HAS_TYPE_DISCOVERY
|
| 74 |
+
{
|
| 75 |
+
struct ddsi_type *minimal;
|
| 76 |
+
struct ddsi_type *complete;
|
| 77 |
+
}
|
| 78 |
+
#endif
|
| 79 |
+
ddsi_type_pair_t;
|
| 80 |
+
|
| 81 |
+
struct ddsi_entity_common {
|
| 82 |
+
enum ddsi_entity_kind kind;
|
| 83 |
+
ddsi_guid_t guid;
|
| 84 |
+
ddsrt_wctime_t tupdate; /* timestamp of last update */
|
| 85 |
+
uint64_t iid;
|
| 86 |
+
struct ddsi_tkmap_instance *tk;
|
| 87 |
+
ddsrt_mutex_t lock;
|
| 88 |
+
bool onlylocal;
|
| 89 |
+
struct ddsi_domaingv *gv;
|
| 90 |
+
ddsrt_avl_node_t all_entities_avlnode;
|
| 91 |
+
|
| 92 |
+
/* QoS changes always lock the entity itself, and additionally
|
| 93 |
+
(and within the scope of the entity lock) acquire qos_lock
|
| 94 |
+
while manipulating the QoS. So any thread that needs to read
|
| 95 |
+
the QoS without acquiring the entity's lock can still do so
|
| 96 |
+
(e.g., the materialisation of samples for built-in topics
|
| 97 |
+
when connecting a reader to a writer for a built-in topic).
|
| 98 |
+
|
| 99 |
+
qos_lock lock order across entities in is in increasing
|
| 100 |
+
order of entity addresses cast to uintptr_t. */
|
| 101 |
+
ddsrt_mutex_t qos_lock;
|
| 102 |
+
};
|
| 103 |
+
|
| 104 |
+
struct ddsi_local_reader_ary {
|
| 105 |
+
ddsrt_mutex_t rdary_lock;
|
| 106 |
+
unsigned valid: 1; /* always true until (proxy-)writer is being deleted; !valid => !fastpath_ok */
|
| 107 |
+
unsigned fastpath_ok: 1; /* if not ok, fall back to using GUIDs (gives access to the reader-writer match data for handling readers that bumped into resource limits, hence can flip-flop, unlike "valid") */
|
| 108 |
+
uint32_t n_readers;
|
| 109 |
+
struct ddsi_reader **rdary; /* for efficient delivery, null-pointer terminated, grouped by topic */
|
| 110 |
+
};
|
| 111 |
+
|
| 112 |
+
struct ddsi_alive_state {
|
| 113 |
+
bool alive;
|
| 114 |
+
uint32_t vclock;
|
| 115 |
+
};
|
| 116 |
+
|
| 117 |
+
bool ddsi_is_null_guid (const ddsi_guid_t *guid);
|
| 118 |
+
int ddsi_is_builtin_entityid (ddsi_entityid_t id, nn_vendorid_t vendorid);
|
| 119 |
+
bool ddsi_update_qos_locked (struct ddsi_entity_common *e, dds_qos_t *ent_qos, const dds_qos_t *xqos, ddsrt_wctime_t timestamp);
|
| 120 |
+
int ddsi_set_topic_type_name (dds_qos_t *xqos, const char * topic_name, const char * type_name);
|
| 121 |
+
int ddsi_compare_entityid (const void *a, const void *b);
|
| 122 |
+
|
| 123 |
+
DDS_EXPORT int ddsi_compare_guid (const void *va, const void *vb);
|
| 124 |
+
DDS_EXPORT ddsi_entityid_t ddsi_to_entityid (unsigned u);
|
| 125 |
+
DDS_EXPORT nn_vendorid_t ddsi_get_entity_vendorid (const struct ddsi_entity_common *e);
|
| 126 |
+
DDS_EXPORT uint64_t ddsi_get_entity_instanceid (const struct ddsi_domaingv *gv, const struct ddsi_guid *guid);
|
| 127 |
+
DDS_EXPORT void ddsi_entity_common_init (struct ddsi_entity_common *e, struct ddsi_domaingv *gv, const struct ddsi_guid *guid, enum ddsi_entity_kind kind, ddsrt_wctime_t tcreate, nn_vendorid_t vendorid, bool onlylocal);
|
| 128 |
+
DDS_EXPORT void ddsi_entity_common_fini (struct ddsi_entity_common *e);
|
| 129 |
+
|
| 130 |
+
#if defined (__cplusplus)
|
| 131 |
+
}
|
| 132 |
+
#endif
|
| 133 |
+
|
| 134 |
+
#endif /* DDSI_ENTITY_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_entity_index.h
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_ENTITY_INDEX_H
|
| 13 |
+
#define DDSI_ENTITY_INDEX_H
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsrt/hopscotch.h"
|
| 16 |
+
#include "dds/ddsi/q_thread.h"
|
| 17 |
+
#include "dds/ddsi/ddsi_entity.h"
|
| 18 |
+
#include "dds/ddsi/ddsi_topic.h"
|
| 19 |
+
#include "dds/ddsi/ddsi_endpoint.h"
|
| 20 |
+
#include "dds/ddsi/ddsi_proxy_endpoint.h"
|
| 21 |
+
|
| 22 |
+
#if defined (__cplusplus)
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
struct entity_index;
|
| 27 |
+
struct ddsi_guid;
|
| 28 |
+
struct ddsi_domaingv;
|
| 29 |
+
|
| 30 |
+
struct match_entities_range_key {
|
| 31 |
+
union {
|
| 32 |
+
#ifdef DDS_HAS_TOPIC_DISCOVERY
|
| 33 |
+
struct ddsi_topic tp;
|
| 34 |
+
#endif
|
| 35 |
+
struct ddsi_writer wr;
|
| 36 |
+
struct ddsi_reader rd;
|
| 37 |
+
struct ddsi_entity_common e;
|
| 38 |
+
struct ddsi_generic_proxy_endpoint gpe;
|
| 39 |
+
} entity;
|
| 40 |
+
struct dds_qos xqos;
|
| 41 |
+
#ifdef DDS_HAS_TOPIC_DISCOVERY
|
| 42 |
+
struct ddsi_topic_definition tpdef;
|
| 43 |
+
#endif
|
| 44 |
+
};
|
| 45 |
+
|
| 46 |
+
struct entidx_enum
|
| 47 |
+
{
|
| 48 |
+
struct entity_index *entidx;
|
| 49 |
+
enum ddsi_entity_kind kind;
|
| 50 |
+
struct ddsi_entity_common *cur;
|
| 51 |
+
#ifndef NDEBUG
|
| 52 |
+
vtime_t vtime;
|
| 53 |
+
#endif
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
/* Readers & writers are both in a GUID- and in a GID-keyed table. If
|
| 57 |
+
they are in the GID-based one, they are also in the GUID-based one,
|
| 58 |
+
but not the way around, for two reasons:
|
| 59 |
+
|
| 60 |
+
- firstly, there are readers & writers that do not have a GID
|
| 61 |
+
(built-in endpoints, fictitious transient data readers),
|
| 62 |
+
|
| 63 |
+
- secondly, they are inserted first in the GUID-keyed one, and then
|
| 64 |
+
in the GID-keyed one.
|
| 65 |
+
|
| 66 |
+
The GID is used solely for the interface with the OpenSplice
|
| 67 |
+
kernel, all internal state and protocol handling is done using the
|
| 68 |
+
GUID. So all this means is that, e.g., a writer being deleted
|
| 69 |
+
becomes invisible to the network reader slightly before it
|
| 70 |
+
disappears in the protocol handling, or that a writer might exist
|
| 71 |
+
at the protocol level slightly before the network reader can use it
|
| 72 |
+
to transmit data. */
|
| 73 |
+
|
| 74 |
+
struct entity_index *entity_index_new (struct ddsi_domaingv *gv) ddsrt_nonnull_all;
|
| 75 |
+
void entity_index_free (struct entity_index *ei) ddsrt_nonnull_all;
|
| 76 |
+
|
| 77 |
+
void entidx_insert_participant_guid (struct entity_index *ei, struct ddsi_participant *pp) ddsrt_nonnull_all;
|
| 78 |
+
void entidx_insert_proxy_participant_guid (struct entity_index *ei, struct ddsi_proxy_participant *proxypp) ddsrt_nonnull_all;
|
| 79 |
+
void entidx_insert_writer_guid (struct entity_index *ei, struct ddsi_writer *wr) ddsrt_nonnull_all;
|
| 80 |
+
void entidx_insert_reader_guid (struct entity_index *ei, struct ddsi_reader *rd) ddsrt_nonnull_all;
|
| 81 |
+
void entidx_insert_proxy_writer_guid (struct entity_index *ei, struct ddsi_proxy_writer *pwr) ddsrt_nonnull_all;
|
| 82 |
+
void entidx_insert_proxy_reader_guid (struct entity_index *ei, struct ddsi_proxy_reader *prd) ddsrt_nonnull_all;
|
| 83 |
+
|
| 84 |
+
void entidx_remove_participant_guid (struct entity_index *ei, struct ddsi_participant *pp) ddsrt_nonnull_all;
|
| 85 |
+
void entidx_remove_proxy_participant_guid (struct entity_index *ei, struct ddsi_proxy_participant *proxypp) ddsrt_nonnull_all;
|
| 86 |
+
void entidx_remove_writer_guid (struct entity_index *ei, struct ddsi_writer *wr) ddsrt_nonnull_all;
|
| 87 |
+
void entidx_remove_reader_guid (struct entity_index *ei, struct ddsi_reader *rd) ddsrt_nonnull_all;
|
| 88 |
+
void entidx_remove_proxy_writer_guid (struct entity_index *ei, struct ddsi_proxy_writer *pwr) ddsrt_nonnull_all;
|
| 89 |
+
void entidx_remove_proxy_reader_guid (struct entity_index *ei, struct ddsi_proxy_reader *prd) ddsrt_nonnull_all;
|
| 90 |
+
|
| 91 |
+
DDS_EXPORT void *entidx_lookup_guid_untyped (const struct entity_index *ei, const struct ddsi_guid *guid) ddsrt_nonnull_all;
|
| 92 |
+
DDS_EXPORT void *entidx_lookup_guid (const struct entity_index *ei, const struct ddsi_guid *guid, enum ddsi_entity_kind kind) ddsrt_nonnull_all;
|
| 93 |
+
|
| 94 |
+
DDS_EXPORT struct ddsi_participant *entidx_lookup_participant_guid (const struct entity_index *ei, const struct ddsi_guid *guid) ddsrt_nonnull_all;
|
| 95 |
+
DDS_EXPORT struct ddsi_proxy_participant *entidx_lookup_proxy_participant_guid (const struct entity_index *ei, const struct ddsi_guid *guid) ddsrt_nonnull_all;
|
| 96 |
+
DDS_EXPORT struct ddsi_writer *entidx_lookup_writer_guid (const struct entity_index *ei, const struct ddsi_guid *guid) ddsrt_nonnull_all;
|
| 97 |
+
DDS_EXPORT struct ddsi_reader *entidx_lookup_reader_guid (const struct entity_index *ei, const struct ddsi_guid *guid) ddsrt_nonnull_all;
|
| 98 |
+
DDS_EXPORT struct ddsi_proxy_writer *entidx_lookup_proxy_writer_guid (const struct entity_index *ei, const struct ddsi_guid *guid) ddsrt_nonnull_all;
|
| 99 |
+
DDS_EXPORT struct ddsi_proxy_reader *entidx_lookup_proxy_reader_guid (const struct entity_index *ei, const struct ddsi_guid *guid) ddsrt_nonnull_all;
|
| 100 |
+
|
| 101 |
+
/* Enumeration of entries in the hash table:
|
| 102 |
+
|
| 103 |
+
- "next" visits at least all entries that were in the hash table at
|
| 104 |
+
the time of calling init and that have not subsequently been
|
| 105 |
+
removed;
|
| 106 |
+
|
| 107 |
+
- "next" may visit an entry more than once, but will do so only
|
| 108 |
+
because of rare events (i.e., resize or so);
|
| 109 |
+
|
| 110 |
+
- the order in which entries are visited is arbitrary;
|
| 111 |
+
|
| 112 |
+
- the caller must call init() before it may call next(); it must
|
| 113 |
+
call fini() before it may call init() again. */
|
| 114 |
+
struct entidx_enum_participant { struct entidx_enum st; };
|
| 115 |
+
struct entidx_enum_writer { struct entidx_enum st; };
|
| 116 |
+
struct entidx_enum_reader { struct entidx_enum st; };
|
| 117 |
+
struct entidx_enum_proxy_participant { struct entidx_enum st; };
|
| 118 |
+
struct entidx_enum_proxy_writer { struct entidx_enum st; };
|
| 119 |
+
struct entidx_enum_proxy_reader { struct entidx_enum st; };
|
| 120 |
+
|
| 121 |
+
void entidx_enum_init (struct entidx_enum *st, const struct entity_index *ei, enum ddsi_entity_kind kind) ddsrt_nonnull_all;
|
| 122 |
+
void entidx_enum_init_topic (struct entidx_enum *st, const struct entity_index *gh, enum ddsi_entity_kind kind, const char *topic, struct match_entities_range_key *max) ddsrt_nonnull_all;
|
| 123 |
+
void entidx_enum_init_topic_w_prefix (struct entidx_enum *st, const struct entity_index *ei, enum ddsi_entity_kind kind, const char *topic, const ddsi_guid_prefix_t *prefix, struct match_entities_range_key *max) ddsrt_nonnull_all;
|
| 124 |
+
void *entidx_enum_next_max (struct entidx_enum *st, const struct match_entities_range_key *max) ddsrt_nonnull_all;
|
| 125 |
+
void *entidx_enum_next (struct entidx_enum *st) ddsrt_nonnull_all;
|
| 126 |
+
void entidx_enum_fini (struct entidx_enum *st) ddsrt_nonnull_all;
|
| 127 |
+
|
| 128 |
+
void entidx_enum_writer_init (struct entidx_enum_writer *st, const struct entity_index *ei) ddsrt_nonnull_all;
|
| 129 |
+
void entidx_enum_reader_init (struct entidx_enum_reader *st, const struct entity_index *ei) ddsrt_nonnull_all;
|
| 130 |
+
void entidx_enum_proxy_writer_init (struct entidx_enum_proxy_writer *st, const struct entity_index *ei) ddsrt_nonnull_all;
|
| 131 |
+
void entidx_enum_proxy_reader_init (struct entidx_enum_proxy_reader *st, const struct entity_index *ei) ddsrt_nonnull_all;
|
| 132 |
+
void entidx_enum_participant_init (struct entidx_enum_participant *st, const struct entity_index *ei) ddsrt_nonnull_all;
|
| 133 |
+
void entidx_enum_proxy_participant_init (struct entidx_enum_proxy_participant *st, const struct entity_index *ei) ddsrt_nonnull_all;
|
| 134 |
+
|
| 135 |
+
struct ddsi_writer *entidx_enum_writer_next (struct entidx_enum_writer *st) ddsrt_nonnull_all;
|
| 136 |
+
struct ddsi_reader *entidx_enum_reader_next (struct entidx_enum_reader *st) ddsrt_nonnull_all;
|
| 137 |
+
struct ddsi_proxy_writer *entidx_enum_proxy_writer_next (struct entidx_enum_proxy_writer *st) ddsrt_nonnull_all;
|
| 138 |
+
struct ddsi_proxy_reader *entidx_enum_proxy_reader_next (struct entidx_enum_proxy_reader *st) ddsrt_nonnull_all;
|
| 139 |
+
struct ddsi_participant *entidx_enum_participant_next (struct entidx_enum_participant *st) ddsrt_nonnull_all;
|
| 140 |
+
struct ddsi_proxy_participant *entidx_enum_proxy_participant_next (struct entidx_enum_proxy_participant *st) ddsrt_nonnull_all;
|
| 141 |
+
|
| 142 |
+
void entidx_enum_writer_fini (struct entidx_enum_writer *st) ddsrt_nonnull_all;
|
| 143 |
+
void entidx_enum_reader_fini (struct entidx_enum_reader *st) ddsrt_nonnull_all;
|
| 144 |
+
void entidx_enum_proxy_writer_fini (struct entidx_enum_proxy_writer *st) ddsrt_nonnull_all;
|
| 145 |
+
void entidx_enum_proxy_reader_fini (struct entidx_enum_proxy_reader *st) ddsrt_nonnull_all;
|
| 146 |
+
void entidx_enum_participant_fini (struct entidx_enum_participant *st) ddsrt_nonnull_all;
|
| 147 |
+
void entidx_enum_proxy_participant_fini (struct entidx_enum_proxy_participant *st) ddsrt_nonnull_all;
|
| 148 |
+
|
| 149 |
+
#ifdef DDS_HAS_TOPIC_DISCOVERY
|
| 150 |
+
void entidx_insert_topic_guid (struct entity_index *ei, struct ddsi_topic *tp) ddsrt_nonnull_all;
|
| 151 |
+
void entidx_remove_topic_guid (struct entity_index *ei, struct ddsi_topic *tp) ddsrt_nonnull_all;
|
| 152 |
+
DDS_EXPORT struct ddsi_topic *entidx_lookup_topic_guid (const struct entity_index *ei, const struct ddsi_guid *guid);
|
| 153 |
+
struct entidx_enum_topic { struct entidx_enum st; };
|
| 154 |
+
void entidx_enum_topic_init (struct entidx_enum_topic *st, const struct entity_index *ei) ddsrt_nonnull_all;
|
| 155 |
+
struct ddsi_topic *entidx_enum_topic_next (struct entidx_enum_topic *st) ddsrt_nonnull_all;
|
| 156 |
+
void entidx_enum_topic_fini (struct entidx_enum_topic *st) ddsrt_nonnull_all;
|
| 157 |
+
#endif
|
| 158 |
+
|
| 159 |
+
#if defined (__cplusplus)
|
| 160 |
+
}
|
| 161 |
+
#endif
|
| 162 |
+
|
| 163 |
+
#endif /* DDSI_ENTITY_INDEX_H */
|
third-party/GR00T-WholeBodyControl/g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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_ENTITY_MATCH_H
|
| 13 |
+
#define DDSI_ENTITY_MATCH_H
|
| 14 |
+
|
| 15 |
+
#include "dds/export.h"
|
| 16 |
+
#include "dds/features.h"
|
| 17 |
+
|
| 18 |
+
#include "dds/ddsrt/avl.h"
|
| 19 |
+
#include "dds/ddsi/ddsi_entity.h"
|
| 20 |
+
#include "dds/ddsi/q_addrset.h"
|
| 21 |
+
|
| 22 |
+
#if defined (__cplusplus)
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
struct ddsi_participant;
|
| 27 |
+
struct ddsi_proxy_participant;
|
| 28 |
+
struct ddsi_writer;
|
| 29 |
+
struct ddsi_reader;
|
| 30 |
+
struct ddsi_proxy_writer;
|
| 31 |
+
struct ddsi_proxy_reader;
|
| 32 |
+
struct ddsi_alive_state;
|
| 33 |
+
struct ddsi_generic_proxy_endpoint;
|
| 34 |
+
|
| 35 |
+
struct bestab {
|
| 36 |
+
unsigned besflag;
|
| 37 |
+
unsigned entityid;
|
| 38 |
+
const char *topic_name;
|
| 39 |
+
};
|
| 40 |
+
|
| 41 |
+
#ifdef DDS_HAS_SECURITY
|
| 42 |
+
struct setab {
|
| 43 |
+
enum ddsi_entity_kind kind;
|
| 44 |
+
uint32_t id;
|
| 45 |
+
};
|
| 46 |
+
#endif
|
| 47 |
+
|
| 48 |
+
struct ddsi_prd_wr_match {
|
| 49 |
+
ddsrt_avl_node_t avlnode;
|
| 50 |
+
ddsi_guid_t wr_guid;
|
| 51 |
+
#ifdef DDS_HAS_SECURITY
|
| 52 |
+
int64_t crypto_handle;
|
| 53 |
+
#endif
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
struct ddsi_rd_pwr_match {
|
| 57 |
+
ddsrt_avl_node_t avlnode;
|
| 58 |
+
ddsi_guid_t pwr_guid;
|
| 59 |
+
unsigned pwr_alive: 1; /* tracks pwr's alive state */
|
| 60 |
+
uint32_t pwr_alive_vclock; /* used to ensure progress */
|
| 61 |
+
#ifdef DDS_HAS_SSM
|
| 62 |
+
ddsi_xlocator_t ssm_mc_loc;
|
| 63 |
+
ddsi_xlocator_t ssm_src_loc;
|
| 64 |
+
#endif
|
| 65 |
+
#ifdef DDS_HAS_SECURITY
|
| 66 |
+
int64_t crypto_handle;
|
| 67 |
+
#endif
|
| 68 |
+
};
|
| 69 |
+
|
| 70 |
+
struct ddsi_wr_rd_match {
|
| 71 |
+
ddsrt_avl_node_t avlnode;
|
| 72 |
+
ddsi_guid_t rd_guid;
|
| 73 |
+
};
|
| 74 |
+
|
| 75 |
+
struct ddsi_rd_wr_match {
|
| 76 |
+
ddsrt_avl_node_t avlnode;
|
| 77 |
+
ddsi_guid_t wr_guid;
|
| 78 |
+
unsigned wr_alive: 1; /* tracks wr's alive state */
|
| 79 |
+
uint32_t wr_alive_vclock; /* used to ensure progress */
|
| 80 |
+
};
|
| 81 |
+
|
| 82 |
+
struct ddsi_wr_prd_match {
|
| 83 |
+
ddsrt_avl_node_t avlnode;
|
| 84 |
+
ddsi_guid_t prd_guid; /* guid of the proxy reader */
|
| 85 |
+
unsigned assumed_in_sync: 1; /* set to 1 upon receipt of ack not nack'ing msgs */
|
| 86 |
+
unsigned has_replied_to_hb: 1; /* we must keep sending HBs until all readers have this set */
|
| 87 |
+
unsigned all_have_replied_to_hb: 1; /* true iff 'has_replied_to_hb' for all readers in subtree */
|
| 88 |
+
unsigned is_reliable: 1; /* true iff reliable proxy reader */
|
| 89 |
+
seqno_t min_seq; /* smallest ack'd seq nr in subtree */
|
| 90 |
+
seqno_t max_seq; /* sort-of highest ack'd seq nr in subtree (see augment function) */
|
| 91 |
+
seqno_t seq; /* highest acknowledged seq nr */
|
| 92 |
+
seqno_t last_seq; /* highest seq send to this reader used when filter is applied */
|
| 93 |
+
uint32_t num_reliable_readers_where_seq_equals_max;
|
| 94 |
+
ddsi_guid_t arbitrary_unacked_reader;
|
| 95 |
+
nn_count_t prev_acknack; /* latest accepted acknack sequence number */
|
| 96 |
+
nn_count_t prev_nackfrag; /* latest accepted nackfrag sequence number */
|
| 97 |
+
ddsrt_etime_t t_acknack_accepted; /* (local) time an acknack was last accepted */
|
| 98 |
+
ddsrt_etime_t t_nackfrag_accepted; /* (local) time a nackfrag was last accepted */
|
| 99 |
+
struct nn_lat_estim hb_to_ack_latency;
|
| 100 |
+
ddsrt_wctime_t hb_to_ack_latency_tlastlog;
|
| 101 |
+
uint32_t non_responsive_count;
|
| 102 |
+
uint32_t rexmit_requests;
|
| 103 |
+
#ifdef DDS_HAS_SECURITY
|
| 104 |
+
int64_t crypto_handle;
|
| 105 |
+
#endif
|
| 106 |
+
};
|
| 107 |
+
|
| 108 |
+
enum pwr_rd_match_syncstate {
|
| 109 |
+
PRMSS_SYNC, /* in sync with proxy writer, has caught up with historical data */
|
| 110 |
+
PRMSS_TLCATCHUP, /* in sync with proxy writer, pwr + readers still catching up on historical data */
|
| 111 |
+
PRMSS_OUT_OF_SYNC /* not in sync with proxy writer */
|
| 112 |
+
};
|
| 113 |
+
|
| 114 |
+
struct last_nack_summary {
|
| 115 |
+
seqno_t seq_end_p1; /* last seq for which we requested a retransmit */
|
| 116 |
+
seqno_t seq_base;
|
| 117 |
+
uint32_t frag_end_p1; /* last fragnum of seq_last_nack for which requested a retransmit */
|
| 118 |
+
uint32_t frag_base;
|
| 119 |
+
};
|
| 120 |
+
|
| 121 |
+
struct ddsi_pwr_rd_match {
|
| 122 |
+
ddsrt_avl_node_t avlnode;
|
| 123 |
+
ddsi_guid_t rd_guid;
|
| 124 |
+
ddsrt_mtime_t tcreate;
|
| 125 |
+
nn_count_t count; /* most recent acknack sequence number */
|
| 126 |
+
nn_count_t prev_heartbeat; /* latest accepted heartbeat (see also add_proxy_writer_to_reader) */
|
| 127 |
+
ddsrt_wctime_t hb_timestamp; /* time of most recent heartbeat that rescheduled the ack event */
|
| 128 |
+
ddsrt_etime_t t_heartbeat_accepted; /* (local) time a heartbeat was last accepted */
|
| 129 |
+
ddsrt_mtime_t t_last_nack; /* (local) time we last sent a NACK */
|
| 130 |
+
ddsrt_mtime_t t_last_ack; /* (local) time we last sent any ACKNACK */
|
| 131 |
+
seqno_t last_seq; /* last known sequence number from this writer */
|
| 132 |
+
struct last_nack_summary last_nack;
|
| 133 |
+
struct xevent *acknack_xevent; /* entry in xevent queue for sending acknacks */
|
| 134 |
+
enum pwr_rd_match_syncstate in_sync; /* whether in sync with the proxy writer */
|
| 135 |
+
unsigned ack_requested : 1; /* set on receipt of HEARTBEAT with FINAL clear, cleared on sending an ACKNACK */
|
| 136 |
+
unsigned heartbeat_since_ack : 1; /* set when a HEARTBEAT has been received since the last ACKNACK */
|
| 137 |
+
unsigned heartbeatfrag_since_ack : 1; /* set when a HEARTBEATFRAG has been received since the last ACKNACK */
|
| 138 |
+
unsigned directed_heartbeat : 1; /* set on receipt of a directed heartbeat, cleared on sending an ACKNACK */
|
| 139 |
+
unsigned nack_sent_on_nackdelay : 1; /* set when the most recent NACK sent was because of the NackDelay */
|
| 140 |
+
unsigned filtered : 1;
|
| 141 |
+
union {
|
| 142 |
+
struct {
|
| 143 |
+
seqno_t end_of_tl_seq; /* when seq >= end_of_tl_seq, it's in sync, =0 when not tl */
|
| 144 |
+
struct nn_reorder *reorder; /* can be done (mostly) per proxy writer, but that is harder; only when state=OUT_OF_SYNC */
|
| 145 |
+
} not_in_sync;
|
| 146 |
+
} u;
|
| 147 |
+
#ifdef DDS_HAS_SECURITY
|
| 148 |
+
int64_t crypto_handle;
|
| 149 |
+
#endif
|
| 150 |
+
};
|
| 151 |
+
|
| 152 |
+
void connect_writer_with_proxy_reader_secure (struct ddsi_writer *wr, struct ddsi_proxy_reader *prd, ddsrt_mtime_t tnow, int64_t crypto_handle);
|
| 153 |
+
void connect_reader_with_proxy_writer_secure (struct ddsi_reader *rd, struct ddsi_proxy_writer *pwr, ddsrt_mtime_t tnow, int64_t crypto_handle);
|
| 154 |
+
void match_writer_with_proxy_readers (struct ddsi_writer *wr, ddsrt_mtime_t tnow);
|
| 155 |
+
void match_writer_with_local_readers (struct ddsi_writer *wr, ddsrt_mtime_t tnow);
|
| 156 |
+
void match_reader_with_proxy_writers (struct ddsi_reader *rd, ddsrt_mtime_t tnow);
|
| 157 |
+
void match_reader_with_local_writers (struct ddsi_reader *rd, ddsrt_mtime_t tnow);
|
| 158 |
+
void match_proxy_writer_with_readers (struct ddsi_proxy_writer *pwr, ddsrt_mtime_t tnow);
|
| 159 |
+
void match_proxy_reader_with_writers (struct ddsi_proxy_reader *prd, ddsrt_mtime_t tnow);
|
| 160 |
+
void free_wr_prd_match (const struct ddsi_domaingv *gv, const ddsi_guid_t *wr_guid, struct ddsi_wr_prd_match *m);
|
| 161 |
+
void free_rd_pwr_match (struct ddsi_domaingv *gv, const ddsi_guid_t *rd_guid, struct ddsi_rd_pwr_match *m);
|
| 162 |
+
void free_pwr_rd_match (struct ddsi_pwr_rd_match *m);
|
| 163 |
+
void free_prd_wr_match (struct ddsi_prd_wr_match *m);
|
| 164 |
+
void free_rd_wr_match (struct ddsi_rd_wr_match *m);
|
| 165 |
+
void free_wr_rd_match (struct ddsi_wr_rd_match *m);
|
| 166 |
+
|
| 167 |
+
void writer_add_connection (struct ddsi_writer *wr, struct ddsi_proxy_reader *prd, int64_t crypto_handle);
|
| 168 |
+
void writer_add_local_connection (struct ddsi_writer *wr, struct ddsi_reader *rd);
|
| 169 |
+
void reader_add_connection (struct ddsi_reader *rd, struct ddsi_proxy_writer *pwr, nn_count_t *init_count, const struct ddsi_alive_state *alive_state, int64_t crypto_handle);
|
| 170 |
+
void reader_add_local_connection (struct ddsi_reader *rd, struct ddsi_writer *wr, const struct ddsi_alive_state *alive_state);
|
| 171 |
+
void proxy_writer_add_connection (struct ddsi_proxy_writer *pwr, struct ddsi_reader *rd, ddsrt_mtime_t tnow, nn_count_t init_count, int64_t crypto_handle);
|
| 172 |
+
void proxy_reader_add_connection (struct ddsi_proxy_reader *prd, struct ddsi_writer *wr, int64_t crypto_handle);
|
| 173 |
+
|
| 174 |
+
void writer_drop_connection (const struct ddsi_guid *wr_guid, const struct ddsi_proxy_reader *prd);
|
| 175 |
+
void writer_drop_local_connection (const struct ddsi_guid *wr_guid, struct ddsi_reader *rd);
|
| 176 |
+
void reader_drop_connection (const struct ddsi_guid *rd_guid, const struct ddsi_proxy_writer *pwr);
|
| 177 |
+
void reader_drop_local_connection (const struct ddsi_guid *rd_guid, const struct ddsi_writer *wr);
|
| 178 |
+
void proxy_writer_drop_connection (const struct ddsi_guid *pwr_guid, struct ddsi_reader *rd);
|
| 179 |
+
void proxy_reader_drop_connection (const struct ddsi_guid *prd_guid, struct ddsi_writer *wr);
|
| 180 |
+
|
| 181 |
+
void local_reader_ary_init (struct ddsi_local_reader_ary *x);
|
| 182 |
+
void local_reader_ary_fini (struct ddsi_local_reader_ary *x);
|
| 183 |
+
void local_reader_ary_setinvalid (struct ddsi_local_reader_ary *x);
|
| 184 |
+
void local_reader_ary_insert (struct ddsi_local_reader_ary *x, struct ddsi_reader *rd);
|
| 185 |
+
void local_reader_ary_remove (struct ddsi_local_reader_ary *x, struct ddsi_reader *rd);
|
| 186 |
+
void local_reader_ary_setfastpath_ok (struct ddsi_local_reader_ary *x, bool fastpath_ok);
|
| 187 |
+
|
| 188 |
+
#ifdef DDS_HAS_SECURITY
|
| 189 |
+
void handshake_end_cb (struct ddsi_handshake *handshake, struct ddsi_participant *pp, struct ddsi_proxy_participant *proxypp, enum ddsi_handshake_state result);
|
| 190 |
+
bool proxy_participant_has_pp_match (struct ddsi_domaingv *gv, struct ddsi_proxy_participant *proxypp);
|
| 191 |
+
void proxy_participant_create_handshakes (struct ddsi_domaingv *gv, struct ddsi_proxy_participant *proxypp);
|
| 192 |
+
void disconnect_proxy_participant_secure (struct ddsi_proxy_participant *proxypp);
|
| 193 |
+
void match_volatile_secure_endpoints (struct ddsi_participant *pp, struct ddsi_proxy_participant *proxypp);
|
| 194 |
+
void update_proxy_participant_endpoint_matching (struct ddsi_proxy_participant *proxypp, struct ddsi_participant *pp);
|
| 195 |
+
#endif
|
| 196 |
+
|
| 197 |
+
DDS_EXPORT void ddsi_update_proxy_endpoint_matching (const struct ddsi_domaingv *gv, struct ddsi_generic_proxy_endpoint *proxy_ep);
|
| 198 |
+
|
| 199 |
+
#if defined (__cplusplus)
|
| 200 |
+
}
|
| 201 |
+
#endif
|
| 202 |
+
|
| 203 |
+
#endif /* DDSI_ENTITY_MATCH_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_guid.h
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2019 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_GUID_H
|
| 13 |
+
#define DDSI_GUID_H
|
| 14 |
+
|
| 15 |
+
#include <stdint.h>
|
| 16 |
+
|
| 17 |
+
#if defined (__cplusplus)
|
| 18 |
+
extern "C" {
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
typedef union ddsi_guid_prefix {
|
| 22 |
+
unsigned char s[12];
|
| 23 |
+
uint32_t u[3];
|
| 24 |
+
} ddsi_guid_prefix_t;
|
| 25 |
+
typedef union ddsi_entityid {
|
| 26 |
+
uint32_t u;
|
| 27 |
+
} ddsi_entityid_t;
|
| 28 |
+
typedef struct ddsi_guid {
|
| 29 |
+
ddsi_guid_prefix_t prefix;
|
| 30 |
+
ddsi_entityid_t entityid;
|
| 31 |
+
} ddsi_guid_t;
|
| 32 |
+
|
| 33 |
+
#if defined (__cplusplus)
|
| 34 |
+
}
|
| 35 |
+
#endif
|
| 36 |
+
|
| 37 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_handshake.h
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_HANDSHAKE_H
|
| 13 |
+
#define DDSI_HANDSHAKE_H
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsi/ddsi_entity.h"
|
| 16 |
+
|
| 17 |
+
#if defined (__cplusplus)
|
| 18 |
+
extern "C" {
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
struct ddsi_participant;
|
| 22 |
+
struct ddsi_proxy_participant;
|
| 23 |
+
struct ddsi_handshake;
|
| 24 |
+
struct dssi_hsadmin;
|
| 25 |
+
|
| 26 |
+
enum ddsi_handshake_state {
|
| 27 |
+
STATE_HANDSHAKE_IN_PROGRESS,
|
| 28 |
+
STATE_HANDSHAKE_TIMED_OUT,
|
| 29 |
+
STATE_HANDSHAKE_FAILED,
|
| 30 |
+
STATE_HANDSHAKE_PROCESSED,
|
| 31 |
+
STATE_HANDSHAKE_SEND_TOKENS,
|
| 32 |
+
STATE_HANDSHAKE_OK
|
| 33 |
+
};
|
| 34 |
+
|
| 35 |
+
/* The handshake will not use the related handshake object after this callback
|
| 36 |
+
* was executed. This means that it can be deleted in this callback. */
|
| 37 |
+
typedef void (*ddsi_handshake_end_cb_t)(
|
| 38 |
+
struct ddsi_handshake *handshake,
|
| 39 |
+
struct ddsi_participant *pp,
|
| 40 |
+
struct ddsi_proxy_participant *proxypp,
|
| 41 |
+
enum ddsi_handshake_state result);
|
| 42 |
+
|
| 43 |
+
#ifdef DDS_HAS_SECURITY
|
| 44 |
+
|
| 45 |
+
#include "dds/ddsi/ddsi_security_msg.h"
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* @brief Release the handshake.
|
| 49 |
+
*
|
| 50 |
+
* This function will decrement the refcount associated with the handshake
|
| 51 |
+
* and delete the handshake when the refcount becomes 0.
|
| 52 |
+
*
|
| 53 |
+
* @param[in] handshake The handshake.
|
| 54 |
+
*/
|
| 55 |
+
void ddsi_handshake_release(struct ddsi_handshake *handshake);
|
| 56 |
+
|
| 57 |
+
/**
|
| 58 |
+
* @brief Handle an authentication handshake message received from the remote participant.
|
| 59 |
+
*
|
| 60 |
+
* During the authentication phase handshake messages are being exchanged between the local and
|
| 61 |
+
* the remote participant. THis function will handle a handshake message received from a remote
|
| 62 |
+
* participant.
|
| 63 |
+
*
|
| 64 |
+
* @param[in] handshake The handshake.
|
| 65 |
+
* @param[in] pp The local participant.
|
| 66 |
+
* @param[in] proxypp The remote participant.
|
| 67 |
+
* @param[in] msg The handshake message received.
|
| 68 |
+
*/
|
| 69 |
+
void ddsi_handshake_handle_message(struct ddsi_handshake *handshake, const struct ddsi_participant *pp, const struct ddsi_proxy_participant *proxypp, const struct nn_participant_generic_message *msg);
|
| 70 |
+
|
| 71 |
+
/**
|
| 72 |
+
* @brief Notify the handshake that crypto tokens have been received.
|
| 73 |
+
*
|
| 74 |
+
* The handshake could be finished at one end while the other side has not yet processed the
|
| 75 |
+
* final handshake messages. The arrival of crypto tokens signals that the other side has also finished
|
| 76 |
+
* processing the handshake. This function is used to signal the handshake that crypto tokens have been
|
| 77 |
+
* received.
|
| 78 |
+
*
|
| 79 |
+
* @param[in] handshake The handshake.
|
| 80 |
+
*/
|
| 81 |
+
void ddsi_handshake_crypto_tokens_received(struct ddsi_handshake *handshake);
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* @brief Get the shared secret handle.
|
| 85 |
+
*
|
| 86 |
+
* During the handshake a shared secret is established which is used to encrypt
|
| 87 |
+
* and decrypt the crypto token exchange messages. This function will return a
|
| 88 |
+
* handle to the shared secret which will be passed to the crypto plugin to
|
| 89 |
+
* determine the session keys used for the echange of the the crypto tokens.
|
| 90 |
+
*
|
| 91 |
+
* @param[in] handshake The handshake.
|
| 92 |
+
*
|
| 93 |
+
* @returns handle to the shared sercet.
|
| 94 |
+
*/
|
| 95 |
+
int64_t ddsi_handshake_get_shared_secret(const struct ddsi_handshake *handshake);
|
| 96 |
+
|
| 97 |
+
/**
|
| 98 |
+
* @brief Get the handshake handle
|
| 99 |
+
*
|
| 100 |
+
* This function returns the handshake handle that was returned by the authentication plugin
|
| 101 |
+
* when starting the handshake.
|
| 102 |
+
*
|
| 103 |
+
* @param[in] handshake The handshake.
|
| 104 |
+
*
|
| 105 |
+
* @returns The handshake handle.
|
| 106 |
+
*/
|
| 107 |
+
int64_t ddsi_handshake_get_handle(const struct ddsi_handshake *handshake);
|
| 108 |
+
|
| 109 |
+
/**
|
| 110 |
+
* @brief Create and start the handshake for the participants
|
| 111 |
+
*
|
| 112 |
+
* This function will create a handshake for the specified local
|
| 113 |
+
* and remote participants when it does not yet exists. It will start the
|
| 114 |
+
* handshake procedure by calling the corresponding functions of the authentication plugin.
|
| 115 |
+
* The callback function is called by the handshake when to report events,
|
| 116 |
+
* for example to indicate that the handshake has finished or has failed.
|
| 117 |
+
*
|
| 118 |
+
* @param[in] pp The local participant.
|
| 119 |
+
* @param[in] proxypp The remote participant.
|
| 120 |
+
* @param[in] callback The callback function.
|
| 121 |
+
*
|
| 122 |
+
*/
|
| 123 |
+
void ddsi_handshake_register(struct ddsi_participant *pp, struct ddsi_proxy_participant *proxypp, ddsi_handshake_end_cb_t callback);
|
| 124 |
+
|
| 125 |
+
/**
|
| 126 |
+
* @brief Remove the handshake associated with the specified participants.
|
| 127 |
+
*
|
| 128 |
+
* This function will remove the handshake from the handshake administation and release
|
| 129 |
+
* the handshake. When the handshake argument is not specified the handshake is searched
|
| 130 |
+
* in the handshake administation.
|
| 131 |
+
*
|
| 132 |
+
* @param[in] pp The local participant.
|
| 133 |
+
* @param[in] proxypp The remote participant.
|
| 134 |
+
*
|
| 135 |
+
*/
|
| 136 |
+
void ddsi_handshake_remove(struct ddsi_participant *pp, struct ddsi_proxy_participant *proxypp);
|
| 137 |
+
|
| 138 |
+
/**
|
| 139 |
+
* @brief Searches for the handshake associated with the specified participants
|
| 140 |
+
*
|
| 141 |
+
* This function will search through the handshake administration to find the handshake
|
| 142 |
+
* corresponding the to specified local and remote participant.
|
| 143 |
+
*
|
| 144 |
+
* @param[in] pp The local participant.
|
| 145 |
+
* @param[in] proxypp The remote participant.
|
| 146 |
+
*
|
| 147 |
+
* @returns The handshake
|
| 148 |
+
*/
|
| 149 |
+
struct ddsi_handshake * ddsi_handshake_find(struct ddsi_participant *pp, struct ddsi_proxy_participant *proxypp);
|
| 150 |
+
|
| 151 |
+
/**
|
| 152 |
+
* @brief Searches for the handshake associated with the specified participants
|
| 153 |
+
*
|
| 154 |
+
* This function will search through the handshake administration to find the handshake
|
| 155 |
+
* corresponding the to specified local and remote participant.
|
| 156 |
+
*
|
| 157 |
+
* @param[in] pp The local participant.
|
| 158 |
+
* @param[in] proxypp The remote participant.
|
| 159 |
+
*
|
| 160 |
+
* @returns The handshake
|
| 161 |
+
*/
|
| 162 |
+
struct ddsi_handshake * ddsi_handshake_find(struct ddsi_participant *pp, struct ddsi_proxy_participant *proxypp);
|
| 163 |
+
|
| 164 |
+
/**
|
| 165 |
+
* @brief Initialize the handshake administration
|
| 166 |
+
*
|
| 167 |
+
* @param[in] gv The global parameters
|
| 168 |
+
*/
|
| 169 |
+
void ddsi_handshake_admin_init(struct ddsi_domaingv *gv);
|
| 170 |
+
|
| 171 |
+
/**
|
| 172 |
+
* @brief Stop handshake background processing.
|
| 173 |
+
*
|
| 174 |
+
* @param[in] gv The global parameters
|
| 175 |
+
*/
|
| 176 |
+
void ddsi_handshake_admin_stop(struct ddsi_domaingv *gv);
|
| 177 |
+
|
| 178 |
+
/**
|
| 179 |
+
* @brief Deinitialze the handshake administration.
|
| 180 |
+
*
|
| 181 |
+
* @param[in] gv The global parameters
|
| 182 |
+
*/
|
| 183 |
+
void ddsi_handshake_admin_deinit(struct ddsi_domaingv *gv);
|
| 184 |
+
|
| 185 |
+
#else /* DDS_HAS_SECURITY */
|
| 186 |
+
|
| 187 |
+
#include "dds/ddsi/q_unused.h"
|
| 188 |
+
|
| 189 |
+
DDS_INLINE_EXPORT inline void ddsi_handshake_register(UNUSED_ARG(struct ddsi_participant *pp), UNUSED_ARG(struct ddsi_proxy_participant *proxypp), UNUSED_ARG(ddsi_handshake_end_cb_t callback))
|
| 190 |
+
{
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
DDS_INLINE_EXPORT inline void ddsi_handshake_release(UNUSED_ARG(struct ddsi_handshake *handshake))
|
| 194 |
+
{
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
DDS_INLINE_EXPORT inline void ddsi_handshake_crypto_tokens_received(UNUSED_ARG(struct ddsi_handshake *handshake))
|
| 198 |
+
{
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
DDS_INLINE_EXPORT inline int64_t ddsi_handshake_get_shared_secret(UNUSED_ARG(const struct ddsi_handshake *handshake))
|
| 202 |
+
{
|
| 203 |
+
return 0;
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
DDS_INLINE_EXPORT inline int64_t ddsi_handshake_get_handle(UNUSED_ARG(const struct ddsi_handshake *handshake))
|
| 207 |
+
{
|
| 208 |
+
return 0;
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
DDS_INLINE_EXPORT inline void ddsi_handshake_remove(UNUSED_ARG(struct ddsi_participant *pp), UNUSED_ARG(struct ddsi_proxy_participant *proxypp), UNUSED_ARG(struct ddsi_handshake *handshake))
|
| 212 |
+
{
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
DDS_INLINE_EXPORT inline struct ddsi_handshake * ddsi_handshake_find(UNUSED_ARG(struct ddsi_participant *pp), UNUSED_ARG(struct ddsi_proxy_participant *proxypp))
|
| 216 |
+
{
|
| 217 |
+
return NULL;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
#endif /* DDS_HAS_SECURITY */
|
| 221 |
+
|
| 222 |
+
#if defined (__cplusplus)
|
| 223 |
+
}
|
| 224 |
+
#endif
|
| 225 |
+
|
| 226 |
+
#endif /* DDSI_HANDSHAKE_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_iid.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2019 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef _DDS_IID_H_
|
| 13 |
+
#define _DDS_IID_H_
|
| 14 |
+
|
| 15 |
+
#include "dds/export.h"
|
| 16 |
+
#include "dds/ddsrt/atomics.h"
|
| 17 |
+
#include "dds/ddsrt/sync.h"
|
| 18 |
+
|
| 19 |
+
#if defined (__cplusplus)
|
| 20 |
+
extern "C" {
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
struct ddsi_iid {
|
| 24 |
+
ddsrt_atomic_uint64_t counter;
|
| 25 |
+
uint32_t key[4];
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
DDS_EXPORT void ddsi_iid_init (void);
|
| 29 |
+
DDS_EXPORT void ddsi_iid_fini (void);
|
| 30 |
+
DDS_EXPORT uint64_t ddsi_iid_gen (void);
|
| 31 |
+
|
| 32 |
+
#if defined (__cplusplus)
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_ipaddr.h
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_IPADDR_H
|
| 13 |
+
#define DDSI_IPADDR_H
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsi/ddsi_tran.h"
|
| 16 |
+
|
| 17 |
+
#if defined (__cplusplus)
|
| 18 |
+
extern "C" {
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
enum ddsi_nearby_address_result ddsi_ipaddr_is_nearby_address (const ddsi_locator_t *loc, size_t ninterf, const struct nn_interface *interf, size_t *interf_idx);
|
| 22 |
+
enum ddsi_locator_from_string_result ddsi_ipaddr_from_string (ddsi_locator_t *loc, const char *str, int32_t kind);
|
| 23 |
+
int ddsi_ipaddr_compare (const struct sockaddr *const sa1, const struct sockaddr *const sa2);
|
| 24 |
+
char *ddsi_ipaddr_to_string (char *dst, size_t sizeof_dst, const ddsi_locator_t *loc, int with_port, const struct nn_interface *interf);
|
| 25 |
+
void ddsi_ipaddr_to_loc (ddsi_locator_t *dst, const struct sockaddr *src, int32_t kind);
|
| 26 |
+
void ddsi_ipaddr_to_xloc (const struct ddsi_tran_factory *tran, ddsi_xlocator_t *dst, const struct sockaddr *src, int32_t kind);
|
| 27 |
+
void ddsi_ipaddr_from_loc (struct sockaddr_storage *dst, const ddsi_locator_t *src);
|
| 28 |
+
|
| 29 |
+
#if defined (__cplusplus)
|
| 30 |
+
}
|
| 31 |
+
#endif
|
| 32 |
+
|
| 33 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_keyhash.h
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_KEYHASH_H
|
| 13 |
+
#define DDSI_KEYHASH_H
|
| 14 |
+
|
| 15 |
+
#if defined (__cplusplus)
|
| 16 |
+
extern "C" {
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
typedef struct ddsi_keyhash {
|
| 20 |
+
unsigned char value[16];
|
| 21 |
+
} ddsi_keyhash_t;
|
| 22 |
+
|
| 23 |
+
#if defined (__cplusplus)
|
| 24 |
+
}
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_lifespan.h
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_LIFESPAN_H
|
| 13 |
+
#define DDSI_LIFESPAN_H
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsrt/fibheap.h"
|
| 16 |
+
#include "dds/ddsrt/time.h"
|
| 17 |
+
#include "dds/ddsi/ddsi_domaingv.h"
|
| 18 |
+
|
| 19 |
+
#if defined (__cplusplus)
|
| 20 |
+
extern "C" {
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
typedef ddsrt_mtime_t (*sample_expired_cb_t)(void *hc, ddsrt_mtime_t tnow);
|
| 24 |
+
|
| 25 |
+
struct lifespan_adm {
|
| 26 |
+
ddsrt_fibheap_t ls_exp_heap; /* heap for sample expiration (lifespan) */
|
| 27 |
+
struct xevent *evt; /* xevent that triggers for sample with earliest expiration */
|
| 28 |
+
sample_expired_cb_t sample_expired_cb; /* callback for expired sample; this cb can use lifespan_next_expired_locked to get next expired sample */
|
| 29 |
+
size_t fh_offset; /* offset of lifespan_adm element in whc or rhc */
|
| 30 |
+
size_t fhn_offset; /* offset of lifespan_fhnode element in whc or rhc node (sample) */
|
| 31 |
+
};
|
| 32 |
+
|
| 33 |
+
struct lifespan_fhnode {
|
| 34 |
+
ddsrt_fibheap_node_t heapnode;
|
| 35 |
+
ddsrt_mtime_t t_expire;
|
| 36 |
+
};
|
| 37 |
+
|
| 38 |
+
DDS_EXPORT void lifespan_init (const struct ddsi_domaingv *gv, struct lifespan_adm *lifespan_adm, size_t fh_offset, size_t fh_node_offset, sample_expired_cb_t sample_expired_cb);
|
| 39 |
+
DDS_EXPORT void lifespan_fini (const struct lifespan_adm *lifespan_adm);
|
| 40 |
+
DDS_EXPORT ddsrt_mtime_t lifespan_next_expired_locked (const struct lifespan_adm *lifespan_adm, ddsrt_mtime_t tnow, void **sample);
|
| 41 |
+
DDS_EXPORT void lifespan_register_sample_real (struct lifespan_adm *lifespan_adm, struct lifespan_fhnode *node);
|
| 42 |
+
DDS_EXPORT void lifespan_unregister_sample_real (struct lifespan_adm *lifespan_adm, struct lifespan_fhnode *node);
|
| 43 |
+
|
| 44 |
+
DDS_INLINE_EXPORT inline void lifespan_register_sample_locked (struct lifespan_adm *lifespan_adm, struct lifespan_fhnode *node)
|
| 45 |
+
{
|
| 46 |
+
if (node->t_expire.v != DDS_NEVER)
|
| 47 |
+
lifespan_register_sample_real (lifespan_adm, node);
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
DDS_INLINE_EXPORT inline void lifespan_unregister_sample_locked (struct lifespan_adm *lifespan_adm, struct lifespan_fhnode *node)
|
| 51 |
+
{
|
| 52 |
+
if (node->t_expire.v != DDS_NEVER)
|
| 53 |
+
lifespan_unregister_sample_real (lifespan_adm, node);
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
#if defined (__cplusplus)
|
| 57 |
+
}
|
| 58 |
+
#endif
|
| 59 |
+
|
| 60 |
+
#endif /* DDSI_LIFESPAN_H */
|
| 61 |
+
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_list_genptr.h
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_LIST_GENPTR_H
|
| 13 |
+
#define DDSI_LIST_GENPTR_H
|
| 14 |
+
|
| 15 |
+
#include <assert.h>
|
| 16 |
+
#include "dds/export.h"
|
| 17 |
+
#include "dds/ddsrt/types.h"
|
| 18 |
+
#include "dds/ddsi/ddsi_list_tmpl.h"
|
| 19 |
+
|
| 20 |
+
#define NOARG
|
| 21 |
+
DDSI_LIST_TYPES_TMPL(generic_ptr_list, void *, NOARG, 32)
|
| 22 |
+
DDSI_LIST_DECLS_TMPL(extern, generic_ptr_list, void *, ddsrt_attribute_unused)
|
| 23 |
+
#undef NOARG
|
| 24 |
+
|
| 25 |
+
#define DDSI_LIST_GENERIC_PTR_TYPES(prefix_) \
|
| 26 |
+
typedef struct generic_ptr_list_node prefix_##_node_t; \
|
| 27 |
+
typedef struct generic_ptr_list prefix_##_t; \
|
| 28 |
+
typedef struct generic_ptr_list_iter prefix_##_iter_t; \
|
| 29 |
+
typedef struct generic_ptr_list_iter_d prefix_##_iter_d_t;
|
| 30 |
+
|
| 31 |
+
#define DDSI_LIST_GENERIC_PTR_DECL(linkage_, prefix_, elemT_, attrs_) \
|
| 32 |
+
linkage_ void prefix_##_init (prefix_##_t *list) attrs_; \
|
| 33 |
+
linkage_ void prefix_##_free (prefix_##_t *list) attrs_; \
|
| 34 |
+
linkage_ elemT_ prefix_##_insert (prefix_##_t *list, elemT_ o) attrs_; \
|
| 35 |
+
linkage_ elemT_ prefix_##_append (prefix_##_t *list, elemT_ o) attrs_; \
|
| 36 |
+
linkage_ elemT_ prefix_##_iter_first (const prefix_##_t *list, prefix_##_iter_t *iter) attrs_; \
|
| 37 |
+
linkage_ elemT_ prefix_##_iter_next (prefix_##_iter_t *iter) attrs_; \
|
| 38 |
+
linkage_ elemT_ *prefix_##_iter_elem_addr (prefix_##_iter_t *iter) attrs_; \
|
| 39 |
+
linkage_ elemT_ prefix_##_iter_d_first (prefix_##_t *list, prefix_##_iter_d_t *iter) attrs_; \
|
| 40 |
+
linkage_ elemT_ prefix_##_iter_d_next (prefix_##_iter_d_t *iter) attrs_; \
|
| 41 |
+
linkage_ void prefix_##_iter_d_remove (prefix_##_iter_d_t *iter) attrs_; \
|
| 42 |
+
linkage_ elemT_ prefix_##_remove (prefix_##_t *list, elemT_ o) attrs_; \
|
| 43 |
+
linkage_ elemT_ prefix_##_take_first (prefix_##_t *list) attrs_; \
|
| 44 |
+
linkage_ elemT_ prefix_##_take_last (prefix_##_t *list) attrs_; \
|
| 45 |
+
linkage_ uint32_t prefix_##_count (const prefix_##_t *list) attrs_; \
|
| 46 |
+
linkage_ void prefix_##_append_list (prefix_##_t *list, prefix_##_t *b) attrs_; \
|
| 47 |
+
linkage_ elemT_ *prefix_##_index_addr (prefix_##_t *list, uint32_t index) attrs_; \
|
| 48 |
+
linkage_ elemT_ prefix_##_index (prefix_##_t *list, uint32_t index) attrs_;
|
| 49 |
+
|
| 50 |
+
#define DDSI_LIST_GENERIC_PTR_CODE(linkage_, prefix_, elemT_, equals_) \
|
| 51 |
+
linkage_ void prefix_##_init (prefix_##_t *list) { \
|
| 52 |
+
generic_ptr_list_init ((struct generic_ptr_list *) list); \
|
| 53 |
+
} \
|
| 54 |
+
linkage_ void prefix_##_free (prefix_##_t *list) { \
|
| 55 |
+
generic_ptr_list_free ((struct generic_ptr_list *) list); \
|
| 56 |
+
} \
|
| 57 |
+
linkage_ elemT_ prefix_##_insert (prefix_##_t *list, elemT_ o) { \
|
| 58 |
+
return (elemT_) generic_ptr_list_insert ((struct generic_ptr_list *) list, (void *) o); \
|
| 59 |
+
} \
|
| 60 |
+
linkage_ elemT_ prefix_##_append (prefix_##_t *list, elemT_ o) { \
|
| 61 |
+
return (elemT_) generic_ptr_list_append ((struct generic_ptr_list *) list, (void *) o); \
|
| 62 |
+
} \
|
| 63 |
+
linkage_ elemT_ prefix_##_iter_first (const prefix_##_t *list, prefix_##_iter_t *iter) { \
|
| 64 |
+
return (elemT_) generic_ptr_list_iter_first ((struct generic_ptr_list *) list, (struct generic_ptr_list_iter *) iter); \
|
| 65 |
+
} \
|
| 66 |
+
linkage_ elemT_ prefix_##_iter_next (prefix_##_iter_t *iter) { \
|
| 67 |
+
return (elemT_) generic_ptr_list_iter_next ((struct generic_ptr_list_iter *) iter); \
|
| 68 |
+
} \
|
| 69 |
+
linkage_ elemT_ *prefix_##_iter_elem_addr (prefix_##_iter_t *iter) { \
|
| 70 |
+
return (elemT_ *) generic_ptr_list_iter_elem_addr ((struct generic_ptr_list_iter *) iter); \
|
| 71 |
+
} \
|
| 72 |
+
linkage_ elemT_ prefix_##_iter_d_first (prefix_##_t *list, prefix_##_iter_d_t *iter) { \
|
| 73 |
+
return (elemT_) generic_ptr_list_iter_d_first ((struct generic_ptr_list *) list, (struct generic_ptr_list_iter_d *) iter); \
|
| 74 |
+
} \
|
| 75 |
+
linkage_ elemT_ prefix_##_iter_d_next (prefix_##_iter_d_t *iter) { \
|
| 76 |
+
return (elemT_) generic_ptr_list_iter_d_next ((struct generic_ptr_list_iter_d *) iter);\
|
| 77 |
+
} \
|
| 78 |
+
linkage_ void prefix_##_iter_d_remove (prefix_##_iter_d_t *iter) { \
|
| 79 |
+
generic_ptr_list_iter_d_remove ((struct generic_ptr_list_iter_d *) iter); \
|
| 80 |
+
} \
|
| 81 |
+
linkage_ elemT_ prefix_##_remove (prefix_##_t *list, elemT_ o) { \
|
| 82 |
+
return (elemT_) generic_ptr_list_remove ((struct generic_ptr_list *) list, (void *) o, (generic_ptr_list_eq_fn) equals_); \
|
| 83 |
+
} \
|
| 84 |
+
linkage_ elemT_ prefix_##_take_first (prefix_##_t *list) { \
|
| 85 |
+
return (elemT_) generic_ptr_list_take_first ((struct generic_ptr_list *) list); \
|
| 86 |
+
} \
|
| 87 |
+
linkage_ elemT_ prefix_##_take_last (prefix_##_t *list) { \
|
| 88 |
+
return (elemT_) generic_ptr_list_take_last ((struct generic_ptr_list *) list); \
|
| 89 |
+
} \
|
| 90 |
+
linkage_ uint32_t prefix_##_count (const prefix_##_t *list) { \
|
| 91 |
+
return generic_ptr_list_count ((struct generic_ptr_list *) list); \
|
| 92 |
+
} \
|
| 93 |
+
linkage_ void prefix_##_append_list (prefix_##_t *list, prefix_##_t *b) { \
|
| 94 |
+
generic_ptr_list_append_list ((struct generic_ptr_list *) list, (struct generic_ptr_list *) b); \
|
| 95 |
+
} \
|
| 96 |
+
linkage_ elemT_ *prefix_##_index_addr (prefix_##_t *list, uint32_t index) { \
|
| 97 |
+
return (elemT_ *) generic_ptr_list_index_addr ((struct generic_ptr_list *) list, index); \
|
| 98 |
+
} \
|
| 99 |
+
linkage_ elemT_ prefix_##_index (prefix_##_t *list, uint32_t index) { \
|
| 100 |
+
return (elemT_) generic_ptr_list_index ((struct generic_ptr_list *) list, index); \
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
#endif /* DDSI_LIST_GENPTR_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_list_tmpl.h
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_LIST_TMPL_H
|
| 13 |
+
#define DDSI_LIST_TMPL_H
|
| 14 |
+
|
| 15 |
+
#define DDSI_LIST_TYPES_TMPL(prefix_, elemT_, extension_, batch_) \
|
| 16 |
+
struct prefix_##_node { \
|
| 17 |
+
struct prefix_##_node *next; \
|
| 18 |
+
uint32_t first, lastp1; \
|
| 19 |
+
elemT_ ary[(batch_)]; \
|
| 20 |
+
}; \
|
| 21 |
+
\
|
| 22 |
+
struct prefix_ { \
|
| 23 |
+
struct prefix_##_node *head; \
|
| 24 |
+
struct prefix_##_node *tail; \
|
| 25 |
+
uint32_t count; \
|
| 26 |
+
extension_ \
|
| 27 |
+
}; \
|
| 28 |
+
\
|
| 29 |
+
struct prefix_##_iter { \
|
| 30 |
+
struct prefix_##_node *node; \
|
| 31 |
+
uint32_t idx; \
|
| 32 |
+
}; \
|
| 33 |
+
\
|
| 34 |
+
struct prefix_##_iter_d { \
|
| 35 |
+
struct prefix_ *list; \
|
| 36 |
+
struct prefix_##_node *node; \
|
| 37 |
+
struct prefix_##_node *prev; \
|
| 38 |
+
uint32_t idx; \
|
| 39 |
+
}; \
|
| 40 |
+
\
|
| 41 |
+
typedef int (*prefix_##_eq_fn)(const elemT_, const elemT_);
|
| 42 |
+
|
| 43 |
+
#ifndef NDEBUG
|
| 44 |
+
#define DDSI_LIST_TMPL_POISON(x) do { x = (void *)1; } while (0)
|
| 45 |
+
#else
|
| 46 |
+
#define DDSI_LIST_TMPL_POISON(x) do {} while (0)
|
| 47 |
+
#endif
|
| 48 |
+
|
| 49 |
+
#define DDSI_LIST_DECLS_TMPL(linkage_, prefix_, elemT_, attrs_) \
|
| 50 |
+
linkage_ void prefix_##_init (struct prefix_ *list) attrs_; \
|
| 51 |
+
linkage_ void prefix_##_free (struct prefix_ *list) attrs_; \
|
| 52 |
+
linkage_ elemT_ prefix_##_insert (struct prefix_ *list, elemT_ o) attrs_; \
|
| 53 |
+
linkage_ elemT_ prefix_##_append (struct prefix_ *list, elemT_ o) attrs_; \
|
| 54 |
+
linkage_ elemT_ prefix_##_iter_first (const struct prefix_ *list, struct prefix_##_iter *iter) attrs_; \
|
| 55 |
+
linkage_ elemT_ prefix_##_iter_next (struct prefix_##_iter *iter) attrs_; \
|
| 56 |
+
linkage_ elemT_ *prefix_##_iter_elem_addr (struct prefix_##_iter *iter) attrs_; \
|
| 57 |
+
linkage_ elemT_ prefix_##_iter_d_first (struct prefix_ *list, struct prefix_##_iter_d *iter) attrs_; \
|
| 58 |
+
linkage_ elemT_ prefix_##_iter_d_next (struct prefix_##_iter_d *iter) attrs_; \
|
| 59 |
+
linkage_ void prefix_##_iter_d_remove (struct prefix_##_iter_d *iter) attrs_; \
|
| 60 |
+
linkage_ elemT_ prefix_##_remove (struct prefix_ *list, elemT_ o, prefix_##_eq_fn) attrs_; \
|
| 61 |
+
linkage_ elemT_ prefix_##_take_first (struct prefix_ *list) attrs_; \
|
| 62 |
+
linkage_ elemT_ prefix_##_take_last (struct prefix_ *list) attrs_; \
|
| 63 |
+
linkage_ uint32_t prefix_##_count (const struct prefix_ *list) attrs_; \
|
| 64 |
+
linkage_ void prefix_##_append_list (struct prefix_ *list, struct prefix_ *b) attrs_; \
|
| 65 |
+
linkage_ elemT_ *prefix_##_index_addr (struct prefix_ *list, uint32_t index) attrs_; \
|
| 66 |
+
linkage_ elemT_ prefix_##_index (struct prefix_ *list, uint32_t index) attrs_;
|
| 67 |
+
|
| 68 |
+
#define DDSI_LIST_CODE_TMPL(linkage_, prefix_, elemT_, null_, malloc_, free_) \
|
| 69 |
+
linkage_ void prefix_##_init (struct prefix_ *list) \
|
| 70 |
+
{ \
|
| 71 |
+
list->head = NULL; \
|
| 72 |
+
list->tail = NULL; \
|
| 73 |
+
list->count = 0; \
|
| 74 |
+
} \
|
| 75 |
+
\
|
| 76 |
+
linkage_ void prefix_##_free (struct prefix_ *list) \
|
| 77 |
+
{ \
|
| 78 |
+
/* Note: just free, not re-init */ \
|
| 79 |
+
struct prefix_##_node *n; \
|
| 80 |
+
while ((n = list->head) != NULL) \
|
| 81 |
+
{ \
|
| 82 |
+
list->head = n->next; \
|
| 83 |
+
free_ (n); \
|
| 84 |
+
} \
|
| 85 |
+
} \
|
| 86 |
+
\
|
| 87 |
+
linkage_ elemT_ prefix_##_insert (struct prefix_ *list, elemT_ o) \
|
| 88 |
+
{ \
|
| 89 |
+
struct prefix_##_node *n; \
|
| 90 |
+
const uint32_t bs = (uint32_t) (sizeof (n->ary) / sizeof (n->ary[0])); \
|
| 91 |
+
if (list->head != NULL && list->head->first > 0) \
|
| 92 |
+
n = list->head; \
|
| 93 |
+
else \
|
| 94 |
+
{ \
|
| 95 |
+
if ((n = (malloc_ (sizeof (struct prefix_##_node)))) == NULL) \
|
| 96 |
+
return null_; \
|
| 97 |
+
n->next = list->head; \
|
| 98 |
+
n->first = n->lastp1 = bs; \
|
| 99 |
+
if (list->head == NULL) \
|
| 100 |
+
list->tail = n; \
|
| 101 |
+
list->head = n; \
|
| 102 |
+
} \
|
| 103 |
+
n->ary[--n->first] = o; \
|
| 104 |
+
list->count++; \
|
| 105 |
+
return o; \
|
| 106 |
+
} \
|
| 107 |
+
\
|
| 108 |
+
linkage_ elemT_ prefix_##_append (struct prefix_ *list, elemT_ o) \
|
| 109 |
+
{ \
|
| 110 |
+
struct prefix_##_node *n; \
|
| 111 |
+
const uint32_t bs = (uint32_t) (sizeof (n->ary) / sizeof (n->ary[0])); \
|
| 112 |
+
if (list->head != NULL && list->tail->lastp1 < bs) \
|
| 113 |
+
n = list->tail; \
|
| 114 |
+
else \
|
| 115 |
+
{ \
|
| 116 |
+
if ((n = (malloc_ (sizeof (struct prefix_##_node)))) == NULL) \
|
| 117 |
+
return null_; \
|
| 118 |
+
n->next = NULL; \
|
| 119 |
+
n->first = n->lastp1 = 0; \
|
| 120 |
+
if (list->head == NULL) \
|
| 121 |
+
list->head = n; \
|
| 122 |
+
else \
|
| 123 |
+
list->tail->next = n; \
|
| 124 |
+
list->tail = n; \
|
| 125 |
+
} \
|
| 126 |
+
n->ary[n->lastp1++] = o; \
|
| 127 |
+
list->count++; \
|
| 128 |
+
return o; \
|
| 129 |
+
} \
|
| 130 |
+
\
|
| 131 |
+
linkage_ elemT_ prefix_##_iter_first (const struct prefix_ *list, struct prefix_##_iter *iter) \
|
| 132 |
+
{ \
|
| 133 |
+
iter->node = list->head; \
|
| 134 |
+
if (iter->node == NULL) \
|
| 135 |
+
{ \
|
| 136 |
+
iter->idx = 0; \
|
| 137 |
+
return null_; \
|
| 138 |
+
} \
|
| 139 |
+
iter->idx = iter->node->first; \
|
| 140 |
+
if (iter->node->first < iter->node->lastp1) \
|
| 141 |
+
return iter->node->ary[iter->idx]; \
|
| 142 |
+
return null_; \
|
| 143 |
+
} \
|
| 144 |
+
\
|
| 145 |
+
linkage_ elemT_ prefix_##_iter_next (struct prefix_##_iter *iter) \
|
| 146 |
+
{ \
|
| 147 |
+
/* You MAY NOT call _list_iter_next after having received a null \
|
| 148 |
+
* pointer from _iter_first or _iter_next */ \
|
| 149 |
+
assert (iter->node != NULL); \
|
| 150 |
+
if (iter->idx+1 < iter->node->lastp1) \
|
| 151 |
+
return iter->node->ary[++iter->idx]; \
|
| 152 |
+
if (iter->node->next == NULL) \
|
| 153 |
+
return null_; \
|
| 154 |
+
iter->node = iter->node->next; \
|
| 155 |
+
iter->idx = iter->node->first; \
|
| 156 |
+
return iter->node->ary[iter->idx]; \
|
| 157 |
+
} \
|
| 158 |
+
\
|
| 159 |
+
linkage_ elemT_ *prefix_##_iter_elem_addr (struct prefix_##_iter *iter) \
|
| 160 |
+
{ \
|
| 161 |
+
assert (iter->node != NULL); \
|
| 162 |
+
return &iter->node->ary[iter->idx]; \
|
| 163 |
+
} \
|
| 164 |
+
\
|
| 165 |
+
linkage_ elemT_ prefix_##_iter_d_first (struct prefix_ *list, struct prefix_##_iter_d *iter) \
|
| 166 |
+
{ \
|
| 167 |
+
iter->list = list; \
|
| 168 |
+
iter->node = list->head; \
|
| 169 |
+
iter->prev = NULL; \
|
| 170 |
+
if (iter->node == NULL) \
|
| 171 |
+
{ \
|
| 172 |
+
iter->idx = 0; \
|
| 173 |
+
return null_; \
|
| 174 |
+
} \
|
| 175 |
+
iter->idx = iter->node->first; \
|
| 176 |
+
if (iter->node->first < iter->node->lastp1) \
|
| 177 |
+
return iter->node->ary[iter->idx]; \
|
| 178 |
+
return null_; \
|
| 179 |
+
} \
|
| 180 |
+
\
|
| 181 |
+
linkage_ elemT_ prefix_##_iter_d_next (struct prefix_##_iter_d *iter) \
|
| 182 |
+
{ \
|
| 183 |
+
/* You MAY NOT call _list_iter_d_next after having received a null \
|
| 184 |
+
* pointer from _iter_d_first or _iter_d_next */ \
|
| 185 |
+
if (iter->node == NULL) \
|
| 186 |
+
return prefix_##_iter_d_first (iter->list, iter); \
|
| 187 |
+
if (iter->idx+1 < iter->node->lastp1) \
|
| 188 |
+
return iter->node->ary[++iter->idx]; \
|
| 189 |
+
if (iter->node->next == NULL) \
|
| 190 |
+
return null_; \
|
| 191 |
+
iter->prev = iter->node; \
|
| 192 |
+
iter->node = iter->node->next; \
|
| 193 |
+
iter->idx = iter->node->first; \
|
| 194 |
+
return iter->node->ary[iter->idx]; \
|
| 195 |
+
} \
|
| 196 |
+
\
|
| 197 |
+
linkage_ void prefix_##_iter_d_remove (struct prefix_##_iter_d *iter) \
|
| 198 |
+
{ \
|
| 199 |
+
struct prefix_ * const list = iter->list; \
|
| 200 |
+
struct prefix_##_node * const n = iter->node; \
|
| 201 |
+
uint32_t j; \
|
| 202 |
+
assert(iter->node); \
|
| 203 |
+
list->count--; \
|
| 204 |
+
for (j = iter->idx; j > n->first; j--) \
|
| 205 |
+
n->ary[j] = n->ary[j-1]; \
|
| 206 |
+
n->first++; \
|
| 207 |
+
if (n->first == n->lastp1) \
|
| 208 |
+
{ \
|
| 209 |
+
if (n == list->tail) \
|
| 210 |
+
list->tail = iter->prev; \
|
| 211 |
+
if (iter->prev) \
|
| 212 |
+
{ \
|
| 213 |
+
iter->prev->next = n->next; \
|
| 214 |
+
iter->node = iter->prev; \
|
| 215 |
+
iter->idx = iter->prev->lastp1; \
|
| 216 |
+
DDSI_LIST_TMPL_POISON(iter->prev); \
|
| 217 |
+
} \
|
| 218 |
+
else \
|
| 219 |
+
{ \
|
| 220 |
+
list->head = n->next; \
|
| 221 |
+
iter->node = NULL; /* removed first entry, restart */ \
|
| 222 |
+
} \
|
| 223 |
+
free_ (n); \
|
| 224 |
+
} \
|
| 225 |
+
} \
|
| 226 |
+
\
|
| 227 |
+
linkage_ elemT_ prefix_##_remove (struct prefix_ *list, elemT_ o, prefix_##_eq_fn equals) \
|
| 228 |
+
{ \
|
| 229 |
+
struct prefix_##_iter_d iter; \
|
| 230 |
+
elemT_ obj; \
|
| 231 |
+
for (obj = prefix_##_iter_d_first (list, &iter); !(equals (obj, null_)); obj = prefix_##_iter_d_next (&iter)) \
|
| 232 |
+
{ \
|
| 233 |
+
if (equals (obj, o)) \
|
| 234 |
+
{ \
|
| 235 |
+
prefix_##_iter_d_remove (&iter); \
|
| 236 |
+
return obj; \
|
| 237 |
+
} \
|
| 238 |
+
} \
|
| 239 |
+
return null_; \
|
| 240 |
+
} \
|
| 241 |
+
\
|
| 242 |
+
linkage_ elemT_ prefix_##_take_first (struct prefix_ *list) \
|
| 243 |
+
{ \
|
| 244 |
+
if (list->count == 0) \
|
| 245 |
+
return null_; \
|
| 246 |
+
struct prefix_##_iter_d iter; \
|
| 247 |
+
elemT_ obj = prefix_##_iter_d_first (list, &iter); \
|
| 248 |
+
prefix_##_iter_d_remove (&iter); \
|
| 249 |
+
return obj; \
|
| 250 |
+
} \
|
| 251 |
+
\
|
| 252 |
+
linkage_ elemT_ prefix_##_take_last (struct prefix_ *list) \
|
| 253 |
+
{ \
|
| 254 |
+
if (list->count == 0) \
|
| 255 |
+
return null_; \
|
| 256 |
+
struct prefix_##_iter_d iter; \
|
| 257 |
+
uint32_t i; \
|
| 258 |
+
elemT_ obj; \
|
| 259 |
+
obj = prefix_##_iter_d_first (list, &iter); \
|
| 260 |
+
for (i = 0; i < list->count - 1; i++) \
|
| 261 |
+
obj = prefix_##_iter_d_next (&iter); \
|
| 262 |
+
prefix_##_iter_d_remove (&iter); \
|
| 263 |
+
return obj; \
|
| 264 |
+
} \
|
| 265 |
+
\
|
| 266 |
+
linkage_ uint32_t prefix_##_count (const struct prefix_ *list) \
|
| 267 |
+
{ \
|
| 268 |
+
return list->count; \
|
| 269 |
+
} \
|
| 270 |
+
\
|
| 271 |
+
linkage_ void prefix_##_append_list (struct prefix_ *list, struct prefix_ *b) \
|
| 272 |
+
{ \
|
| 273 |
+
if (list->head == NULL) \
|
| 274 |
+
*list = *b; \
|
| 275 |
+
else if (b->head != NULL) \
|
| 276 |
+
{ \
|
| 277 |
+
list->tail->next = b->head; \
|
| 278 |
+
list->tail = b->tail; \
|
| 279 |
+
list->count += b->count; \
|
| 280 |
+
} \
|
| 281 |
+
} \
|
| 282 |
+
\
|
| 283 |
+
linkage_ elemT_ *prefix_##_index_addr (struct prefix_ *list, uint32_t index) \
|
| 284 |
+
{ \
|
| 285 |
+
struct prefix_##_node *n; \
|
| 286 |
+
uint32_t pos = 0; \
|
| 287 |
+
if (index >= list->count) \
|
| 288 |
+
return NULL; \
|
| 289 |
+
if (index == list->count - 1) \
|
| 290 |
+
{ \
|
| 291 |
+
n = list->tail; \
|
| 292 |
+
pos = list->count - (n->lastp1 - n->first); \
|
| 293 |
+
} \
|
| 294 |
+
else \
|
| 295 |
+
{ \
|
| 296 |
+
for (n = list->head; n; n = n->next) \
|
| 297 |
+
{ \
|
| 298 |
+
const uint32_t c = n->lastp1 - n->first; \
|
| 299 |
+
if (pos + c > index) \
|
| 300 |
+
break; \
|
| 301 |
+
pos += c; \
|
| 302 |
+
} \
|
| 303 |
+
} \
|
| 304 |
+
if (n == NULL) \
|
| 305 |
+
return NULL; \
|
| 306 |
+
assert (pos <= index && index < pos + n->lastp1 - n->first); \
|
| 307 |
+
return &n->ary[n->first + (index - pos)]; \
|
| 308 |
+
} \
|
| 309 |
+
\
|
| 310 |
+
linkage_ elemT_ prefix_##_index (struct prefix_ *list, uint32_t index) \
|
| 311 |
+
{ \
|
| 312 |
+
elemT_ *p = prefix_##_index_addr (list, index); \
|
| 313 |
+
if (p == NULL) \
|
| 314 |
+
return null_; \
|
| 315 |
+
return *p; \
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
#endif /* DDSI_LIST_TMPL_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_locator.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_LOCATOR_H
|
| 13 |
+
#define DDSI_LOCATOR_H
|
| 14 |
+
|
| 15 |
+
#include <stdint.h>
|
| 16 |
+
|
| 17 |
+
#if defined (__cplusplus)
|
| 18 |
+
extern "C" {
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
struct ddsi_tran_factory;
|
| 22 |
+
struct ddsi_tran_conn;
|
| 23 |
+
|
| 24 |
+
/* address field in locator maintained in network byte order, the rest in host */
|
| 25 |
+
typedef struct {
|
| 26 |
+
int32_t kind;
|
| 27 |
+
uint32_t port;
|
| 28 |
+
unsigned char address[16];
|
| 29 |
+
} ddsi_locator_t;
|
| 30 |
+
typedef struct {
|
| 31 |
+
ddsi_locator_t c;
|
| 32 |
+
struct ddsi_tran_conn *conn;
|
| 33 |
+
} ddsi_xlocator_t;
|
| 34 |
+
|
| 35 |
+
#if defined (__cplusplus)
|
| 36 |
+
}
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
#endif /* DDSI_LOCATOR_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_mcgroup.h
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_MCGROUP_H
|
| 13 |
+
#define DDSI_MCGROUP_H
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsi/ddsi_tran.h"
|
| 16 |
+
|
| 17 |
+
#if defined (__cplusplus)
|
| 18 |
+
extern "C" {
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
struct nn_group_membership;
|
| 22 |
+
|
| 23 |
+
struct nn_group_membership *new_group_membership (void);
|
| 24 |
+
void free_group_membership (struct nn_group_membership *mship);
|
| 25 |
+
int ddsi_join_mc (const struct ddsi_domaingv *gv, struct nn_group_membership *mship, ddsi_tran_conn_t conn, const ddsi_locator_t *srcip, const ddsi_locator_t *mcip);
|
| 26 |
+
int ddsi_leave_mc (const struct ddsi_domaingv *gv, struct nn_group_membership *mship, ddsi_tran_conn_t conn, const ddsi_locator_t *srcip, const ddsi_locator_t *mcip);
|
| 27 |
+
void ddsi_transfer_group_membership (struct nn_group_membership *mship, ddsi_tran_conn_t conn, ddsi_tran_conn_t newconn);
|
| 28 |
+
int ddsi_rejoin_transferred_mcgroups (const struct ddsi_domaingv *gv, struct nn_group_membership *mship, ddsi_tran_conn_t conn);
|
| 29 |
+
|
| 30 |
+
#if defined (__cplusplus)
|
| 31 |
+
}
|
| 32 |
+
#endif
|
| 33 |
+
|
| 34 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_ownip.h
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_OWNIP_H
|
| 13 |
+
#define DDSI_OWNIP_H
|
| 14 |
+
|
| 15 |
+
#include <stdbool.h>
|
| 16 |
+
|
| 17 |
+
#include "dds/ddsrt/ifaddrs.h"
|
| 18 |
+
#include "dds/ddsrt/sockets.h"
|
| 19 |
+
#include "dds/ddsi/ddsi_locator.h"
|
| 20 |
+
|
| 21 |
+
#if defined (__cplusplus)
|
| 22 |
+
extern "C" {
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
struct ddsi_domaingv;
|
| 26 |
+
|
| 27 |
+
struct nn_interface {
|
| 28 |
+
ddsi_locator_t loc; // actual interface address
|
| 29 |
+
ddsi_locator_t extloc; // interface address to advertise in discovery
|
| 30 |
+
ddsi_locator_t netmask;
|
| 31 |
+
uint32_t if_index;
|
| 32 |
+
unsigned mc_capable: 1;
|
| 33 |
+
unsigned mc_flaky: 1;
|
| 34 |
+
unsigned point_to_point: 1;
|
| 35 |
+
unsigned loopback: 1;
|
| 36 |
+
unsigned link_local: 1;
|
| 37 |
+
unsigned prefer_multicast: 1;
|
| 38 |
+
int32_t priority;
|
| 39 |
+
char *name;
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
int find_own_ip (struct ddsi_domaingv *gv);
|
| 43 |
+
|
| 44 |
+
#if defined (__cplusplus)
|
| 45 |
+
}
|
| 46 |
+
#endif
|
| 47 |
+
|
| 48 |
+
#endif /* DDSI_OWNIP_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_participant.h
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_PARTICIPANT_H
|
| 13 |
+
#define DDSI_PARTICIPANT_H
|
| 14 |
+
|
| 15 |
+
#include "dds/export.h"
|
| 16 |
+
#include "dds/features.h"
|
| 17 |
+
|
| 18 |
+
#include "dds/ddsrt/avl.h"
|
| 19 |
+
#include "dds/ddsrt/fibheap.h"
|
| 20 |
+
#include "dds/ddsrt/sync.h"
|
| 21 |
+
#include "dds/ddsi/ddsi_entity.h"
|
| 22 |
+
|
| 23 |
+
#if defined (__cplusplus)
|
| 24 |
+
extern "C" {
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
#define DPG_LOCAL 1
|
| 28 |
+
#define DPG_REMOTE 2
|
| 29 |
+
|
| 30 |
+
extern const ddsrt_fibheap_def_t ldur_fhdef;
|
| 31 |
+
extern const ddsrt_fibheap_def_t lease_fhdef_pp;
|
| 32 |
+
|
| 33 |
+
struct deleted_participant {
|
| 34 |
+
ddsrt_avl_node_t avlnode;
|
| 35 |
+
ddsi_guid_t guid;
|
| 36 |
+
unsigned for_what;
|
| 37 |
+
ddsrt_mtime_t t_prune;
|
| 38 |
+
};
|
| 39 |
+
|
| 40 |
+
struct deleted_participants_admin {
|
| 41 |
+
ddsrt_mutex_t deleted_participants_lock;
|
| 42 |
+
ddsrt_avl_tree_t deleted_participants;
|
| 43 |
+
const ddsrt_log_cfg_t *logcfg;
|
| 44 |
+
int64_t delay;
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
struct avail_entityid_set {
|
| 48 |
+
struct inverse_uint32_set x;
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
enum ddsi_participant_state {
|
| 52 |
+
DDSI_PARTICIPANT_STATE_INITIALIZING,
|
| 53 |
+
DDSI_PARTICIPANT_STATE_OPERATIONAL,
|
| 54 |
+
DDSI_PARTICIPANT_STATE_DELETE_STARTED,
|
| 55 |
+
DDSI_PARTICIPANT_STATE_DELETING_BUILTINS
|
| 56 |
+
};
|
| 57 |
+
|
| 58 |
+
struct ddsi_participant
|
| 59 |
+
{
|
| 60 |
+
struct ddsi_entity_common e;
|
| 61 |
+
dds_duration_t lease_duration; /* constant */
|
| 62 |
+
uint32_t bes; /* built-in endpoint set */
|
| 63 |
+
unsigned is_ddsi2_pp: 1; /* true for the "federation leader", the ddsi2 participant itself in OSPL; FIXME: probably should use this for broker mode as well ... */
|
| 64 |
+
struct ddsi_plist *plist; /* settings/QoS for this participant */
|
| 65 |
+
struct xevent *spdp_xevent; /* timed event for periodically publishing SPDP */
|
| 66 |
+
struct xevent *pmd_update_xevent; /* timed event for periodically publishing ParticipantMessageData */
|
| 67 |
+
ddsi_locator_t m_locator; /* this is always a unicast address, it is set if it is in the many unicast mode */
|
| 68 |
+
ddsi_tran_conn_t m_conn; /* this is connection to m_locator, if it is set, this is used */
|
| 69 |
+
struct avail_entityid_set avail_entityids; /* available entity ids [e.lock] */
|
| 70 |
+
ddsrt_mutex_t refc_lock;
|
| 71 |
+
int32_t user_refc; /* number of non-built-in endpoints in this participant [refc_lock] */
|
| 72 |
+
int32_t builtin_refc; /* number of built-in endpoints in this participant [refc_lock] */
|
| 73 |
+
enum ddsi_participant_state state; /* current state of this participant [refc_lock] */
|
| 74 |
+
ddsrt_fibheap_t ldur_auto_wr; /* Heap that contains lease duration for writers with automatic liveliness in this participant */
|
| 75 |
+
ddsrt_atomic_voidp_t minl_man; /* clone of min(leaseheap_man) */
|
| 76 |
+
ddsrt_fibheap_t leaseheap_man; /* keeps leases for this participant's writers (with liveliness manual-by-participant) */
|
| 77 |
+
#ifdef DDS_HAS_SECURITY
|
| 78 |
+
struct participant_sec_attributes *sec_attr;
|
| 79 |
+
nn_security_info_t security_info;
|
| 80 |
+
#endif
|
| 81 |
+
};
|
| 82 |
+
|
| 83 |
+
/* Interface for glue code between the OpenSplice kernel and the DDSI
|
| 84 |
+
entities. These all return 0 iff successful. All GIDs supplied
|
| 85 |
+
__MUST_BE_UNIQUE__. All hell may break loose if they aren't.
|
| 86 |
+
|
| 87 |
+
All delete operations synchronously remove the entity being deleted
|
| 88 |
+
from the various global hash tables on GUIDs. This ensures no new
|
| 89 |
+
operations can be invoked by the glue code, discovery, protocol
|
| 90 |
+
messages, &c. The entity is then scheduled for garbage collection.
|
| 91 |
+
|
| 92 |
+
There is one exception: a participant without built-in
|
| 93 |
+
endpoints: that one synchronously reaches reference count zero
|
| 94 |
+
and is then freed immediately.
|
| 95 |
+
|
| 96 |
+
If ddsi_new_writer () and/or ddsi_new_reader () may be called in parallel to
|
| 97 |
+
ddsi_delete_participant (), trouble ensues. The current glue code
|
| 98 |
+
performs all local discovery single-threaded, and can't ever get
|
| 99 |
+
into that issue.
|
| 100 |
+
|
| 101 |
+
A garbage collector thread is used to perform the actual freeing of
|
| 102 |
+
an entity, but it never does so before all threads have made
|
| 103 |
+
sufficient progress to guarantee they are not using that entity any
|
| 104 |
+
longer, with the exception of use via internal pointers in the
|
| 105 |
+
entity data structures.
|
| 106 |
+
|
| 107 |
+
An example of the latter is that (proxy) endpoints have a pointer
|
| 108 |
+
to the owning (proxy) participant, but the (proxy) participant is
|
| 109 |
+
reference counted to make this safe.
|
| 110 |
+
|
| 111 |
+
The case of a proxy writer is particularly complicated is it has to
|
| 112 |
+
pass through a multiple-stage delay in the garbage collector before
|
| 113 |
+
it may be freed: first there is the possibility of a parallel
|
| 114 |
+
delete or protocol message, then there is still the possibility of
|
| 115 |
+
data in a delivery queue. This is dealt by requeueing garbage
|
| 116 |
+
collection and sending bubbles through the delivery queue. */
|
| 117 |
+
|
| 118 |
+
/* Set this flag in new_participant to prevent the creation SPDP, SEDP
|
| 119 |
+
and PMD readers for that participant. It doesn't really need it,
|
| 120 |
+
they all share the information anyway. But you do need it once. */
|
| 121 |
+
#define RTPS_PF_NO_BUILTIN_READERS 1u
|
| 122 |
+
/* Set this flag to prevent the creation of SPDP, SEDP and PMD
|
| 123 |
+
writers. It will then rely on the "privileged participant", which
|
| 124 |
+
must exist at the time of creation. It creates a reference to that
|
| 125 |
+
"privileged participant" to ensure it won't disappear too early. */
|
| 126 |
+
#define RTPS_PF_NO_BUILTIN_WRITERS 2u
|
| 127 |
+
/* Set this flag to mark the participant as the "privileged
|
| 128 |
+
participant", there can only be one of these. The privileged
|
| 129 |
+
participant MUST have all builtin readers and writers. */
|
| 130 |
+
#define RTPS_PF_PRIVILEGED_PP 4u
|
| 131 |
+
/* Set this flag to mark the participant as is_ddsi2_pp. */
|
| 132 |
+
#define RTPS_PF_IS_DDSI2_PP 8u
|
| 133 |
+
/* Set this flag to mark the participant as an local entity only. */
|
| 134 |
+
#define RTPS_PF_ONLY_LOCAL 16u
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
void ddsi_participant_add_wr_lease_locked (struct ddsi_participant * pp, const struct ddsi_writer * wr);
|
| 138 |
+
void ddsi_participant_remove_wr_lease_locked (struct ddsi_participant * pp, struct ddsi_writer * wr);
|
| 139 |
+
dds_return_t ddsi_participant_allocate_entityid (ddsi_entityid_t *id, uint32_t kind, struct ddsi_participant *pp);
|
| 140 |
+
void ddsi_participant_release_entityid (struct ddsi_participant *pp, ddsi_entityid_t id);
|
| 141 |
+
void ddsi_gc_participant_lease (struct gcreq *gcreq);
|
| 142 |
+
void ddsi_prune_deleted_participant_guids (struct deleted_participants_admin *admin, ddsrt_mtime_t tnow);
|
| 143 |
+
void ddsi_remove_deleted_participant_guid (struct deleted_participants_admin *admin, const struct ddsi_guid *guid, unsigned for_what);
|
| 144 |
+
void ddsi_remember_deleted_participant_guid (struct deleted_participants_admin *admin, const struct ddsi_guid *guid);
|
| 145 |
+
struct ddsi_participant *ddsi_ref_participant (struct ddsi_participant *pp, const struct ddsi_guid *guid_of_refing_entity);
|
| 146 |
+
void ddsi_unref_participant (struct ddsi_participant *pp, const struct ddsi_guid *guid_of_refing_entity);
|
| 147 |
+
struct deleted_participants_admin *ddsi_deleted_participants_admin_new (const ddsrt_log_cfg_t *logcfg, int64_t delay);
|
| 148 |
+
void ddsi_deleted_participants_admin_free (struct deleted_participants_admin *admin);
|
| 149 |
+
int ddsi_is_deleted_participant_guid (struct deleted_participants_admin *admin, const struct ddsi_guid *guid, unsigned for_what);
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
/**
|
| 154 |
+
* @brief Create a new participant in the domain
|
| 155 |
+
*
|
| 156 |
+
* @param[out] ppguid
|
| 157 |
+
* On successful return: the GUID of the new participant;
|
| 158 |
+
* Undefined on error.
|
| 159 |
+
* @param[in] flags
|
| 160 |
+
* Zero or more of:
|
| 161 |
+
* - RTPS_PF_NO_BUILTIN_READERS do not create discovery readers in new ppant
|
| 162 |
+
* - RTPS_PF_NO_BUILTIN_WRITERS do not create discvoery writers in new ppant
|
| 163 |
+
* - RTPS_PF_PRIVILEGED_PP FIXME: figure out how to describe this ...
|
| 164 |
+
* - RTPS_PF_IS_DDSI2_PP FIXME: OSPL holdover - there is no DDSI2E here
|
| 165 |
+
* - RTPS_PF_ONLY_LOCAL FIXME: not used, it seems
|
| 166 |
+
* @param[in] plist
|
| 167 |
+
* Parameters/QoS for this participant
|
| 168 |
+
*
|
| 169 |
+
* @returns A dds_return_t indicating success or failure.
|
| 170 |
+
*
|
| 171 |
+
* @retval DDS_RETCODE_OK
|
| 172 |
+
* Success, there is now a local participant with the GUID stored in
|
| 173 |
+
* *ppguid
|
| 174 |
+
* @retval DDS_RETCODE_OUT_OF_RESOURCES
|
| 175 |
+
* Failed to allocate a new GUID (note: currently this will always
|
| 176 |
+
* happen after 2**24-1 successful calls to new_participant ...).
|
| 177 |
+
* @retval DDS_RETCODE_OUT_OF_RESOURCES
|
| 178 |
+
* The configured maximum number of participants has been reached.
|
| 179 |
+
*/
|
| 180 |
+
DDS_EXPORT dds_return_t ddsi_new_participant (struct ddsi_guid *ppguid, struct ddsi_domaingv *gv, unsigned flags, const struct ddsi_plist *plist);
|
| 181 |
+
|
| 182 |
+
/**
|
| 183 |
+
* @brief Initiate the deletion of the participant:
|
| 184 |
+
* - dispose/unregister built-in topic
|
| 185 |
+
* - list it as one of the recently deleted participants
|
| 186 |
+
* - remote it from the GUID hash tables
|
| 187 |
+
* - schedule the scare stuff to really delete it via the GC
|
| 188 |
+
*
|
| 189 |
+
* It is ok to call delete_participant without deleting all DDSI-level
|
| 190 |
+
* readers/writers: those will simply be deleted. (New ones can't be
|
| 191 |
+
* created anymore because the participant can no longer be located via
|
| 192 |
+
* the hash tables).
|
| 193 |
+
*
|
| 194 |
+
* @param[in] ppguid
|
| 195 |
+
* GUID of the participant to be deleted.
|
| 196 |
+
*
|
| 197 |
+
* @returns A dds_return_t indicating success or failure.
|
| 198 |
+
*
|
| 199 |
+
* @retval DDS_RETCODE_OK
|
| 200 |
+
* Success, it is no longer visible and GC events have
|
| 201 |
+
* been scheduled for eventual deleting of all remaining
|
| 202 |
+
* readers and writers and freeing of memory
|
| 203 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 204 |
+
* ppguid lookup failed.
|
| 205 |
+
*/
|
| 206 |
+
DDS_EXPORT dds_return_t ddsi_delete_participant (struct ddsi_domaingv *gv, const struct ddsi_guid *ppguid);
|
| 207 |
+
|
| 208 |
+
/**
|
| 209 |
+
* @brief Updates the parameters list for this participant and trigger sending
|
| 210 |
+
* an updated SPDP message.
|
| 211 |
+
*
|
| 212 |
+
* @param[in] pp The participant
|
| 213 |
+
* @param[in] plist The new parameters
|
| 214 |
+
*/
|
| 215 |
+
DDS_EXPORT void ddsi_update_participant_plist (struct ddsi_participant *pp, const struct ddsi_plist *plist);
|
| 216 |
+
|
| 217 |
+
/**
|
| 218 |
+
* @brief Gets the interval for PMD messages, which is the minimal lease duration for writers
|
| 219 |
+
* with auto liveliness in this participant, or the participants lease duration if shorter
|
| 220 |
+
*
|
| 221 |
+
* @param[in] pp The participant
|
| 222 |
+
* @returns The PMD interval of the participant
|
| 223 |
+
*/
|
| 224 |
+
DDS_EXPORT dds_duration_t ddsi_participant_get_pmd_interval (struct ddsi_participant *pp);
|
| 225 |
+
|
| 226 |
+
/**
|
| 227 |
+
* @brief To obtain the builtin writer to be used for publishing SPDP, SEDP, PMD stuff for
|
| 228 |
+
* PP and its endpoints, given the entityid. If PP has its own writer, use it; else use the
|
| 229 |
+
* privileged participant.
|
| 230 |
+
*
|
| 231 |
+
* @param[in] pp The participant
|
| 232 |
+
* @param[in] entityid The entity ID of the writer
|
| 233 |
+
* @returns The built-in writer
|
| 234 |
+
*/
|
| 235 |
+
DDS_EXPORT struct ddsi_writer *ddsi_get_builtin_writer (const struct ddsi_participant *pp, unsigned entityid);
|
| 236 |
+
|
| 237 |
+
#if defined (__cplusplus)
|
| 238 |
+
}
|
| 239 |
+
#endif
|
| 240 |
+
|
| 241 |
+
#endif /* DDSI_PARTICIPANT_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_plist.h
ADDED
|
@@ -0,0 +1,526 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_PLIST_H
|
| 13 |
+
#define DDSI_PLIST_H
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsrt/bswap.h"
|
| 16 |
+
#include "dds/ddsi/q_feature_check.h"
|
| 17 |
+
#include "dds/ddsi/ddsi_xqos.h"
|
| 18 |
+
#include "dds/ddsi/ddsi_keyhash.h"
|
| 19 |
+
#include "dds/ddsi/ddsi_tran.h" /* FIXME: eliminate */
|
| 20 |
+
#include "dds/ddsi/ddsi_typelookup.h"
|
| 21 |
+
|
| 22 |
+
#if defined (__cplusplus)
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
#define PP_PROTOCOL_VERSION ((uint64_t)1 << 0)
|
| 27 |
+
#define PP_VENDORID ((uint64_t)1 << 1)
|
| 28 |
+
#define PP_UNICAST_LOCATOR ((uint64_t)1 << 2)
|
| 29 |
+
#define PP_MULTICAST_LOCATOR ((uint64_t)1 << 3)
|
| 30 |
+
#define PP_DEFAULT_UNICAST_LOCATOR ((uint64_t)1 << 4)
|
| 31 |
+
#define PP_DEFAULT_MULTICAST_LOCATOR ((uint64_t)1 << 5)
|
| 32 |
+
#define PP_METATRAFFIC_UNICAST_LOCATOR ((uint64_t)1 << 6)
|
| 33 |
+
#define PP_METATRAFFIC_MULTICAST_LOCATOR ((uint64_t)1 << 7)
|
| 34 |
+
#define PP_EXPECTS_INLINE_QOS ((uint64_t)1 << 8)
|
| 35 |
+
#define PP_PARTICIPANT_MANUAL_LIVELINESS_COUNT ((uint64_t)1 << 9)
|
| 36 |
+
#define PP_PARTICIPANT_BUILTIN_ENDPOINTS ((uint64_t)1 << 10)
|
| 37 |
+
#define PP_PARTICIPANT_LEASE_DURATION ((uint64_t)1 << 11)
|
| 38 |
+
#define PP_CONTENT_FILTER_PROPERTY ((uint64_t)1 << 12)
|
| 39 |
+
#define PP_PARTICIPANT_GUID ((uint64_t)1 << 13)
|
| 40 |
+
#define PP_PARTICIPANT_ENTITYID ((uint64_t)1 << 14)
|
| 41 |
+
#define PP_GROUP_GUID ((uint64_t)1 << 15)
|
| 42 |
+
#define PP_GROUP_ENTITYID ((uint64_t)1 << 16)
|
| 43 |
+
#define PP_BUILTIN_ENDPOINT_SET ((uint64_t)1 << 17)
|
| 44 |
+
#define PP_PROPERTIES ((uint64_t)1 << 18)
|
| 45 |
+
#define PP_TYPE_MAX_SIZE_SERIALIZED ((uint64_t)1 << 19)
|
| 46 |
+
#define PP_CYCLONE_REDUNDANT_NETWORKING ((uint64_t)1 << 20)
|
| 47 |
+
#define PP_KEYHASH ((uint64_t)1 << 21)
|
| 48 |
+
#define PP_STATUSINFO ((uint64_t)1 << 22)
|
| 49 |
+
#define PP_ORIGINAL_WRITER_INFO ((uint64_t)1 << 23)
|
| 50 |
+
#define PP_ENDPOINT_GUID ((uint64_t)1 << 24)
|
| 51 |
+
#define PP_ADLINK_PARTICIPANT_VERSION_INFO ((uint64_t)1 << 26)
|
| 52 |
+
#define PP_ADLINK_TYPE_DESCRIPTION ((uint64_t)1 << 27)
|
| 53 |
+
#define PP_COHERENT_SET ((uint64_t)1 << 28)
|
| 54 |
+
#ifdef DDS_HAS_SSM
|
| 55 |
+
#define PP_READER_FAVOURS_SSM ((uint64_t)1 << 29)
|
| 56 |
+
#endif
|
| 57 |
+
#define PP_DOMAIN_ID ((uint64_t)1 << 30)
|
| 58 |
+
#define PP_DOMAIN_TAG ((uint64_t)1 << 31)
|
| 59 |
+
/* Security extensions. */
|
| 60 |
+
#define PP_IDENTITY_TOKEN ((uint64_t)1 << 32)
|
| 61 |
+
#define PP_PERMISSIONS_TOKEN ((uint64_t)1 << 33)
|
| 62 |
+
#define PP_ENDPOINT_SECURITY_INFO ((uint64_t)1 << 34)
|
| 63 |
+
#define PP_PARTICIPANT_SECURITY_INFO ((uint64_t)1 << 35)
|
| 64 |
+
#define PP_IDENTITY_STATUS_TOKEN ((uint64_t)1 << 36)
|
| 65 |
+
#define PP_DATA_TAGS ((uint64_t)1 << 37)
|
| 66 |
+
/* Other stuff */
|
| 67 |
+
#define PP_CYCLONE_RECEIVE_BUFFER_SIZE ((uint64_t)1 << 38)
|
| 68 |
+
#define PP_CYCLONE_TOPIC_GUID ((uint64_t)1 << 39)
|
| 69 |
+
#define PP_CYCLONE_REQUESTS_KEYHASH ((uint64_t)1 << 40)
|
| 70 |
+
|
| 71 |
+
/* Set for unrecognized parameters that are in the reserved space or
|
| 72 |
+
in our own vendor-specific space that have the
|
| 73 |
+
PID_UNRECOGNIZED_INCOMPATIBLE_FLAG set (see DDSI 2.1 9.6.2.2.1) */
|
| 74 |
+
#define PP_INCOMPATIBLE ((uint64_t)1 << 63)
|
| 75 |
+
|
| 76 |
+
#define NN_ADLINK_PARTICIPANT_VERSION_INFO_FIXED_CDRSIZE (24)
|
| 77 |
+
|
| 78 |
+
#define NN_ADLINK_FL_KERNEL_SEQUENCE_NUMBER (1u << 0)
|
| 79 |
+
#define NN_ADLINK_FL_DISCOVERY_INCLUDES_GID (1u << 1)
|
| 80 |
+
#define NN_ADLINK_FL_PTBES_FIXED_0 (1u << 2)
|
| 81 |
+
#define NN_ADLINK_FL_DDSI2_PARTICIPANT_FLAG (1u << 3)
|
| 82 |
+
#define NN_ADLINK_FL_PARTICIPANT_IS_DDSI2 (1u << 4)
|
| 83 |
+
#define NN_ADLINK_FL_MINIMAL_BES_MODE (1u << 5)
|
| 84 |
+
#define NN_ADLINK_FL_SUPPORTS_STATUSINFOX (1u << 5)
|
| 85 |
+
/* SUPPORTS_STATUSINFOX: when set, also means any combination of
|
| 86 |
+
write/unregister/dispose supported */
|
| 87 |
+
|
| 88 |
+
/* For locators one could patch the received message data to create
|
| 89 |
+
singly-linked lists (parameter header -> offset of next entry in
|
| 90 |
+
list relative to current), allowing aliasing of the data. But that
|
| 91 |
+
requires modifying the data. For string sequences the length does
|
| 92 |
+
the same thing. */
|
| 93 |
+
struct nn_locators_one {
|
| 94 |
+
struct nn_locators_one *next;
|
| 95 |
+
ddsi_locator_t loc;
|
| 96 |
+
};
|
| 97 |
+
|
| 98 |
+
typedef struct nn_locators {
|
| 99 |
+
uint32_t n;
|
| 100 |
+
struct nn_locators_one *first;
|
| 101 |
+
struct nn_locators_one *last;
|
| 102 |
+
} nn_locators_t;
|
| 103 |
+
|
| 104 |
+
typedef uint32_t nn_ipv4address_t;
|
| 105 |
+
|
| 106 |
+
typedef uint32_t nn_port_t;
|
| 107 |
+
|
| 108 |
+
#ifdef DDS_HAS_SECURITY
|
| 109 |
+
typedef struct nn_tag {
|
| 110 |
+
char *name;
|
| 111 |
+
char *value;
|
| 112 |
+
} nn_tag_t;
|
| 113 |
+
|
| 114 |
+
typedef struct nn_tagseq {
|
| 115 |
+
uint32_t n;
|
| 116 |
+
nn_tag_t *tags;
|
| 117 |
+
} nn_tagseq_t;
|
| 118 |
+
|
| 119 |
+
typedef struct nn_datatags {
|
| 120 |
+
nn_tagseq_t tags;
|
| 121 |
+
} nn_datatags_t;
|
| 122 |
+
#endif
|
| 123 |
+
|
| 124 |
+
#ifdef DDS_HAS_SSM
|
| 125 |
+
typedef struct nn_reader_favours_ssm {
|
| 126 |
+
uint32_t state; /* default is false */
|
| 127 |
+
} nn_reader_favours_ssm_t;
|
| 128 |
+
#endif
|
| 129 |
+
|
| 130 |
+
#ifdef DDS_HAS_SECURITY
|
| 131 |
+
typedef struct nn_dataholder
|
| 132 |
+
{
|
| 133 |
+
char *class_id;
|
| 134 |
+
dds_propertyseq_t properties;
|
| 135 |
+
dds_binarypropertyseq_t binary_properties;
|
| 136 |
+
} nn_dataholder_t;
|
| 137 |
+
|
| 138 |
+
typedef struct nn_dataholderseq {
|
| 139 |
+
uint32_t n;
|
| 140 |
+
nn_dataholder_t *tags;
|
| 141 |
+
} nn_dataholderseq_t;
|
| 142 |
+
|
| 143 |
+
typedef nn_dataholder_t nn_token_t;
|
| 144 |
+
|
| 145 |
+
/* Used for both nn_participant_security_info and nn_endpoint_security_info. */
|
| 146 |
+
typedef struct nn_security_info
|
| 147 |
+
{
|
| 148 |
+
uint32_t security_attributes;
|
| 149 |
+
uint32_t plugin_security_attributes;
|
| 150 |
+
} nn_security_info_t;
|
| 151 |
+
|
| 152 |
+
#define NN_ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_READ_PROTECTED (1u << 0)
|
| 153 |
+
#define NN_ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_WRITE_PROTECTED (1u << 1)
|
| 154 |
+
#define NN_ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_DISCOVERY_PROTECTED (1u << 2)
|
| 155 |
+
#define NN_ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_SUBMESSAGE_PROTECTED (1u << 3)
|
| 156 |
+
#define NN_ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_PAYLOAD_PROTECTED (1u << 4)
|
| 157 |
+
#define NN_ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_KEY_PROTECTED (1u << 5)
|
| 158 |
+
#define NN_ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_LIVELINESS_PROTECTED (1u << 6)
|
| 159 |
+
#define NN_ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_VALID (1u << 31)
|
| 160 |
+
|
| 161 |
+
#define NN_PLUGIN_ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_SUBMESSAGE_ENCRYPTED (1u << 0)
|
| 162 |
+
#define NN_PLUGIN_ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_PAYLOAD_ENCRYPTED (1u << 1)
|
| 163 |
+
#define NN_PLUGIN_ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_SUBMESSAGE_ORIGIN_AUTHENTICATED (1u << 2)
|
| 164 |
+
|
| 165 |
+
#define NN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_RTPS_PROTECTED (1u << 0)
|
| 166 |
+
#define NN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_DISCOVERY_PROTECTED (1u << 1)
|
| 167 |
+
#define NN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_LIVELINESS_PROTECTED (1u << 2)
|
| 168 |
+
#define NN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_VALID (1u << 31)
|
| 169 |
+
|
| 170 |
+
#define NN_PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_RTPS_ENCRYPTED (1u << 0)
|
| 171 |
+
#define NN_PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_DISCOVERY_ENCRYPTED (1u << 1)
|
| 172 |
+
#define NN_PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_LIVELINESS_ENCRYPTED (1u << 2)
|
| 173 |
+
#define NN_PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_RTPS_AUTHENTICATED (1u << 3)
|
| 174 |
+
#define NN_PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_DISCOVERY_AUTHENTICATED (1u << 4)
|
| 175 |
+
#define NN_PLUGIN_PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_LIVELINESS_AUTHENTICATED (1u << 5)
|
| 176 |
+
#else
|
| 177 |
+
struct nn_security_info;
|
| 178 |
+
typedef struct nn_security_info nn_security_info_t;
|
| 179 |
+
#endif
|
| 180 |
+
|
| 181 |
+
typedef struct nn_adlink_participant_version_info
|
| 182 |
+
{
|
| 183 |
+
uint32_t version;
|
| 184 |
+
uint32_t flags;
|
| 185 |
+
uint32_t unused[3];
|
| 186 |
+
char *internals;
|
| 187 |
+
} nn_adlink_participant_version_info_t;
|
| 188 |
+
|
| 189 |
+
typedef struct ddsi_plist {
|
| 190 |
+
uint64_t present;
|
| 191 |
+
uint64_t aliased;
|
| 192 |
+
|
| 193 |
+
dds_qos_t qos;
|
| 194 |
+
|
| 195 |
+
nn_protocol_version_t protocol_version;
|
| 196 |
+
nn_vendorid_t vendorid;
|
| 197 |
+
nn_locators_t unicast_locators;
|
| 198 |
+
nn_locators_t multicast_locators;
|
| 199 |
+
nn_locators_t default_unicast_locators;
|
| 200 |
+
nn_locators_t default_multicast_locators;
|
| 201 |
+
nn_locators_t metatraffic_unicast_locators;
|
| 202 |
+
nn_locators_t metatraffic_multicast_locators;
|
| 203 |
+
|
| 204 |
+
unsigned char expects_inline_qos;
|
| 205 |
+
nn_count_t participant_manual_liveliness_count;
|
| 206 |
+
uint32_t participant_builtin_endpoints;
|
| 207 |
+
dds_duration_t participant_lease_duration;
|
| 208 |
+
/* nn_content_filter_property_t content_filter_property; */
|
| 209 |
+
ddsi_guid_t participant_guid;
|
| 210 |
+
ddsi_guid_t endpoint_guid;
|
| 211 |
+
ddsi_guid_t group_guid;
|
| 212 |
+
ddsi_guid_t topic_guid;
|
| 213 |
+
#if 0 /* reserved, rather than NIY */
|
| 214 |
+
nn_entityid_t participant_entityid;
|
| 215 |
+
nn_entityid_t group_entityid;
|
| 216 |
+
#endif
|
| 217 |
+
uint32_t builtin_endpoint_set;
|
| 218 |
+
/* int type_max_size_serialized; */
|
| 219 |
+
ddsi_keyhash_t keyhash;
|
| 220 |
+
uint32_t statusinfo;
|
| 221 |
+
nn_adlink_participant_version_info_t adlink_participant_version_info;
|
| 222 |
+
char *type_description;
|
| 223 |
+
nn_sequence_number_t coherent_set_seqno;
|
| 224 |
+
#ifdef DDS_HAS_SECURITY
|
| 225 |
+
nn_token_t identity_token;
|
| 226 |
+
nn_token_t permissions_token;
|
| 227 |
+
nn_security_info_t endpoint_security_info;
|
| 228 |
+
nn_security_info_t participant_security_info;
|
| 229 |
+
nn_token_t identity_status_token;
|
| 230 |
+
nn_datatags_t data_tags;
|
| 231 |
+
#endif
|
| 232 |
+
#ifdef DDS_HAS_SSM
|
| 233 |
+
nn_reader_favours_ssm_t reader_favours_ssm;
|
| 234 |
+
#endif
|
| 235 |
+
uint32_t domain_id;
|
| 236 |
+
char *domain_tag;
|
| 237 |
+
uint32_t cyclone_receive_buffer_size;
|
| 238 |
+
unsigned char cyclone_requests_keyhash;
|
| 239 |
+
unsigned char cyclone_redundant_networking;
|
| 240 |
+
} ddsi_plist_t;
|
| 241 |
+
|
| 242 |
+
|
| 243 |
+
/***/
|
| 244 |
+
|
| 245 |
+
typedef struct ddsi_plist_src {
|
| 246 |
+
nn_protocol_version_t protocol_version; /**< input protocol version */
|
| 247 |
+
nn_vendorid_t vendorid; /**< vendor code for input */
|
| 248 |
+
int encoding; /**< PL_CDR_LE or PL_CDR_BE */
|
| 249 |
+
const unsigned char *buf; /**< input buffer */
|
| 250 |
+
size_t bufsz; /**< size of input buffer */
|
| 251 |
+
bool strict; /**< whether to be strict in checking */
|
| 252 |
+
} ddsi_plist_src_t;
|
| 253 |
+
|
| 254 |
+
DDS_EXPORT extern const ddsi_plist_t ddsi_default_plist_participant;
|
| 255 |
+
|
| 256 |
+
/**
|
| 257 |
+
* @brief Initialize global parameter-list parsing indices.
|
| 258 |
+
*
|
| 259 |
+
* These indices are derived from compile-time constant tables. This only does the work
|
| 260 |
+
* once; ideally it would be done at compile time instead.
|
| 261 |
+
*/
|
| 262 |
+
void ddsi_plist_init_tables (void);
|
| 263 |
+
|
| 264 |
+
/**
|
| 265 |
+
* @brief Initialize a ddsi_plist_t as an empty object
|
| 266 |
+
*
|
| 267 |
+
* In principle, this only clears the "present" and "aliased" bitmasks. A debug build
|
| 268 |
+
* additionally initializes all other bytes to 0x55.
|
| 269 |
+
*
|
| 270 |
+
* @param[out] dest plist_t to be initialized.
|
| 271 |
+
*/
|
| 272 |
+
DDS_EXPORT void ddsi_plist_init_empty (ddsi_plist_t *dest);
|
| 273 |
+
|
| 274 |
+
/**
|
| 275 |
+
* @brief Extend "a" with selected entries present in "b"
|
| 276 |
+
*
|
| 277 |
+
* This copies into "a" any entries present in "b" that are included in "pmask" and
|
| 278 |
+
* "qmask" and missing in "a". It doesn't touch any entries already present in "a".
|
| 279 |
+
* Calling this on an empty "a" with all bits set in "pmask" and "qmask" all is equivalent
|
| 280 |
+
* to copying "b" into "a"; calling this with "pmask" and "qmask" both 0 copies nothing.
|
| 281 |
+
*
|
| 282 |
+
* @param[in,out] a ddsi_plist_t to be extended
|
| 283 |
+
* @param[in] b ddsi_plist_t from which to copy entries
|
| 284 |
+
* @param[in] pmask subset of non-QoS part of b (if PP_X is set, include X)
|
| 285 |
+
* @param[in] qmask subset of QoS part of b (if QP_X is set, include X)
|
| 286 |
+
*/
|
| 287 |
+
DDS_EXPORT void ddsi_plist_mergein_missing (ddsi_plist_t *a, const ddsi_plist_t *b, uint64_t pmask, uint64_t qmask);
|
| 288 |
+
|
| 289 |
+
/**
|
| 290 |
+
* @brief Copy "src" to "dst"
|
| 291 |
+
*
|
| 292 |
+
* @param[out] dst destination, any contents are overwritten
|
| 293 |
+
* @param[in] src source ddsi_plist_t
|
| 294 |
+
*/
|
| 295 |
+
DDS_EXPORT void ddsi_plist_copy (ddsi_plist_t *dst, const ddsi_plist_t *src);
|
| 296 |
+
|
| 297 |
+
/**
|
| 298 |
+
* @brief Duplicate "src"
|
| 299 |
+
*
|
| 300 |
+
* @param[in] src ddsi_plist_t to be duplicated
|
| 301 |
+
*
|
| 302 |
+
* @returns a new (allocated using ddsrt_malloc) ddsi_plist_t containing a copy of "src".
|
| 303 |
+
*/
|
| 304 |
+
DDS_EXPORT ddsi_plist_t *ddsi_plist_dup (const ddsi_plist_t *src);
|
| 305 |
+
|
| 306 |
+
/**
|
| 307 |
+
* @brief Initialize an ddsi_plist_t from a PL_CDR_{LE,BE} paylaod.
|
| 308 |
+
*
|
| 309 |
+
* @param[in] pwanted
|
| 310 |
+
* PP_... flags indicating which non-QoS parameters are of interest, treated as
|
| 311 |
+
* a hint. Parameters in the input that are outside the mask may or may not be
|
| 312 |
+
* ignored.
|
| 313 |
+
* @param[in] qwanted
|
| 314 |
+
* QP_... flags indicating which QoS settings are of interest, and is treated as
|
| 315 |
+
* a hint. Parameters in the input that are outside the mask may or may not be
|
| 316 |
+
* ignored.
|
| 317 |
+
* @param[in] src
|
| 318 |
+
* Serialized payload to be parsed, validated and copied into dest
|
| 319 |
+
* - protocol_version is the version protocol version according to which the list
|
| 320 |
+
* should be parsed
|
| 321 |
+
* - vendorid is the vendor id code for the source of the parameter list (for
|
| 322 |
+
* handling vendor-specific parameters and compatibility workarounds)
|
| 323 |
+
* - encoding is PL_CDR_LE or PL_CDR_BE
|
| 324 |
+
* - buf is a pointer to the first parameter header
|
| 325 |
+
* - bufsz is the size in bytes of the input buffer
|
| 326 |
+
* @param[in] gv
|
| 327 |
+
* Global context, used for locator kind lookups and tracing
|
| 328 |
+
* @param[out] dest
|
| 329 |
+
* Filled with the recognized parameters in the input if successful, otherwise
|
| 330 |
+
* initialized to an empty parameter list. Where possible, pointers alias the
|
| 331 |
+
* input (indicated by the "aliased" bits in the plist/xqos structures), but
|
| 332 |
+
* some things cannot be aliased (e.g., the array of pointers to strings for a
|
| 333 |
+
* sequence of strings).
|
| 334 |
+
* Generally, ddsi_plist_fini should be called when done with the parameter list,
|
| 335 |
+
* even when ddsi_plist_unlias or ddsi_xqos_unlias hasn't been called.
|
| 336 |
+
* @param[out] nextafterplist
|
| 337 |
+
* If non-NULL, *nextafterplist is set to the first byte following the parameter
|
| 338 |
+
* list sentinel on successful parse, or to NULL on failure
|
| 339 |
+
*
|
| 340 |
+
* @returns A dds_return_t indicating success or failure.
|
| 341 |
+
*
|
| 342 |
+
* @retval DDS_RETCODE_OK
|
| 343 |
+
* All parameters valid (or ignored), dest and *nextafterplist have been set
|
| 344 |
+
* accordingly.
|
| 345 |
+
* @retval DDS_INCONSISTENT_POLICY
|
| 346 |
+
* All individual settings are valid, but there are inconsistencies between
|
| 347 |
+
* dependent settings.
|
| 348 |
+
* @retval DDS_RETCODE_BAD_PARAMETER
|
| 349 |
+
* Input contained invalid data; dest is cleared, *nextafterplist is NULL.
|
| 350 |
+
* @retval DDS_RETCODE_UNSUPPORTED
|
| 351 |
+
* Input contained an unrecognized parameter with the "incompatible-if-unknown"
|
| 352 |
+
* flag set; dest is cleared, *nextafterplist is NULL.
|
| 353 |
+
*/
|
| 354 |
+
DDS_EXPORT dds_return_t ddsi_plist_init_frommsg (ddsi_plist_t *dest, char **nextafterplist, uint64_t pwanted, uint64_t qwanted, const ddsi_plist_src_t *src, struct ddsi_domaingv const * const gv);
|
| 355 |
+
|
| 356 |
+
/**
|
| 357 |
+
* @brief Free memory owned by "ps"
|
| 358 |
+
*
|
| 359 |
+
* A ddsi_plist_t may own other allocated blocks of memory, depending on which fields are
|
| 360 |
+
* set, their types and whether they are marked as "aliased". This function releases any
|
| 361 |
+
* such memory owned by "ps", but not "ps" itself. Afterward, the contents of "ps" is
|
| 362 |
+
* undefined and must not be used again without initialising it (either via
|
| 363 |
+
* `ddsi_plist_init_empty`, `ddsi_plist_init_frommsg` or `ddsi_plist_copy`.
|
| 364 |
+
*
|
| 365 |
+
* @param[in] ps ddsi_plist_t for which to free memory
|
| 366 |
+
*/
|
| 367 |
+
DDS_EXPORT void ddsi_plist_fini (ddsi_plist_t *ps);
|
| 368 |
+
|
| 369 |
+
/**
|
| 370 |
+
* @brief Free memory owned by "plist" for a subset of the entries
|
| 371 |
+
*
|
| 372 |
+
* A ddsi_plist_t may own other allocated blocks of memory, depending on which fields are
|
| 373 |
+
* set, their types and whether they are marked as "aliased". This function releases any
|
| 374 |
+
* such memory owned by "plist" for entries included in "pmask" and "qmask". The
|
| 375 |
+
* "present" and "aliased" bits are cleared accordingly.
|
| 376 |
+
*
|
| 377 |
+
* @param[in,out] plist ddsi_plist_t for which to free memory
|
| 378 |
+
* @param[in] pmask subset of non-QoS part of b (if PP_X is set, free X if present)
|
| 379 |
+
* @param[in] qmask subset of QoS part of b (if QP_X is set, free X if present)
|
| 380 |
+
*/
|
| 381 |
+
DDS_EXPORT void ddsi_plist_fini_mask (ddsi_plist_t *plist, uint64_t pmask, uint64_t qmask);
|
| 382 |
+
|
| 383 |
+
/**
|
| 384 |
+
* @brief Replace any memory "plist" aliases by copies it owns
|
| 385 |
+
*
|
| 386 |
+
* A ddsi_plist_t may can reference other memory without owning it. This functions allows
|
| 387 |
+
* one to replace any such aliased memory by copies, allowing one to free the original
|
| 388 |
+
* copy.
|
| 389 |
+
*
|
| 390 |
+
* @param[in,out] plist ddsi_plist_t for which to replace all aliased memory by owned
|
| 391 |
+
* copies
|
| 392 |
+
*/
|
| 393 |
+
DDS_EXPORT void ddsi_plist_unalias (ddsi_plist_t *plist);
|
| 394 |
+
|
| 395 |
+
/**
|
| 396 |
+
* @brief Add selected entries in "ps" to a message in native endianness.
|
| 397 |
+
*
|
| 398 |
+
* This functions appends to "m" a serialized copy of the the entries selected by
|
| 399 |
+
* "pwanted"/"qwanted" and present in "ps". Each copy is preceded by a 4-byte header with
|
| 400 |
+
* a parameter id and length (conform the PL_CDR representation). It does *not* add a
|
| 401 |
+
* sentinel to allow adding additional data to the parameter list. A sentinel can be
|
| 402 |
+
* added using `nn_xmsg_addpar_sentinel`.
|
| 403 |
+
*
|
| 404 |
+
* @param[in,out] m message to append the parameters to
|
| 405 |
+
* @param[in] ps source
|
| 406 |
+
* @param[in] pwanted subset of non-QoS part of ps (if PP_X is set, add X if present)
|
| 407 |
+
* @param[in] qwanted subset of QoS part of ps (if QP_X is set, add X if present)
|
| 408 |
+
*/
|
| 409 |
+
DDS_EXPORT void ddsi_plist_addtomsg (struct nn_xmsg *m, const ddsi_plist_t *ps, uint64_t pwanted, uint64_t qwanted);
|
| 410 |
+
|
| 411 |
+
/**
|
| 412 |
+
* @brief Add selected entries in "ps" to a message with selected endianness.
|
| 413 |
+
*
|
| 414 |
+
* This functions appends to "m" a serialized copy of the the entries selected by
|
| 415 |
+
* "pwanted"/"qwanted" and present in "ps". Each copy is preceded by a 4-byte header with
|
| 416 |
+
* a parameter id and length (conform the PL_CDR representation). It does *not* add a
|
| 417 |
+
* sentinel to allow adding additional data to the parameter list. A sentinel can be
|
| 418 |
+
* added using `nn_xmsg_addpar_sentinel`.
|
| 419 |
+
*
|
| 420 |
+
* @param[in,out] m message to append the parameters to
|
| 421 |
+
* @param[in] ps source
|
| 422 |
+
* @param[in] pwanted subset of non-QoS part of ps (if PP_X is set, add X if present)
|
| 423 |
+
* @param[in] qwanted subset of QoS part of ps (if QP_X is set, add X if present)
|
| 424 |
+
* @param[in] bo byte order
|
| 425 |
+
*/
|
| 426 |
+
DDS_EXPORT void ddsi_plist_addtomsg_bo (struct nn_xmsg *m, const ddsi_plist_t *ps, uint64_t pwanted, uint64_t qwanted, enum ddsrt_byte_order_selector bo);
|
| 427 |
+
|
| 428 |
+
/**
|
| 429 |
+
* @brief Determine the set of entries in which "x" differs from "y"
|
| 430 |
+
*
|
| 431 |
+
* This computes the entries set in "x" but not set in "y", not set in "x" but set in "y",
|
| 432 |
+
* or set in both "x" and "y" but to a different value. It returns this set reduced to
|
| 433 |
+
* only those included in "pmask"/"qmask", that is, if bit X is clear in "pmask", bit X
|
| 434 |
+
* will be clear in "pdelta", etc.
|
| 435 |
+
*
|
| 436 |
+
* @param[out] pdelta non-QoS entries that are different and not masked out
|
| 437 |
+
* @param[out] qdelta QoS entries that are different and not masked out
|
| 438 |
+
* @param[in] x one of the two plists to compare
|
| 439 |
+
* @param[in] y other plist to compare
|
| 440 |
+
* @param[in] pmask subset of non-QoS part to be compared
|
| 441 |
+
* @param[in] qmask subset of QoS part to be compared
|
| 442 |
+
*/
|
| 443 |
+
DDS_EXPORT void ddsi_plist_delta (uint64_t *pdelta, uint64_t *qdelta, const ddsi_plist_t *x, const ddsi_plist_t *y, uint64_t pmask, uint64_t qmask);
|
| 444 |
+
|
| 445 |
+
/**
|
| 446 |
+
* @brief Formats plist using `ddsi_plist_print` and writes it to the trace.
|
| 447 |
+
*
|
| 448 |
+
* @param[in] cat log category to use
|
| 449 |
+
* @param[in] logcfg logging configuration
|
| 450 |
+
* @param[in] plist parameter list to be logged
|
| 451 |
+
*/
|
| 452 |
+
DDS_EXPORT void ddsi_plist_log (uint32_t cat, const struct ddsrt_log_cfg *logcfg, const ddsi_plist_t *plist);
|
| 453 |
+
|
| 454 |
+
/**
|
| 455 |
+
* @brief Formats plist into a buffer
|
| 456 |
+
*
|
| 457 |
+
* The representation is somewhat cryptic as all enumerated types are dumped as numbers
|
| 458 |
+
* and timestamps are durations as nanoseconds with "infinite" represented as
|
| 459 |
+
* 9223372036854775807 (INT64_MAX).
|
| 460 |
+
*
|
| 461 |
+
* @param[out] buf buffer to store the formatted representation in
|
| 462 |
+
* @param[in] bufsize size of buffer, if > 0, there will be a terminating 0 in buf on
|
| 463 |
+
* return
|
| 464 |
+
* @param[in] plist parameter list to be formatted as a string
|
| 465 |
+
*
|
| 466 |
+
* @returns number of bytes written to buf, excluding a terminating 0.
|
| 467 |
+
*/
|
| 468 |
+
DDS_EXPORT size_t ddsi_plist_print (char * __restrict buf, size_t bufsize, const ddsi_plist_t *plist);
|
| 469 |
+
|
| 470 |
+
struct nn_rsample_info;
|
| 471 |
+
|
| 472 |
+
/**
|
| 473 |
+
* @brief Scan a PL_CDR-serialized parameter list, checking structure and copying some information to "dest".
|
| 474 |
+
*
|
| 475 |
+
* This checks that the serialized data is structured correctly (proper aligned headers,
|
| 476 |
+
* declared lengths within bounds, a sentinel at the end). It sets the `statusinfo` of
|
| 477 |
+
* `dest` to the least significant two bits (UNREGISTER and DISPOSE) of a status info
|
| 478 |
+
* parameter if present, else to 0. A statusinfo parameter that is too short (less than 4
|
| 479 |
+
* bytes) is treated as an invalid input.
|
| 480 |
+
*
|
| 481 |
+
* It sets the `complex_qos` flag if it encounters any parameter other than a statusinfo
|
| 482 |
+
* limited to those two bits, keyhash or padding, and clears it otherwise.
|
| 483 |
+
*
|
| 484 |
+
* It clears the `bswap` flag in `dest` if the input is in native endianness, and sets it
|
| 485 |
+
* otherwise.
|
| 486 |
+
*
|
| 487 |
+
* @param[out] dest internal sample info of which some fields will be set
|
| 488 |
+
* @param[in] src input description (see `ddsi_plist_init_frommsg`)
|
| 489 |
+
* @param[out] keyhashp set to point to keyhash in inline QoS if present, else to NULL
|
| 490 |
+
* @param[in] gv global context (for logging)
|
| 491 |
+
*
|
| 492 |
+
* @return pointer to the first byte following the sentinel if the input is well-formed, a
|
| 493 |
+
* null pointer if it is not.
|
| 494 |
+
*/
|
| 495 |
+
DDS_EXPORT unsigned char *ddsi_plist_quickscan (struct nn_rsample_info *dest, const ddsi_keyhash_t **keyhashp, const ddsi_plist_src_t *src, struct ddsi_domaingv const * const gv);
|
| 496 |
+
|
| 497 |
+
/**
|
| 498 |
+
* @brief Locate a specific parameter in a PL_CDR-serialized parameter list
|
| 499 |
+
*
|
| 500 |
+
* This scans the serialized data until it encounters the sentinel, recording whether the
|
| 501 |
+
* specified parameter occurs and returning the size and address of it in `buf`.
|
| 502 |
+
*
|
| 503 |
+
* If `needle` is PID_SENTINEL, it will simply check well-formedness of the input and
|
| 504 |
+
* `needlep` and `needlesz` must both be null pointers. If `needle` is not PID_SENTINEL,
|
| 505 |
+
* `needlep` and `needlesz` may not be null pointers.
|
| 506 |
+
*
|
| 507 |
+
* @param[in] buf serialized parameter list to scan
|
| 508 |
+
* @param[in] bufsz length of serialized form
|
| 509 |
+
* @param[in] encoding encoding of `buf`, either PL_CDR_LE or PL_CDR_BE
|
| 510 |
+
* @param[in] needle parameter id to look for
|
| 511 |
+
* @param[out] needlep where to store the address of the `needle` value
|
| 512 |
+
* @param[out] needlesz where to store the size of the `needle` value
|
| 513 |
+
*
|
| 514 |
+
* @return Whether input was valid and if so, whether it contains the needle.
|
| 515 |
+
*
|
| 516 |
+
* @retval DDS_RETCODE_BAD_PARAMETER invalid input
|
| 517 |
+
* @retval DDS_RETCODE_NOT_FOUND valid input, `needle` not present
|
| 518 |
+
* @retval DDS_RETCODE_OK valid input, `needle` is present
|
| 519 |
+
*/
|
| 520 |
+
DDS_EXPORT dds_return_t ddsi_plist_findparam_checking (const void *buf, size_t bufsz, uint16_t encoding, nn_parameterid_t needle, void **needlep, size_t *needlesz);
|
| 521 |
+
|
| 522 |
+
#if defined (__cplusplus)
|
| 523 |
+
}
|
| 524 |
+
#endif
|
| 525 |
+
|
| 526 |
+
#endif /* DDSI_PLIST_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_plist_generic.h
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2019 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_PLIST_GENERIC_H
|
| 13 |
+
#define DDSI_PLIST_GENERIC_H
|
| 14 |
+
|
| 15 |
+
#include <stddef.h>
|
| 16 |
+
#include <assert.h>
|
| 17 |
+
#include <stdbool.h>
|
| 18 |
+
|
| 19 |
+
#include "dds/export.h"
|
| 20 |
+
#include "dds/ddsrt/bswap.h"
|
| 21 |
+
#include "dds/ddsrt/attributes.h"
|
| 22 |
+
#include "dds/ddsrt/retcode.h"
|
| 23 |
+
|
| 24 |
+
#if defined (__cplusplus)
|
| 25 |
+
extern "C" {
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
/* Instructions for the generic serializer (&c) that handles most parameters.
|
| 29 |
+
The "packed" attribute means single-byte instructions on GCC and Clang. */
|
| 30 |
+
enum pserop {
|
| 31 |
+
XSTOP,
|
| 32 |
+
XO, /* octet sequence */
|
| 33 |
+
XS, /* string */
|
| 34 |
+
XE1, XE2, XE3, /* enum 0..1, 0..2, 0..3 */
|
| 35 |
+
Xs, /* int16_t */
|
| 36 |
+
Xi, Xix2, Xix3, Xix4, /* int32_t, 1 .. 4 in a row */
|
| 37 |
+
Xu, Xux2, Xux3, Xux4, Xux5, /* uint32_t, 1 .. 5 in a row */
|
| 38 |
+
XD, XDx2, /* duration, 1 .. 2 in a row */
|
| 39 |
+
Xl, /* int64_t */
|
| 40 |
+
Xo, Xox2, /* octet, 1 .. 2 in a row */
|
| 41 |
+
Xb, Xbx2, Xbx3, Xbx4, Xbx5, /* boolean, 1 .. 5 in a row */
|
| 42 |
+
XbCOND, /* boolean: compare to ignore remainder if false (for use_... flags) */
|
| 43 |
+
XbPROP, /* boolean: omit in serialized form; skip serialization if false; always true on deserialize */
|
| 44 |
+
XG, /* GUID */
|
| 45 |
+
XK, /* keyhash */
|
| 46 |
+
XQ, /* arbitary non-nested sequence */
|
| 47 |
+
Xopt, /* remainder is optional on deser, 0-init if not present */
|
| 48 |
+
} ddsrt_attribute_packed;
|
| 49 |
+
|
| 50 |
+
DDS_EXPORT void plist_fini_generic (void * __restrict dst, const enum pserop *desc, bool aliased);
|
| 51 |
+
DDS_EXPORT void plist_ser_generic_size_embeddable (size_t *dstoff, const void *src, size_t srcoff, const enum pserop * __restrict desc);
|
| 52 |
+
DDS_EXPORT dds_return_t plist_deser_generic (void * __restrict dst, const void * __restrict src, size_t srcsize, bool bswap, const enum pserop * __restrict desc);
|
| 53 |
+
DDS_EXPORT dds_return_t plist_deser_generic_srcoff (void * __restrict dst, const void * __restrict src, size_t srcsize, size_t *srcoff, bool bswap, const enum pserop * __restrict desc);
|
| 54 |
+
DDS_EXPORT dds_return_t plist_ser_generic_embeddable (char * const data, size_t *dstoff, const void *src, size_t srcoff, const enum pserop * __restrict desc, enum ddsrt_byte_order_selector bo);
|
| 55 |
+
DDS_EXPORT dds_return_t plist_ser_generic (void **dst, size_t *dstsize, const void *src, const enum pserop * __restrict desc);
|
| 56 |
+
DDS_EXPORT dds_return_t plist_ser_generic_be (void **dst, size_t *dstsize, const void *src, const enum pserop * __restrict desc);
|
| 57 |
+
DDS_EXPORT dds_return_t plist_unalias_generic (void * __restrict dst, const enum pserop * __restrict desc);
|
| 58 |
+
DDS_EXPORT bool plist_equal_generic (const void *srcx, const void *srcy, const enum pserop * __restrict desc);
|
| 59 |
+
DDS_EXPORT size_t plist_memsize_generic (const enum pserop * __restrict desc);
|
| 60 |
+
DDS_EXPORT size_t plist_print_generic (char * __restrict buf, size_t bufsize, const void * __restrict src, const enum pserop * __restrict desc);
|
| 61 |
+
|
| 62 |
+
#if defined (__cplusplus)
|
| 63 |
+
}
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_pmd.h
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_PMD_H
|
| 13 |
+
#define DDSI_PMD_H
|
| 14 |
+
|
| 15 |
+
#include <stdint.h>
|
| 16 |
+
#include "dds/ddsrt/time.h"
|
| 17 |
+
#include "dds/ddsi/ddsi_serdata.h"
|
| 18 |
+
#include "dds/ddsi/ddsi_plist_generic.h"
|
| 19 |
+
#include "dds/ddsi/ddsi_guid.h"
|
| 20 |
+
#include "dds/ddsi/ddsi_xqos.h"
|
| 21 |
+
|
| 22 |
+
#if defined (__cplusplus)
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
struct ddsi_domaingv;
|
| 27 |
+
struct thread_state;
|
| 28 |
+
struct ddsi_guid;
|
| 29 |
+
struct nn_xpack;
|
| 30 |
+
struct ddsi_participant;
|
| 31 |
+
struct receiver_state;
|
| 32 |
+
|
| 33 |
+
typedef struct ParticipantMessageData {
|
| 34 |
+
ddsi_guid_prefix_t participantGuidPrefix;
|
| 35 |
+
uint32_t kind; /* really 4 octets */
|
| 36 |
+
ddsi_octetseq_t value;
|
| 37 |
+
} ParticipantMessageData_t;
|
| 38 |
+
|
| 39 |
+
extern const enum pserop participant_message_data_ops[];
|
| 40 |
+
extern size_t participant_message_data_nops;
|
| 41 |
+
extern const enum pserop participant_message_data_ops_key[];
|
| 42 |
+
extern size_t participant_message_data_nops_key;
|
| 43 |
+
|
| 44 |
+
void write_pmd_message_guid (struct ddsi_domaingv * const gv, struct ddsi_guid *pp_guid, unsigned pmd_kind);
|
| 45 |
+
void write_pmd_message (struct thread_state * const ts1, struct nn_xpack *xp, struct ddsi_participant *pp, unsigned pmd_kind);
|
| 46 |
+
void handle_pmd_message (const struct receiver_state *rst, struct ddsi_serdata *sample_common);
|
| 47 |
+
|
| 48 |
+
#if defined (__cplusplus)
|
| 49 |
+
}
|
| 50 |
+
#endif
|
| 51 |
+
#endif /* DDSI_PMD_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_portmapping.h
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2019 to 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_PORTMAPPING_H
|
| 13 |
+
#define DDSI_PORTMAPPING_H
|
| 14 |
+
|
| 15 |
+
#include <stdint.h>
|
| 16 |
+
#include <stddef.h>
|
| 17 |
+
#include <stdbool.h>
|
| 18 |
+
|
| 19 |
+
#if defined (__cplusplus)
|
| 20 |
+
extern "C" {
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
enum ddsi_port {
|
| 24 |
+
DDSI_PORT_MULTI_DISC,
|
| 25 |
+
DDSI_PORT_MULTI_DATA,
|
| 26 |
+
DDSI_PORT_UNI_DISC,
|
| 27 |
+
DDSI_PORT_UNI_DATA
|
| 28 |
+
};
|
| 29 |
+
|
| 30 |
+
struct ddsi_portmapping {
|
| 31 |
+
uint32_t base;
|
| 32 |
+
uint32_t dg;
|
| 33 |
+
uint32_t pg;
|
| 34 |
+
uint32_t d0;
|
| 35 |
+
uint32_t d1;
|
| 36 |
+
uint32_t d2;
|
| 37 |
+
uint32_t d3;
|
| 38 |
+
};
|
| 39 |
+
|
| 40 |
+
struct ddsi_config;
|
| 41 |
+
|
| 42 |
+
bool ddsi_valid_portmapping (const struct ddsi_config *config, int32_t participant_index, char *msg, size_t msgsize);
|
| 43 |
+
uint32_t ddsi_get_port (const struct ddsi_config *config, enum ddsi_port which, int32_t participant_index);
|
| 44 |
+
|
| 45 |
+
#if defined (__cplusplus)
|
| 46 |
+
}
|
| 47 |
+
#endif
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2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_PROXY_ENDPOINT_H
|
| 13 |
+
#define DDSI_PROXY_ENDPOINT_H
|
| 14 |
+
|
| 15 |
+
#include "dds/export.h"
|
| 16 |
+
#include "dds/features.h"
|
| 17 |
+
|
| 18 |
+
#include "dds/ddsrt/avl.h"
|
| 19 |
+
#include "dds/ddsrt/atomics.h"
|
| 20 |
+
#include "dds/ddsi/ddsi_guid.h"
|
| 21 |
+
#include "dds/ddsi/ddsi_domaingv.h"
|
| 22 |
+
#include "dds/ddsi/ddsi_entity.h"
|
| 23 |
+
|
| 24 |
+
#if defined (__cplusplus)
|
| 25 |
+
extern "C" {
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
struct ddsi_proxy_participant;
|
| 29 |
+
struct dds_qos;
|
| 30 |
+
struct addrset;
|
| 31 |
+
|
| 32 |
+
struct ddsi_proxy_endpoint_common
|
| 33 |
+
{
|
| 34 |
+
struct ddsi_proxy_participant *proxypp; /* counted backref to proxy participant */
|
| 35 |
+
struct ddsi_proxy_endpoint_common *next_ep; /* next \ endpoint belonging to this proxy participant */
|
| 36 |
+
struct ddsi_proxy_endpoint_common *prev_ep; /* prev / -- this is in arbitrary ordering */
|
| 37 |
+
struct dds_qos *xqos; /* proxy endpoint QoS lives here; FIXME: local ones should have it moved to common as well */
|
| 38 |
+
struct addrset *as; /* address set to use for communicating with this endpoint */
|
| 39 |
+
ddsi_guid_t group_guid; /* 0:0:0:0 if not available */
|
| 40 |
+
nn_vendorid_t vendor; /* cached from proxypp->vendor */
|
| 41 |
+
seqno_t seq; /* sequence number of most recent SEDP message */
|
| 42 |
+
#ifdef DDS_HAS_TYPE_DISCOVERY
|
| 43 |
+
struct ddsi_type_pair *type_pair;
|
| 44 |
+
#endif
|
| 45 |
+
#ifdef DDS_HAS_SECURITY
|
| 46 |
+
nn_security_info_t security_info;
|
| 47 |
+
#endif
|
| 48 |
+
};
|
| 49 |
+
|
| 50 |
+
struct ddsi_generic_proxy_endpoint {
|
| 51 |
+
struct ddsi_entity_common e;
|
| 52 |
+
struct ddsi_proxy_endpoint_common c;
|
| 53 |
+
};
|
| 54 |
+
|
| 55 |
+
struct ddsi_proxy_writer {
|
| 56 |
+
struct ddsi_entity_common e;
|
| 57 |
+
struct ddsi_proxy_endpoint_common c;
|
| 58 |
+
ddsrt_avl_tree_t readers; /* matching LOCAL readers, see pwr_rd_match */
|
| 59 |
+
int32_t n_reliable_readers; /* number of those that are reliable */
|
| 60 |
+
int32_t n_readers_out_of_sync; /* number of those that require special handling (accepting historical data, waiting for historical data set to become complete) */
|
| 61 |
+
seqno_t last_seq; /* highest known seq published by the writer, not last delivered */
|
| 62 |
+
uint32_t last_fragnum; /* last known frag for last_seq, or UINT32_MAX if last_seq not partial */
|
| 63 |
+
nn_count_t nackfragcount; /* last nackfrag seq number */
|
| 64 |
+
ddsrt_atomic_uint32_t next_deliv_seq_lowword; /* lower 32-bits for next sequence number that will be delivered; for generating acks; 32-bit so atomic reads on all supported platforms */
|
| 65 |
+
unsigned deliver_synchronously: 1; /* iff 1, delivery happens straight from receive thread for non-historical data; else through delivery queue "dqueue" */
|
| 66 |
+
unsigned have_seen_heartbeat: 1; /* iff 1, we have received at least on heartbeat from this proxy writer */
|
| 67 |
+
unsigned local_matching_inprogress: 1; /* iff 1, we are still busy matching local readers; this is so we don't deliver incoming data to some but not all readers initially */
|
| 68 |
+
unsigned alive: 1; /* iff 1, the proxy writer is alive (lease for this proxy writer is not expired); field may be modified only when holding both pwr->e.lock and pwr->c.proxypp->e.lock */
|
| 69 |
+
unsigned filtered: 1; /* iff 1, builtin proxy writer uses content filter, which affects heartbeats and gaps. */
|
| 70 |
+
unsigned redundant_networking: 1; /* 1 iff requests receiving data on all advertised interfaces */
|
| 71 |
+
#ifdef DDS_HAS_SSM
|
| 72 |
+
unsigned supports_ssm: 1; /* iff 1, this proxy writer supports SSM */
|
| 73 |
+
#endif
|
| 74 |
+
#ifdef DDS_HAS_SHM
|
| 75 |
+
unsigned is_iceoryx : 1;
|
| 76 |
+
#endif
|
| 77 |
+
uint32_t alive_vclock; /* virtual clock counting transitions between alive/not-alive */
|
| 78 |
+
struct nn_defrag *defrag; /* defragmenter for this proxy writer; FIXME: perhaps shouldn't be for historical data */
|
| 79 |
+
struct nn_reorder *reorder; /* message reordering for this proxy writer, out-of-sync readers can have their own, see pwr_rd_match */
|
| 80 |
+
struct nn_dqueue *dqueue; /* delivery queue for asynchronous delivery (historical data is always delivered asynchronously) */
|
| 81 |
+
struct xeventq *evq; /* timed event queue to be used for ACK generation */
|
| 82 |
+
struct ddsi_local_reader_ary rdary; /* LOCAL readers for fast-pathing; if not fast-pathed, fall back to scanning local_readers */
|
| 83 |
+
ddsi2direct_directread_cb_t ddsi2direct_cb;
|
| 84 |
+
void *ddsi2direct_cbarg;
|
| 85 |
+
struct lease *lease;
|
| 86 |
+
};
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
typedef int (*ddsi_filter_fn_t)(struct ddsi_writer *wr, struct ddsi_proxy_reader *prd, struct ddsi_serdata *serdata);
|
| 90 |
+
|
| 91 |
+
struct ddsi_proxy_reader {
|
| 92 |
+
struct ddsi_entity_common e;
|
| 93 |
+
struct ddsi_proxy_endpoint_common c;
|
| 94 |
+
unsigned deleting: 1; /* set when being deleted */
|
| 95 |
+
unsigned is_fict_trans_reader: 1; /* only true when it is certain that is a fictitious transient data reader (affects built-in topic generation) */
|
| 96 |
+
unsigned requests_keyhash: 1; /* 1 iff this reader would like to receive keyhashes */
|
| 97 |
+
unsigned redundant_networking: 1; /* 1 iff requests receiving data on all advertised interfaces */
|
| 98 |
+
#ifdef DDS_HAS_SSM
|
| 99 |
+
unsigned favours_ssm: 1; /* iff 1, this proxy reader favours SSM when available */
|
| 100 |
+
#endif
|
| 101 |
+
#ifdef DDS_HAS_SHM
|
| 102 |
+
unsigned is_iceoryx: 1;
|
| 103 |
+
#endif
|
| 104 |
+
ddsrt_avl_tree_t writers; /* matching LOCAL writers */
|
| 105 |
+
uint32_t receive_buffer_size; /* assumed receive buffer size inherited from proxypp */
|
| 106 |
+
ddsi_filter_fn_t filter;
|
| 107 |
+
};
|
| 108 |
+
|
| 109 |
+
DDS_EXPORT extern const ddsrt_avl_treedef_t ddsi_pwr_readers_treedef;
|
| 110 |
+
DDS_EXPORT extern const ddsrt_avl_treedef_t ddsi_prd_writers_treedef;
|
| 111 |
+
|
| 112 |
+
void ddsi_proxy_writer_set_alive_may_unlock (struct ddsi_proxy_writer *pwr, bool notify);
|
| 113 |
+
int ddsi_proxy_writer_set_notalive (struct ddsi_proxy_writer *pwr, bool notify);
|
| 114 |
+
void ddsi_proxy_writer_get_alive_state (struct ddsi_proxy_writer *pwr, struct ddsi_alive_state *st);
|
| 115 |
+
struct ddsi_entity_common *ddsi_entity_common_from_proxy_endpoint_common (const struct ddsi_proxy_endpoint_common *c);
|
| 116 |
+
bool ddsi_is_proxy_endpoint (const struct ddsi_entity_common *e);
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
/* To create a new proxy writer or reader; the proxy participant is
|
| 120 |
+
determined from the GUID and must exist. */
|
| 121 |
+
DDS_EXPORT int ddsi_new_proxy_writer (struct ddsi_domaingv *gv, const struct ddsi_guid *ppguid, const struct ddsi_guid *guid, struct addrset *as, const struct ddsi_plist *plist, struct nn_dqueue *dqueue, struct xeventq *evq, ddsrt_wctime_t timestamp, seqno_t seq);
|
| 122 |
+
DDS_EXPORT int ddsi_new_proxy_reader (struct ddsi_domaingv *gv, const struct ddsi_guid *ppguid, const struct ddsi_guid *guid, struct addrset *as, const struct ddsi_plist *plist, ddsrt_wctime_t timestamp, seqno_t seq
|
| 123 |
+
#ifdef DDS_HAS_SSM
|
| 124 |
+
, int favours_ssm
|
| 125 |
+
#endif
|
| 126 |
+
);
|
| 127 |
+
|
| 128 |
+
/* To delete a proxy writer or reader; these synchronously hide it
|
| 129 |
+
from the outside world, preventing it from being matched to a
|
| 130 |
+
reader or writer. Actual deletion is scheduled in the future, when
|
| 131 |
+
no outstanding references may still exist (determined by checking
|
| 132 |
+
thread progress, &c.). */
|
| 133 |
+
DDS_EXPORT int ddsi_delete_proxy_writer (struct ddsi_domaingv *gv, const struct ddsi_guid *guid, ddsrt_wctime_t timestamp, int isimplicit);
|
| 134 |
+
DDS_EXPORT int ddsi_delete_proxy_reader (struct ddsi_domaingv *gv, const struct ddsi_guid *guid, ddsrt_wctime_t timestamp, int isimplicit);
|
| 135 |
+
|
| 136 |
+
DDS_EXPORT void ddsi_update_proxy_reader (struct ddsi_proxy_reader *prd, seqno_t seq, struct addrset *as, const struct dds_qos *xqos, ddsrt_wctime_t timestamp);
|
| 137 |
+
DDS_EXPORT void ddsi_update_proxy_writer (struct ddsi_proxy_writer *pwr, seqno_t seq, struct addrset *as, const struct dds_qos *xqos, ddsrt_wctime_t timestamp);
|
| 138 |
+
|
| 139 |
+
#if defined (__cplusplus)
|
| 140 |
+
}
|
| 141 |
+
#endif
|
| 142 |
+
|
| 143 |
+
#endif /* DDSI_PROXY_ENDPOINT_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_proxy_participant.h
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_PROXY_PARTICIPANT_H
|
| 13 |
+
#define DDSI_PROXY_PARTICIPANT_H
|
| 14 |
+
|
| 15 |
+
#include "dds/export.h"
|
| 16 |
+
#include "dds/features.h"
|
| 17 |
+
|
| 18 |
+
#include "dds/ddsrt/atomics.h"
|
| 19 |
+
#include "dds/ddsrt/avl.h"
|
| 20 |
+
#include "dds/ddsrt/fibheap.h"
|
| 21 |
+
#include "dds/ddsi/ddsi_domaingv.h"
|
| 22 |
+
#include "dds/ddsi/ddsi_entity.h"
|
| 23 |
+
#include "dds/ddsi/ddsi_topic.h"
|
| 24 |
+
|
| 25 |
+
#if defined (__cplusplus)
|
| 26 |
+
extern "C" {
|
| 27 |
+
#endif
|
| 28 |
+
|
| 29 |
+
struct lease;
|
| 30 |
+
struct ddsi_plist;
|
| 31 |
+
struct addrset;
|
| 32 |
+
struct ddsi_proxy_endpoint_common;
|
| 33 |
+
|
| 34 |
+
struct ddsi_proxy_participant
|
| 35 |
+
{
|
| 36 |
+
struct ddsi_entity_common e;
|
| 37 |
+
uint32_t refc; /* number of proxy endpoints (both user & built-in; not groups, they don't have a life of their own) */
|
| 38 |
+
nn_vendorid_t vendor; /* vendor code from discovery */
|
| 39 |
+
unsigned bes; /* built-in endpoint set */
|
| 40 |
+
ddsi_guid_t privileged_pp_guid; /* if this PP depends on another PP for its SEDP writing */
|
| 41 |
+
struct ddsi_plist *plist; /* settings/QoS for this participant */
|
| 42 |
+
ddsrt_atomic_voidp_t minl_auto; /* clone of min(leaseheap_auto) */
|
| 43 |
+
ddsrt_fibheap_t leaseheap_auto; /* keeps leases for this proxypp and leases for pwrs (with liveliness automatic) */
|
| 44 |
+
ddsrt_atomic_voidp_t minl_man; /* clone of min(leaseheap_man) */
|
| 45 |
+
ddsrt_fibheap_t leaseheap_man; /* keeps leases for this proxypp and leases for pwrs (with liveliness manual-by-participant) */
|
| 46 |
+
struct lease *lease; /* lease for this proxypp */
|
| 47 |
+
struct addrset *as_default; /* default address set to use for user data traffic */
|
| 48 |
+
struct addrset *as_meta; /* default address set to use for discovery traffic */
|
| 49 |
+
struct ddsi_proxy_endpoint_common *endpoints; /* all proxy endpoints can be reached from here */
|
| 50 |
+
#ifdef DDS_HAS_TOPIC_DISCOVERY
|
| 51 |
+
ddsrt_avl_tree_t topics;
|
| 52 |
+
#endif
|
| 53 |
+
seqno_t seq; /* sequence number of most recent SPDP message */
|
| 54 |
+
uint32_t receive_buffer_size; /* assumed size of receive buffer, used to limit bursts involving this proxypp */
|
| 55 |
+
unsigned implicitly_created : 1; /* participants are implicitly created for Cloud/Fog discovered endpoints */
|
| 56 |
+
unsigned is_ddsi2_pp: 1; /* if this is the federation-leader on the remote node */
|
| 57 |
+
unsigned minimal_bes_mode: 1;
|
| 58 |
+
unsigned lease_expired: 1;
|
| 59 |
+
unsigned deleting: 1;
|
| 60 |
+
unsigned proxypp_have_spdp: 1;
|
| 61 |
+
unsigned owns_lease: 1;
|
| 62 |
+
unsigned redundant_networking: 1; /* 1 iff requests receiving data on all advertised interfaces */
|
| 63 |
+
#ifdef DDS_HAS_SECURITY
|
| 64 |
+
nn_security_info_t security_info;
|
| 65 |
+
struct ddsi_proxy_participant_sec_attributes *sec_attr;
|
| 66 |
+
#endif
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
#ifdef DDS_HAS_TOPIC_DISCOVERY
|
| 70 |
+
extern const ddsrt_avl_treedef_t ddsi_proxypp_proxytp_treedef;
|
| 71 |
+
#endif
|
| 72 |
+
|
| 73 |
+
/* Set when this proxy participant is created implicitly and has to be deleted upon disappearance
|
| 74 |
+
of its last endpoint. FIXME: Currently there is a potential race with adding a new endpoint
|
| 75 |
+
in parallel to deleting the last remaining one. The endpoint will then be created, added to the
|
| 76 |
+
proxy participant and then both are deleted. With the current single-threaded discovery
|
| 77 |
+
this can only happen when it is all triggered by lease expiry. */
|
| 78 |
+
#define CF_IMPLICITLY_CREATED_PROXYPP (1 << 0)
|
| 79 |
+
/* Set when this proxy participant is a DDSI2 participant, to help Cloud figure out whom to send
|
| 80 |
+
discovery data when used in conjunction with the networking bridge */
|
| 81 |
+
#define CF_PARTICIPANT_IS_DDSI2 (1 << 1)
|
| 82 |
+
/* Set when this proxy participant is not to be announced on the built-in topics yet */
|
| 83 |
+
#define CF_PROXYPP_NO_SPDP (1 << 2)
|
| 84 |
+
|
| 85 |
+
int ddsi_update_proxy_participant_plist_locked (struct ddsi_proxy_participant *proxypp, seqno_t seq, const struct ddsi_plist *datap, ddsrt_wctime_t timestamp);
|
| 86 |
+
void ddsi_proxy_participant_reassign_lease (struct ddsi_proxy_participant *proxypp, struct lease *newlease);
|
| 87 |
+
void ddsi_purge_proxy_participants (struct ddsi_domaingv *gv, const ddsi_xlocator_t *loc, bool delete_from_as_disc);
|
| 88 |
+
int ddsi_ref_proxy_participant (struct ddsi_proxy_participant *proxypp, struct ddsi_proxy_endpoint_common *c);
|
| 89 |
+
void ddsi_unref_proxy_participant (struct ddsi_proxy_participant *proxypp, struct ddsi_proxy_endpoint_common *c);
|
| 90 |
+
void ddsi_proxy_participant_add_pwr_lease_locked (struct ddsi_proxy_participant * proxypp, const struct ddsi_proxy_writer * pwr);
|
| 91 |
+
void ddsi_proxy_participant_remove_pwr_lease_locked (struct ddsi_proxy_participant * proxypp, struct ddsi_proxy_writer * pwr);
|
| 92 |
+
|
| 93 |
+
/* To create or delete a new proxy participant: "guid" MUST have the
|
| 94 |
+
pre-defined participant entity id. Unlike ddsi_delete_participant (),
|
| 95 |
+
deleting a proxy participant will automatically delete all its
|
| 96 |
+
readers & writers. Delete removes the participant from a hash table
|
| 97 |
+
and schedules the actual deletion.
|
| 98 |
+
|
| 99 |
+
TODO: what about proxy participants without built-in endpoints?
|
| 100 |
+
*/
|
| 101 |
+
|
| 102 |
+
DDS_EXPORT bool ddsi_new_proxy_participant (struct ddsi_domaingv *gv, const struct ddsi_guid *guid, uint32_t bes, const struct ddsi_guid *privileged_pp_guid, struct addrset *as_default, struct addrset *as_meta, const struct ddsi_plist *plist, dds_duration_t tlease_dur, nn_vendorid_t vendor, unsigned custom_flags, ddsrt_wctime_t timestamp, seqno_t seq);
|
| 103 |
+
DDS_EXPORT int ddsi_delete_proxy_participant_by_guid (struct ddsi_domaingv *gv, const struct ddsi_guid *guid, ddsrt_wctime_t timestamp, int isimplicit);
|
| 104 |
+
|
| 105 |
+
#if defined (__cplusplus)
|
| 106 |
+
}
|
| 107 |
+
#endif
|
| 108 |
+
|
| 109 |
+
#endif /* DDSI_PROXY_PARTICIPANT_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_raweth.h
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_RAWETH_H
|
| 13 |
+
#define DDSI_RAWETH_H
|
| 14 |
+
|
| 15 |
+
#if defined (__cplusplus)
|
| 16 |
+
extern "C" {
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
int ddsi_raweth_init (struct ddsi_domaingv *gv);
|
| 20 |
+
|
| 21 |
+
#if defined (__cplusplus)
|
| 22 |
+
}
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_rhc.h
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_RHC_H
|
| 13 |
+
#define DDSI_RHC_H
|
| 14 |
+
|
| 15 |
+
#include <stddef.h>
|
| 16 |
+
#include <stdint.h>
|
| 17 |
+
#include <stdbool.h>
|
| 18 |
+
|
| 19 |
+
#include "dds/export.h"
|
| 20 |
+
#include "dds/features.h"
|
| 21 |
+
|
| 22 |
+
/* DDS_EXPORT inline i.c.w. __attributes__((visibility...)) and some compilers: */
|
| 23 |
+
#include "dds/ddsrt/attributes.h"
|
| 24 |
+
#include "dds/ddsrt/time.h"
|
| 25 |
+
#include "dds/ddsi/ddsi_guid.h"
|
| 26 |
+
|
| 27 |
+
#if defined (__cplusplus)
|
| 28 |
+
extern "C" {
|
| 29 |
+
#endif
|
| 30 |
+
|
| 31 |
+
struct dds_qos;
|
| 32 |
+
struct ddsi_rhc;
|
| 33 |
+
struct ddsi_tkmap_instance;
|
| 34 |
+
struct ddsi_serdata;
|
| 35 |
+
|
| 36 |
+
struct ddsi_writer_info
|
| 37 |
+
{
|
| 38 |
+
ddsi_guid_t guid;
|
| 39 |
+
bool auto_dispose;
|
| 40 |
+
int32_t ownership_strength;
|
| 41 |
+
uint64_t iid;
|
| 42 |
+
#ifdef DDS_HAS_LIFESPAN
|
| 43 |
+
ddsrt_mtime_t lifespan_exp;
|
| 44 |
+
#endif
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
typedef void (*ddsi_rhc_free_t) (struct ddsi_rhc *rhc);
|
| 48 |
+
typedef bool (*ddsi_rhc_store_t) (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk);
|
| 49 |
+
typedef void (*ddsi_rhc_unregister_wr_t) (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo);
|
| 50 |
+
typedef void (*ddsi_rhc_relinquish_ownership_t) (struct ddsi_rhc * __restrict rhc, const uint64_t wr_iid);
|
| 51 |
+
typedef void (*ddsi_rhc_set_qos_t) (struct ddsi_rhc *rhc, const struct dds_qos *qos);
|
| 52 |
+
|
| 53 |
+
struct ddsi_rhc_ops {
|
| 54 |
+
ddsi_rhc_store_t store;
|
| 55 |
+
ddsi_rhc_unregister_wr_t unregister_wr;
|
| 56 |
+
ddsi_rhc_relinquish_ownership_t relinquish_ownership;
|
| 57 |
+
ddsi_rhc_set_qos_t set_qos;
|
| 58 |
+
ddsi_rhc_free_t free;
|
| 59 |
+
};
|
| 60 |
+
|
| 61 |
+
struct ddsi_rhc {
|
| 62 |
+
const struct ddsi_rhc_ops *ops;
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
+
DDS_INLINE_EXPORT inline bool ddsi_rhc_store (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk) {
|
| 66 |
+
return rhc->ops->store (rhc, wrinfo, sample, tk);
|
| 67 |
+
}
|
| 68 |
+
DDS_INLINE_EXPORT inline void ddsi_rhc_unregister_wr (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo) {
|
| 69 |
+
rhc->ops->unregister_wr (rhc, wrinfo);
|
| 70 |
+
}
|
| 71 |
+
DDS_INLINE_EXPORT inline void ddsi_rhc_relinquish_ownership (struct ddsi_rhc * __restrict rhc, const uint64_t wr_iid) {
|
| 72 |
+
rhc->ops->relinquish_ownership (rhc, wr_iid);
|
| 73 |
+
}
|
| 74 |
+
DDS_INLINE_EXPORT inline void ddsi_rhc_set_qos (struct ddsi_rhc *rhc, const struct dds_qos *qos) {
|
| 75 |
+
rhc->ops->set_qos (rhc, qos);
|
| 76 |
+
}
|
| 77 |
+
DDS_INLINE_EXPORT inline void ddsi_rhc_free (struct ddsi_rhc *rhc) {
|
| 78 |
+
rhc->ops->free (rhc);
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
#if defined (__cplusplus)
|
| 82 |
+
}
|
| 83 |
+
#endif
|
| 84 |
+
|
| 85 |
+
#endif /* DDSI_RHC_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_security_exchange.h
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_SECURITY_EXCHANGE_H
|
| 13 |
+
#define DDSI_SECURITY_EXCHANGE_H
|
| 14 |
+
|
| 15 |
+
#include "dds/features.h"
|
| 16 |
+
|
| 17 |
+
#ifdef DDS_HAS_SECURITY
|
| 18 |
+
|
| 19 |
+
#if defined (__cplusplus)
|
| 20 |
+
extern "C" {
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
#include "dds/ddsi/q_rtps.h"
|
| 24 |
+
#include "dds/ddsi/q_radmin.h"
|
| 25 |
+
#include "dds/ddsi/ddsi_entity.h"
|
| 26 |
+
#include "dds/ddsi/ddsi_security_msg.h"
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
#define GMCLASSID_SECURITY_PARTICIPANT_CRYPTO_TOKENS "dds.sec.participant_crypto_tokens"
|
| 30 |
+
#define GMCLASSID_SECURITY_DATAWRITER_CRYPTO_TOKENS "dds.sec.datawriter_crypto_tokens"
|
| 31 |
+
#define GMCLASSID_SECURITY_DATAREADER_CRYPTO_TOKENS "dds.sec.datareader_crypto_tokens"
|
| 32 |
+
|
| 33 |
+
bool write_auth_handshake_message(const struct ddsi_participant *pp, const struct ddsi_proxy_participant *proxypp, nn_dataholderseq_t *mdata, bool request, const nn_message_identity_t *related_message_id);
|
| 34 |
+
void handle_auth_handshake_message(const struct receiver_state *rst, ddsi_entityid_t wr_entity_id, struct ddsi_serdata *sample);
|
| 35 |
+
void handle_crypto_exchange_message(const struct receiver_state *rst, struct ddsi_serdata *sample);
|
| 36 |
+
void auth_get_serialized_participant_data(struct ddsi_participant *pp, ddsi_octetseq_t *seq);
|
| 37 |
+
bool write_crypto_participant_tokens(const struct ddsi_participant *pp, const struct ddsi_proxy_participant *proxypp, const nn_dataholderseq_t *tokens);
|
| 38 |
+
bool write_crypto_writer_tokens(const struct ddsi_writer *wr, const struct ddsi_proxy_reader *prd, const nn_dataholderseq_t *tokens);
|
| 39 |
+
bool write_crypto_reader_tokens(const struct ddsi_reader *rd, const struct ddsi_proxy_writer *pwr, const nn_dataholderseq_t *tokens);
|
| 40 |
+
|
| 41 |
+
#if defined (__cplusplus)
|
| 42 |
+
}
|
| 43 |
+
#endif
|
| 44 |
+
|
| 45 |
+
#else /* DDS_HAS_SECURITY */
|
| 46 |
+
|
| 47 |
+
#define volatile_secure_data_filter NULL
|
| 48 |
+
|
| 49 |
+
#endif /* DDS_HAS_SECURITY */
|
| 50 |
+
|
| 51 |
+
#endif /* DDSI_SECURITY_EXCHANGE_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_security_msg.h
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_SECURITY_MSG_H
|
| 13 |
+
#define DDSI_SECURITY_MSG_H
|
| 14 |
+
|
| 15 |
+
#include "dds/features.h"
|
| 16 |
+
|
| 17 |
+
#ifdef DDS_HAS_SECURITY
|
| 18 |
+
|
| 19 |
+
#include "dds/ddsi/ddsi_plist.h"
|
| 20 |
+
#include "dds/ddsi/ddsi_guid.h"
|
| 21 |
+
#include "dds/ddsrt/retcode.h"
|
| 22 |
+
#include "dds/ddsrt/misc.h"
|
| 23 |
+
#include "dds/ddsi/ddsi_plist_generic.h"
|
| 24 |
+
|
| 25 |
+
#if defined (__cplusplus)
|
| 26 |
+
extern "C" {
|
| 27 |
+
#endif
|
| 28 |
+
|
| 29 |
+
struct ddsi_participant;
|
| 30 |
+
struct ddsi_writer;
|
| 31 |
+
struct ddsi_proxy_reader;
|
| 32 |
+
struct ddsi_serdata;
|
| 33 |
+
|
| 34 |
+
#define DDS_SECURITY_AUTH_REQUEST "dds.sec.auth_request"
|
| 35 |
+
#define DDS_SECURITY_AUTH_HANDSHAKE "dds.sec.auth"
|
| 36 |
+
|
| 37 |
+
#define DDS_SECURITY_AUTH_VERSION_MAJOR 1
|
| 38 |
+
#define DDS_SECURITY_AUTH_VERSION_MINOR 0
|
| 39 |
+
|
| 40 |
+
#define DDS_SECURITY_AUTH_TOKEN_CLASS_ID_BASE "DDS:Auth:PKI-DH:"
|
| 41 |
+
#define DDS_SECURITY_AUTH_TOKEN_CLASS_ID DDS_SECURITY_AUTH_TOKEN_CLASS_ID_BASE DDSRT_STRINGIFY(DDS_SECURITY_AUTH_VERSION_MAJOR) "." DDSRT_STRINGIFY(DDS_SECURITY_AUTH_VERSION_MINOR)
|
| 42 |
+
|
| 43 |
+
#define DDS_SECURITY_AUTH_REQUEST_TOKEN_CLASS_ID DDS_SECURITY_AUTH_TOKEN_CLASS_ID "+AuthReq"
|
| 44 |
+
#define DDS_SECURITY_AUTH_HANDSHAKE_REQUEST_TOKEN_ID DDS_SECURITY_AUTH_TOKEN_CLASS_ID "+Req"
|
| 45 |
+
#define DDS_SECURITY_AUTH_HANDSHAKE_REPLY_TOKEN_ID DDS_SECURITY_AUTH_TOKEN_CLASS_ID "+Reply"
|
| 46 |
+
#define DDS_SECURITY_AUTH_HANDSHAKE_FINAL_TOKEN_ID DDS_SECURITY_AUTH_TOKEN_CLASS_ID "+Final"
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
typedef struct nn_message_identity {
|
| 50 |
+
ddsi_guid_t source_guid;
|
| 51 |
+
seqno_t sequence_number;
|
| 52 |
+
} nn_message_identity_t;
|
| 53 |
+
|
| 54 |
+
typedef struct nn_participant_generic_message {
|
| 55 |
+
nn_message_identity_t message_identity;
|
| 56 |
+
nn_message_identity_t related_message_identity;
|
| 57 |
+
ddsi_guid_t destination_participant_guid;
|
| 58 |
+
ddsi_guid_t destination_endpoint_guid;
|
| 59 |
+
ddsi_guid_t source_endpoint_guid;
|
| 60 |
+
const char *message_class_id;
|
| 61 |
+
nn_dataholderseq_t message_data;
|
| 62 |
+
} nn_participant_generic_message_t;
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
/*
|
| 66 |
+
* The arguments are aliased in the resulting message structure.
|
| 67 |
+
* This means that the lifecycle of the arguments should be longer
|
| 68 |
+
* then that of the message.
|
| 69 |
+
*/
|
| 70 |
+
DDS_EXPORT void
|
| 71 |
+
nn_participant_generic_message_init(
|
| 72 |
+
nn_participant_generic_message_t *msg,
|
| 73 |
+
const ddsi_guid_t *wrguid,
|
| 74 |
+
seqno_t wrseq,
|
| 75 |
+
const ddsi_guid_t *dstpguid,
|
| 76 |
+
const ddsi_guid_t *dsteguid,
|
| 77 |
+
const ddsi_guid_t *srceguid,
|
| 78 |
+
const char *classid,
|
| 79 |
+
const nn_dataholderseq_t *mdata,
|
| 80 |
+
const nn_message_identity_t *rmid);
|
| 81 |
+
|
| 82 |
+
/*
|
| 83 |
+
* Aliased struct variables will not be freed.
|
| 84 |
+
*/
|
| 85 |
+
DDS_EXPORT void
|
| 86 |
+
nn_participant_generic_message_deinit(
|
| 87 |
+
nn_participant_generic_message_t *msg);
|
| 88 |
+
|
| 89 |
+
/*
|
| 90 |
+
* Some struct variables are aliased to the given buffer.
|
| 91 |
+
* This means that the lifecycle of the data buffer should be
|
| 92 |
+
* longer then that of the message.
|
| 93 |
+
*/
|
| 94 |
+
DDS_EXPORT dds_return_t
|
| 95 |
+
nn_participant_generic_message_deseralize(
|
| 96 |
+
nn_participant_generic_message_t *msg,
|
| 97 |
+
const unsigned char *data,
|
| 98 |
+
size_t len,
|
| 99 |
+
bool bswap);
|
| 100 |
+
|
| 101 |
+
DDS_EXPORT dds_return_t
|
| 102 |
+
nn_participant_generic_message_serialize(
|
| 103 |
+
const nn_participant_generic_message_t *msg,
|
| 104 |
+
unsigned char **data,
|
| 105 |
+
size_t *len);
|
| 106 |
+
|
| 107 |
+
DDS_EXPORT extern const enum pserop pserop_participant_generic_message[];
|
| 108 |
+
DDS_EXPORT extern const size_t pserop_participant_generic_message_nops;
|
| 109 |
+
|
| 110 |
+
DDS_EXPORT int
|
| 111 |
+
volatile_secure_data_filter(
|
| 112 |
+
struct ddsi_writer *wr,
|
| 113 |
+
struct ddsi_proxy_reader *prd,
|
| 114 |
+
struct ddsi_serdata *serdata);
|
| 115 |
+
|
| 116 |
+
#if defined (__cplusplus)
|
| 117 |
+
}
|
| 118 |
+
#endif
|
| 119 |
+
|
| 120 |
+
#endif
|
| 121 |
+
|
| 122 |
+
#endif /* DDSI_SECURITY_MSG_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_security_omg.h
ADDED
|
@@ -0,0 +1,1455 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_OMG_SECURITY_H
|
| 13 |
+
#define DDSI_OMG_SECURITY_H
|
| 14 |
+
|
| 15 |
+
#include "dds/features.h"
|
| 16 |
+
|
| 17 |
+
#include "dds/ddsrt/sync.h"
|
| 18 |
+
#include "dds/ddsrt/avl.h"
|
| 19 |
+
|
| 20 |
+
#include "dds/ddsi/ddsi_plist.h"
|
| 21 |
+
#include "dds/ddsi/ddsi_entity.h"
|
| 22 |
+
#include "dds/ddsi/ddsi_entity_match.h"
|
| 23 |
+
#include "dds/ddsi/ddsi_domaingv.h"
|
| 24 |
+
#include "dds/ddsi/q_radmin.h"
|
| 25 |
+
#include "dds/ddsi/q_xmsg.h"
|
| 26 |
+
#include "dds/ddsrt/retcode.h"
|
| 27 |
+
#include "dds/ddsrt/types.h"
|
| 28 |
+
#include "dds/ddsrt/sync.h"
|
| 29 |
+
#include "dds/ddsi/ddsi_xqos.h"
|
| 30 |
+
|
| 31 |
+
#ifdef DDS_HAS_SECURITY
|
| 32 |
+
#include "dds/security/dds_security_api.h"
|
| 33 |
+
#endif
|
| 34 |
+
|
| 35 |
+
#if defined (__cplusplus)
|
| 36 |
+
extern "C" {
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
typedef enum {
|
| 40 |
+
NN_RTPS_MSG_STATE_ERROR,
|
| 41 |
+
NN_RTPS_MSG_STATE_PLAIN,
|
| 42 |
+
NN_RTPS_MSG_STATE_ENCODED
|
| 43 |
+
} nn_rtps_msg_state_t;
|
| 44 |
+
|
| 45 |
+
struct ddsi_hsadmin;
|
| 46 |
+
struct participant_sec_attributes;
|
| 47 |
+
struct ddsi_proxy_participant_sec_attributes;
|
| 48 |
+
struct ddsi_writer_sec_attributes;
|
| 49 |
+
struct ddsi_reader_sec_attributes;
|
| 50 |
+
struct dds_security_context;
|
| 51 |
+
struct ddsi_topic;
|
| 52 |
+
struct ddsi_proxy_endpoint_common;
|
| 53 |
+
|
| 54 |
+
#ifdef DDS_HAS_SECURITY
|
| 55 |
+
|
| 56 |
+
typedef struct nn_msg_sec_info {
|
| 57 |
+
unsigned encoded:1;
|
| 58 |
+
unsigned use_rtps_encoding:1;
|
| 59 |
+
int64_t src_pp_handle;
|
| 60 |
+
int64_t dst_pp_handle;
|
| 61 |
+
} nn_msg_sec_info_t;
|
| 62 |
+
|
| 63 |
+
struct pp_proxypp_match {
|
| 64 |
+
ddsrt_avl_node_t avlnode;
|
| 65 |
+
ddsi_guid_t proxypp_guid;
|
| 66 |
+
DDS_Security_ParticipantCryptoHandle proxypp_crypto_handle;
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
struct proxypp_pp_match {
|
| 70 |
+
ddsrt_avl_node_t avlnode;
|
| 71 |
+
ddsi_guid_t pp_guid;
|
| 72 |
+
DDS_Security_ParticipantCryptoHandle pp_crypto_handle;
|
| 73 |
+
DDS_Security_PermissionsHandle permissions_handle;
|
| 74 |
+
DDS_Security_SharedSecretHandle shared_secret;
|
| 75 |
+
bool authenticated;
|
| 76 |
+
};
|
| 77 |
+
|
| 78 |
+
struct participant_sec_attributes {
|
| 79 |
+
ddsrt_avl_node_t avlnode;
|
| 80 |
+
ddsi_guid_t pp_guid;
|
| 81 |
+
DDS_Security_ParticipantSecurityAttributes attr;
|
| 82 |
+
DDS_Security_IdentityHandle local_identity_handle;
|
| 83 |
+
DDS_Security_PermissionsHandle permissions_handle;
|
| 84 |
+
DDS_Security_ParticipantCryptoHandle crypto_handle;
|
| 85 |
+
bool plugin_attr;
|
| 86 |
+
ddsrt_mutex_t lock;
|
| 87 |
+
ddsrt_avl_ctree_t proxy_participants;
|
| 88 |
+
bool initialized;
|
| 89 |
+
};
|
| 90 |
+
|
| 91 |
+
struct ddsi_proxy_participant_sec_attributes {
|
| 92 |
+
struct dds_security_context *sc;
|
| 93 |
+
DDS_Security_IdentityHandle remote_identity_handle;
|
| 94 |
+
DDS_Security_ParticipantCryptoHandle crypto_handle;
|
| 95 |
+
ddsrt_mutex_t lock;
|
| 96 |
+
ddsrt_avl_tree_t participants;
|
| 97 |
+
bool initialized;
|
| 98 |
+
};
|
| 99 |
+
|
| 100 |
+
struct ddsi_writer_sec_attributes {
|
| 101 |
+
DDS_Security_EndpointSecurityAttributes attr;
|
| 102 |
+
DDS_Security_DatawriterCryptoHandle crypto_handle;
|
| 103 |
+
bool plugin_attr;
|
| 104 |
+
};
|
| 105 |
+
|
| 106 |
+
struct ddsi_reader_sec_attributes {
|
| 107 |
+
DDS_Security_EndpointSecurityAttributes attr;
|
| 108 |
+
DDS_Security_DatareaderCryptoHandle crypto_handle;
|
| 109 |
+
bool plugin_attr;
|
| 110 |
+
};
|
| 111 |
+
|
| 112 |
+
DDS_EXPORT struct dds_security_access_control *q_omg_participant_get_access_control(const struct ddsi_participant *pp);
|
| 113 |
+
DDS_EXPORT struct dds_security_authentication *q_omg_participant_get_authentication(const struct ddsi_participant *pp);
|
| 114 |
+
DDS_EXPORT struct dds_security_cryptography *q_omg_participant_get_cryptography(const struct ddsi_participant *pp);
|
| 115 |
+
|
| 116 |
+
void q_omg_vlog_exception(const struct ddsrt_log_cfg *lc, uint32_t cat, DDS_Security_SecurityException *exception, const char *file, uint32_t line, const char *func, const char *fmt, va_list ap);
|
| 117 |
+
void q_omg_log_exception(const struct ddsrt_log_cfg *lc, uint32_t cat, DDS_Security_SecurityException *exception, const char *file, uint32_t line, const char *func, const char *fmt, ...);
|
| 118 |
+
|
| 119 |
+
/**
|
| 120 |
+
* @brief Check if access control is enabled for the participant.
|
| 121 |
+
*
|
| 122 |
+
* @param[in] pp Participant to check.
|
| 123 |
+
*
|
| 124 |
+
* @returns bool True if access control is enabled for participant
|
| 125 |
+
*/
|
| 126 |
+
bool q_omg_participant_is_access_protected(const struct ddsi_participant *pp);
|
| 127 |
+
|
| 128 |
+
/**
|
| 129 |
+
* @brief Check if protection at RTPS level is enabled for the participant.
|
| 130 |
+
*
|
| 131 |
+
* @param[in] pp Participant to check.
|
| 132 |
+
*
|
| 133 |
+
* @returns bool True if RTPS protection enabled for participant
|
| 134 |
+
*/
|
| 135 |
+
bool q_omg_participant_is_rtps_protected(const struct ddsi_participant *pp);
|
| 136 |
+
|
| 137 |
+
/**
|
| 138 |
+
* @brief Check if liveliness is protected for the participant.
|
| 139 |
+
*
|
| 140 |
+
* @param[in] pp Participant to check.
|
| 141 |
+
*
|
| 142 |
+
* @returns bool True if liveliness data for participant is protected
|
| 143 |
+
*/
|
| 144 |
+
bool q_omg_participant_is_liveliness_protected(const struct ddsi_participant *pp);
|
| 145 |
+
|
| 146 |
+
/**
|
| 147 |
+
* @brief Check if discovery is protected for the participant.
|
| 148 |
+
*
|
| 149 |
+
* @param[in] pp Participant to check.
|
| 150 |
+
*
|
| 151 |
+
* @returns bool True if discovery data for participant is protected
|
| 152 |
+
*/
|
| 153 |
+
bool q_omg_participant_is_discovery_protected(const struct ddsi_participant *pp);
|
| 154 |
+
|
| 155 |
+
/**
|
| 156 |
+
* @brief Check if security is enabled for the participant.
|
| 157 |
+
*
|
| 158 |
+
* @param[in] pp Participant to check if it is secure.
|
| 159 |
+
*
|
| 160 |
+
* @returns bool True if participant is secure
|
| 161 |
+
*/
|
| 162 |
+
bool q_omg_participant_is_secure(const struct ddsi_participant *pp);
|
| 163 |
+
|
| 164 |
+
/**
|
| 165 |
+
* @brief Check if security is enabled for the proxy participant.
|
| 166 |
+
*
|
| 167 |
+
* @param[in] proxypp Proxy participant to check if it is secure.
|
| 168 |
+
*
|
| 169 |
+
* @returns bool True if proxy participant is secure
|
| 170 |
+
*/
|
| 171 |
+
bool q_omg_proxy_participant_is_secure(const struct ddsi_proxy_participant *proxypp);
|
| 172 |
+
|
| 173 |
+
/**
|
| 174 |
+
* @brief Check security if it is allowed to create the participant.
|
| 175 |
+
*
|
| 176 |
+
* When security is enabled for this participant it is checked if the
|
| 177 |
+
* participant is authenticated by checking the provided security
|
| 178 |
+
* certificates. When that is ok the participant is registered with
|
| 179 |
+
* access control and with cryptography. When that is all successful
|
| 180 |
+
* this function return true;
|
| 181 |
+
*
|
| 182 |
+
* @param[in] pp The participant to check if alloweed by security.
|
| 183 |
+
* #param[in] domain_id The domain_id
|
| 184 |
+
*
|
| 185 |
+
* @returns dds_return_t
|
| 186 |
+
* @retval DDS_RETCODE_OK Participant is allowed
|
| 187 |
+
* @retval DDS_RETCODE_NOT_ALLOWED_BY_SECURITY
|
| 188 |
+
* Participant is not allowed
|
| 189 |
+
*/
|
| 190 |
+
dds_return_t q_omg_security_check_create_participant(struct ddsi_participant *pp, uint32_t domain_id);
|
| 191 |
+
|
| 192 |
+
void q_omg_security_participant_set_initialized(struct ddsi_participant *pp);
|
| 193 |
+
|
| 194 |
+
bool q_omg_security_participant_is_initialized(struct ddsi_participant *pp);
|
| 195 |
+
|
| 196 |
+
/**
|
| 197 |
+
* @brief Remove the participant from the security plugins.
|
| 198 |
+
*
|
| 199 |
+
* When the participant was registered with the security
|
| 200 |
+
* plugins then this function will release the allocated
|
| 201 |
+
* security resources.
|
| 202 |
+
*
|
| 203 |
+
* @param[in] pp Participant to remove.
|
| 204 |
+
*/
|
| 205 |
+
void q_omg_security_deregister_participant(struct ddsi_participant *pp);
|
| 206 |
+
|
| 207 |
+
/**
|
| 208 |
+
* @brief Get the identity handle associate with this participant.
|
| 209 |
+
*
|
| 210 |
+
* This function returns the identity handle that was created
|
| 211 |
+
* when the participant was authenticated. This handle corresponds
|
| 212 |
+
* with the handle returned by calling validate_local_identity on
|
| 213 |
+
* the authentication plugin.
|
| 214 |
+
*
|
| 215 |
+
* @param[in] pp Participant to check if it is secure.
|
| 216 |
+
*
|
| 217 |
+
* @returns int64_t
|
| 218 |
+
* @retval !0 Identity handle associated with the participant.
|
| 219 |
+
* @retval 0 Invalid handle the participant was not registered
|
| 220 |
+
*/
|
| 221 |
+
int64_t q_omg_security_get_local_participant_handle(const struct ddsi_participant *pp);
|
| 222 |
+
|
| 223 |
+
/**
|
| 224 |
+
* @brief Get security info flags of the given participant.
|
| 225 |
+
*
|
| 226 |
+
* @param[in] pp Participant to get the security info from.
|
| 227 |
+
* @param[out] info The security info.
|
| 228 |
+
*
|
| 229 |
+
* @returns bool
|
| 230 |
+
* @retval true Security info set.
|
| 231 |
+
* @retval false Security info not set.
|
| 232 |
+
*/
|
| 233 |
+
bool q_omg_get_participant_security_info(const struct ddsi_participant *pp, nn_security_info_t *info);
|
| 234 |
+
|
| 235 |
+
/**
|
| 236 |
+
* @brief Get the is_rtps_protected flag of the given remote participant.
|
| 237 |
+
*
|
| 238 |
+
* @param[in] pp The participant.
|
| 239 |
+
* @param[in] entityid ID of the entity to check.
|
| 240 |
+
*
|
| 241 |
+
* @returns bool
|
| 242 |
+
* @retval true RTPS protected is set.
|
| 243 |
+
* @retval false RTPS protected is not set.
|
| 244 |
+
*/
|
| 245 |
+
bool q_omg_security_is_local_rtps_protected(const struct ddsi_participant *pp, ddsi_entityid_t entityid);
|
| 246 |
+
|
| 247 |
+
/**
|
| 248 |
+
* @brief Check if the participant and the proxy participant
|
| 249 |
+
* have compatible security info settings.
|
| 250 |
+
*
|
| 251 |
+
* Associated with a secure participant is the ParticipantSecurityInfo parameter.
|
| 252 |
+
* This parameter contains the setting of the security attributes and the associated
|
| 253 |
+
* plugin security attributes of the secure participant.
|
| 254 |
+
* This function will check if the received ParticipantSecurityInfo parameter is
|
| 255 |
+
* compatible with the local ParticipantSecurityInfo parameter.
|
| 256 |
+
*
|
| 257 |
+
* @param[in] pp The participant.
|
| 258 |
+
* @param[in] proxypp The proxy participant.
|
| 259 |
+
*
|
| 260 |
+
* @returns bool
|
| 261 |
+
* @retval true The participant and the proxy participant have compatible
|
| 262 |
+
* security info settings.
|
| 263 |
+
* @retval false Otherwise.
|
| 264 |
+
*/
|
| 265 |
+
bool q_omg_is_similar_participant_security_info(struct ddsi_participant *pp, struct ddsi_proxy_participant *proxypp);
|
| 266 |
+
|
| 267 |
+
/**
|
| 268 |
+
* @brief Check if the parameter list key hash is protected
|
| 269 |
+
*
|
| 270 |
+
* @param[in] plist The parameter list
|
| 271 |
+
*
|
| 272 |
+
* @returns bool True if the parameter list key hash is protected
|
| 273 |
+
*/
|
| 274 |
+
bool q_omg_plist_keyhash_is_protected(const ddsi_plist_t *plist);
|
| 275 |
+
|
| 276 |
+
/**
|
| 277 |
+
* @brief Check if the endpoint is protected
|
| 278 |
+
*
|
| 279 |
+
* Checks whether the provided parameter list has the flag
|
| 280 |
+
* ENDPOINT_SECURITY_ATTRIBUTES_FLAG_IS_VALID set. When this flag
|
| 281 |
+
* is set, this implies that the remote endpoint has protection
|
| 282 |
+
* enabled.
|
| 283 |
+
*
|
| 284 |
+
* @param[in] plist The parameter list
|
| 285 |
+
*
|
| 286 |
+
* @returns bool True if the endpoint is protected
|
| 287 |
+
*/
|
| 288 |
+
bool q_omg_is_endpoint_protected(const ddsi_plist_t *plist);
|
| 289 |
+
|
| 290 |
+
/**
|
| 291 |
+
* @brief Writes the security attributes and security plugin attributes to log (category discovery)
|
| 292 |
+
*
|
| 293 |
+
* @param[in] gv Global variable
|
| 294 |
+
* @param[in] plist The parameter list
|
| 295 |
+
*/
|
| 296 |
+
void q_omg_log_endpoint_protection(struct ddsi_domaingv * const gv, const ddsi_plist_t *plist);
|
| 297 |
+
|
| 298 |
+
/**
|
| 299 |
+
* @brief Check if security allows to create the topic.
|
| 300 |
+
*
|
| 301 |
+
* This function checks with access control if is allowed to create
|
| 302 |
+
* this topic for the specified domain.
|
| 303 |
+
*
|
| 304 |
+
* @param[in] gv The domain global information.
|
| 305 |
+
* @param[in] pp_guid The participant guid.
|
| 306 |
+
* @param[in] topic_name The name of the topic.
|
| 307 |
+
* @param[in] qos The topic QoS used.
|
| 308 |
+
*
|
| 309 |
+
* @returns bool
|
| 310 |
+
* @retval true Creation of the topic is allowed
|
| 311 |
+
* @retval false Otherwise.
|
| 312 |
+
*/
|
| 313 |
+
bool q_omg_security_check_create_topic(const struct ddsi_domaingv *gv, const ddsi_guid_t *pp_guid, const char *topic_name, const struct dds_qos *qos);
|
| 314 |
+
|
| 315 |
+
/**
|
| 316 |
+
* @brief Get security info flags of the given writer.
|
| 317 |
+
*
|
| 318 |
+
* @param[in] wr Writer to get the security info from.
|
| 319 |
+
* @param[out] info The security info.
|
| 320 |
+
*
|
| 321 |
+
* @returns bool
|
| 322 |
+
* @retval true Security info set.
|
| 323 |
+
* @retval false Security info not set (probably unsecure writer).
|
| 324 |
+
*/
|
| 325 |
+
bool q_omg_get_writer_security_info(const struct ddsi_writer *wr, nn_security_info_t *info);
|
| 326 |
+
|
| 327 |
+
/**
|
| 328 |
+
* @brief Return the builtin writer id for this writers' discovery.
|
| 329 |
+
*
|
| 330 |
+
* Return builtin entity id of the writer to use for the publication
|
| 331 |
+
* discovery information.
|
| 332 |
+
* Depending on whether the discovery is protected or not (for the
|
| 333 |
+
* given writer), either the default writer or protected writer needs
|
| 334 |
+
* to be used.
|
| 335 |
+
*
|
| 336 |
+
* @param[in] wr Writer to determine the publication writer from.
|
| 337 |
+
*
|
| 338 |
+
* @returns unsigned
|
| 339 |
+
* @retval NN_ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
|
| 340 |
+
* @retval NN_ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER
|
| 341 |
+
*/
|
| 342 |
+
unsigned determine_publication_writer(const struct ddsi_writer *wr);
|
| 343 |
+
|
| 344 |
+
/**
|
| 345 |
+
* @brief Check if security allows to create the writer.
|
| 346 |
+
*
|
| 347 |
+
* This function checks with access control if is allowed to create
|
| 348 |
+
* this writer for the specified domain.
|
| 349 |
+
*
|
| 350 |
+
* @param[in] pp Participant on which the topic is being created.
|
| 351 |
+
* @param[in] domain_id The corresponding domain_id.
|
| 352 |
+
* @param[in] topic_name The name of the topic.
|
| 353 |
+
* @param[in] writer_qos The writer QoS used.
|
| 354 |
+
*
|
| 355 |
+
* @returns bool
|
| 356 |
+
* @retval true Creation of the writer is allowed
|
| 357 |
+
* @retval false Otherwise.
|
| 358 |
+
*/
|
| 359 |
+
bool q_omg_security_check_create_writer(struct ddsi_participant *pp, uint32_t domain_id, const char *topic_name, const struct dds_qos *writer_qos);
|
| 360 |
+
|
| 361 |
+
/**
|
| 362 |
+
* @brief Register the writer with security.
|
| 363 |
+
*
|
| 364 |
+
* This function registers the writer with security
|
| 365 |
+
* when the associated participant has security enabled.
|
| 366 |
+
* The security settings associated with this writer are determined
|
| 367 |
+
* and the writer is registered with cryptography when needed by
|
| 368 |
+
* the security settings which indicate if payload protection and or
|
| 369 |
+
* submessage protection is enabled for this writer.
|
| 370 |
+
*
|
| 371 |
+
* @param[in] wr The writer to register.
|
| 372 |
+
*/
|
| 373 |
+
void q_omg_security_register_writer(struct ddsi_writer *wr);
|
| 374 |
+
|
| 375 |
+
/**
|
| 376 |
+
* @brief Remove the writer from security.
|
| 377 |
+
*
|
| 378 |
+
* When the writer was registered with security then this function
|
| 379 |
+
* will remove the writer from security which will free the allocated
|
| 380 |
+
* security resource created for this writer.
|
| 381 |
+
*
|
| 382 |
+
* @param[in] wr The writer to remove.
|
| 383 |
+
*/
|
| 384 |
+
void q_omg_security_deregister_writer(struct ddsi_writer *wr);
|
| 385 |
+
|
| 386 |
+
/**
|
| 387 |
+
* @brief Get security info flags of the given reader.
|
| 388 |
+
*
|
| 389 |
+
* @param[in] rd Reader to get the security info from.
|
| 390 |
+
* @param[out] info The security info.
|
| 391 |
+
*
|
| 392 |
+
* @returns bool
|
| 393 |
+
* @retval true Security info set.
|
| 394 |
+
* @retval false Security info not set (probably unsecure reader).
|
| 395 |
+
*/
|
| 396 |
+
bool q_omg_get_reader_security_info(const struct ddsi_reader *rd, nn_security_info_t *info);
|
| 397 |
+
|
| 398 |
+
/**
|
| 399 |
+
* @brief Return the builtin writer id for this readers' discovery.
|
| 400 |
+
*
|
| 401 |
+
* Return builtin entity id of the writer to use for the subscription
|
| 402 |
+
* discovery information.
|
| 403 |
+
* Depending on whether the discovery is protected or not (for the
|
| 404 |
+
* given reader), either the default writer or protected writer needs
|
| 405 |
+
* to be used.
|
| 406 |
+
*
|
| 407 |
+
* @param[in] rd Reader to determine the subscription writer from.
|
| 408 |
+
*
|
| 409 |
+
* @returns unsigned
|
| 410 |
+
* @retval NN_ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
|
| 411 |
+
* @retval NN_ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER
|
| 412 |
+
*/
|
| 413 |
+
unsigned determine_subscription_writer(const struct ddsi_reader *rd);
|
| 414 |
+
|
| 415 |
+
#ifdef DDS_HAS_TOPIC_DISCOVERY
|
| 416 |
+
/**
|
| 417 |
+
* @brief Return the builtin writer id for topic discovery.
|
| 418 |
+
*
|
| 419 |
+
* Return builtin entity id of the writer to use for the topic
|
| 420 |
+
* discovery information.
|
| 421 |
+
*
|
| 422 |
+
* @param[in] tp Topic to determine the writer from.
|
| 423 |
+
*
|
| 424 |
+
* @returns unsigned
|
| 425 |
+
* @retval NN_ENTITYID_SEDP_BUILTIN_TOPIC_WRITER
|
| 426 |
+
*/
|
| 427 |
+
unsigned determine_topic_writer(const struct ddsi_topic *tp);
|
| 428 |
+
#endif /* DDS_HAS_TOPIC_DISCOVERY */
|
| 429 |
+
|
| 430 |
+
/**
|
| 431 |
+
* @brief Check if security allows to create the reader.
|
| 432 |
+
*
|
| 433 |
+
* This function checks with access control if is allowed to create
|
| 434 |
+
* this reader for the specified domain.
|
| 435 |
+
*
|
| 436 |
+
* @param[in] pp Participant on which the topic is being created.
|
| 437 |
+
* @param[in] domain_id The corresponding domain_id.
|
| 438 |
+
* @param[in] topic_name The name of the topic.
|
| 439 |
+
* @param[in] reader_qos The reader QoS used.
|
| 440 |
+
*
|
| 441 |
+
* @returns bool
|
| 442 |
+
* @retval true Creation of the writer is allowed
|
| 443 |
+
* @retval false Otherwise.
|
| 444 |
+
*/
|
| 445 |
+
bool q_omg_security_check_create_reader(struct ddsi_participant *pp, uint32_t domain_id, const char *topic_name, const struct dds_qos *reader_qos);
|
| 446 |
+
|
| 447 |
+
/**
|
| 448 |
+
* @brief Register the reader with security.
|
| 449 |
+
*
|
| 450 |
+
* This function registers the reader with security
|
| 451 |
+
* when the associated participant has security enabled.
|
| 452 |
+
* The security settings associated with this reader are determined
|
| 453 |
+
* and the reader is registered with cryptography when needed by
|
| 454 |
+
* the security settings which indicate if submessage protection is
|
| 455 |
+
* enabled for this reader.
|
| 456 |
+
*
|
| 457 |
+
* @param[in] rd The reader to register.
|
| 458 |
+
*/
|
| 459 |
+
void q_omg_security_register_reader(struct ddsi_reader *rd);
|
| 460 |
+
|
| 461 |
+
/**
|
| 462 |
+
* @brief Remove the reader from security.
|
| 463 |
+
*
|
| 464 |
+
* When the reader was registered with security then this function
|
| 465 |
+
* will remove the reader from security which will free the allocated
|
| 466 |
+
* security resource created for this reader.
|
| 467 |
+
*
|
| 468 |
+
* @param[in] rd The reader to remove.
|
| 469 |
+
*/
|
| 470 |
+
void q_omg_security_deregister_reader(struct ddsi_reader *rd);
|
| 471 |
+
|
| 472 |
+
/**
|
| 473 |
+
* @brief Determine if the proxy participant is allowed to be deleted
|
| 474 |
+
* by the given writer.
|
| 475 |
+
*
|
| 476 |
+
* If an proxy participant is authenticated, it is only allowed to
|
| 477 |
+
* to deleted when a dispose is received from the proper protected
|
| 478 |
+
* discovery writer.
|
| 479 |
+
*
|
| 480 |
+
* @param[in] gv Used for tracing.
|
| 481 |
+
* @param[in] guid Guid of the proxy participant to be deleted.
|
| 482 |
+
* @param[in] pwr_entityid Writer that send the dispose.
|
| 483 |
+
*
|
| 484 |
+
* @returns bool
|
| 485 |
+
* @retval true The proxy participant may be deleted.
|
| 486 |
+
* @retval false The proxy participant may not be deleted by this writer.
|
| 487 |
+
*/
|
| 488 |
+
bool is_proxy_participant_deletion_allowed(struct ddsi_domaingv * const gv, const struct ddsi_guid *guid, const ddsi_entityid_t pwr_entityid);
|
| 489 |
+
|
| 490 |
+
/**
|
| 491 |
+
* @brief Determine if the messages, related to the given remote
|
| 492 |
+
* entity, are RTPS protected or not.
|
| 493 |
+
*
|
| 494 |
+
* @param[in] proxy_pp Related proxy participant.
|
| 495 |
+
* @param[in] entityid ID of the entity to check.
|
| 496 |
+
*
|
| 497 |
+
* @returns bool
|
| 498 |
+
* @retval true The entity messages are RTPS protected.
|
| 499 |
+
* @retval false The entity messages are not RTPS protected.
|
| 500 |
+
*/
|
| 501 |
+
bool q_omg_security_is_remote_rtps_protected(const struct ddsi_proxy_participant *proxy_pp, ddsi_entityid_t entityid);
|
| 502 |
+
|
| 503 |
+
/**
|
| 504 |
+
* @brief Set security information, depending on plist, into the given
|
| 505 |
+
* proxy participant.
|
| 506 |
+
*
|
| 507 |
+
* @param[in] proxypp Proxy participant to set security info on.
|
| 508 |
+
* @param[in] plist Paramater list, possibly contains security info.
|
| 509 |
+
*/
|
| 510 |
+
void set_proxy_participant_security_info(struct ddsi_proxy_participant *proxypp, const ddsi_plist_t *plist);
|
| 511 |
+
|
| 512 |
+
/**
|
| 513 |
+
* @brief Determine if the messages, related to the given remote
|
| 514 |
+
* entity, are RTPS protected or not.
|
| 515 |
+
*
|
| 516 |
+
* @param[in] pp The participant.
|
| 517 |
+
* @param[in] entityid ID of the entity to check.
|
| 518 |
+
*
|
| 519 |
+
* @returns bool
|
| 520 |
+
* @retval true The entity messages are RTPS protected.
|
| 521 |
+
* @retval false The entity messages are not RTPS protected.
|
| 522 |
+
*/
|
| 523 |
+
bool q_omg_security_is_local_rtps_protected(const struct ddsi_participant *pp, ddsi_entityid_t entityid);
|
| 524 |
+
|
| 525 |
+
/**
|
| 526 |
+
* @brief Check if the participant allows communication with unauthenticated
|
| 527 |
+
* participants
|
| 528 |
+
*
|
| 529 |
+
* @param[in] pp The participant.
|
| 530 |
+
*
|
| 531 |
+
* @returns bool
|
| 532 |
+
* @retval true The participant allows unauthenticated communication
|
| 533 |
+
* @retval false Otherwise.
|
| 534 |
+
*/
|
| 535 |
+
bool q_omg_participant_allow_unauthenticated(struct ddsi_participant *pp);
|
| 536 |
+
|
| 537 |
+
/**
|
| 538 |
+
* @brief Initialize the proxy participant security attributes
|
| 539 |
+
*
|
| 540 |
+
* @param[in] proxypp The proxy participant.
|
| 541 |
+
*
|
| 542 |
+
*/
|
| 543 |
+
void q_omg_security_init_remote_participant(struct ddsi_proxy_participant *proxypp);
|
| 544 |
+
|
| 545 |
+
void q_omg_security_remote_participant_set_initialized(struct ddsi_proxy_participant *proxypp);
|
| 546 |
+
|
| 547 |
+
bool q_omg_security_remote_participant_is_initialized(struct ddsi_proxy_participant *proxypp);
|
| 548 |
+
|
| 549 |
+
/**
|
| 550 |
+
* @brief Registers the matched proxy participant with the crypto plugin
|
| 551 |
+
*
|
| 552 |
+
* When the proxy participant is authenticated and allowed by access control then the match between the local and
|
| 553 |
+
* the remote participant must be registered with the cypto factory provided by the crypto plugin. The
|
| 554 |
+
* shared secret handle obtained from the authentication phase and the permission handle returned when validating
|
| 555 |
+
* the proxy participant with access control plugin have to be provided.
|
| 556 |
+
*
|
| 557 |
+
*
|
| 558 |
+
* @param[in] pp The participant.
|
| 559 |
+
* @param[in] proxypp The proxy participant.
|
| 560 |
+
* @param[in] shared_secret The shared_secret handle.
|
| 561 |
+
*
|
| 562 |
+
* @returns bool
|
| 563 |
+
* @retval true The proxy participant is allowed.
|
| 564 |
+
* @retval false The proxy participant is not allowed.
|
| 565 |
+
*/
|
| 566 |
+
bool q_omg_security_register_remote_participant(struct ddsi_participant *pp, struct ddsi_proxy_participant *proxypp, int64_t shared_secret);
|
| 567 |
+
|
| 568 |
+
/**
|
| 569 |
+
* @brief Sets the matching participant and proxy participant as authorized.
|
| 570 |
+
*
|
| 571 |
+
* When the authentication handshake has finished successfully and the
|
| 572 |
+
* volatile secure readers and writers are matched then with this function
|
| 573 |
+
* the matching local and remote participant are set to authenticated which
|
| 574 |
+
* allows the crypto tokens to be exchanged and the corresponding entities
|
| 575 |
+
* be matched.
|
| 576 |
+
*
|
| 577 |
+
* @param[in] pp The participant.
|
| 578 |
+
* @param[in] proxypp The proxy participant.
|
| 579 |
+
*/
|
| 580 |
+
void q_omg_security_set_remote_participant_authenticated(struct ddsi_participant *pp, struct ddsi_proxy_participant *proxypp);
|
| 581 |
+
|
| 582 |
+
/**
|
| 583 |
+
* @brief Removes a registered proxy participant from administation of the authentication,
|
| 584 |
+
* access control and crypto plugins.
|
| 585 |
+
*
|
| 586 |
+
* @param[in] proxypp The proxy participant.
|
| 587 |
+
*/
|
| 588 |
+
void q_omg_security_deregister_remote_participant(struct ddsi_proxy_participant *proxypp);
|
| 589 |
+
|
| 590 |
+
/**
|
| 591 |
+
* @brief Generate and send the crypto tokens needed for encoding RTPS messages.
|
| 592 |
+
*
|
| 593 |
+
* When the security settings indicate that RTPS message encoding or signing is
|
| 594 |
+
* configured for the participant then this function will ask the cypto echange for
|
| 595 |
+
* the corresponding cypto tokens and send these to the proxy participant.
|
| 596 |
+
*
|
| 597 |
+
* @param[in] pp The participant.
|
| 598 |
+
* @param[in] proxypp The proxy participant.
|
| 599 |
+
*/
|
| 600 |
+
void q_omg_security_participant_send_tokens(struct ddsi_participant *pp, struct ddsi_proxy_participant *proxypp);
|
| 601 |
+
|
| 602 |
+
/**
|
| 603 |
+
* @brief Get the cypto handle associated with the proxy participant.
|
| 604 |
+
*
|
| 605 |
+
* This function returns the handle which is the association between
|
| 606 |
+
* the proxy participant and the crypto plugin. This handle is created
|
| 607 |
+
* when the proxy participant is registered with the crypto plugin.
|
| 608 |
+
*
|
| 609 |
+
* @param[in] proxypp The proxy participant.
|
| 610 |
+
*
|
| 611 |
+
* @returns handle
|
| 612 |
+
* @retval !0 Valid crypto handle associated with the proxy participant.
|
| 613 |
+
* @retval 0 Otherwise.
|
| 614 |
+
*/
|
| 615 |
+
int64_t q_omg_security_get_remote_participant_handle(struct ddsi_proxy_participant *proxypp);
|
| 616 |
+
|
| 617 |
+
/**
|
| 618 |
+
* @brief Set the crypto tokens used for the encryption and decryption of RTPS messages.
|
| 619 |
+
*
|
| 620 |
+
* The remote participant will send the crypto tokens when the security settings determine that the
|
| 621 |
+
* communication between the participants must be secure. These tokens are used for the necryption and
|
| 622 |
+
* decryption of complete RTPS messages. When these tokens are received this function will register these tokens
|
| 623 |
+
* with the crypto plugin. The crypto plugin will return a crypto handle that will be used to associate the
|
| 624 |
+
* stored tokens with the remote participant.
|
| 625 |
+
*
|
| 626 |
+
* @param[in] pp The local participant.
|
| 627 |
+
* @param[in] proxypp The remote participant.
|
| 628 |
+
* @param[in] tokens The crypto token received from the remote participant for the local participant.
|
| 629 |
+
*/
|
| 630 |
+
void q_omg_security_set_participant_crypto_tokens(struct ddsi_participant *pp, struct ddsi_proxy_participant *proxypp, const nn_dataholderseq_t *tokens);
|
| 631 |
+
|
| 632 |
+
/**
|
| 633 |
+
* @brief Check if the writer has the is_discovery_protected flag set
|
| 634 |
+
*
|
| 635 |
+
* @param[in] wr The local writer.
|
| 636 |
+
*
|
| 637 |
+
* @returns bool True if the writer has the is_discovery_protected flag set
|
| 638 |
+
*/
|
| 639 |
+
bool q_omg_writer_is_discovery_protected(const struct ddsi_writer *wr);
|
| 640 |
+
|
| 641 |
+
/**
|
| 642 |
+
* @brief Check if the writer has the is_submessage_protected flag set
|
| 643 |
+
*
|
| 644 |
+
* @param[in] wr The local writer.
|
| 645 |
+
*
|
| 646 |
+
* @returns bool True if the writer has the is_submessage_protected flag set
|
| 647 |
+
*/
|
| 648 |
+
bool q_omg_writer_is_submessage_protected(const struct ddsi_writer *wr);
|
| 649 |
+
|
| 650 |
+
/**
|
| 651 |
+
* @brief Check if the writer has the is_payload_protected flag set
|
| 652 |
+
*
|
| 653 |
+
* @param[in] wr The local writer.
|
| 654 |
+
*
|
| 655 |
+
* @returns bool True if the writer has the is_payload_protected flag set
|
| 656 |
+
*/
|
| 657 |
+
bool q_omg_writer_is_payload_protected(const struct ddsi_writer *wr);
|
| 658 |
+
|
| 659 |
+
/**
|
| 660 |
+
* @brief Check if the remote writer is allowed to communicate with endpoints of the
|
| 661 |
+
* local participant.
|
| 662 |
+
*
|
| 663 |
+
* This function will check with the access control plugin if the remote writer
|
| 664 |
+
* is allowed to communicate with this participant.
|
| 665 |
+
*
|
| 666 |
+
* @param[in] pwr The remote writer.
|
| 667 |
+
* @param[in] domain_id The domain id.
|
| 668 |
+
* @param[in] pp The local participant.
|
| 669 |
+
*
|
| 670 |
+
* @returns bool
|
| 671 |
+
* @retval true The remote writer is allowed to communicate.
|
| 672 |
+
* @retval false Otherwise.
|
| 673 |
+
*/
|
| 674 |
+
bool q_omg_security_check_remote_writer_permissions(const struct ddsi_proxy_writer *pwr, uint32_t domain_id, struct ddsi_participant *pp);
|
| 675 |
+
|
| 676 |
+
/**
|
| 677 |
+
* @brief Check it the remote writer is allowed to communicate with the local reader.
|
| 678 |
+
*
|
| 679 |
+
* When a remote writer is allowed by access control it has to be checked if the remote
|
| 680 |
+
* writer is allowed to communicate with a particular local reader. This function will
|
| 681 |
+
* check if the provided security end-point attributes are compatible, When the security
|
| 682 |
+
* attributes are compatible then the function will register the reader and remote writer
|
| 683 |
+
* match with the crypto factory and will also ask the crypto exchange to generate the
|
| 684 |
+
* crypto tokens associate with the local reader which will be sent to the remote entity.
|
| 685 |
+
* Note that the reader crypto tokens are used to encrypt the reader specific submessages
|
| 686 |
+
* when submessage encoding or signing is configured.
|
| 687 |
+
*
|
| 688 |
+
* @param[in] rd The local reader.
|
| 689 |
+
* @param[in] pwr The remote writer.
|
| 690 |
+
* @param[out] crypto_handle The crypto handle associated with the match.
|
| 691 |
+
*
|
| 692 |
+
* @returns bool
|
| 693 |
+
* @retval true The local reader and remote writer are allowed to communicate.
|
| 694 |
+
* @retval false Otherwise.
|
| 695 |
+
*/
|
| 696 |
+
bool q_omg_security_match_remote_writer_enabled(struct ddsi_reader *rd, struct ddsi_proxy_writer *pwr, int64_t *crypto_handle);
|
| 697 |
+
|
| 698 |
+
/**
|
| 699 |
+
* @brief Release the security information associated with the match between a reader and
|
| 700 |
+
* a remote writer.
|
| 701 |
+
*
|
| 702 |
+
* This function releases the security resources that were allocated for this reader and remote
|
| 703 |
+
* writer match. For example it will release the security tokens that where associated with this
|
| 704 |
+
* reader and the remote writer.
|
| 705 |
+
*
|
| 706 |
+
* @param[in] gv The global parameters.
|
| 707 |
+
* @param[in] rd_guid The guid of the reader.
|
| 708 |
+
* @param[in] match The reader-proxy_writer match.
|
| 709 |
+
*/
|
| 710 |
+
void q_omg_security_deregister_remote_writer_match(const struct ddsi_domaingv *gv, const ddsi_guid_t *rd_guid, struct ddsi_rd_pwr_match *match);
|
| 711 |
+
|
| 712 |
+
/**
|
| 713 |
+
* @brief Set the crypto tokens used for the secure communication from the remote writer to the reader.
|
| 714 |
+
*
|
| 715 |
+
* The remote writer instance will send the crypto tokens when the security settings determine that the
|
| 716 |
+
* communication between the remote writer and the reader must be secure. When these tokens are received
|
| 717 |
+
* this function will register these tokens with the crypto plugin and set the corresponding crypto handle returned
|
| 718 |
+
* by the crypto plugin which is then used for decrypting messages received from that remote writer to the reader.
|
| 719 |
+
*
|
| 720 |
+
* @param[in] rd The local reader.
|
| 721 |
+
* @param[in] pwr_guid The guid of the remote writer.
|
| 722 |
+
* @param[in] tokens The crypto token received from the remote writer for the reader.
|
| 723 |
+
*/
|
| 724 |
+
void q_omg_security_set_remote_writer_crypto_tokens(struct ddsi_reader *rd, const ddsi_guid_t *pwr_guid, const nn_dataholderseq_t *tokens);
|
| 725 |
+
|
| 726 |
+
/**
|
| 727 |
+
* @brief Release all the security resources associated with the remote writer.
|
| 728 |
+
*
|
| 729 |
+
* Cleanup security resource associated with the remote writer.
|
| 730 |
+
*
|
| 731 |
+
* @param[in] pwr The remote writer.
|
| 732 |
+
*/
|
| 733 |
+
void q_omg_security_deregister_remote_writer(const struct ddsi_proxy_writer *pwr);
|
| 734 |
+
|
| 735 |
+
/**
|
| 736 |
+
* @brief Set security information, depending on plist and proxy participant,
|
| 737 |
+
* into the given proxy reader.
|
| 738 |
+
*
|
| 739 |
+
* @param[in] prd Proxy reader to set security info on.
|
| 740 |
+
* @param[in] plist Paramater list, possibly contains security info.
|
| 741 |
+
*/
|
| 742 |
+
void set_proxy_reader_security_info(struct ddsi_proxy_reader *prd, const ddsi_plist_t *plist);
|
| 743 |
+
|
| 744 |
+
/**
|
| 745 |
+
* @brief Determine the security settings associated with the remote reader.
|
| 746 |
+
*
|
| 747 |
+
* From the security information contained in the parameter list from the remote reader
|
| 748 |
+
* the corresponding security settings are determined and returned in the info parameter.
|
| 749 |
+
*
|
| 750 |
+
* @param[in] prd The remote reader.
|
| 751 |
+
* @param[in] plist The parameter list from the remote reader.
|
| 752 |
+
* @param[out] info The security settings associated with the remote reader.
|
| 753 |
+
*/
|
| 754 |
+
void q_omg_get_proxy_reader_security_info(struct ddsi_proxy_reader *prd, const ddsi_plist_t *plist, nn_security_info_t *info);
|
| 755 |
+
|
| 756 |
+
/**
|
| 757 |
+
* @brief Check if the reader has the is_discovery_protected flag set
|
| 758 |
+
*
|
| 759 |
+
* @param[in] rd The local reader.
|
| 760 |
+
*
|
| 761 |
+
* @returns bool True if the reader has the is_discovery_protected flag set
|
| 762 |
+
*/
|
| 763 |
+
bool q_omg_reader_is_discovery_protected(const struct ddsi_reader *rd);
|
| 764 |
+
|
| 765 |
+
/**
|
| 766 |
+
* @brief Check if the reader has the is_submessage_protected flag set
|
| 767 |
+
*
|
| 768 |
+
* @param[in] rd The local reader.
|
| 769 |
+
*
|
| 770 |
+
* @returns bool True if the reader has the is_submessage_protected flag set
|
| 771 |
+
*/
|
| 772 |
+
bool q_omg_reader_is_submessage_protected(const struct ddsi_reader *rd);
|
| 773 |
+
|
| 774 |
+
/**
|
| 775 |
+
* @brief Check if the remote reader is allowed to communicate with endpoints of the
|
| 776 |
+
* local participant.
|
| 777 |
+
*
|
| 778 |
+
* This function will check with the access control plugin if the remote reader
|
| 779 |
+
* is allowed to communicate with this participant.
|
| 780 |
+
*
|
| 781 |
+
* @param[in] prd The remote reader.
|
| 782 |
+
* @param[in] domain_id The domain id.
|
| 783 |
+
* @param[in] pp The local participant.
|
| 784 |
+
* @param[out] relay_only The "relay_only" value returned by the access control
|
| 785 |
+
* operation check_remote_datareader()
|
| 786 |
+
*
|
| 787 |
+
* @returns bool
|
| 788 |
+
* @retval true The remote reader is allowed to communicate.
|
| 789 |
+
* @retval false Otherwise; relay_only is unspecified.
|
| 790 |
+
*/
|
| 791 |
+
bool q_omg_security_check_remote_reader_permissions(const struct ddsi_proxy_reader *prd, uint32_t domain_id, struct ddsi_participant *pp, bool *relay_only);
|
| 792 |
+
|
| 793 |
+
|
| 794 |
+
/**
|
| 795 |
+
* @brief Set security information, depending on plist and proxy participant,
|
| 796 |
+
* into the given proxy endpoint.
|
| 797 |
+
*
|
| 798 |
+
* @param[in] entity The endpoint common attributes.
|
| 799 |
+
* @param[in] proxypp_sec_info The security info of the proxy participant
|
| 800 |
+
* @param[in] plist Paramater list which may contain security info.
|
| 801 |
+
* @param[in] info The proxy endpoint security info to be set.
|
| 802 |
+
*/
|
| 803 |
+
void q_omg_get_proxy_endpoint_security_info(const struct ddsi_entity_common *entity, nn_security_info_t *proxypp_sec_info, const ddsi_plist_t *plist, nn_security_info_t *info);
|
| 804 |
+
|
| 805 |
+
/**
|
| 806 |
+
* @brief Check it the local writer is allowed to communicate with the remote reader.
|
| 807 |
+
*
|
| 808 |
+
* When a remote reader is allowed by accessstruct dds_security_garbage control it has to be checked if the local
|
| 809 |
+
* writer is allowed to communicate with a particular local writer. This function will
|
| 810 |
+
* check if the provided security end-point attributes are compatible, When the security
|
| 811 |
+
* attributes are compatible then the function will register the writer and remote reader
|
| 812 |
+
* match with the crypto factory and will also ask the crypto exchange to generate the
|
| 813 |
+
* crypto tokens associate with the local writer which will be sent to the remote entity.
|
| 814 |
+
* Note that the writer crypto tokens are used to encrypt the writer specific submessages
|
| 815 |
+
* when submessage encoding or signing is configured and also the crypto tokens used
|
| 816 |
+
* for encoding the payload of data or datafrag messages.
|
| 817 |
+
*
|
| 818 |
+
* @param[in] wr The local writer.
|
| 819 |
+
* @param[in] prd The remote reader.
|
| 820 |
+
* @param[in] relay_only The "relay_only" returned by access control
|
| 821 |
+
* operation check_remote_datareader()
|
| 822 |
+
* @param[out] crypto_handle The crypto handle associated with the match.
|
| 823 |
+
*
|
| 824 |
+
* @returns bool
|
| 825 |
+
* @retval true The local writer and remote reader are allowed to communicate.
|
| 826 |
+
* @retval false Otherwise.
|
| 827 |
+
*/
|
| 828 |
+
bool q_omg_security_match_remote_reader_enabled(struct ddsi_writer *wr, struct ddsi_proxy_reader *prd, bool relay_only, int64_t *crypto_handle);
|
| 829 |
+
|
| 830 |
+
/**
|
| 831 |
+
* @brief Release the security information associated with the match between a writer and
|
| 832 |
+
* a remote reader.
|
| 833 |
+
*
|
| 834 |
+
* This function releases the security resources that were allocated for this writer and remote
|
| 835 |
+
* reader match. For example it will release the security tokens that where associated with this
|
| 836 |
+
* writer and the remote reader.
|
| 837 |
+
*
|
| 838 |
+
* @param[in] gv The global parameters.
|
| 839 |
+
* @param[in] wr_guid The guid of the writer.
|
| 840 |
+
* @param[in] match The writer-proxy_reader match.
|
| 841 |
+
*/
|
| 842 |
+
void q_omg_security_deregister_remote_reader_match(const struct ddsi_domaingv *gv, const ddsi_guid_t *wr_guid, struct ddsi_wr_prd_match *match);
|
| 843 |
+
|
| 844 |
+
/**
|
| 845 |
+
* @brief Set the crypto tokens used for the secure communication from the remote reader to the writer.
|
| 846 |
+
*
|
| 847 |
+
* The remote reader instance will send the crypto tokens when the security settings determine that the
|
| 848 |
+
* communication between the remote reader and the writer must be secure. When these tokens are received
|
| 849 |
+
* this function will register these tokens with the crypto plugin and set the corresponding crypto handle returned
|
| 850 |
+
* by the crypto plugin which is then used for decrypting messages received from that remote reader to the writer.
|
| 851 |
+
*
|
| 852 |
+
* @param[in] wr The local writer.
|
| 853 |
+
* @param[in] prd_guid The guid of the remote reader.
|
| 854 |
+
* @param[in] tokens The crypto token received from the remote reader for the writer.
|
| 855 |
+
*/
|
| 856 |
+
void q_omg_security_set_remote_reader_crypto_tokens(struct ddsi_writer *wr, const ddsi_guid_t *prd_guid, const nn_dataholderseq_t *tokens);
|
| 857 |
+
|
| 858 |
+
/**
|
| 859 |
+
* @brief Release all the security resources associated with the remote reader.
|
| 860 |
+
*
|
| 861 |
+
* Cleanup security resource associated with the remote reader.
|
| 862 |
+
*
|
| 863 |
+
* @param[in] prd The remote reader.
|
| 864 |
+
*/
|
| 865 |
+
void q_omg_security_deregister_remote_reader(const struct ddsi_proxy_reader *prd);
|
| 866 |
+
|
| 867 |
+
/**
|
| 868 |
+
* @brief Encode RTPS message.
|
| 869 |
+
*
|
| 870 |
+
* @param[in] src_handle Security handle of data source.
|
| 871 |
+
* @param[in] src_guid GUID of the entity data source.
|
| 872 |
+
* @param[in] src_buf Original RTPS message.
|
| 873 |
+
* @param[in] src_len Original RTPS message size.
|
| 874 |
+
* @param[out] dst_buf Encoded RTPS message.
|
| 875 |
+
* @param[out] dst_len Encoded RTPS message size.
|
| 876 |
+
* @param[in] dst_handle Security handle of data destination.
|
| 877 |
+
*
|
| 878 |
+
* @returns bool
|
| 879 |
+
* @retval true Encoding succeeded.
|
| 880 |
+
* @retval false Encoding failed.
|
| 881 |
+
*/
|
| 882 |
+
bool
|
| 883 |
+
q_omg_security_encode_rtps_message(
|
| 884 |
+
const struct ddsi_domaingv *gv,
|
| 885 |
+
int64_t src_handle,
|
| 886 |
+
const ddsi_guid_t *src_guid,
|
| 887 |
+
const unsigned char *src_buf,
|
| 888 |
+
size_t src_len,
|
| 889 |
+
unsigned char **dst_buf,
|
| 890 |
+
size_t *dst_len,
|
| 891 |
+
int64_t dst_handle);
|
| 892 |
+
|
| 893 |
+
/**
|
| 894 |
+
* @brief Encode payload when necessary.
|
| 895 |
+
*
|
| 896 |
+
* When encoding is necessary, *buf will be allocated and the vec contents
|
| 897 |
+
* will change to point to that buffer.
|
| 898 |
+
* It is expected that the vec contents is always aliased.
|
| 899 |
+
*
|
| 900 |
+
* If no encoding is necessary, nothing changes.
|
| 901 |
+
*
|
| 902 |
+
* encoding( not needed) -> return( true), vec(untouched), buf(NULL)
|
| 903 |
+
* encoding(needed&success) -> return( true), vec( buf(new))
|
| 904 |
+
* encoding(needed&failure) -> return(false), vec(untouched), buf(NULL)
|
| 905 |
+
*
|
| 906 |
+
* @param[in] wr Writer that writes the payload.
|
| 907 |
+
* @param[in,out] vec An iovec that contains the payload.
|
| 908 |
+
* @param[out] buf Buffer to contain the encoded payload.
|
| 909 |
+
*
|
| 910 |
+
* @returns bool
|
| 911 |
+
* @retval true Encoding succeeded or not necessary. Either way, vec
|
| 912 |
+
* contains the payload that should be send.
|
| 913 |
+
* @retval false Encoding was necessary, but failed.
|
| 914 |
+
*/
|
| 915 |
+
bool encode_payload(struct ddsi_writer *wr, ddsrt_iovec_t *vec, unsigned char **buf);
|
| 916 |
+
|
| 917 |
+
/**
|
| 918 |
+
* @brief Decode the payload of a Data submessage.
|
| 919 |
+
*
|
| 920 |
+
* When decoding is necessary, the payloadp memory will be replaced
|
| 921 |
+
* by the decoded payload. This means that the original submessage
|
| 922 |
+
* now contains payload that can be deserialized.
|
| 923 |
+
*
|
| 924 |
+
* If no decoding is necessary, nothing changes.
|
| 925 |
+
*
|
| 926 |
+
* @param[in] gv Global information.
|
| 927 |
+
* @param[in] sampleinfo Sample information.
|
| 928 |
+
* @param[in,out] payloadp Pointer to payload memory.
|
| 929 |
+
* @param[in] payloadsz Size of payload.
|
| 930 |
+
* @param[in,out] submsg_len Size of submessage.
|
| 931 |
+
*
|
| 932 |
+
* @returns bool
|
| 933 |
+
* @retval true Decoding succeeded or not necessary. Either way, payloadp
|
| 934 |
+
* contains the data that should be deserialized.
|
| 935 |
+
* @retval false Decoding was necessary, but failed.
|
| 936 |
+
*/
|
| 937 |
+
bool decode_Data(const struct ddsi_domaingv *gv, struct nn_rsample_info *sampleinfo, unsigned char *payloadp, uint32_t payloadsz, size_t *submsg_len);
|
| 938 |
+
|
| 939 |
+
/**
|
| 940 |
+
* @brief Decode the payload of a DataFrag submessage.
|
| 941 |
+
*
|
| 942 |
+
* When decoding is necessary, the payloadp memory will be replaced
|
| 943 |
+
* by the decoded payload. This means that the original submessage
|
| 944 |
+
* now contains payload that can be deserialized.
|
| 945 |
+
*
|
| 946 |
+
* If no decoding is necessary, nothing changes.
|
| 947 |
+
*
|
| 948 |
+
* @param[in] gv Global information.
|
| 949 |
+
* @param[in] sampleinfo Sample information.
|
| 950 |
+
* @param[in,out] payloadp Pointer to payload memory.
|
| 951 |
+
* @param[in] payloadsz Size of payload.
|
| 952 |
+
* @param[in,out] submsg_len Size of submessage.
|
| 953 |
+
*
|
| 954 |
+
* @returns bool
|
| 955 |
+
* @retval true Decoding succeeded or not necessary. Either way, payloadp
|
| 956 |
+
* contains the data that should be deserialized.
|
| 957 |
+
* @retval false Decoding was necessary, but failed.
|
| 958 |
+
*/
|
| 959 |
+
bool decode_DataFrag(const struct ddsi_domaingv *gv, struct nn_rsample_info *sampleinfo, unsigned char *payloadp, uint32_t payloadsz, size_t *submsg_len);
|
| 960 |
+
|
| 961 |
+
/**
|
| 962 |
+
* @brief Encode datareader submessage when necessary.
|
| 963 |
+
*
|
| 964 |
+
* When encoding is necessary, the original submessage will be replaced
|
| 965 |
+
* by a new encoded submessage.
|
| 966 |
+
* If the encoding fails, the original submessage will be removed.
|
| 967 |
+
*
|
| 968 |
+
* If no encoding is necessary, nothing changes.
|
| 969 |
+
*
|
| 970 |
+
* @param[in,out] msg Complete message.
|
| 971 |
+
* @param[in,out] sm_marker Submessage location within message.
|
| 972 |
+
* @param[in] pwr Writer for which the message is intended.
|
| 973 |
+
* @param[in] rd_guid Origin reader guid.
|
| 974 |
+
*/
|
| 975 |
+
void encode_datareader_submsg(struct nn_xmsg *msg, struct nn_xmsg_marker sm_marker, const struct ddsi_proxy_writer *pwr, const struct ddsi_guid *rd_guid);
|
| 976 |
+
|
| 977 |
+
/**
|
| 978 |
+
* @brief Encode datawriter submessage when necessary.
|
| 979 |
+
*
|
| 980 |
+
* When encoding is necessary, the original submessage will be replaced
|
| 981 |
+
* by a new encoded submessage.
|
| 982 |
+
* If the encoding fails, the original submessage will be removed.
|
| 983 |
+
*
|
| 984 |
+
* If no encoding is necessary, nothing changes.
|
| 985 |
+
*
|
| 986 |
+
* @param[in,out] msg Complete message.
|
| 987 |
+
* @param[in,out] sm_marker Submessage location within message.
|
| 988 |
+
* @param[in] wr Origin writer guid.
|
| 989 |
+
*/
|
| 990 |
+
void encode_datawriter_submsg(struct nn_xmsg *msg, struct nn_xmsg_marker sm_marker, struct ddsi_writer *wr);
|
| 991 |
+
|
| 992 |
+
/**
|
| 993 |
+
* @brief Check if given submessage is properly decoded.
|
| 994 |
+
*
|
| 995 |
+
* When decoding is necessary, it should be checked if a plain submessage was
|
| 996 |
+
* actually decoded. Otherwise data can be injected just by inserting a plain
|
| 997 |
+
* submessage directly.
|
| 998 |
+
*
|
| 999 |
+
* @param[in] e Entity information.
|
| 1000 |
+
* @param[in] c Proxy endpoint information.
|
| 1001 |
+
* @param[in] proxypp Related proxy participant.
|
| 1002 |
+
* @param[in] rst Receiver information.
|
| 1003 |
+
* @param[in] prev_smid Previously handled submessage ID.
|
| 1004 |
+
*
|
| 1005 |
+
* @returns bool
|
| 1006 |
+
* @retval true Decoding succeeded or was not necessary.
|
| 1007 |
+
* @retval false Decoding was necessary, but not detected.
|
| 1008 |
+
*/
|
| 1009 |
+
bool
|
| 1010 |
+
validate_msg_decoding(
|
| 1011 |
+
const struct ddsi_entity_common *e,
|
| 1012 |
+
const struct ddsi_proxy_endpoint_common *c,
|
| 1013 |
+
const struct ddsi_proxy_participant *proxypp,
|
| 1014 |
+
const struct receiver_state *rst,
|
| 1015 |
+
SubmessageKind_t prev_smid);
|
| 1016 |
+
|
| 1017 |
+
/**
|
| 1018 |
+
* @brief Decode not only SecPrefix, but also the SecBody and SecPostfix
|
| 1019 |
+
* sub-messages.
|
| 1020 |
+
*
|
| 1021 |
+
* When encrypted, the original SecBody will be replaced by the decrypted
|
| 1022 |
+
* submessage. Then the normal sequence can continue as if there was no
|
| 1023 |
+
* encrypted data.
|
| 1024 |
+
*
|
| 1025 |
+
* @param[in] rst Receiver information.
|
| 1026 |
+
* @param[in,out] submsg Pointer to SecPrefix/(SecBody|Submsg)/SecPostfix.
|
| 1027 |
+
* @param[in] submsg_size Size of SecPrefix submessage.
|
| 1028 |
+
* @param[in] msg_end End of the complete message.
|
| 1029 |
+
* @param[in] src_prefix Prefix of the source entity.
|
| 1030 |
+
* @param[in] dst_prefix Prefix of the destination entity.
|
| 1031 |
+
* @param[in] byteswap Do the bytes need swapping?
|
| 1032 |
+
*
|
| 1033 |
+
* @returns bool
|
| 1034 |
+
* @retval true Decoding succeeded.
|
| 1035 |
+
* @retval false Decoding failed.
|
| 1036 |
+
*/
|
| 1037 |
+
bool
|
| 1038 |
+
decode_SecPrefix(
|
| 1039 |
+
const struct receiver_state *rst,
|
| 1040 |
+
unsigned char *submsg,
|
| 1041 |
+
size_t submsg_size,
|
| 1042 |
+
unsigned char * const msg_end,
|
| 1043 |
+
const ddsi_guid_prefix_t * const src_prefix,
|
| 1044 |
+
const ddsi_guid_prefix_t * const dst_prefix,
|
| 1045 |
+
int byteswap);
|
| 1046 |
+
|
| 1047 |
+
/**
|
| 1048 |
+
* @brief Decode the RTPS message.
|
| 1049 |
+
*
|
| 1050 |
+
* When encrypted, the original buffers and information will be replaced
|
| 1051 |
+
* by the decrypted RTPS message. Then the normal sequence can continue
|
| 1052 |
+
* as if there was no encrypted data.
|
| 1053 |
+
*
|
| 1054 |
+
* @param[in] thrst Thread information.
|
| 1055 |
+
* @param[in] gv Global information.
|
| 1056 |
+
* @param[in,out] rmsg Message information.
|
| 1057 |
+
* @param[in,out] hdr Message header.
|
| 1058 |
+
* @param[in,out] buff Message buffer.
|
| 1059 |
+
* @param[in,out] sz Message size.
|
| 1060 |
+
* @param[in] rbpool Buffers pool.
|
| 1061 |
+
* @param[in] isstream Is message a stream variant?
|
| 1062 |
+
*
|
| 1063 |
+
* @returns nn_rtps_msg_state_t
|
| 1064 |
+
* @retval NN_RTPS_MSG_STATE_PLAIN No decoding was necessary.
|
| 1065 |
+
* @retval NN_RTPS_MSG_STATE_ENCODED Decoding succeeded.
|
| 1066 |
+
* @retval NN_RTPS_MSG_STATE_ERROR Decoding failed.
|
| 1067 |
+
*/
|
| 1068 |
+
nn_rtps_msg_state_t decode_rtps_message(struct thread_state * const thrst, struct ddsi_domaingv *gv, struct nn_rmsg **rmsg, Header_t **hdr, unsigned char **buff, size_t *sz, struct nn_rbufpool *rbpool, bool isstream);
|
| 1069 |
+
|
| 1070 |
+
/**
|
| 1071 |
+
* @brief Send the RTPS message securely.
|
| 1072 |
+
*
|
| 1073 |
+
* @param[in] conn Connection to use.
|
| 1074 |
+
* @param[in] dst Possible destination information.
|
| 1075 |
+
* @param[in] niov Number of io vectors.
|
| 1076 |
+
* @param[in] iov Array of io vectors.
|
| 1077 |
+
* @param[in] flags Connection write flags.
|
| 1078 |
+
* @param[in,out] msg_len Submessage containing length.
|
| 1079 |
+
* @param[in] dst_one Is there only one specific destination?
|
| 1080 |
+
* @param[in] sec_info Security information for handles.
|
| 1081 |
+
* @param[in] conn_write_cb Function to call to do the actual writing.
|
| 1082 |
+
*
|
| 1083 |
+
* @returns ssize_t
|
| 1084 |
+
* @retval negative/zero Something went wrong.
|
| 1085 |
+
* @retval positive Secure writing succeeded.
|
| 1086 |
+
*/
|
| 1087 |
+
ssize_t
|
| 1088 |
+
secure_conn_write(
|
| 1089 |
+
const struct ddsi_domaingv *gv,
|
| 1090 |
+
ddsi_tran_conn_t conn,
|
| 1091 |
+
const ddsi_locator_t *dst,
|
| 1092 |
+
size_t niov,
|
| 1093 |
+
const ddsrt_iovec_t *iov,
|
| 1094 |
+
uint32_t flags,
|
| 1095 |
+
MsgLen_t *msg_len,
|
| 1096 |
+
bool dst_one,
|
| 1097 |
+
nn_msg_sec_info_t *sec_info,
|
| 1098 |
+
ddsi_tran_write_fn_t conn_write_cb);
|
| 1099 |
+
|
| 1100 |
+
|
| 1101 |
+
/**
|
| 1102 |
+
* @brief Loads the security plugins with the given configuration.
|
| 1103 |
+
* This function tries to load the plugins only once. Returns the same
|
| 1104 |
+
* result on subsequent calls.
|
| 1105 |
+
* It logs the reason and returns error if can not load a plugin.
|
| 1106 |
+
*
|
| 1107 |
+
* @param[in] qos Participant qos which owns the Property list
|
| 1108 |
+
* that contains security configurations and
|
| 1109 |
+
* plugin properties that are required for loading libraries
|
| 1110 |
+
* @returns dds_return_t
|
| 1111 |
+
* @retval DDS_RETCODE_OK All plugins are successfully loaded
|
| 1112 |
+
* @retval DDS_RETCODE_ERROR One or more security plugins are not loaded.
|
| 1113 |
+
*/
|
| 1114 |
+
dds_return_t q_omg_security_load( struct dds_security_context *security_context, const dds_qos_t *qos, struct ddsi_domaingv *gv );
|
| 1115 |
+
|
| 1116 |
+
|
| 1117 |
+
void q_omg_security_init( struct ddsi_domaingv *gv );
|
| 1118 |
+
|
| 1119 |
+
void q_omg_security_stop (struct ddsi_domaingv *gv);
|
| 1120 |
+
|
| 1121 |
+
void q_omg_security_deinit (struct dds_security_context *sc );
|
| 1122 |
+
|
| 1123 |
+
void q_omg_security_free (struct ddsi_domaingv *gv);
|
| 1124 |
+
|
| 1125 |
+
bool q_omg_is_security_loaded( struct dds_security_context *sc );
|
| 1126 |
+
|
| 1127 |
+
#else /* DDS_HAS_SECURITY */
|
| 1128 |
+
|
| 1129 |
+
#include "dds/ddsi/q_unused.h"
|
| 1130 |
+
|
| 1131 |
+
DDS_INLINE_EXPORT inline bool q_omg_security_enabled(void)
|
| 1132 |
+
{
|
| 1133 |
+
return false;
|
| 1134 |
+
}
|
| 1135 |
+
|
| 1136 |
+
DDS_INLINE_EXPORT inline bool q_omg_participant_is_access_protected(UNUSED_ARG(const struct ddsi_participant *pp))
|
| 1137 |
+
{
|
| 1138 |
+
return false;
|
| 1139 |
+
}
|
| 1140 |
+
|
| 1141 |
+
DDS_INLINE_EXPORT inline bool q_omg_participant_is_rtps_protected(UNUSED_ARG(const struct ddsi_participant *pp))
|
| 1142 |
+
{
|
| 1143 |
+
return false;
|
| 1144 |
+
}
|
| 1145 |
+
|
| 1146 |
+
DDS_INLINE_EXPORT inline bool q_omg_participant_is_liveliness_protected(UNUSED_ARG(const struct ddsi_participant *pp))
|
| 1147 |
+
{
|
| 1148 |
+
return false;
|
| 1149 |
+
}
|
| 1150 |
+
|
| 1151 |
+
DDS_INLINE_EXPORT inline bool q_omg_participant_is_discovery_protected(UNUSED_ARG(const struct ddsi_participant *pp))
|
| 1152 |
+
{
|
| 1153 |
+
return false;
|
| 1154 |
+
}
|
| 1155 |
+
|
| 1156 |
+
DDS_INLINE_EXPORT inline bool q_omg_participant_is_secure(UNUSED_ARG(const struct ddsi_participant *pp))
|
| 1157 |
+
{
|
| 1158 |
+
return false;
|
| 1159 |
+
}
|
| 1160 |
+
|
| 1161 |
+
DDS_INLINE_EXPORT inline bool q_omg_proxy_participant_is_secure(UNUSED_ARG(const struct ddsi_proxy_participant *proxypp))
|
| 1162 |
+
{
|
| 1163 |
+
return false;
|
| 1164 |
+
}
|
| 1165 |
+
|
| 1166 |
+
DDS_INLINE_EXPORT inline unsigned determine_subscription_writer(UNUSED_ARG(const struct ddsi_reader *rd))
|
| 1167 |
+
{
|
| 1168 |
+
return NN_ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER;
|
| 1169 |
+
}
|
| 1170 |
+
|
| 1171 |
+
DDS_INLINE_EXPORT inline unsigned determine_publication_writer(UNUSED_ARG(const struct ddsi_writer *wr))
|
| 1172 |
+
{
|
| 1173 |
+
return NN_ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER;
|
| 1174 |
+
}
|
| 1175 |
+
|
| 1176 |
+
#ifdef DDS_HAS_TOPIC_DISCOVERY
|
| 1177 |
+
DDS_INLINE_EXPORT inline unsigned determine_topic_writer(UNUSED_ARG(const struct ddsi_topic *tp))
|
| 1178 |
+
{
|
| 1179 |
+
return NN_ENTITYID_SEDP_BUILTIN_TOPIC_WRITER;
|
| 1180 |
+
}
|
| 1181 |
+
#endif
|
| 1182 |
+
|
| 1183 |
+
DDS_INLINE_EXPORT inline bool is_proxy_participant_deletion_allowed(UNUSED_ARG(struct ddsi_domaingv * const gv), UNUSED_ARG(const struct ddsi_guid *guid), UNUSED_ARG(const ddsi_entityid_t pwr_entityid))
|
| 1184 |
+
{
|
| 1185 |
+
return true;
|
| 1186 |
+
}
|
| 1187 |
+
|
| 1188 |
+
DDS_INLINE_EXPORT inline bool q_omg_is_similar_participant_security_info(UNUSED_ARG(struct ddsi_participant *pp), UNUSED_ARG(struct ddsi_proxy_participant *proxypp))
|
| 1189 |
+
{
|
| 1190 |
+
return true;
|
| 1191 |
+
}
|
| 1192 |
+
|
| 1193 |
+
DDS_INLINE_EXPORT inline bool q_omg_participant_allow_unauthenticated(UNUSED_ARG(struct ddsi_participant *pp))
|
| 1194 |
+
{
|
| 1195 |
+
return true;
|
| 1196 |
+
}
|
| 1197 |
+
|
| 1198 |
+
DDS_INLINE_EXPORT inline bool q_omg_security_check_create_participant(UNUSED_ARG(struct ddsi_participant *pp), UNUSED_ARG(uint32_t domain_id))
|
| 1199 |
+
{
|
| 1200 |
+
return true;
|
| 1201 |
+
}
|
| 1202 |
+
|
| 1203 |
+
DDS_INLINE_EXPORT inline void q_omg_security_deregister_participant(UNUSED_ARG(struct ddsi_participant *pp))
|
| 1204 |
+
{
|
| 1205 |
+
}
|
| 1206 |
+
|
| 1207 |
+
DDS_INLINE_EXPORT inline bool q_omg_security_check_create_topic(UNUSED_ARG(const struct ddsi_domaingv *gv), UNUSED_ARG(const ddsi_guid_t *pp_guid), UNUSED_ARG(const char *topic_name), UNUSED_ARG(const struct dds_qos *qos))
|
| 1208 |
+
{
|
| 1209 |
+
return true;
|
| 1210 |
+
}
|
| 1211 |
+
|
| 1212 |
+
DDS_INLINE_EXPORT inline int64_t q_omg_security_get_local_participant_handle(UNUSED_ARG(const struct ddsi_participant *pp))
|
| 1213 |
+
{
|
| 1214 |
+
return 0;
|
| 1215 |
+
}
|
| 1216 |
+
|
| 1217 |
+
DDS_INLINE_EXPORT inline bool q_omg_security_check_create_writer(UNUSED_ARG(struct ddsi_participant *pp), UNUSED_ARG(uint32_t domain_id), UNUSED_ARG(const char *topic_name), UNUSED_ARG(const struct dds_qos *writer_qos))
|
| 1218 |
+
{
|
| 1219 |
+
return true;
|
| 1220 |
+
}
|
| 1221 |
+
|
| 1222 |
+
DDS_INLINE_EXPORT inline void q_omg_security_register_writer(UNUSED_ARG(struct ddsi_writer *wr))
|
| 1223 |
+
{
|
| 1224 |
+
}
|
| 1225 |
+
|
| 1226 |
+
DDS_INLINE_EXPORT inline void q_omg_security_deregister_writer(UNUSED_ARG(struct ddsi_writer *wr))
|
| 1227 |
+
{
|
| 1228 |
+
}
|
| 1229 |
+
|
| 1230 |
+
DDS_INLINE_EXPORT inline bool q_omg_security_check_create_reader(UNUSED_ARG(struct ddsi_participant *pp), UNUSED_ARG(uint32_t domain_id), UNUSED_ARG(const char *topic_name), UNUSED_ARG(const struct dds_qos *reader_qos))
|
| 1231 |
+
{
|
| 1232 |
+
return true;
|
| 1233 |
+
}
|
| 1234 |
+
|
| 1235 |
+
DDS_INLINE_EXPORT inline void q_omg_security_register_reader(UNUSED_ARG(struct ddsi_reader *rd))
|
| 1236 |
+
{
|
| 1237 |
+
}
|
| 1238 |
+
|
| 1239 |
+
DDS_INLINE_EXPORT inline void q_omg_security_deregister_reader(UNUSED_ARG(struct ddsi_reader *rd))
|
| 1240 |
+
{
|
| 1241 |
+
}
|
| 1242 |
+
|
| 1243 |
+
DDS_INLINE_EXPORT inline bool q_omg_security_is_remote_rtps_protected(UNUSED_ARG(const struct ddsi_proxy_participant *proxypp), UNUSED_ARG(ddsi_entityid_t entityid))
|
| 1244 |
+
{
|
| 1245 |
+
return false;
|
| 1246 |
+
}
|
| 1247 |
+
|
| 1248 |
+
DDS_INLINE_EXPORT inline void q_omg_security_init_remote_participant(UNUSED_ARG(struct ddsi_proxy_participant *proxypp))
|
| 1249 |
+
{
|
| 1250 |
+
}
|
| 1251 |
+
|
| 1252 |
+
DDS_INLINE_EXPORT inline int64_t q_omg_security_check_remote_participant_permissions(UNUSED_ARG(uint32_t domain_id), UNUSED_ARG(struct ddsi_participant *pp), UNUSED_ARG(struct ddsi_proxy_participant *proxypp))
|
| 1253 |
+
{
|
| 1254 |
+
return 0LL;
|
| 1255 |
+
}
|
| 1256 |
+
|
| 1257 |
+
DDS_INLINE_EXPORT inline bool q_omg_security_register_remote_participant(UNUSED_ARG(struct ddsi_participant *pp), UNUSED_ARG(struct ddsi_proxy_participant *proxypp), UNUSED_ARG(int64_t identity_handle), UNUSED_ARG(int64_t shared_secret))
|
| 1258 |
+
{
|
| 1259 |
+
return true;
|
| 1260 |
+
}
|
| 1261 |
+
|
| 1262 |
+
DDS_INLINE_EXPORT inline void q_omg_security_deregister_remote_participant(UNUSED_ARG(struct ddsi_proxy_participant *proxypp))
|
| 1263 |
+
{
|
| 1264 |
+
}
|
| 1265 |
+
|
| 1266 |
+
DDS_INLINE_EXPORT inline void q_omg_security_participant_send_tokens(UNUSED_ARG(struct ddsi_participant *pp), UNUSED_ARG(struct ddsi_proxy_participant *proxypp))
|
| 1267 |
+
{
|
| 1268 |
+
}
|
| 1269 |
+
|
| 1270 |
+
DDS_INLINE_EXPORT inline int64_t q_omg_security_get_remote_participant_handle(UNUSED_ARG(struct ddsi_proxy_participant *proxypp))
|
| 1271 |
+
{
|
| 1272 |
+
return 0;
|
| 1273 |
+
}
|
| 1274 |
+
|
| 1275 |
+
DDS_INLINE_EXPORT inline bool q_omg_security_match_remote_writer_enabled(UNUSED_ARG(struct ddsi_reader *rd), UNUSED_ARG(struct ddsi_proxy_writer *pwr), UNUSED_ARG(int64_t *crypto_handle))
|
| 1276 |
+
{
|
| 1277 |
+
return true;
|
| 1278 |
+
}
|
| 1279 |
+
|
| 1280 |
+
DDS_INLINE_EXPORT inline bool q_omg_security_match_remote_reader_enabled(UNUSED_ARG(struct ddsi_writer *wr), UNUSED_ARG(struct ddsi_proxy_reader *prd), UNUSED_ARG(bool relay_only), UNUSED_ARG(int64_t *crypto_handle))
|
| 1281 |
+
{
|
| 1282 |
+
return true;
|
| 1283 |
+
}
|
| 1284 |
+
|
| 1285 |
+
DDS_INLINE_EXPORT inline void q_omg_get_proxy_writer_security_info(UNUSED_ARG(struct ddsi_proxy_writer *pwr), UNUSED_ARG(const ddsi_plist_t *plist), UNUSED_ARG(nn_security_info_t *info))
|
| 1286 |
+
{
|
| 1287 |
+
}
|
| 1288 |
+
|
| 1289 |
+
DDS_INLINE_EXPORT inline bool q_omg_writer_is_discovery_protected(UNUSED_ARG(const struct ddsi_writer *wr))
|
| 1290 |
+
{
|
| 1291 |
+
return false;
|
| 1292 |
+
}
|
| 1293 |
+
|
| 1294 |
+
DDS_INLINE_EXPORT inline bool q_omg_writer_is_submessage_protected(UNUSED_ARG(const struct ddsi_writer *wr))
|
| 1295 |
+
{
|
| 1296 |
+
return false;
|
| 1297 |
+
}
|
| 1298 |
+
|
| 1299 |
+
DDS_INLINE_EXPORT inline bool q_omg_writer_is_payload_protected(UNUSED_ARG(const struct ddsi_writer *wr))
|
| 1300 |
+
{
|
| 1301 |
+
return false;
|
| 1302 |
+
}
|
| 1303 |
+
|
| 1304 |
+
DDS_INLINE_EXPORT inline bool q_omg_security_check_remote_writer_permissions(UNUSED_ARG(const struct ddsi_proxy_writer *pwr), UNUSED_ARG(uint32_t domain_id), UNUSED_ARG(struct ddsi_participant *pp))
|
| 1305 |
+
{
|
| 1306 |
+
return true;
|
| 1307 |
+
}
|
| 1308 |
+
|
| 1309 |
+
DDS_INLINE_EXPORT inline void q_omg_security_deregister_remote_writer_match(UNUSED_ARG(const struct ddsi_proxy_writer *pwr), UNUSED_ARG(const struct ddsi_reader *rd), UNUSED_ARG(struct ddsi_rd_pwr_match *match))
|
| 1310 |
+
{
|
| 1311 |
+
}
|
| 1312 |
+
|
| 1313 |
+
DDS_INLINE_EXPORT inline void q_omg_get_proxy_reader_security_info(UNUSED_ARG(struct ddsi_proxy_reader *prd), UNUSED_ARG(const ddsi_plist_t *plist), UNUSED_ARG(nn_security_info_t *info))
|
| 1314 |
+
{
|
| 1315 |
+
}
|
| 1316 |
+
|
| 1317 |
+
DDS_INLINE_EXPORT inline bool q_omg_reader_is_discovery_protected(UNUSED_ARG(const struct ddsi_reader *rd))
|
| 1318 |
+
{
|
| 1319 |
+
return false;
|
| 1320 |
+
}
|
| 1321 |
+
|
| 1322 |
+
DDS_INLINE_EXPORT inline bool q_omg_reader_is_submessage_protected(UNUSED_ARG(const struct ddsi_reader *rd))
|
| 1323 |
+
{
|
| 1324 |
+
return false;
|
| 1325 |
+
}
|
| 1326 |
+
|
| 1327 |
+
|
| 1328 |
+
DDS_INLINE_EXPORT inline bool q_omg_security_check_remote_reader_permissions(UNUSED_ARG(const struct ddsi_proxy_reader *prd), UNUSED_ARG(uint32_t domain_id), UNUSED_ARG(struct ddsi_participant *pp), UNUSED_ARG(bool *relay_only))
|
| 1329 |
+
{
|
| 1330 |
+
*relay_only = false;
|
| 1331 |
+
return true;
|
| 1332 |
+
}
|
| 1333 |
+
|
| 1334 |
+
DDS_INLINE_EXPORT inline void set_proxy_participant_security_info(UNUSED_ARG(struct ddsi_proxy_participant *prd), UNUSED_ARG(const ddsi_plist_t *plist))
|
| 1335 |
+
{
|
| 1336 |
+
}
|
| 1337 |
+
|
| 1338 |
+
DDS_INLINE_EXPORT inline void set_proxy_reader_security_info(UNUSED_ARG(struct ddsi_proxy_reader *prd), UNUSED_ARG(const ddsi_plist_t *plist))
|
| 1339 |
+
{
|
| 1340 |
+
}
|
| 1341 |
+
|
| 1342 |
+
DDS_INLINE_EXPORT inline void set_proxy_writer_security_info(UNUSED_ARG(struct ddsi_proxy_writer *pwr), UNUSED_ARG(const ddsi_plist_t *plist))
|
| 1343 |
+
{
|
| 1344 |
+
}
|
| 1345 |
+
|
| 1346 |
+
DDS_INLINE_EXPORT inline bool
|
| 1347 |
+
decode_Data(
|
| 1348 |
+
UNUSED_ARG(const struct ddsi_domaingv *gv),
|
| 1349 |
+
UNUSED_ARG(struct nn_rsample_info *sampleinfo),
|
| 1350 |
+
UNUSED_ARG(unsigned char *payloadp),
|
| 1351 |
+
UNUSED_ARG(uint32_t payloadsz),
|
| 1352 |
+
UNUSED_ARG(size_t *submsg_len))
|
| 1353 |
+
{
|
| 1354 |
+
return true;
|
| 1355 |
+
}
|
| 1356 |
+
|
| 1357 |
+
DDS_INLINE_EXPORT inline bool
|
| 1358 |
+
decode_DataFrag(
|
| 1359 |
+
UNUSED_ARG(const struct ddsi_domaingv *gv),
|
| 1360 |
+
UNUSED_ARG(struct nn_rsample_info *sampleinfo),
|
| 1361 |
+
UNUSED_ARG(unsigned char *payloadp),
|
| 1362 |
+
UNUSED_ARG(uint32_t payloadsz),
|
| 1363 |
+
UNUSED_ARG(size_t *submsg_len))
|
| 1364 |
+
{
|
| 1365 |
+
return true;
|
| 1366 |
+
}
|
| 1367 |
+
|
| 1368 |
+
DDS_INLINE_EXPORT inline void
|
| 1369 |
+
encode_datareader_submsg(
|
| 1370 |
+
UNUSED_ARG(struct nn_xmsg *msg),
|
| 1371 |
+
UNUSED_ARG(struct nn_xmsg_marker sm_marker),
|
| 1372 |
+
UNUSED_ARG(const struct ddsi_proxy_writer *pwr),
|
| 1373 |
+
UNUSED_ARG(const struct ddsi_guid *rd_guid))
|
| 1374 |
+
{
|
| 1375 |
+
}
|
| 1376 |
+
|
| 1377 |
+
DDS_INLINE_EXPORT inline void
|
| 1378 |
+
encode_datawriter_submsg(
|
| 1379 |
+
UNUSED_ARG(struct nn_xmsg *msg),
|
| 1380 |
+
UNUSED_ARG(struct nn_xmsg_marker sm_marker),
|
| 1381 |
+
UNUSED_ARG(struct ddsi_writer *wr))
|
| 1382 |
+
{
|
| 1383 |
+
}
|
| 1384 |
+
|
| 1385 |
+
DDS_INLINE_EXPORT inline bool
|
| 1386 |
+
validate_msg_decoding(
|
| 1387 |
+
UNUSED_ARG(const struct ddsi_entity_common *e),
|
| 1388 |
+
UNUSED_ARG(const struct ddsi_proxy_endpoint_common *c),
|
| 1389 |
+
UNUSED_ARG(struct ddsi_proxy_participant *proxypp),
|
| 1390 |
+
UNUSED_ARG(struct receiver_state *rst),
|
| 1391 |
+
UNUSED_ARG(SubmessageKind_t prev_smid))
|
| 1392 |
+
{
|
| 1393 |
+
return true;
|
| 1394 |
+
}
|
| 1395 |
+
|
| 1396 |
+
DDS_INLINE_EXPORT inline int
|
| 1397 |
+
decode_SecPrefix(
|
| 1398 |
+
UNUSED_ARG(struct receiver_state *rst),
|
| 1399 |
+
UNUSED_ARG(unsigned char *submsg),
|
| 1400 |
+
UNUSED_ARG(size_t submsg_size),
|
| 1401 |
+
UNUSED_ARG(unsigned char * const msg_end),
|
| 1402 |
+
UNUSED_ARG(const ddsi_guid_prefix_t * const src_prefix),
|
| 1403 |
+
UNUSED_ARG(const ddsi_guid_prefix_t * const dst_prefix),
|
| 1404 |
+
UNUSED_ARG(int byteswap))
|
| 1405 |
+
{
|
| 1406 |
+
/* Just let the parsing ignore the security sub-messages. */
|
| 1407 |
+
return true;
|
| 1408 |
+
}
|
| 1409 |
+
|
| 1410 |
+
DDS_INLINE_EXPORT inline nn_rtps_msg_state_t
|
| 1411 |
+
decode_rtps_message(
|
| 1412 |
+
UNUSED_ARG(struct thread_state * const thrst),
|
| 1413 |
+
UNUSED_ARG(struct ddsi_domaingv *gv),
|
| 1414 |
+
UNUSED_ARG(struct nn_rmsg **rmsg),
|
| 1415 |
+
UNUSED_ARG(Header_t **hdr),
|
| 1416 |
+
UNUSED_ARG(unsigned char **buff),
|
| 1417 |
+
UNUSED_ARG(size_t *sz),
|
| 1418 |
+
UNUSED_ARG(struct nn_rbufpool *rbpool),
|
| 1419 |
+
UNUSED_ARG(bool isstream))
|
| 1420 |
+
{
|
| 1421 |
+
return NN_RTPS_MSG_STATE_PLAIN;
|
| 1422 |
+
}
|
| 1423 |
+
|
| 1424 |
+
DDS_INLINE_EXPORT inline dds_return_t q_omg_security_load( UNUSED_ARG( struct dds_security_context *security_context ), UNUSED_ARG( const dds_qos_t *property_seq), UNUSED_ARG ( struct ddsi_domaingv *gv ) )
|
| 1425 |
+
{
|
| 1426 |
+
return DDS_RETCODE_ERROR;
|
| 1427 |
+
}
|
| 1428 |
+
|
| 1429 |
+
DDS_INLINE_EXPORT inline bool q_omg_is_security_loaded( UNUSED_ARG( struct dds_security_context *sc )) { return false; }
|
| 1430 |
+
|
| 1431 |
+
DDS_INLINE_EXPORT inline void q_omg_security_deregister_remote_reader_match(UNUSED_ARG(const struct ddsi_proxy_reader *prd), UNUSED_ARG(const struct ddsi_writer *wr), UNUSED_ARG(struct ddsi_wr_prd_match *match))
|
| 1432 |
+
{
|
| 1433 |
+
}
|
| 1434 |
+
|
| 1435 |
+
DDS_INLINE_EXPORT inline bool q_omg_plist_keyhash_is_protected(UNUSED_ARG(const ddsi_plist_t *plist))
|
| 1436 |
+
{
|
| 1437 |
+
return false;
|
| 1438 |
+
}
|
| 1439 |
+
|
| 1440 |
+
DDS_INLINE_EXPORT inline bool q_omg_is_endpoint_protected(UNUSED_ARG(const ddsi_plist_t *plist))
|
| 1441 |
+
{
|
| 1442 |
+
return false;
|
| 1443 |
+
}
|
| 1444 |
+
|
| 1445 |
+
DDS_INLINE_EXPORT inline void q_omg_log_endpoint_protection(UNUSED_ARG(struct ddsi_domaingv * const gv), UNUSED_ARG(const ddsi_plist_t *plist))
|
| 1446 |
+
{
|
| 1447 |
+
}
|
| 1448 |
+
|
| 1449 |
+
#endif /* DDS_HAS_SECURITY */
|
| 1450 |
+
|
| 1451 |
+
#if defined (__cplusplus)
|
| 1452 |
+
}
|
| 1453 |
+
#endif
|
| 1454 |
+
|
| 1455 |
+
#endif /* DDSI_OMG_SECURITY_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_security_util.h
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_SECURITY_UTIL_H
|
| 13 |
+
#define DDSI_SECURITY_UTIL_H
|
| 14 |
+
|
| 15 |
+
#include "dds/features.h"
|
| 16 |
+
|
| 17 |
+
#ifdef DDS_HAS_SECURITY
|
| 18 |
+
|
| 19 |
+
#include "dds/ddsi/ddsi_plist.h"
|
| 20 |
+
#include "dds/security/core/dds_security_utils.h"
|
| 21 |
+
|
| 22 |
+
#if defined (__cplusplus)
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
void g_omg_shallow_copy_StringSeq(DDS_Security_StringSeq *dst, const ddsi_stringseq_t *src);
|
| 27 |
+
void g_omg_shallow_free_StringSeq(DDS_Security_StringSeq *obj);
|
| 28 |
+
void q_omg_copy_PropertySeq(DDS_Security_PropertySeq *dst, const dds_propertyseq_t *src);
|
| 29 |
+
void q_omg_shallow_copyin_PropertySeq(DDS_Security_PropertySeq *dst, const dds_propertyseq_t *src);
|
| 30 |
+
void q_omg_shallow_copyout_PropertySeq(dds_propertyseq_t *dst, const DDS_Security_PropertySeq *src);
|
| 31 |
+
void q_omg_shallow_free_PropertySeq(DDS_Security_PropertySeq *obj);
|
| 32 |
+
void q_omg_shallow_copyin_BinaryPropertySeq(DDS_Security_BinaryPropertySeq *dst, const dds_binarypropertyseq_t *src);
|
| 33 |
+
void q_omg_shallow_copyout_BinaryPropertySeq(dds_binarypropertyseq_t *dst, const DDS_Security_BinaryPropertySeq *src);
|
| 34 |
+
void q_omg_shallow_free_BinaryPropertySeq(DDS_Security_BinaryPropertySeq *obj);
|
| 35 |
+
void q_omg_shallow_copy_PropertyQosPolicy(DDS_Security_PropertyQosPolicy *dst, const dds_property_qospolicy_t *src);
|
| 36 |
+
void q_omg_shallow_copy_security_qos(DDS_Security_Qos *dst, const struct dds_qos *src);
|
| 37 |
+
void q_omg_shallow_free_PropertyQosPolicy(DDS_Security_PropertyQosPolicy *obj);
|
| 38 |
+
void q_omg_shallow_free_security_qos(DDS_Security_Qos *obj);
|
| 39 |
+
void q_omg_security_dataholder_copyin(nn_dataholder_t *dh, const DDS_Security_DataHolder *holder);
|
| 40 |
+
void q_omg_security_dataholder_copyout(DDS_Security_DataHolder *holder, const nn_dataholder_t *dh);
|
| 41 |
+
void q_omg_shallow_copyin_DataHolder(DDS_Security_DataHolder *dst, const nn_dataholder_t *src);
|
| 42 |
+
void q_omg_shallow_copyout_DataHolder(nn_dataholder_t *dst, const DDS_Security_DataHolder *src);
|
| 43 |
+
void q_omg_shallow_free_DataHolder(DDS_Security_DataHolder *obj);
|
| 44 |
+
void q_omg_shallow_free_nn_dataholder(nn_dataholder_t *holder);
|
| 45 |
+
void q_omg_shallow_copyin_DataHolderSeq(DDS_Security_DataHolderSeq *dst, const nn_dataholderseq_t *src);
|
| 46 |
+
void q_omg_copyin_DataHolderSeq(DDS_Security_DataHolderSeq *dst, const nn_dataholderseq_t *src);
|
| 47 |
+
void q_omg_shallow_copyout_DataHolderSeq(nn_dataholderseq_t *dst, const DDS_Security_DataHolderSeq *src);
|
| 48 |
+
void q_omg_shallow_free_DataHolderSeq(DDS_Security_DataHolderSeq *obj);
|
| 49 |
+
void q_omg_shallow_free_nn_dataholderseq(nn_dataholderseq_t *obj);
|
| 50 |
+
void q_omg_shallow_copy_ParticipantBuiltinTopicDataSecure(DDS_Security_ParticipantBuiltinTopicDataSecure *dst, const ddsi_guid_t *guid, const ddsi_plist_t *plist);
|
| 51 |
+
void q_omg_shallow_free_ParticipantBuiltinTopicDataSecure(DDS_Security_ParticipantBuiltinTopicDataSecure *obj);
|
| 52 |
+
void q_omg_shallow_copy_SubscriptionBuiltinTopicDataSecure(DDS_Security_SubscriptionBuiltinTopicDataSecure *dst, const ddsi_guid_t *guid, const struct dds_qos *qos, const nn_security_info_t *secinfo);
|
| 53 |
+
void q_omg_shallow_free_SubscriptionBuiltinTopicDataSecure(DDS_Security_SubscriptionBuiltinTopicDataSecure *obj);
|
| 54 |
+
void q_omg_shallow_copy_PublicationBuiltinTopicDataSecure(DDS_Security_PublicationBuiltinTopicDataSecure *dst, const ddsi_guid_t *guid, const struct dds_qos *qos, const nn_security_info_t *secinfo);
|
| 55 |
+
void q_omg_shallow_free_PublicationBuiltinTopicDataSecure(DDS_Security_PublicationBuiltinTopicDataSecure *obj);
|
| 56 |
+
void q_omg_shallow_copy_TopicBuiltinTopicData(DDS_Security_TopicBuiltinTopicData *dst, const char *topic_name, const char *type_name);
|
| 57 |
+
void q_omg_shallow_free_TopicBuiltinTopicData(DDS_Security_TopicBuiltinTopicData *obj);
|
| 58 |
+
|
| 59 |
+
#if defined (__cplusplus)
|
| 60 |
+
}
|
| 61 |
+
#endif
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
#endif /* DDS_HAS_SECURITY */
|
| 65 |
+
|
| 66 |
+
#endif /* DDSI_SECURITY_UTIL_H */
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_serdata.h
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_SERDATA_H
|
| 13 |
+
#define DDSI_SERDATA_H
|
| 14 |
+
|
| 15 |
+
#include "dds/features.h"
|
| 16 |
+
#include "dds/ddsrt/misc.h"
|
| 17 |
+
#include "dds/ddsrt/time.h"
|
| 18 |
+
#include "dds/ddsrt/iovec.h"
|
| 19 |
+
#include "dds/ddsi/ddsi_sertype.h"
|
| 20 |
+
#include "dds/ddsi/ddsi_keyhash.h"
|
| 21 |
+
#include "dds/ddsi/ddsi_typelib.h"
|
| 22 |
+
|
| 23 |
+
#if defined (__cplusplus)
|
| 24 |
+
extern "C" {
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
struct nn_rdata;
|
| 28 |
+
|
| 29 |
+
enum ddsi_serdata_kind {
|
| 30 |
+
SDK_EMPTY,
|
| 31 |
+
SDK_KEY,
|
| 32 |
+
SDK_DATA
|
| 33 |
+
};
|
| 34 |
+
|
| 35 |
+
struct ddsi_serdata {
|
| 36 |
+
// Backwards compatibility support for ddsi_sertopic (which is intended to exist
|
| 37 |
+
// only for a little while, have to see how that works out ...) relies on reading
|
| 38 |
+
// and writing the first few fields of ddsi_serdata regardless of whether it is a
|
| 39 |
+
// new or an old one.
|
| 40 |
+
//
|
| 41 |
+
// At a minimum, it needs to look at "ops" for this. Currently, because the old
|
| 42 |
+
// serdata is a prefix of the new serdata anyway, it also looks directly at "type"
|
| 43 |
+
// in dds_writecdr_impl, and elsewhere it simply timestamp and statusinfo.
|
| 44 |
+
//
|
| 45 |
+
// So don't change anything of the layout up to and including "twrite" unless
|
| 46 |
+
// checking the compatibility code in ddsi_sertopic.c, dds_writecdr_impl and
|
| 47 |
+
// dds_readcdr_impl.
|
| 48 |
+
|
| 49 |
+
const struct ddsi_serdata_ops *ops; /* cached from type->serdata_ops */
|
| 50 |
+
uint32_t hash;
|
| 51 |
+
ddsrt_atomic_uint32_t refc;
|
| 52 |
+
enum ddsi_serdata_kind kind;
|
| 53 |
+
const struct ddsi_sertype *type;
|
| 54 |
+
|
| 55 |
+
/* these get set by generic code after creating the serdata */
|
| 56 |
+
ddsrt_wctime_t timestamp;
|
| 57 |
+
uint32_t statusinfo;
|
| 58 |
+
|
| 59 |
+
/* FIXME: can I get rid of this one? */
|
| 60 |
+
ddsrt_mtime_t twrite; /* write time, not source timestamp, set post-throttling */
|
| 61 |
+
|
| 62 |
+
#ifdef DDS_HAS_SHM
|
| 63 |
+
void* iox_chunk;
|
| 64 |
+
void* iox_subscriber; // actually: iox_sub_t *
|
| 65 |
+
#endif
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
struct ddsi_serdata_wrapper {
|
| 69 |
+
struct ddsi_serdata c;
|
| 70 |
+
void *compat_wrap;
|
| 71 |
+
};
|
| 72 |
+
|
| 73 |
+
/* Serialised size of sample inclusive of DDSI encoding header
|
| 74 |
+
- uint32_t because the protocol can't handle samples larger than 4GB anyway
|
| 75 |
+
- FIXME: get the encoding header out of the serialised data */
|
| 76 |
+
typedef uint32_t (*ddsi_serdata_size_t) (const struct ddsi_serdata *d);
|
| 77 |
+
|
| 78 |
+
/* Free a serdata (called by unref when refcount goes to 0) */
|
| 79 |
+
typedef void (*ddsi_serdata_free_t) (struct ddsi_serdata *d);
|
| 80 |
+
|
| 81 |
+
/* Construct a serdata from a fragchain received over the network
|
| 82 |
+
- "kind" is KEY or DATA depending on the type of payload
|
| 83 |
+
- "size" is the serialised size of the sample, inclusive of DDSI encoding header
|
| 84 |
+
- the first fragchain always contains the encoding header in its entirety
|
| 85 |
+
- fragchains may overlap, though I have never seen any DDS implementation
|
| 86 |
+
actually send such nasty fragments
|
| 87 |
+
- FIXME: get the encoding header out of the serialised data */
|
| 88 |
+
typedef struct ddsi_serdata * (*ddsi_serdata_from_ser_t) (const struct ddsi_sertype *type, enum ddsi_serdata_kind kind, const struct nn_rdata *fragchain, size_t size);
|
| 89 |
+
|
| 90 |
+
/* Exactly like ddsi_serdata_from_ser_t, but with the data in an iovec and guaranteed absence of overlap */
|
| 91 |
+
typedef struct ddsi_serdata * (*ddsi_serdata_from_ser_iov_t) (const struct ddsi_sertype *type, enum ddsi_serdata_kind kind, ddsrt_msg_iovlen_t niov, const ddsrt_iovec_t *iov, size_t size);
|
| 92 |
+
|
| 93 |
+
/* Construct a serdata from a keyhash (an SDK_KEY by definition) */
|
| 94 |
+
typedef struct ddsi_serdata * (*ddsi_serdata_from_keyhash_t) (const struct ddsi_sertype *type, const struct ddsi_keyhash *keyhash);
|
| 95 |
+
|
| 96 |
+
/* Construct a serdata from an application sample
|
| 97 |
+
- "kind" is KEY or DATA depending on the operation invoked by the application;
|
| 98 |
+
e.g., write results in kind = DATA, dispose in kind = KEY. The important bit
|
| 99 |
+
is to not assume anything of the contents of non-key fields if kind = KEY
|
| 100 |
+
unless additional application knowledge is available */
|
| 101 |
+
typedef struct ddsi_serdata * (*ddsi_serdata_from_sample_t) (const struct ddsi_sertype *type, enum ddsi_serdata_kind kind, const void *sample);
|
| 102 |
+
|
| 103 |
+
/* Construct a untyped serdata with just a keyvalue given a normal serdata (either key or data)
|
| 104 |
+
- used for mapping key values to instance ids in tkmap
|
| 105 |
+
- two reasons: size (keys are typically smaller than samples), and data in tkmap
|
| 106 |
+
is shared across topics
|
| 107 |
+
- whether a serdata is untyped or not is known from the context, and the topic
|
| 108 |
+
field may have any value for a untyped serdata (so in some cases, one can
|
| 109 |
+
simply do "return ddsi_serdata_ref(d);"
|
| 110 |
+
*/
|
| 111 |
+
typedef struct ddsi_serdata * (*ddsi_serdata_to_untyped_t) (const struct ddsi_serdata *d);
|
| 112 |
+
|
| 113 |
+
/* Fill buffer with 'size' bytes of serialised data, starting from 'off'
|
| 114 |
+
- 0 <= off < off+sz <= alignup4(size(d))
|
| 115 |
+
- bytes at offsets 0 .. 3 are DDSI encoding header, size(d) includes that header
|
| 116 |
+
- what to copy for bytes in [size(d), alignup4(size(d))) depends on the serdata
|
| 117 |
+
implementation, the protocol treats them as undefined
|
| 118 |
+
- FIXME: get the encoding header out of the serialised data */
|
| 119 |
+
typedef void (*ddsi_serdata_to_ser_t) (const struct ddsi_serdata *d, size_t off, size_t sz, void *buf);
|
| 120 |
+
|
| 121 |
+
/* Provide a pointer to 'size' bytes of serialised data, starting from 'off'
|
| 122 |
+
- see ddsi_serdata_to_ser_t above
|
| 123 |
+
- instead of copying, this gives a reference that must remain valid until the
|
| 124 |
+
corresponding call to to_ser_unref
|
| 125 |
+
- multiple calls to to_ser_ref() may be issued in parallel
|
| 126 |
+
- lazily creating the serialised representation is allowed (though I'm not sure
|
| 127 |
+
how that would work with knowing the serialised size beforehand ...) */
|
| 128 |
+
typedef struct ddsi_serdata * (*ddsi_serdata_to_ser_ref_t) (const struct ddsi_serdata *d, size_t off, size_t sz, ddsrt_iovec_t *ref);
|
| 129 |
+
|
| 130 |
+
/* Release a lock on serialised data
|
| 131 |
+
- ref was previousy filled by ddsi_serdata_to_ser_ref_t */
|
| 132 |
+
typedef void (*ddsi_serdata_to_ser_unref_t) (struct ddsi_serdata *d, const ddsrt_iovec_t *ref);
|
| 133 |
+
|
| 134 |
+
/* Turn serdata into an application sample (or just the key values if only key values are
|
| 135 |
+
available); return false on error (typically out-of-memory, but if from_ser doesn't do any
|
| 136 |
+
validation it might be a deserialisation error, too).
|
| 137 |
+
|
| 138 |
+
If (bufptr != 0), then *bufptr .. buflim is space to be used from *bufptr up (with minimal
|
| 139 |
+
padding) for any data in the sample that needs to be allocated (e.g., strings, sequences);
|
| 140 |
+
otherwise malloc() is to be used for those. (This allows read/take to be given a block of memory
|
| 141 |
+
by the caller.) */
|
| 142 |
+
typedef bool (*ddsi_serdata_to_sample_t) (const struct ddsi_serdata *d, void *sample, void **bufptr, void *buflim);
|
| 143 |
+
|
| 144 |
+
/* Create a sample from a untyped serdata, as returned by serdata_to_untyped. This sample
|
| 145 |
+
obviously has just the key fields filled in and is used for generating invalid samples. */
|
| 146 |
+
typedef bool (*ddsi_serdata_untyped_to_sample_t) (const struct ddsi_sertype *type, const struct ddsi_serdata *d, void *sample, void **bufptr, void *buflim);
|
| 147 |
+
|
| 148 |
+
/* Test key values of two serdatas for equality. The two will have the same ddsi_serdata_ops,
|
| 149 |
+
but are not necessarily of the same topic (one can decide to never consider them equal if they
|
| 150 |
+
are of different topics, of course; but the nice thing about _not_ doing that is that all
|
| 151 |
+
instances with a certain key value with have the same instance id, and that in turn makes
|
| 152 |
+
computing equijoins across topics much simpler). */
|
| 153 |
+
typedef bool (*ddsi_serdata_eqkey_t) (const struct ddsi_serdata *a, const struct ddsi_serdata *b);
|
| 154 |
+
|
| 155 |
+
/* Print a serdata into the provided buffer (truncating as necessary)
|
| 156 |
+
- topic is present for supporting printing of "untyped" samples
|
| 157 |
+
- buf != NULL, bufsize > 0 on input
|
| 158 |
+
- buf must always be terminated with a nul character on return
|
| 159 |
+
- returns the number of characters (excluding the terminating 0) needed to print it
|
| 160 |
+
in full (or, as an optimization, it may pretend that it has printed it in full,
|
| 161 |
+
returning bufsize-1) if it had to truncate) */
|
| 162 |
+
typedef size_t (*ddsi_serdata_print_t) (const struct ddsi_sertype *type, const struct ddsi_serdata *d, char *buf, size_t size);
|
| 163 |
+
|
| 164 |
+
/* Add keyhash (from serdata) to buffer (forcing md5 when necessary).
|
| 165 |
+
- key needs to be set within serdata (can already be md5)
|
| 166 |
+
- buf needs to be at least 16 bytes large */
|
| 167 |
+
typedef void (*ddsi_serdata_get_keyhash_t) (const struct ddsi_serdata *d, struct ddsi_keyhash *buf, bool force_md5);
|
| 168 |
+
|
| 169 |
+
#ifdef DDS_HAS_SHM
|
| 170 |
+
typedef uint32_t(*ddsi_serdata_iox_size_t) (const struct ddsi_serdata* d);
|
| 171 |
+
|
| 172 |
+
// Used for receiving a sample from a Iceoryx and for constructing a serdata for writing a "loaned sample",
|
| 173 |
+
// that is, for constructing a sample where the data is already in shared memory. The latter allows one
|
| 174 |
+
// to avoid serializing the data for zero-copy data transfer if all subscribers are reachable via Iceoryx.
|
| 175 |
+
//
|
| 176 |
+
// The first case is when "sub" is not NULL, in which case it is a pointer to the Iceoryx subscriber
|
| 177 |
+
typedef struct ddsi_serdata* (*ddsi_serdata_from_iox_t) (const struct ddsi_sertype* type, enum ddsi_serdata_kind kind, void* sub, void* buffer);
|
| 178 |
+
#endif
|
| 179 |
+
|
| 180 |
+
struct ddsi_serdata_ops {
|
| 181 |
+
ddsi_serdata_eqkey_t eqkey;
|
| 182 |
+
ddsi_serdata_size_t get_size;
|
| 183 |
+
ddsi_serdata_from_ser_t from_ser;
|
| 184 |
+
ddsi_serdata_from_ser_iov_t from_ser_iov;
|
| 185 |
+
ddsi_serdata_from_keyhash_t from_keyhash;
|
| 186 |
+
ddsi_serdata_from_sample_t from_sample;
|
| 187 |
+
ddsi_serdata_to_ser_t to_ser;
|
| 188 |
+
ddsi_serdata_to_ser_ref_t to_ser_ref;
|
| 189 |
+
ddsi_serdata_to_ser_unref_t to_ser_unref;
|
| 190 |
+
ddsi_serdata_to_sample_t to_sample;
|
| 191 |
+
ddsi_serdata_to_untyped_t to_untyped;
|
| 192 |
+
ddsi_serdata_untyped_to_sample_t untyped_to_sample;
|
| 193 |
+
ddsi_serdata_free_t free;
|
| 194 |
+
ddsi_serdata_print_t print;
|
| 195 |
+
ddsi_serdata_get_keyhash_t get_keyhash;
|
| 196 |
+
#ifdef DDS_HAS_SHM
|
| 197 |
+
ddsi_serdata_iox_size_t get_sample_size;
|
| 198 |
+
ddsi_serdata_from_iox_t from_iox_buffer;
|
| 199 |
+
#endif
|
| 200 |
+
};
|
| 201 |
+
|
| 202 |
+
#define DDSI_SERDATA_HAS_PRINT 1
|
| 203 |
+
#define DDSI_SERDATA_HAS_FROM_SER_IOV 1
|
| 204 |
+
#define DDSI_SERDATA_HAS_GET_KEYHASH 1
|
| 205 |
+
|
| 206 |
+
DDS_EXPORT void ddsi_serdata_init (struct ddsi_serdata *d, const struct ddsi_sertype *type, enum ddsi_serdata_kind kind);
|
| 207 |
+
|
| 208 |
+
/**
|
| 209 |
+
* @brief Return a pointer to the keyhash in the message fragchain if it was present, or else NULL.
|
| 210 |
+
*
|
| 211 |
+
* @param[in] fragchain the fragchain argument passed to @ref ddsi_serdata_from_ser (the first one, not any subsequent ones)
|
| 212 |
+
* @returns A pointer to the keyhash in the message if it was present, NULL if not. The lifetime is at least that of the fragchain itself.
|
| 213 |
+
*/
|
| 214 |
+
DDS_EXPORT const ddsi_keyhash_t *ddsi_serdata_keyhash_from_fragchain (const struct nn_rdata *fragchain);
|
| 215 |
+
|
| 216 |
+
/* backwards compatibility: wrap a sertopic-derived serdata so that it may be used as a sertype-derived one; increments refcount */
|
| 217 |
+
DDS_EXPORT struct ddsi_serdata *ddsi_sertopic_wrap_serdata (const struct ddsi_sertype *type, enum ddsi_serdata_kind kind, void *old);
|
| 218 |
+
|
| 219 |
+
/**
|
| 220 |
+
* @brief Return a reference to a serdata with possible type conversion
|
| 221 |
+
*
|
| 222 |
+
* If `serdata` is of type `type`, this increments the reference count and returns
|
| 223 |
+
* `serdata`. Otherwise, it constructs a new one from the serialised representation of
|
| 224 |
+
* `serdata`. This can fail, in which case it returns NULL.
|
| 225 |
+
*
|
| 226 |
+
* @param[in] type sertype the returned serdata must have
|
| 227 |
+
* @param[in] serdata source sample (untouched except for the reference count and/or
|
| 228 |
+
* extracting the serialised representation)
|
| 229 |
+
* @returns A reference to a serdata that is equivalent to the input with the correct
|
| 230 |
+
* topic, or a null pointer on failure. The reference must be released with @ref
|
| 231 |
+
* ddsi_serdata_unref.
|
| 232 |
+
*/
|
| 233 |
+
DDS_EXPORT struct ddsi_serdata *ddsi_serdata_ref_as_type (const struct ddsi_sertype *type, struct ddsi_serdata *serdata);
|
| 234 |
+
|
| 235 |
+
DDS_INLINE_EXPORT inline struct ddsi_serdata *ddsi_serdata_ref (const struct ddsi_serdata *serdata_const) {
|
| 236 |
+
#if defined (__cplusplus)
|
| 237 |
+
DDSRT_WARNING_GNUC_OFF(old-style-cast)
|
| 238 |
+
DDSRT_WARNING_CLANG_OFF(old-style-cast)
|
| 239 |
+
#endif
|
| 240 |
+
struct ddsi_serdata *serdata = (struct ddsi_serdata *)serdata_const;
|
| 241 |
+
#if defined (__cplusplus)
|
| 242 |
+
DDSRT_WARNING_CLANG_ON(old-style-cast)
|
| 243 |
+
DDSRT_WARNING_GNUC_ON(old-style-cast)
|
| 244 |
+
#endif
|
| 245 |
+
ddsrt_atomic_inc32 (&serdata->refc);
|
| 246 |
+
return serdata;
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
DDS_INLINE_EXPORT inline void ddsi_serdata_unref (struct ddsi_serdata *serdata) {
|
| 250 |
+
if (ddsrt_atomic_dec32_ov (&serdata->refc) == 1)
|
| 251 |
+
serdata->ops->free (serdata);
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
DDS_INLINE_EXPORT inline uint32_t ddsi_serdata_size (const struct ddsi_serdata *d) {
|
| 255 |
+
return d->ops->get_size (d);
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
DDS_INLINE_EXPORT inline struct ddsi_serdata *ddsi_serdata_from_ser (const struct ddsi_sertype *type, enum ddsi_serdata_kind kind, const struct nn_rdata *fragchain, size_t size) {
|
| 259 |
+
return type->serdata_ops->from_ser (type, kind, fragchain, size);
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
DDS_INLINE_EXPORT inline struct ddsi_serdata *ddsi_serdata_from_ser_iov (const struct ddsi_sertype *type, enum ddsi_serdata_kind kind, ddsrt_msg_iovlen_t niov, const ddsrt_iovec_t *iov, size_t size) {
|
| 263 |
+
return type->serdata_ops->from_ser_iov (type, kind, niov, iov, size);
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
DDS_INLINE_EXPORT inline struct ddsi_serdata *ddsi_serdata_from_keyhash (const struct ddsi_sertype *type, const struct ddsi_keyhash *keyhash) {
|
| 267 |
+
return type->serdata_ops->from_keyhash (type, keyhash);
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
DDS_INLINE_EXPORT inline struct ddsi_serdata *ddsi_serdata_from_sample (const struct ddsi_sertype *type, enum ddsi_serdata_kind kind, const void *sample) {
|
| 271 |
+
return type->serdata_ops->from_sample (type, kind, sample);
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
DDS_INLINE_EXPORT inline struct ddsi_serdata *ddsi_serdata_to_untyped (const struct ddsi_serdata *d) {
|
| 275 |
+
return d->ops->to_untyped (d);
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
DDS_INLINE_EXPORT inline void ddsi_serdata_to_ser (const struct ddsi_serdata *d, size_t off, size_t sz, void *buf) {
|
| 279 |
+
d->ops->to_ser (d, off, sz, buf);
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
DDS_INLINE_EXPORT inline struct ddsi_serdata *ddsi_serdata_to_ser_ref (const struct ddsi_serdata *d, size_t off, size_t sz, ddsrt_iovec_t *ref) {
|
| 283 |
+
return d->ops->to_ser_ref (d, off, sz, ref);
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
DDS_INLINE_EXPORT inline void ddsi_serdata_to_ser_unref (struct ddsi_serdata *d, const ddsrt_iovec_t *ref) {
|
| 287 |
+
d->ops->to_ser_unref (d, ref);
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
DDS_INLINE_EXPORT inline bool ddsi_serdata_to_sample (const struct ddsi_serdata *d, void *sample, void **bufptr, void *buflim) {
|
| 291 |
+
return d->ops->to_sample (d, sample, bufptr, buflim);
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
DDS_INLINE_EXPORT inline bool ddsi_serdata_untyped_to_sample (const struct ddsi_sertype *type, const struct ddsi_serdata *d, void *sample, void **bufptr, void *buflim) {
|
| 295 |
+
return d->ops->untyped_to_sample (type, d, sample, bufptr, buflim);
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
DDS_INLINE_EXPORT inline bool ddsi_serdata_eqkey (const struct ddsi_serdata *a, const struct ddsi_serdata *b) {
|
| 299 |
+
return a->ops->eqkey (a, b);
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
DDS_INLINE_EXPORT inline bool ddsi_serdata_print (const struct ddsi_serdata *d, char *buf, size_t size) {
|
| 303 |
+
return d->ops->print (d->type, d, buf, size);
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
+
DDS_INLINE_EXPORT inline bool ddsi_serdata_print_untyped (const struct ddsi_sertype *type, const struct ddsi_serdata *d, char *buf, size_t size) {
|
| 307 |
+
if (d->ops->print)
|
| 308 |
+
return d->ops->print (type, d, buf, size);
|
| 309 |
+
else
|
| 310 |
+
{
|
| 311 |
+
buf[0] = 0;
|
| 312 |
+
return 0;
|
| 313 |
+
}
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
DDS_INLINE_EXPORT inline void ddsi_serdata_get_keyhash (const struct ddsi_serdata *d, struct ddsi_keyhash *buf, bool force_md5) {
|
| 317 |
+
d->ops->get_keyhash (d, buf, force_md5);
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
#ifdef DDS_HAS_SHM
|
| 321 |
+
DDS_INLINE_EXPORT inline uint32_t ddsi_serdata_iox_size(const struct ddsi_serdata* d)
|
| 322 |
+
{
|
| 323 |
+
return d->type->iox_size;
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
inline struct ddsi_serdata* ddsi_serdata_from_iox(const struct ddsi_sertype* type, enum ddsi_serdata_kind kind, void* sub, void* iox_buffer) ddsrt_nonnull_all;
|
| 327 |
+
|
| 328 |
+
DDS_INLINE_EXPORT inline struct ddsi_serdata* ddsi_serdata_from_iox(const struct ddsi_sertype* type, enum ddsi_serdata_kind kind, void* sub, void* iox_buffer)
|
| 329 |
+
{
|
| 330 |
+
return type->serdata_ops->from_iox_buffer(type, kind, sub, iox_buffer);
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
inline struct ddsi_serdata *ddsi_serdata_from_loaned_sample(const struct ddsi_sertype *type, enum ddsi_serdata_kind kind, const char *sample) ddsrt_nonnull_all;
|
| 334 |
+
|
| 335 |
+
DDS_INLINE_EXPORT inline struct ddsi_serdata *ddsi_serdata_from_loaned_sample(const struct ddsi_sertype *type, enum ddsi_serdata_kind kind, const char *sample)
|
| 336 |
+
{
|
| 337 |
+
if (type->serdata_ops->from_iox_buffer)
|
| 338 |
+
return type->serdata_ops->from_iox_buffer (type, kind, NULL, (void *) sample);
|
| 339 |
+
else
|
| 340 |
+
return type->serdata_ops->from_sample (type, kind, sample);
|
| 341 |
+
}
|
| 342 |
+
#endif
|
| 343 |
+
|
| 344 |
+
#if defined (__cplusplus)
|
| 345 |
+
}
|
| 346 |
+
#endif
|
| 347 |
+
|
| 348 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_serdata_default.h
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2022 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_SERDATA_DEFAULT_H
|
| 13 |
+
#define DDSI_SERDATA_DEFAULT_H
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsrt/endian.h"
|
| 16 |
+
#include "dds/ddsi/q_protocol.h" /* for nn_parameterid_t */
|
| 17 |
+
#include "dds/ddsi/q_freelist.h"
|
| 18 |
+
#include "dds/ddsrt/avl.h"
|
| 19 |
+
#include "dds/ddsi/ddsi_serdata.h"
|
| 20 |
+
#include "dds/ddsi/ddsi_plist_generic.h"
|
| 21 |
+
#include "dds/ddsi/ddsi_typelib.h"
|
| 22 |
+
#include "dds/ddsi/ddsi_typelookup.h"
|
| 23 |
+
|
| 24 |
+
#include "dds/dds.h"
|
| 25 |
+
|
| 26 |
+
#if defined (__cplusplus)
|
| 27 |
+
extern "C" {
|
| 28 |
+
#endif
|
| 29 |
+
|
| 30 |
+
struct CDRHeader {
|
| 31 |
+
unsigned short identifier;
|
| 32 |
+
unsigned short options;
|
| 33 |
+
};
|
| 34 |
+
|
| 35 |
+
struct serdatapool {
|
| 36 |
+
struct nn_freelist freelist;
|
| 37 |
+
};
|
| 38 |
+
|
| 39 |
+
#define KEYBUFTYPE_UNSET 0u
|
| 40 |
+
#define KEYBUFTYPE_STATIC 1u // uses u.stbuf
|
| 41 |
+
#define KEYBUFTYPE_DYNALIAS 2u // points into payload
|
| 42 |
+
#define KEYBUFTYPE_DYNALLOC 3u // dynamically allocated
|
| 43 |
+
|
| 44 |
+
#define SERDATA_DEFAULT_KEYSIZE_MASK 0x3FFFFFFFu
|
| 45 |
+
|
| 46 |
+
struct ddsi_serdata_default_key {
|
| 47 |
+
unsigned buftype : 2;
|
| 48 |
+
unsigned keysize : 30;
|
| 49 |
+
union {
|
| 50 |
+
unsigned char stbuf[DDS_FIXED_KEY_MAX_SIZE];
|
| 51 |
+
unsigned char *dynbuf;
|
| 52 |
+
} u;
|
| 53 |
+
};
|
| 54 |
+
|
| 55 |
+
/* Debug builds may want to keep some additional state */
|
| 56 |
+
#ifndef NDEBUG
|
| 57 |
+
#define DDSI_SERDATA_DEFAULT_DEBUG_FIELDS \
|
| 58 |
+
bool fixed;
|
| 59 |
+
#else
|
| 60 |
+
#define DDSI_SERDATA_DEFAULT_DEBUG_FIELDS
|
| 61 |
+
#endif
|
| 62 |
+
|
| 63 |
+
/* There is an alignment requirement on the raw data (it must be at
|
| 64 |
+
offset mod 8 for the conversion to/from a dds_stream to work).
|
| 65 |
+
So we define two types: one without any additional padding, and
|
| 66 |
+
one where the appropriate amount of padding is inserted */
|
| 67 |
+
#define DDSI_SERDATA_DEFAULT_PREPAD \
|
| 68 |
+
struct ddsi_serdata c; \
|
| 69 |
+
uint32_t pos; \
|
| 70 |
+
uint32_t size; \
|
| 71 |
+
DDSI_SERDATA_DEFAULT_DEBUG_FIELDS \
|
| 72 |
+
struct ddsi_serdata_default_key key;\
|
| 73 |
+
struct serdatapool *serpool; \
|
| 74 |
+
struct ddsi_serdata_default *next /* in pool->freelist */
|
| 75 |
+
/* We suppress the zero-array warning (MSVC C4200) here ONLY for MSVC
|
| 76 |
+
and ONLY if it is being compiled as C++ code, as it only causes
|
| 77 |
+
issues there */
|
| 78 |
+
#if defined _MSC_VER && defined __cplusplus
|
| 79 |
+
#define DDSI_SERDATA_DEFAULT_POSTPAD \
|
| 80 |
+
struct CDRHeader hdr; \
|
| 81 |
+
DDSRT_WARNING_MSVC_OFF(4200) \
|
| 82 |
+
char data[]; \
|
| 83 |
+
DDSRT_WARNING_MSVC_ON(4200)
|
| 84 |
+
#else
|
| 85 |
+
#define DDSI_SERDATA_DEFAULT_POSTPAD \
|
| 86 |
+
struct CDRHeader hdr; \
|
| 87 |
+
char data[]
|
| 88 |
+
#endif
|
| 89 |
+
|
| 90 |
+
struct ddsi_serdata_default_unpadded {
|
| 91 |
+
DDSI_SERDATA_DEFAULT_PREPAD;
|
| 92 |
+
DDSI_SERDATA_DEFAULT_POSTPAD;
|
| 93 |
+
};
|
| 94 |
+
|
| 95 |
+
#ifdef __GNUC__
|
| 96 |
+
#define DDSI_SERDATA_DEFAULT_PAD(n) ((n) % 8)
|
| 97 |
+
#else
|
| 98 |
+
#define DDSI_SERDATA_DEFAULT_PAD(n) (n)
|
| 99 |
+
#endif
|
| 100 |
+
|
| 101 |
+
struct ddsi_serdata_default {
|
| 102 |
+
DDSI_SERDATA_DEFAULT_PREPAD;
|
| 103 |
+
char pad[DDSI_SERDATA_DEFAULT_PAD (8 - (offsetof (struct ddsi_serdata_default_unpadded, data) % 8))];
|
| 104 |
+
DDSI_SERDATA_DEFAULT_POSTPAD;
|
| 105 |
+
};
|
| 106 |
+
|
| 107 |
+
#undef DDSI_SERDATA_DEFAULT_PAD
|
| 108 |
+
#undef DDSI_SERDATA_DEFAULT_POSTPAD
|
| 109 |
+
#undef DDSI_SERDATA_DEFAULT_PREPAD
|
| 110 |
+
#undef DDSI_SERDATA_DEFAULT_FIXED_FIELD
|
| 111 |
+
|
| 112 |
+
#ifndef DDS_TOPIC_INTERN_FILTER_FN_DEFINED
|
| 113 |
+
#define DDS_TOPIC_INTERN_FILTER_FN_DEFINED
|
| 114 |
+
typedef bool (*dds_topic_intern_filter_fn) (const void * sample, void *ctx);
|
| 115 |
+
#endif
|
| 116 |
+
|
| 117 |
+
typedef struct ddsi_sertype_default_desc_key {
|
| 118 |
+
uint32_t ops_offs; /* Offset for key ops */
|
| 119 |
+
uint32_t idx; /* Key index (used for key order) */
|
| 120 |
+
} ddsi_sertype_default_desc_key_t;
|
| 121 |
+
|
| 122 |
+
typedef struct ddsi_sertype_default_desc_key_seq {
|
| 123 |
+
uint32_t nkeys;
|
| 124 |
+
ddsi_sertype_default_desc_key_t *keys;
|
| 125 |
+
} ddsi_sertype_default_desc_key_seq_t;
|
| 126 |
+
|
| 127 |
+
typedef struct ddsi_sertype_default_desc_op_seq {
|
| 128 |
+
uint32_t nops; /* Number of words in ops (which >= number of ops stored in preproc output) */
|
| 129 |
+
uint32_t *ops; /* Marshalling meta data */
|
| 130 |
+
} ddsi_sertype_default_desc_op_seq_t;
|
| 131 |
+
|
| 132 |
+
/* Reduced version of dds_topic_descriptor_t */
|
| 133 |
+
struct ddsi_sertype_default_desc {
|
| 134 |
+
uint32_t size; /* Size of topic type */
|
| 135 |
+
uint32_t align; /* Alignment of topic type */
|
| 136 |
+
uint32_t flagset; /* Flags */
|
| 137 |
+
ddsi_sertype_default_desc_key_seq_t keys;
|
| 138 |
+
ddsi_sertype_default_desc_op_seq_t ops;
|
| 139 |
+
ddsi_sertype_cdr_data_t typeinfo_ser;
|
| 140 |
+
ddsi_sertype_cdr_data_t typemap_ser;
|
| 141 |
+
};
|
| 142 |
+
|
| 143 |
+
struct ddsi_sertype_default {
|
| 144 |
+
struct ddsi_sertype c;
|
| 145 |
+
uint16_t encoding_format; /* CDR_ENC_FORMAT_(PLAIN|DELIMITED|PL) - CDR encoding format for the top-level type in this sertype */
|
| 146 |
+
uint16_t write_encoding_version; /* CDR_ENC_VERSION_(1|2) - CDR encoding version used for writing data using this sertype */
|
| 147 |
+
struct serdatapool *serpool;
|
| 148 |
+
struct ddsi_sertype_default_desc type;
|
| 149 |
+
size_t opt_size_xcdr1;
|
| 150 |
+
size_t opt_size_xcdr2;
|
| 151 |
+
};
|
| 152 |
+
|
| 153 |
+
struct ddsi_plist_sample {
|
| 154 |
+
void *blob;
|
| 155 |
+
size_t size;
|
| 156 |
+
nn_parameterid_t keyparam;
|
| 157 |
+
};
|
| 158 |
+
|
| 159 |
+
struct ddsi_rawcdr_sample {
|
| 160 |
+
void *blob;
|
| 161 |
+
size_t size;
|
| 162 |
+
void *key;
|
| 163 |
+
size_t keysize;
|
| 164 |
+
};
|
| 165 |
+
|
| 166 |
+
extern DDS_EXPORT const struct ddsi_sertype_ops ddsi_sertype_ops_default;
|
| 167 |
+
|
| 168 |
+
extern DDS_EXPORT const struct ddsi_serdata_ops ddsi_serdata_ops_cdr;
|
| 169 |
+
extern DDS_EXPORT const struct ddsi_serdata_ops ddsi_serdata_ops_cdr_nokey;
|
| 170 |
+
|
| 171 |
+
extern DDS_EXPORT const struct ddsi_serdata_ops ddsi_serdata_ops_xcdr2;
|
| 172 |
+
extern DDS_EXPORT const struct ddsi_serdata_ops ddsi_serdata_ops_xcdr2_nokey;
|
| 173 |
+
|
| 174 |
+
struct serdatapool * ddsi_serdatapool_new (void);
|
| 175 |
+
void ddsi_serdatapool_free (struct serdatapool * pool);
|
| 176 |
+
dds_return_t ddsi_sertype_default_init (const struct ddsi_domaingv *gv, struct ddsi_sertype_default *st, const dds_topic_descriptor_t *desc, uint16_t min_xcdrv, dds_data_representation_id_t data_representation);
|
| 177 |
+
|
| 178 |
+
#if defined (__cplusplus)
|
| 179 |
+
}
|
| 180 |
+
#endif
|
| 181 |
+
|
| 182 |
+
#endif
|
third-party/GR00T-WholeBodyControl/gear_sonic_deploy/thirdparty/unitree_sdk2/thirdparty/include/dds/ddsi/ddsi_serdata_plist.h
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
| 3 |
+
*
|
| 4 |
+
* This program and the accompanying materials are made available under the
|
| 5 |
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
| 6 |
+
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
| 7 |
+
* v. 1.0 which is available at
|
| 8 |
+
* http://www.eclipse.org/org/documents/edl-v10.php.
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
#ifndef DDSI_SERDATA_PLIST_H
|
| 13 |
+
#define DDSI_SERDATA_PLIST_H
|
| 14 |
+
|
| 15 |
+
#include "dds/ddsi/q_protocol.h" /* for nn_parameterid_t */
|
| 16 |
+
#include "dds/ddsi/ddsi_keyhash.h"
|
| 17 |
+
#include "dds/ddsi/ddsi_serdata.h"
|
| 18 |
+
#include "dds/ddsi/ddsi_sertype.h"
|
| 19 |
+
|
| 20 |
+
#include "dds/dds.h"
|
| 21 |
+
|
| 22 |
+
#if defined (__cplusplus)
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
/* There is an alignment requirement on the raw data (it must be at
|
| 27 |
+
offset mod 8 for the conversion to/from a dds_stream to work).
|
| 28 |
+
So we define two types: one without any additional padding, and
|
| 29 |
+
one where the appropriate amount of padding is inserted */
|
| 30 |
+
#define DDSI_SERDATA_PLIST_PREPAD \
|
| 31 |
+
struct ddsi_serdata c; \
|
| 32 |
+
uint32_t pos; \
|
| 33 |
+
uint32_t size; \
|
| 34 |
+
nn_vendorid_t vendorid; \
|
| 35 |
+
nn_protocol_version_t protoversion; \
|
| 36 |
+
ddsi_keyhash_t keyhash
|
| 37 |
+
#define DDSI_SERDATA_PLIST_POSTPAD \
|
| 38 |
+
uint16_t identifier; \
|
| 39 |
+
uint16_t options; \
|
| 40 |
+
char data[]
|
| 41 |
+
|
| 42 |
+
struct ddsi_serdata_plist_unpadded {
|
| 43 |
+
DDSI_SERDATA_PLIST_PREPAD;
|
| 44 |
+
DDSI_SERDATA_PLIST_POSTPAD;
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
#ifdef __GNUC__
|
| 48 |
+
#define DDSI_SERDATA_PLIST_PAD(n) ((n) % 8)
|
| 49 |
+
#else
|
| 50 |
+
#define DDSI_SERDATA_PLIST_PAD(n) (n)
|
| 51 |
+
#endif
|
| 52 |
+
|
| 53 |
+
struct ddsi_serdata_plist {
|
| 54 |
+
DDSI_SERDATA_PLIST_PREPAD;
|
| 55 |
+
char pad[DDSI_SERDATA_PLIST_PAD (8 - (offsetof (struct ddsi_serdata_plist_unpadded, data) % 8))];
|
| 56 |
+
DDSI_SERDATA_PLIST_POSTPAD;
|
| 57 |
+
};
|
| 58 |
+
|
| 59 |
+
#undef DDSI_SERDATA_PLIST_PAD
|
| 60 |
+
#undef DDSI_SERDATA_PLIST_POSTPAD
|
| 61 |
+
#undef DDSI_SERDATA_PLIST_PREPAD
|
| 62 |
+
|
| 63 |
+
struct ddsi_sertype_plist {
|
| 64 |
+
struct ddsi_sertype c;
|
| 65 |
+
uint16_t encoding_format; /* CDR_ENC_FORMAT_(PLAIN|DELIMITED|PL) */
|
| 66 |
+
nn_parameterid_t keyparam;
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
extern DDS_EXPORT const struct ddsi_sertype_ops ddsi_sertype_ops_plist;
|
| 70 |
+
extern DDS_EXPORT const struct ddsi_serdata_ops ddsi_serdata_ops_plist;
|
| 71 |
+
|
| 72 |
+
#if defined (__cplusplus)
|
| 73 |
+
}
|
| 74 |
+
#endif
|
| 75 |
+
|
| 76 |
+
#endif
|