Merge branch 'master' into security

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2020-02-12 16:00:57 +01:00
commit ad58db0721
158 changed files with 6915 additions and 3361 deletions

View file

@ -50,6 +50,8 @@ extern "C" {
#endif
struct dds_rhc;
struct ddsi_plist;
struct ddsi_sertopic;
struct ddsi_serdata;
#define DDS_MIN_PSEUDO_HANDLE ((dds_entity_t) 0x7fff0000)
@ -555,7 +557,9 @@ dds_set_enabled_status(dds_entity_t entity, uint32_t mask);
* @param[in] entity Entity on which to get qos.
* @param[out] qos Pointer to the qos structure that returns the set policies.
*
* @returns A dds_return_t indicating success or failure.
* @returns A dds_return_t indicating success or failure. The QoS object will have
* at least all QoS relevant for the entity present and the corresponding dds_qget_...
* will return true.
*
* @retval DDS_RETCODE_OK
* The existing set of QoS policy values applied to the entity
@ -962,7 +966,9 @@ dds_lookup_participant(
* @brief Creates a new topic with default type handling.
*
* The type name for the topic is taken from the generated descriptor. Topic
* matching is done on a combination of topic name and type name.
* matching is done on a combination of topic name and type name. Each successful
* call to dds_create_topic creates a new topic entity sharing the same QoS
* settings with all other topics of the same name.
*
* @param[in] participant Participant on which to create the topic.
* @param[in] descriptor An IDL generated topic descriptor.
@ -970,14 +976,20 @@ dds_lookup_participant(
* @param[in] qos QoS to set on the new topic (can be NULL).
* @param[in] listener Any listener functions associated with the new topic (can be NULL).
*
* @returns A valid topic handle or an error code.
* @returns A valid, unique topic handle or an error code.
*
* @retval >=0
* A valid topic handle.
* A valid unique topic handle.
* @retval DDS_RETCODE_BAD_PARAMETER
* Either participant, descriptor, name or qos is invalid.
* @retval DDS_RETCODE_BAD_PARAMETER
* Either participant, descriptor, name or qos is invalid.
* @retval DDS_RETCODE_INCONSISTENT_POLICY
* QoS mismatch between qos and an existing topic's QoS.
* @retval DDS_RETCODE_PRECONDITION_NOT_MET
* Mismatch between type name in descriptor and pre-existing
* topic's type name.
*/
/* TODO: Check list of retcodes is complete. */
DDS_EXPORT dds_entity_t
dds_create_topic(
dds_entity_t participant,
@ -986,13 +998,17 @@ dds_create_topic(
const dds_qos_t *qos,
const dds_listener_t *listener);
struct ddsi_sertopic;
struct nn_plist;
/**
* @brief Creates a new topic with arbitrary type handling.
*
* The type name for the topic is taken from the provided "sertopic" object. Topic
* matching is done on a combination of topic name and type name.
* matching is done on a combination of topic name and type name. Each successful
* call to dds_create_topic creates a new topic entity sharing the same QoS
* settings with all other topics of the same name.
*
* If sertopic is not yet known in the domain, it is added and its refcount
* incremented; if an equivalent sertopic object is already known, then the known
* one is used instead.
*
* @param[in] participant Participant on which to create the topic.
* @param[in] sertopic Internal description of the topic type (includes name).
@ -1000,21 +1016,27 @@ struct nn_plist;
* @param[in] listener Any listener functions associated with the new topic (can be NULL).
* @param[in] sedp_plist Topic description to be published as part of discovery (if NULL, not published).
*
* @returns A valid topic handle or an error code.
* @returns A valid, unique topic handle or an error code.
*
* @retval >=0
* A valid topic handle.
* A valid unique topic handle.
* @retval DDS_RETCODE_BAD_PARAMETER
* Either participant, descriptor, name or qos is invalid.
* @retval DDS_RETCODE_BAD_PARAMETER
* Either participant, descriptor, name or qos is invalid.
* @retval DDS_RETCODE_INCONSISTENT_POLICY
* QoS mismatch between qos and an existing topic's QoS.
* @retval DDS_RETCODE_PRECONDITION_NOT_MET
* Mismatch between type name in sertopic and pre-existing
* topic's type name.
*/
/* TODO: Check list of retcodes is complete. */
DDS_EXPORT dds_entity_t
dds_create_topic_arbitrary (
dds_entity_t participant,
struct ddsi_sertopic *sertopic,
const dds_qos_t *qos,
const dds_listener_t *listener,
const struct nn_plist *sedp_plist);
const struct ddsi_plist *sedp_plist);
/**
* @brief Finds a named topic.
@ -1030,8 +1052,9 @@ dds_create_topic_arbitrary (
* A valid topic handle.
* @retval DDS_RETCODE_BAD_PARAMETER
* Participant was invalid.
* @retval DDS_RETCODE_PRECONDITION_NOT_MET
* No topic of this name existed yet in the participant
*/
/* TODO: Check list of retcodes is complete. */
DDS_EXPORT dds_entity_t
dds_find_topic(dds_entity_t participant, const char *name);
@ -1047,8 +1070,6 @@ dds_find_topic(dds_entity_t participant, const char *name);
* @retval DDS_RETCODE_OK
* Success.
*/
/* TODO: do we need a convenience version as well that allocates and add a _s suffix to this one? */
/* TODO: Check annotation. Could be _Out_writes_to_(size, return + 1) as well. */
DDS_EXPORT dds_return_t
dds_get_name(dds_entity_t topic, char *name, size_t size);
@ -1324,7 +1345,7 @@ dds_create_writer(
*
* This operation registers an instance with a key value to the data writer and
* returns an instance handle that could be used for successive write & dispose
* operations. When the handle is not allocated, the function will return and
* operations. When the handle is not allocated, the function will return an
* error and the handle will be un-touched.
*
* @param[in] writer The writer to which instance has be associated.
@ -2035,7 +2056,7 @@ dds_waitset_attach(
* @returns A dds_return_t indicating success or failure.
*
* @retval DDS_RETCODE_OK
* Entity attached.
* Entity detached.
* @retval DDS_RETCODE_ERROR
* An internal error has occurred.
* @retval DDS_RETCODE_BAD_PARAMETER
@ -2072,7 +2093,7 @@ dds_waitset_detach(
* @returns A dds_return_t indicating success or failure.
*
* @retval DDS_RETCODE_OK
* Entity attached.
* Trigger value set.
* @retval DDS_RETCODE_ERROR
* An internal error has occurred.
* @retval DDS_RETCODE_BAD_PARAMETER

View file

@ -0,0 +1,44 @@
/*
* Copyright(c) 2006 to 2020 ADLINK Technology Limited and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
* v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
/** @file
* WARNING This file is only needed for the work around for https://github.com/eclipse-cyclonedds/cyclonedds/issues/74
* Do not include this file in an application! Once issue #74 is solved this header file should be removed.
*/
#ifndef DDS_INTERNAL_API_H
#define DDS_INTERNAL_API_H
#if defined (__cplusplus)
extern "C" {
#endif
#define DDS_READ_WITHOUT_LOCK (0xFFFFFFED)
/*
* @private
* dds_reader_lock_samples: Returns number of samples in read cache and locks the
* reader cache to make sure that the samples content doesn't change.
* Because the cache is locked, you should be able to read/take without having to
* lock first. This is done by passing the DDS_READ_WITHOUT_LOCK value to the
* read/take call as maxs. Then the read/take will not lock but still unlock.
*
* CycloneDDS doesn't support a read/take that just returns all
* available samples issue #74. As a work around to support LENGTH_UNLIMITED in C++.
* dds_reader_lock_samples() and DDS_READ_WITHOUT_LOCK are needed.
*/
DDS_EXPORT uint32_t
dds_reader_lock_samples (dds_entity_t entity);
#if defined (__cplusplus)
}
#endif
#endif

View file

@ -112,6 +112,7 @@ typedef enum dds_entity_kind
DDS_KIND_DOMAIN,
DDS_KIND_CYCLONEDDS
} dds_entity_kind_t;
#define DDS_KIND_MAX DDS_KIND_CYCLONEDDS
/* Handles are opaque pointers to implementation types */
typedef uint64_t dds_instance_handle_t;

View file

@ -149,6 +149,8 @@ dds_qset_durability (dds_qos_t * __restrict qos, dds_durability_kind_t kind);
/**
* @brief Set the history policy of a qos structure.
*
* Note that depth is only relevant for keep last. If you want limited history for keep all, use dds_qset_resource_limits().
*
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
* @param[in] kind - History kind value \ref DCPS_QoS_History
@ -297,7 +299,7 @@ dds_qset_partition1 (
*
* @param[in,out] qos - Pointer to a dds_qos_t structure that will store the policy
* @param[in] kind - Reliability kind
* @param[in] max_blocking_time - Max blocking duration applied when kind is reliable.
* @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.
*/
DDS_EXPORT void
dds_qset_reliability (