Remove QoS duplication between DDS and DDSI
All this duplication was rather useless: the values are standardized anyway and the conversion was a simple type cast without any check. This commit unifies the definitions. * DDSI now uses the definitions of the various QoS "kind" values from the header file; * The durations in the QoS objects are no longer in wire-format representation, the conversions now happen only in conversion to/from wire format; * The core DDSI stack no longer uses DDSI time representations for time stamps, instead using the "native" one; * QoS policy ids duplication has been eliminated, again using the IDs visible in the API -- the actual values are meaningless to the DDSI stack anyway. Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
13480616e0
commit
12e6946163
38 changed files with 1074 additions and 1242 deletions
|
@ -46,6 +46,7 @@ PREPEND(hdrs_public_ddsc "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/dd
|
||||||
ddsc/dds_public_impl.h
|
ddsc/dds_public_impl.h
|
||||||
ddsc/dds_public_listener.h
|
ddsc/dds_public_listener.h
|
||||||
ddsc/dds_public_qos.h
|
ddsc/dds_public_qos.h
|
||||||
|
ddsc/dds_public_qosdefs.h
|
||||||
ddsc/dds_public_status.h
|
ddsc/dds_public_status.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,6 @@ typedef struct dds_sequence
|
||||||
}
|
}
|
||||||
dds_sequence_t;
|
dds_sequence_t;
|
||||||
|
|
||||||
#define DDS_LENGTH_UNLIMITED -1
|
|
||||||
|
|
||||||
typedef struct dds_key_descriptor
|
typedef struct dds_key_descriptor
|
||||||
{
|
{
|
||||||
const char * m_name;
|
const char * m_name;
|
||||||
|
|
|
@ -21,131 +21,12 @@
|
||||||
#define DDS_QOS_H
|
#define DDS_QOS_H
|
||||||
|
|
||||||
#include "dds/export.h"
|
#include "dds/export.h"
|
||||||
|
#include "dds/ddsc/dds_public_qosdefs.h"
|
||||||
|
|
||||||
#if defined (__cplusplus)
|
#if defined (__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* QoS identifiers */
|
|
||||||
/** @name QoS identifiers
|
|
||||||
@{**/
|
|
||||||
#define DDS_INVALID_QOS_POLICY_ID 0
|
|
||||||
#define DDS_USERDATA_QOS_POLICY_ID 1
|
|
||||||
#define DDS_DURABILITY_QOS_POLICY_ID 2
|
|
||||||
#define DDS_PRESENTATION_QOS_POLICY_ID 3
|
|
||||||
#define DDS_DEADLINE_QOS_POLICY_ID 4
|
|
||||||
#define DDS_LATENCYBUDGET_QOS_POLICY_ID 5
|
|
||||||
#define DDS_OWNERSHIP_QOS_POLICY_ID 6
|
|
||||||
#define DDS_OWNERSHIPSTRENGTH_QOS_POLICY_ID 7
|
|
||||||
#define DDS_LIVELINESS_QOS_POLICY_ID 8
|
|
||||||
#define DDS_TIMEBASEDFILTER_QOS_POLICY_ID 9
|
|
||||||
#define DDS_PARTITION_QOS_POLICY_ID 10
|
|
||||||
#define DDS_RELIABILITY_QOS_POLICY_ID 11
|
|
||||||
#define DDS_DESTINATIONORDER_QOS_POLICY_ID 12
|
|
||||||
#define DDS_HISTORY_QOS_POLICY_ID 13
|
|
||||||
#define DDS_RESOURCELIMITS_QOS_POLICY_ID 14
|
|
||||||
#define DDS_ENTITYFACTORY_QOS_POLICY_ID 15
|
|
||||||
#define DDS_WRITERDATALIFECYCLE_QOS_POLICY_ID 16
|
|
||||||
#define DDS_READERDATALIFECYCLE_QOS_POLICY_ID 17
|
|
||||||
#define DDS_TOPICDATA_QOS_POLICY_ID 18
|
|
||||||
#define DDS_GROUPDATA_QOS_POLICY_ID 19
|
|
||||||
#define DDS_TRANSPORTPRIORITY_QOS_POLICY_ID 20
|
|
||||||
#define DDS_LIFESPAN_QOS_POLICY_ID 21
|
|
||||||
#define DDS_DURABILITYSERVICE_QOS_POLICY_ID 22
|
|
||||||
/** @}*/
|
|
||||||
|
|
||||||
|
|
||||||
/* QoS structure is opaque */
|
|
||||||
/** QoS structure */
|
|
||||||
typedef struct nn_xqos dds_qos_t;
|
|
||||||
|
|
||||||
/** Durability QoS: Applies to Topic, DataReader, DataWriter */
|
|
||||||
typedef enum dds_durability_kind
|
|
||||||
{
|
|
||||||
DDS_DURABILITY_VOLATILE,
|
|
||||||
DDS_DURABILITY_TRANSIENT_LOCAL,
|
|
||||||
DDS_DURABILITY_TRANSIENT,
|
|
||||||
DDS_DURABILITY_PERSISTENT
|
|
||||||
}
|
|
||||||
dds_durability_kind_t;
|
|
||||||
|
|
||||||
/** History QoS: Applies to Topic, DataReader, DataWriter */
|
|
||||||
typedef enum dds_history_kind
|
|
||||||
{
|
|
||||||
DDS_HISTORY_KEEP_LAST,
|
|
||||||
DDS_HISTORY_KEEP_ALL
|
|
||||||
}
|
|
||||||
dds_history_kind_t;
|
|
||||||
|
|
||||||
/** Ownership QoS: Applies to Topic, DataReader, DataWriter */
|
|
||||||
typedef enum dds_ownership_kind
|
|
||||||
{
|
|
||||||
DDS_OWNERSHIP_SHARED,
|
|
||||||
DDS_OWNERSHIP_EXCLUSIVE
|
|
||||||
}
|
|
||||||
dds_ownership_kind_t;
|
|
||||||
|
|
||||||
/** Liveliness QoS: Applies to Topic, DataReader, DataWriter */
|
|
||||||
typedef enum dds_liveliness_kind
|
|
||||||
{
|
|
||||||
DDS_LIVELINESS_AUTOMATIC,
|
|
||||||
DDS_LIVELINESS_MANUAL_BY_PARTICIPANT,
|
|
||||||
DDS_LIVELINESS_MANUAL_BY_TOPIC
|
|
||||||
}
|
|
||||||
dds_liveliness_kind_t;
|
|
||||||
|
|
||||||
/** Reliability QoS: Applies to Topic, DataReader, DataWriter */
|
|
||||||
typedef enum dds_reliability_kind
|
|
||||||
{
|
|
||||||
DDS_RELIABILITY_BEST_EFFORT,
|
|
||||||
DDS_RELIABILITY_RELIABLE
|
|
||||||
}
|
|
||||||
dds_reliability_kind_t;
|
|
||||||
|
|
||||||
/** DestinationOrder QoS: Applies to Topic, DataReader, DataWriter */
|
|
||||||
typedef enum dds_destination_order_kind
|
|
||||||
{
|
|
||||||
DDS_DESTINATIONORDER_BY_RECEPTION_TIMESTAMP,
|
|
||||||
DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP
|
|
||||||
}
|
|
||||||
dds_destination_order_kind_t;
|
|
||||||
|
|
||||||
/** History QoS: Applies to Topic, DataReader, DataWriter */
|
|
||||||
typedef struct dds_history_qospolicy
|
|
||||||
{
|
|
||||||
dds_history_kind_t kind;
|
|
||||||
int32_t depth;
|
|
||||||
}
|
|
||||||
dds_history_qospolicy_t;
|
|
||||||
|
|
||||||
/** ResourceLimits QoS: Applies to Topic, DataReader, DataWriter */
|
|
||||||
typedef struct dds_resource_limits_qospolicy
|
|
||||||
{
|
|
||||||
int32_t max_samples;
|
|
||||||
int32_t max_instances;
|
|
||||||
int32_t max_samples_per_instance;
|
|
||||||
}
|
|
||||||
dds_resource_limits_qospolicy_t;
|
|
||||||
|
|
||||||
/** Presentation QoS: Applies to Publisher, Subscriber */
|
|
||||||
typedef enum dds_presentation_access_scope_kind
|
|
||||||
{
|
|
||||||
DDS_PRESENTATION_INSTANCE,
|
|
||||||
DDS_PRESENTATION_TOPIC,
|
|
||||||
DDS_PRESENTATION_GROUP
|
|
||||||
}
|
|
||||||
dds_presentation_access_scope_kind_t;
|
|
||||||
|
|
||||||
/** Ignore-local QoS: Applies to DataReader, DataWriter */
|
|
||||||
typedef enum dds_ignorelocal_kind
|
|
||||||
{
|
|
||||||
DDS_IGNORELOCAL_NONE,
|
|
||||||
DDS_IGNORELOCAL_PARTICIPANT,
|
|
||||||
DDS_IGNORELOCAL_PROCESS
|
|
||||||
}
|
|
||||||
dds_ignorelocal_kind_t;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Allocate memory and initialize default QoS-policies
|
* @brief Allocate memory and initialize default QoS-policies
|
||||||
*
|
*
|
||||||
|
|
132
src/core/ddsc/include/dds/ddsc/dds_public_qosdefs.h
Normal file
132
src/core/ddsc/include/dds/ddsc/dds_public_qosdefs.h
Normal file
|
@ -0,0 +1,132 @@
|
||||||
|
/*
|
||||||
|
* Copyright(c) 2006 to 2018 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
|
||||||
|
*
|
||||||
|
* @brief DDS C QoS API
|
||||||
|
*
|
||||||
|
* This header file defines the public API of QoS and Policies in the
|
||||||
|
* Eclipse Cyclone DDS C language binding.
|
||||||
|
*/
|
||||||
|
#ifndef DDS_QOSDEFS_H
|
||||||
|
#define DDS_QOSDEFS_H
|
||||||
|
|
||||||
|
#if defined (__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define DDS_LENGTH_UNLIMITED -1
|
||||||
|
|
||||||
|
/** QoS identifiers */
|
||||||
|
typedef enum dds_qos_policy_id {
|
||||||
|
DDS_INVALID_QOS_POLICY_ID,
|
||||||
|
DDS_USERDATA_QOS_POLICY_ID,
|
||||||
|
DDS_DURABILITY_QOS_POLICY_ID,
|
||||||
|
DDS_PRESENTATION_QOS_POLICY_ID,
|
||||||
|
DDS_DEADLINE_QOS_POLICY_ID,
|
||||||
|
DDS_LATENCYBUDGET_QOS_POLICY_ID,
|
||||||
|
DDS_OWNERSHIP_QOS_POLICY_ID,
|
||||||
|
DDS_OWNERSHIPSTRENGTH_QOS_POLICY_ID,
|
||||||
|
DDS_LIVELINESS_QOS_POLICY_ID,
|
||||||
|
DDS_TIMEBASEDFILTER_QOS_POLICY_ID,
|
||||||
|
DDS_PARTITION_QOS_POLICY_ID,
|
||||||
|
DDS_RELIABILITY_QOS_POLICY_ID,
|
||||||
|
DDS_DESTINATIONORDER_QOS_POLICY_ID,
|
||||||
|
DDS_HISTORY_QOS_POLICY_ID,
|
||||||
|
DDS_RESOURCELIMITS_QOS_POLICY_ID,
|
||||||
|
DDS_ENTITYFACTORY_QOS_POLICY_ID,
|
||||||
|
DDS_WRITERDATALIFECYCLE_QOS_POLICY_ID,
|
||||||
|
DDS_READERDATALIFECYCLE_QOS_POLICY_ID,
|
||||||
|
DDS_TOPICDATA_QOS_POLICY_ID,
|
||||||
|
DDS_GROUPDATA_QOS_POLICY_ID,
|
||||||
|
DDS_TRANSPORTPRIORITY_QOS_POLICY_ID,
|
||||||
|
DDS_LIFESPAN_QOS_POLICY_ID,
|
||||||
|
DDS_DURABILITYSERVICE_QOS_POLICY_ID
|
||||||
|
} dds_qos_policy_id_t;
|
||||||
|
|
||||||
|
/* QoS structure is opaque */
|
||||||
|
/** QoS structure */
|
||||||
|
typedef struct dds_qos dds_qos_t;
|
||||||
|
|
||||||
|
/** Durability QoS: Applies to Topic, DataReader, DataWriter */
|
||||||
|
typedef enum dds_durability_kind
|
||||||
|
{
|
||||||
|
DDS_DURABILITY_VOLATILE,
|
||||||
|
DDS_DURABILITY_TRANSIENT_LOCAL,
|
||||||
|
DDS_DURABILITY_TRANSIENT,
|
||||||
|
DDS_DURABILITY_PERSISTENT
|
||||||
|
}
|
||||||
|
dds_durability_kind_t;
|
||||||
|
|
||||||
|
/** History QoS: Applies to Topic, DataReader, DataWriter */
|
||||||
|
typedef enum dds_history_kind
|
||||||
|
{
|
||||||
|
DDS_HISTORY_KEEP_LAST,
|
||||||
|
DDS_HISTORY_KEEP_ALL
|
||||||
|
}
|
||||||
|
dds_history_kind_t;
|
||||||
|
|
||||||
|
/** Ownership QoS: Applies to Topic, DataReader, DataWriter */
|
||||||
|
typedef enum dds_ownership_kind
|
||||||
|
{
|
||||||
|
DDS_OWNERSHIP_SHARED,
|
||||||
|
DDS_OWNERSHIP_EXCLUSIVE
|
||||||
|
}
|
||||||
|
dds_ownership_kind_t;
|
||||||
|
|
||||||
|
/** Liveliness QoS: Applies to Topic, DataReader, DataWriter */
|
||||||
|
typedef enum dds_liveliness_kind
|
||||||
|
{
|
||||||
|
DDS_LIVELINESS_AUTOMATIC,
|
||||||
|
DDS_LIVELINESS_MANUAL_BY_PARTICIPANT,
|
||||||
|
DDS_LIVELINESS_MANUAL_BY_TOPIC
|
||||||
|
}
|
||||||
|
dds_liveliness_kind_t;
|
||||||
|
|
||||||
|
/** Reliability QoS: Applies to Topic, DataReader, DataWriter */
|
||||||
|
typedef enum dds_reliability_kind
|
||||||
|
{
|
||||||
|
DDS_RELIABILITY_BEST_EFFORT,
|
||||||
|
DDS_RELIABILITY_RELIABLE
|
||||||
|
}
|
||||||
|
dds_reliability_kind_t;
|
||||||
|
|
||||||
|
/** DestinationOrder QoS: Applies to Topic, DataReader, DataWriter */
|
||||||
|
typedef enum dds_destination_order_kind
|
||||||
|
{
|
||||||
|
DDS_DESTINATIONORDER_BY_RECEPTION_TIMESTAMP,
|
||||||
|
DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP
|
||||||
|
}
|
||||||
|
dds_destination_order_kind_t;
|
||||||
|
|
||||||
|
/** Presentation QoS: Applies to Publisher, Subscriber */
|
||||||
|
typedef enum dds_presentation_access_scope_kind
|
||||||
|
{
|
||||||
|
DDS_PRESENTATION_INSTANCE,
|
||||||
|
DDS_PRESENTATION_TOPIC,
|
||||||
|
DDS_PRESENTATION_GROUP
|
||||||
|
}
|
||||||
|
dds_presentation_access_scope_kind_t;
|
||||||
|
|
||||||
|
/** Ignore-local QoS: Applies to DataReader, DataWriter */
|
||||||
|
typedef enum dds_ignorelocal_kind
|
||||||
|
{
|
||||||
|
DDS_IGNORELOCAL_NONE,
|
||||||
|
DDS_IGNORELOCAL_PARTICIPANT,
|
||||||
|
DDS_IGNORELOCAL_PROCESS
|
||||||
|
}
|
||||||
|
dds_ignorelocal_kind_t;
|
||||||
|
|
||||||
|
#if defined (__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
|
@ -21,12 +21,12 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool validate_deadline_and_timebased_filter (const nn_duration_t deadline, const nn_duration_t minimum_separation);
|
bool validate_deadline_and_timebased_filter (const dds_duration_t deadline, const dds_duration_t minimum_separation);
|
||||||
bool validate_entityfactory_qospolicy (const nn_entity_factory_qospolicy_t * entityfactory);
|
bool validate_entityfactory_qospolicy (const dds_entity_factory_qospolicy_t * entityfactory);
|
||||||
bool validate_octetseq (const nn_octetseq_t* seq);
|
bool validate_octetseq (const ddsi_octetseq_t* seq);
|
||||||
bool validate_partition_qospolicy (const nn_partition_qospolicy_t * partition);
|
bool validate_partition_qospolicy (const dds_partition_qospolicy_t * partition);
|
||||||
bool validate_reliability_qospolicy (const nn_reliability_qospolicy_t * reliability);
|
bool validate_reliability_qospolicy (const dds_reliability_qospolicy_t * reliability);
|
||||||
bool validate_stringseq (const nn_stringseq_t* seq);
|
bool validate_stringseq (const ddsi_stringseq_t* seq);
|
||||||
|
|
||||||
bool dds_qos_validate_common (const dds_qos_t *qos);
|
bool dds_qos_validate_common (const dds_qos_t *qos);
|
||||||
dds_return_t dds_qos_validate_mutable_common (const dds_qos_t *qos);
|
dds_return_t dds_qos_validate_mutable_common (const dds_qos_t *qos);
|
||||||
|
|
|
@ -19,7 +19,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct rhc;
|
struct rhc;
|
||||||
struct nn_xqos;
|
struct dds_qos;
|
||||||
struct ddsi_serdata;
|
struct ddsi_serdata;
|
||||||
struct ddsi_tkmap_instance;
|
struct ddsi_tkmap_instance;
|
||||||
struct proxy_writer_info;
|
struct proxy_writer_info;
|
||||||
|
@ -54,7 +54,7 @@ dds_rhc_take(
|
||||||
dds_instance_handle_t handle,
|
dds_instance_handle_t handle,
|
||||||
dds_readcond *cond);
|
dds_readcond *cond);
|
||||||
|
|
||||||
DDS_EXPORT void dds_rhc_set_qos (struct rhc * rhc, const struct nn_xqos * qos);
|
DDS_EXPORT void dds_rhc_set_qos (struct rhc * rhc, const struct dds_qos * qos);
|
||||||
|
|
||||||
DDS_EXPORT bool dds_rhc_add_readcondition (dds_readcond * cond);
|
DDS_EXPORT bool dds_rhc_add_readcondition (dds_readcond * cond);
|
||||||
DDS_EXPORT void dds_rhc_remove_readcondition (dds_readcond * cond);
|
DDS_EXPORT void dds_rhc_remove_readcondition (dds_readcond * cond);
|
||||||
|
|
|
@ -24,7 +24,7 @@ struct ddsi_serdata_builtintopic {
|
||||||
struct ddsi_serdata c;
|
struct ddsi_serdata c;
|
||||||
nn_guid_t key;
|
nn_guid_t key;
|
||||||
dds_instance_handle_t pphandle;
|
dds_instance_handle_t pphandle;
|
||||||
nn_xqos_t xqos;
|
dds_qos_t xqos;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ddsi_sertopic_builtintopic_type {
|
enum ddsi_sertopic_builtintopic_type {
|
||||||
|
|
|
@ -128,7 +128,7 @@ bool dds__validate_builtin_reader_qos (dds_entity_t topic, const dds_qos_t *qos)
|
||||||
assert (0);
|
assert (0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return qos_match_p (qos, bwr->wr.xqos) && !qos_has_resource_limits (qos);
|
return !qos_match_p (qos, bwr->wr.xqos, NULL) && !qos_has_resource_limits (qos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,7 @@
|
||||||
#include "dds__qos.h"
|
#include "dds__qos.h"
|
||||||
#include "dds/ddsi/q_config.h"
|
#include "dds/ddsi/q_config.h"
|
||||||
|
|
||||||
/* TODO: dd_duration_t is converted to nn_ddsi_time_t declared in q_time.h
|
static void dds_qos_data_copy_in (ddsi_octetseq_t *data, const void * __restrict value, size_t sz)
|
||||||
This structure contain seconds and fractions.
|
|
||||||
Revisit on the conversion as default values are { 0x7fffffff, 0xffffffff }
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void dds_qos_data_copy_in (nn_octetseq_t *data, const void * __restrict value, size_t sz)
|
|
||||||
{
|
{
|
||||||
if (data->value)
|
if (data->value)
|
||||||
{
|
{
|
||||||
|
@ -34,7 +29,7 @@ static void dds_qos_data_copy_in (nn_octetseq_t *data, const void * __restrict v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool dds_qos_data_copy_out (const nn_octetseq_t *data, void **value, size_t *sz)
|
static bool dds_qos_data_copy_out (const ddsi_octetseq_t *data, void **value, size_t *sz)
|
||||||
{
|
{
|
||||||
assert (data->length < UINT32_MAX);
|
assert (data->length < UINT32_MAX);
|
||||||
if (sz == NULL && value != NULL)
|
if (sz == NULL && value != NULL)
|
||||||
|
@ -57,13 +52,13 @@ static bool dds_qos_data_copy_out (const nn_octetseq_t *data, void **value, size
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool validate_octetseq (const nn_octetseq_t *seq)
|
bool validate_octetseq (const ddsi_octetseq_t *seq)
|
||||||
{
|
{
|
||||||
/* default value is NULL with length 0 */
|
/* default value is NULL with length 0 */
|
||||||
return ((seq->length == 0 && seq->value == NULL) || (seq->length > 0 && seq->length < UINT32_MAX));
|
return ((seq->length == 0 && seq->value == NULL) || (seq->length > 0 && seq->length < UINT32_MAX));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool validate_stringseq (const nn_stringseq_t *seq)
|
bool validate_stringseq (const ddsi_stringseq_t *seq)
|
||||||
{
|
{
|
||||||
if (seq->n == 0)
|
if (seq->n == 0)
|
||||||
return (seq->strs == NULL);
|
return (seq->strs == NULL);
|
||||||
|
@ -76,30 +71,30 @@ bool validate_stringseq (const nn_stringseq_t *seq)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool validate_entityfactory_qospolicy (const nn_entity_factory_qospolicy_t *entityfactory)
|
bool validate_entityfactory_qospolicy (const dds_entity_factory_qospolicy_t *entityfactory)
|
||||||
{
|
{
|
||||||
/* Bools must be 0 or 1, i.e., only the lsb may be set */
|
/* Bools must be 0 or 1, i.e., only the lsb may be set */
|
||||||
return !(entityfactory->autoenable_created_entities & ~1);
|
return !(entityfactory->autoenable_created_entities & ~1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool validate_reliability_qospolicy (const nn_reliability_qospolicy_t *reliability)
|
bool validate_reliability_qospolicy (const dds_reliability_qospolicy_t *reliability)
|
||||||
{
|
{
|
||||||
return ((reliability->kind == NN_BEST_EFFORT_RELIABILITY_QOS || reliability->kind == NN_RELIABLE_RELIABILITY_QOS) &&
|
return ((reliability->kind == DDS_RELIABILITY_BEST_EFFORT || reliability->kind == DDS_RELIABILITY_RELIABLE) &&
|
||||||
(validate_duration (&reliability->max_blocking_time) == 0));
|
(validate_duration (reliability->max_blocking_time) == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool validate_deadline_and_timebased_filter (const nn_duration_t deadline, const nn_duration_t minimum_separation)
|
bool validate_deadline_and_timebased_filter (const dds_duration_t deadline, const dds_duration_t minimum_separation)
|
||||||
{
|
{
|
||||||
return (validate_duration (&deadline) == DDS_RETCODE_OK &&
|
return (validate_duration (deadline) == DDS_RETCODE_OK &&
|
||||||
validate_duration (&minimum_separation) == DDS_RETCODE_OK &&
|
validate_duration (minimum_separation) == DDS_RETCODE_OK &&
|
||||||
nn_from_ddsi_duration (minimum_separation) <= nn_from_ddsi_duration (deadline));
|
minimum_separation <= deadline);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool dds_qos_validate_common (const dds_qos_t *qos)
|
bool dds_qos_validate_common (const dds_qos_t *qos)
|
||||||
{
|
{
|
||||||
return !(((qos->present & QP_DURABILITY) && validate_durability_qospolicy (&qos->durability) != DDS_RETCODE_OK) ||
|
return !(((qos->present & QP_DURABILITY) && validate_durability_qospolicy (&qos->durability) != DDS_RETCODE_OK) ||
|
||||||
((qos->present & QP_DEADLINE) && validate_duration (&qos->deadline.deadline) != DDS_RETCODE_OK) ||
|
((qos->present & QP_DEADLINE) && validate_duration (qos->deadline.deadline) != DDS_RETCODE_OK) ||
|
||||||
((qos->present & QP_LATENCY_BUDGET) && validate_duration (&qos->latency_budget.duration) != DDS_RETCODE_OK) ||
|
((qos->present & QP_LATENCY_BUDGET) && validate_duration (qos->latency_budget.duration) != DDS_RETCODE_OK) ||
|
||||||
((qos->present & QP_OWNERSHIP) && validate_ownership_qospolicy (&qos->ownership) != DDS_RETCODE_OK) ||
|
((qos->present & QP_OWNERSHIP) && validate_ownership_qospolicy (&qos->ownership) != DDS_RETCODE_OK) ||
|
||||||
((qos->present & QP_LIVELINESS) && validate_liveliness_qospolicy (&qos->liveliness) != DDS_RETCODE_OK) ||
|
((qos->present & QP_LIVELINESS) && validate_liveliness_qospolicy (&qos->liveliness) != DDS_RETCODE_OK) ||
|
||||||
((qos->present & QP_RELIABILITY) && ! validate_reliability_qospolicy (&qos->reliability)) ||
|
((qos->present & QP_RELIABILITY) && ! validate_reliability_qospolicy (&qos->reliability)) ||
|
||||||
|
@ -134,32 +129,32 @@ static void dds_qos_init_defaults (dds_qos_t * __restrict qos)
|
||||||
{
|
{
|
||||||
assert (qos);
|
assert (qos);
|
||||||
memset (qos, 0, sizeof (*qos));
|
memset (qos, 0, sizeof (*qos));
|
||||||
qos->durability.kind = (nn_durability_kind_t) DDS_DURABILITY_VOLATILE;
|
qos->durability.kind = DDS_DURABILITY_VOLATILE;
|
||||||
qos->deadline.deadline = nn_to_ddsi_duration (DDS_INFINITY);
|
qos->deadline.deadline = DDS_INFINITY;
|
||||||
qos->durability_service.service_cleanup_delay = nn_to_ddsi_duration (0);
|
qos->durability_service.service_cleanup_delay = 0;
|
||||||
qos->durability_service.history.kind = (nn_history_kind_t) DDS_HISTORY_KEEP_LAST;
|
qos->durability_service.history.kind = DDS_HISTORY_KEEP_LAST;
|
||||||
qos->durability_service.history.depth = 1;
|
qos->durability_service.history.depth = 1;
|
||||||
qos->durability_service.resource_limits.max_samples = DDS_LENGTH_UNLIMITED;
|
qos->durability_service.resource_limits.max_samples = DDS_LENGTH_UNLIMITED;
|
||||||
qos->durability_service.resource_limits.max_instances = DDS_LENGTH_UNLIMITED;
|
qos->durability_service.resource_limits.max_instances = DDS_LENGTH_UNLIMITED;
|
||||||
qos->durability_service.resource_limits.max_samples_per_instance = DDS_LENGTH_UNLIMITED;
|
qos->durability_service.resource_limits.max_samples_per_instance = DDS_LENGTH_UNLIMITED;
|
||||||
qos->presentation.access_scope = (nn_presentation_access_scope_kind_t) DDS_PRESENTATION_INSTANCE;
|
qos->presentation.access_scope = DDS_PRESENTATION_INSTANCE;
|
||||||
qos->latency_budget.duration = nn_to_ddsi_duration (0);
|
qos->latency_budget.duration = 0;
|
||||||
qos->ownership.kind = (nn_ownership_kind_t) DDS_OWNERSHIP_SHARED;
|
qos->ownership.kind = DDS_OWNERSHIP_SHARED;
|
||||||
qos->liveliness.kind = (nn_liveliness_kind_t) DDS_LIVELINESS_AUTOMATIC;
|
qos->liveliness.kind = DDS_LIVELINESS_AUTOMATIC;
|
||||||
qos->liveliness.lease_duration = nn_to_ddsi_duration (DDS_INFINITY);
|
qos->liveliness.lease_duration = DDS_INFINITY;
|
||||||
qos->time_based_filter.minimum_separation = nn_to_ddsi_duration (0);
|
qos->time_based_filter.minimum_separation = 0;
|
||||||
qos->reliability.kind = (nn_reliability_kind_t) DDS_RELIABILITY_BEST_EFFORT;
|
qos->reliability.kind = DDS_RELIABILITY_BEST_EFFORT;
|
||||||
qos->reliability.max_blocking_time = nn_to_ddsi_duration (DDS_MSECS (100));
|
qos->reliability.max_blocking_time = DDS_MSECS (100);
|
||||||
qos->lifespan.duration = nn_to_ddsi_duration (DDS_INFINITY);
|
qos->lifespan.duration = DDS_INFINITY;
|
||||||
qos->destination_order.kind = (nn_destination_order_kind_t) DDS_DESTINATIONORDER_BY_RECEPTION_TIMESTAMP;
|
qos->destination_order.kind = DDS_DESTINATIONORDER_BY_RECEPTION_TIMESTAMP;
|
||||||
qos->history.kind = (nn_history_kind_t) DDS_HISTORY_KEEP_LAST;
|
qos->history.kind = DDS_HISTORY_KEEP_LAST;
|
||||||
qos->history.depth = 1;
|
qos->history.depth = 1;
|
||||||
qos->resource_limits.max_samples = DDS_LENGTH_UNLIMITED;
|
qos->resource_limits.max_samples = DDS_LENGTH_UNLIMITED;
|
||||||
qos->resource_limits.max_instances = DDS_LENGTH_UNLIMITED;
|
qos->resource_limits.max_instances = DDS_LENGTH_UNLIMITED;
|
||||||
qos->resource_limits.max_samples_per_instance = DDS_LENGTH_UNLIMITED;
|
qos->resource_limits.max_samples_per_instance = DDS_LENGTH_UNLIMITED;
|
||||||
qos->writer_data_lifecycle.autodispose_unregistered_instances = true;
|
qos->writer_data_lifecycle.autodispose_unregistered_instances = true;
|
||||||
qos->reader_data_lifecycle.autopurge_nowriter_samples_delay = nn_to_ddsi_duration (DDS_INFINITY);
|
qos->reader_data_lifecycle.autopurge_nowriter_samples_delay = DDS_INFINITY;
|
||||||
qos->reader_data_lifecycle.autopurge_disposed_samples_delay = nn_to_ddsi_duration (DDS_INFINITY);
|
qos->reader_data_lifecycle.autopurge_disposed_samples_delay = DDS_INFINITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
dds_qos_t *dds_create_qos (void)
|
dds_qos_t *dds_create_qos (void)
|
||||||
|
@ -269,7 +264,7 @@ void dds_qset_durability (dds_qos_t * __restrict qos, dds_durability_kind_t kind
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->durability.kind = (nn_durability_kind_t) kind;
|
qos->durability.kind = kind;
|
||||||
qos->present |= QP_DURABILITY;
|
qos->present |= QP_DURABILITY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -278,7 +273,7 @@ void dds_qset_history (dds_qos_t * __restrict qos, dds_history_kind_t kind, int3
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->history.kind = (nn_history_kind_t) kind;
|
qos->history.kind = kind;
|
||||||
qos->history.depth = depth;
|
qos->history.depth = depth;
|
||||||
qos->present |= QP_HISTORY;
|
qos->present |= QP_HISTORY;
|
||||||
}
|
}
|
||||||
|
@ -299,7 +294,7 @@ void dds_qset_presentation (dds_qos_t * __restrict qos, dds_presentation_access_
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->presentation.access_scope = (nn_presentation_access_scope_kind_t) access_scope;
|
qos->presentation.access_scope = access_scope;
|
||||||
qos->presentation.coherent_access = coherent_access;
|
qos->presentation.coherent_access = coherent_access;
|
||||||
qos->presentation.ordered_access = ordered_access;
|
qos->presentation.ordered_access = ordered_access;
|
||||||
qos->present |= QP_PRESENTATION;
|
qos->present |= QP_PRESENTATION;
|
||||||
|
@ -310,7 +305,7 @@ void dds_qset_lifespan (dds_qos_t * __restrict qos, dds_duration_t lifespan)
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->lifespan.duration = nn_to_ddsi_duration (lifespan);
|
qos->lifespan.duration = lifespan;
|
||||||
qos->present |= QP_LIFESPAN;
|
qos->present |= QP_LIFESPAN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -319,7 +314,7 @@ void dds_qset_deadline (dds_qos_t * __restrict qos, dds_duration_t deadline)
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->deadline.deadline = nn_to_ddsi_duration (deadline);
|
qos->deadline.deadline = deadline;
|
||||||
qos->present |= QP_DEADLINE;
|
qos->present |= QP_DEADLINE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -328,7 +323,7 @@ void dds_qset_latency_budget (dds_qos_t * __restrict qos, dds_duration_t duratio
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->latency_budget.duration = nn_to_ddsi_duration (duration);
|
qos->latency_budget.duration = duration;
|
||||||
qos->present |= QP_LATENCY_BUDGET;
|
qos->present |= QP_LATENCY_BUDGET;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -337,7 +332,7 @@ void dds_qset_ownership (dds_qos_t * __restrict qos, dds_ownership_kind_t kind)
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->ownership.kind = (nn_ownership_kind_t) kind;
|
qos->ownership.kind = kind;
|
||||||
qos->present |= QP_OWNERSHIP;
|
qos->present |= QP_OWNERSHIP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -355,8 +350,8 @@ void dds_qset_liveliness (dds_qos_t * __restrict qos, dds_liveliness_kind_t kind
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->liveliness.kind = (nn_liveliness_kind_t) kind;
|
qos->liveliness.kind = kind;
|
||||||
qos->liveliness.lease_duration = nn_to_ddsi_duration (lease_duration);
|
qos->liveliness.lease_duration = lease_duration;
|
||||||
qos->present |= QP_LIVELINESS;
|
qos->present |= QP_LIVELINESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -365,7 +360,7 @@ void dds_qset_time_based_filter (dds_qos_t * __restrict qos, dds_duration_t mini
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->time_based_filter.minimum_separation = nn_to_ddsi_duration (minimum_separation);
|
qos->time_based_filter.minimum_separation = minimum_separation;
|
||||||
qos->present |= QP_TIME_BASED_FILTER;
|
qos->present |= QP_TIME_BASED_FILTER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -405,8 +400,8 @@ void dds_qset_reliability (dds_qos_t * __restrict qos, dds_reliability_kind_t ki
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->reliability.kind = (nn_reliability_kind_t) kind;
|
qos->reliability.kind = kind;
|
||||||
qos->reliability.max_blocking_time = nn_to_ddsi_duration (max_blocking_time);
|
qos->reliability.max_blocking_time = max_blocking_time;
|
||||||
qos->present |= QP_RELIABILITY;
|
qos->present |= QP_RELIABILITY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -424,7 +419,7 @@ void dds_qset_destination_order (dds_qos_t * __restrict qos, dds_destination_ord
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->destination_order.kind = (nn_destination_order_kind_t) kind;
|
qos->destination_order.kind = kind;
|
||||||
qos->present |= QP_DESTINATION_ORDER;
|
qos->present |= QP_DESTINATION_ORDER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -442,8 +437,8 @@ void dds_qset_reader_data_lifecycle (dds_qos_t * __restrict qos, dds_duration_t
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->reader_data_lifecycle.autopurge_nowriter_samples_delay = nn_to_ddsi_duration (autopurge_nowriter_samples_delay);
|
qos->reader_data_lifecycle.autopurge_nowriter_samples_delay = autopurge_nowriter_samples_delay;
|
||||||
qos->reader_data_lifecycle.autopurge_disposed_samples_delay = nn_to_ddsi_duration (autopurge_disposed_samples_delay);
|
qos->reader_data_lifecycle.autopurge_disposed_samples_delay = autopurge_disposed_samples_delay;
|
||||||
qos->present |= QP_PRISMTECH_READER_DATA_LIFECYCLE;
|
qos->present |= QP_PRISMTECH_READER_DATA_LIFECYCLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -452,8 +447,8 @@ void dds_qset_durability_service (dds_qos_t * __restrict qos, dds_duration_t ser
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->durability_service.service_cleanup_delay = nn_to_ddsi_duration (service_cleanup_delay);
|
qos->durability_service.service_cleanup_delay = service_cleanup_delay;
|
||||||
qos->durability_service.history.kind = (nn_history_kind_t) history_kind;
|
qos->durability_service.history.kind = history_kind;
|
||||||
qos->durability_service.history.depth = history_depth;
|
qos->durability_service.history.depth = history_depth;
|
||||||
qos->durability_service.resource_limits.max_samples = max_samples;
|
qos->durability_service.resource_limits.max_samples = max_samples;
|
||||||
qos->durability_service.resource_limits.max_instances = max_instances;
|
qos->durability_service.resource_limits.max_instances = max_instances;
|
||||||
|
@ -466,7 +461,7 @@ void dds_qset_ignorelocal (dds_qos_t * __restrict qos, dds_ignorelocal_kind_t ig
|
||||||
{
|
{
|
||||||
if (qos != NULL)
|
if (qos != NULL)
|
||||||
{
|
{
|
||||||
qos->ignorelocal.value = (nn_ignorelocal_kind_t) ignore;
|
qos->ignorelocal.value = ignore;
|
||||||
qos->present |= QP_CYCLONE_IGNORELOCAL;
|
qos->present |= QP_CYCLONE_IGNORELOCAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -497,7 +492,7 @@ bool dds_qget_durability (const dds_qos_t * __restrict qos, dds_durability_kind_
|
||||||
if (qos == NULL || !(qos->present & QP_DURABILITY))
|
if (qos == NULL || !(qos->present & QP_DURABILITY))
|
||||||
return false;
|
return false;
|
||||||
if (kind)
|
if (kind)
|
||||||
*kind = (dds_durability_kind_t) qos->durability.kind;
|
*kind = qos->durability.kind;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -506,7 +501,7 @@ bool dds_qget_history (const dds_qos_t * __restrict qos, dds_history_kind_t *kin
|
||||||
if (qos == NULL || !(qos->present & QP_HISTORY))
|
if (qos == NULL || !(qos->present & QP_HISTORY))
|
||||||
return false;
|
return false;
|
||||||
if (kind)
|
if (kind)
|
||||||
*kind = (dds_history_kind_t) qos->history.kind;
|
*kind = qos->history.kind;
|
||||||
if (depth)
|
if (depth)
|
||||||
*depth = qos->history.depth;
|
*depth = qos->history.depth;
|
||||||
return true;
|
return true;
|
||||||
|
@ -530,7 +525,7 @@ bool dds_qget_presentation (const dds_qos_t * __restrict qos, dds_presentation_a
|
||||||
if (qos == NULL || !(qos->present & QP_PRESENTATION))
|
if (qos == NULL || !(qos->present & QP_PRESENTATION))
|
||||||
return false;
|
return false;
|
||||||
if (access_scope)
|
if (access_scope)
|
||||||
*access_scope = (dds_presentation_access_scope_kind_t) qos->presentation.access_scope;
|
*access_scope = qos->presentation.access_scope;
|
||||||
if (coherent_access)
|
if (coherent_access)
|
||||||
*coherent_access = qos->presentation.coherent_access;
|
*coherent_access = qos->presentation.coherent_access;
|
||||||
if (ordered_access)
|
if (ordered_access)
|
||||||
|
@ -543,7 +538,7 @@ bool dds_qget_lifespan (const dds_qos_t * __restrict qos, dds_duration_t *lifesp
|
||||||
if (qos == NULL || !(qos->present & QP_LIFESPAN))
|
if (qos == NULL || !(qos->present & QP_LIFESPAN))
|
||||||
return false;
|
return false;
|
||||||
if (lifespan)
|
if (lifespan)
|
||||||
*lifespan = nn_from_ddsi_duration (qos->lifespan.duration);
|
*lifespan = qos->lifespan.duration;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -552,7 +547,7 @@ bool dds_qget_deadline (const dds_qos_t * __restrict qos, dds_duration_t *deadli
|
||||||
if (qos == NULL || !(qos->present & QP_DEADLINE))
|
if (qos == NULL || !(qos->present & QP_DEADLINE))
|
||||||
return false;
|
return false;
|
||||||
if (deadline)
|
if (deadline)
|
||||||
*deadline = nn_from_ddsi_duration (qos->deadline.deadline);
|
*deadline = qos->deadline.deadline;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -561,7 +556,7 @@ bool dds_qget_latency_budget (const dds_qos_t * __restrict qos, dds_duration_t *
|
||||||
if (qos == NULL || !(qos->present & QP_LATENCY_BUDGET))
|
if (qos == NULL || !(qos->present & QP_LATENCY_BUDGET))
|
||||||
return false;
|
return false;
|
||||||
if (duration)
|
if (duration)
|
||||||
*duration = nn_from_ddsi_duration (qos->latency_budget.duration);
|
*duration = qos->latency_budget.duration;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,7 +565,7 @@ bool dds_qget_ownership (const dds_qos_t * __restrict qos, dds_ownership_kind_t
|
||||||
if (qos == NULL || !(qos->present & QP_OWNERSHIP))
|
if (qos == NULL || !(qos->present & QP_OWNERSHIP))
|
||||||
return false;
|
return false;
|
||||||
if (kind)
|
if (kind)
|
||||||
*kind = (dds_ownership_kind_t) qos->ownership.kind;
|
*kind = qos->ownership.kind;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,9 +583,9 @@ bool dds_qget_liveliness (const dds_qos_t * __restrict qos, dds_liveliness_kind_
|
||||||
if (qos == NULL || !(qos->present & QP_LIVELINESS))
|
if (qos == NULL || !(qos->present & QP_LIVELINESS))
|
||||||
return false;
|
return false;
|
||||||
if (kind)
|
if (kind)
|
||||||
*kind = (dds_liveliness_kind_t) qos->liveliness.kind;
|
*kind = qos->liveliness.kind;
|
||||||
if (lease_duration)
|
if (lease_duration)
|
||||||
*lease_duration = nn_from_ddsi_duration (qos->liveliness.lease_duration);
|
*lease_duration = qos->liveliness.lease_duration;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,7 +594,7 @@ bool dds_qget_time_based_filter (const dds_qos_t * __restrict qos, dds_duration_
|
||||||
if (qos == NULL || !(qos->present & QP_TIME_BASED_FILTER))
|
if (qos == NULL || !(qos->present & QP_TIME_BASED_FILTER))
|
||||||
return false;
|
return false;
|
||||||
if (minimum_separation)
|
if (minimum_separation)
|
||||||
*minimum_separation = nn_from_ddsi_duration (qos->time_based_filter.minimum_separation);
|
*minimum_separation = qos->time_based_filter.minimum_separation;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -630,9 +625,9 @@ bool dds_qget_reliability (const dds_qos_t * __restrict qos, dds_reliability_kin
|
||||||
if (qos == NULL || !(qos->present & QP_RELIABILITY))
|
if (qos == NULL || !(qos->present & QP_RELIABILITY))
|
||||||
return false;
|
return false;
|
||||||
if (kind)
|
if (kind)
|
||||||
*kind = (dds_reliability_kind_t) qos->reliability.kind;
|
*kind = qos->reliability.kind;
|
||||||
if (max_blocking_time)
|
if (max_blocking_time)
|
||||||
*max_blocking_time = nn_from_ddsi_duration (qos->reliability.max_blocking_time);
|
*max_blocking_time = qos->reliability.max_blocking_time;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,7 +645,7 @@ bool dds_qget_destination_order (const dds_qos_t * __restrict qos, dds_destinati
|
||||||
if (qos == NULL || !(qos->present & QP_DESTINATION_ORDER))
|
if (qos == NULL || !(qos->present & QP_DESTINATION_ORDER))
|
||||||
return false;
|
return false;
|
||||||
if (kind)
|
if (kind)
|
||||||
*kind = (dds_destination_order_kind_t) qos->destination_order.kind;
|
*kind = qos->destination_order.kind;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,9 +663,9 @@ bool dds_qget_reader_data_lifecycle (const dds_qos_t * __restrict qos, dds_durat
|
||||||
if (qos == NULL || !(qos->present & QP_PRISMTECH_READER_DATA_LIFECYCLE))
|
if (qos == NULL || !(qos->present & QP_PRISMTECH_READER_DATA_LIFECYCLE))
|
||||||
return false;
|
return false;
|
||||||
if (autopurge_nowriter_samples_delay)
|
if (autopurge_nowriter_samples_delay)
|
||||||
*autopurge_nowriter_samples_delay = nn_from_ddsi_duration (qos->reader_data_lifecycle.autopurge_nowriter_samples_delay);
|
*autopurge_nowriter_samples_delay = qos->reader_data_lifecycle.autopurge_nowriter_samples_delay;
|
||||||
if (autopurge_disposed_samples_delay)
|
if (autopurge_disposed_samples_delay)
|
||||||
*autopurge_disposed_samples_delay = nn_from_ddsi_duration (qos->reader_data_lifecycle.autopurge_disposed_samples_delay);
|
*autopurge_disposed_samples_delay = qos->reader_data_lifecycle.autopurge_disposed_samples_delay;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -679,9 +674,9 @@ bool dds_qget_durability_service (const dds_qos_t * __restrict qos, dds_duration
|
||||||
if (qos == NULL || !(qos->present & QP_DURABILITY_SERVICE))
|
if (qos == NULL || !(qos->present & QP_DURABILITY_SERVICE))
|
||||||
return false;
|
return false;
|
||||||
if (service_cleanup_delay)
|
if (service_cleanup_delay)
|
||||||
*service_cleanup_delay = nn_from_ddsi_duration (qos->durability_service.service_cleanup_delay);
|
*service_cleanup_delay = qos->durability_service.service_cleanup_delay;
|
||||||
if (history_kind)
|
if (history_kind)
|
||||||
*history_kind = (dds_history_kind_t) qos->durability_service.history.kind;
|
*history_kind = qos->durability_service.history.kind;
|
||||||
if (history_depth)
|
if (history_depth)
|
||||||
*history_depth = qos->durability_service.history.depth;
|
*history_depth = qos->durability_service.history.depth;
|
||||||
if (max_samples)
|
if (max_samples)
|
||||||
|
@ -698,6 +693,6 @@ bool dds_qget_ignorelocal (const dds_qos_t * __restrict qos, dds_ignorelocal_kin
|
||||||
if (qos == NULL || !(qos->present & QP_CYCLONE_IGNORELOCAL))
|
if (qos == NULL || !(qos->present & QP_CYCLONE_IGNORELOCAL))
|
||||||
return false;
|
return false;
|
||||||
if (ignore)
|
if (ignore)
|
||||||
*ignore = (dds_ignorelocal_kind_t) qos->ignorelocal.value;
|
*ignore = qos->ignorelocal.value;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ static dds_return_t dds_reader_qos_validate (const dds_qos_t *qos, bool enabled)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
if ((qos->present & QP_PRISMTECH_READER_DATA_LIFECYCLE) && validate_reader_data_lifecycle (&qos->reader_data_lifecycle) < 0)
|
if ((qos->present & QP_PRISMTECH_READER_DATA_LIFECYCLE) && validate_reader_data_lifecycle (&qos->reader_data_lifecycle) < 0)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
if ((qos->present & QP_TIME_BASED_FILTER) && validate_duration (&qos->time_based_filter.minimum_separation) < 0)
|
if ((qos->present & QP_TIME_BASED_FILTER) && validate_duration (qos->time_based_filter.minimum_separation) < 0)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
if ((qos->present & QP_HISTORY) && (qos->present & QP_RESOURCE_LIMITS) && validate_history_and_resource_limits (&qos->history, &qos->resource_limits) < 0)
|
if ((qos->present & QP_HISTORY) && (qos->present & QP_RESOURCE_LIMITS) && validate_history_and_resource_limits (&qos->history, &qos->resource_limits) < 0)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
|
@ -432,7 +432,7 @@ dds_entity_t dds_create_reader (dds_entity_t participant_or_subscriber, dds_enti
|
||||||
thread_state_asleep (lookup_thread_state ());
|
thread_state_asleep (lookup_thread_state ());
|
||||||
|
|
||||||
/* For persistent data register reader with durability */
|
/* For persistent data register reader with durability */
|
||||||
if (dds_global.m_dur_reader && (rd->m_entity.m_qos->durability.kind > NN_TRANSIENT_LOCAL_DURABILITY_QOS)) {
|
if (dds_global.m_dur_reader && (rd->m_entity.m_qos->durability.kind > DDS_DURABILITY_TRANSIENT_LOCAL)) {
|
||||||
(dds_global.m_dur_reader) (rd, rhc);
|
(dds_global.m_dur_reader) (rd, rhc);
|
||||||
}
|
}
|
||||||
dds_topic_unlock (tp);
|
dds_topic_unlock (tp);
|
||||||
|
|
|
@ -464,18 +464,18 @@ struct rhc * dds_rhc_new (dds_reader * reader, const struct ddsi_sertopic * topi
|
||||||
return rhc;
|
return rhc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dds_rhc_set_qos (struct rhc * rhc, const nn_xqos_t * qos)
|
void dds_rhc_set_qos (struct rhc * rhc, const dds_qos_t * qos)
|
||||||
{
|
{
|
||||||
/* Set read related QoS */
|
/* Set read related QoS */
|
||||||
|
|
||||||
rhc->max_samples = qos->resource_limits.max_samples;
|
rhc->max_samples = qos->resource_limits.max_samples;
|
||||||
rhc->max_instances = qos->resource_limits.max_instances;
|
rhc->max_instances = qos->resource_limits.max_instances;
|
||||||
rhc->max_samples_per_instance = qos->resource_limits.max_samples_per_instance;
|
rhc->max_samples_per_instance = qos->resource_limits.max_samples_per_instance;
|
||||||
rhc->by_source_ordering = (qos->destination_order.kind == NN_BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS);
|
rhc->by_source_ordering = (qos->destination_order.kind == DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP);
|
||||||
rhc->exclusive_ownership = (qos->ownership.kind == NN_EXCLUSIVE_OWNERSHIP_QOS);
|
rhc->exclusive_ownership = (qos->ownership.kind == DDS_OWNERSHIP_EXCLUSIVE);
|
||||||
rhc->reliable = (qos->reliability.kind == NN_RELIABLE_RELIABILITY_QOS);
|
rhc->reliable = (qos->reliability.kind == DDS_RELIABILITY_RELIABLE);
|
||||||
assert(qos->history.kind != NN_KEEP_LAST_HISTORY_QOS || qos->history.depth > 0);
|
assert(qos->history.kind != DDS_HISTORY_KEEP_LAST || qos->history.depth > 0);
|
||||||
rhc->history_depth = (qos->history.kind == NN_KEEP_LAST_HISTORY_QOS) ? (uint32_t)qos->history.depth : ~0u;
|
rhc->history_depth = (qos->history.kind == DDS_HISTORY_KEEP_LAST) ? (uint32_t)qos->history.depth : ~0u;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool eval_predicate_sample (const struct rhc *rhc, const struct ddsi_serdata *sample, bool (*pred) (const void *sample))
|
static bool eval_predicate_sample (const struct rhc *rhc, const struct ddsi_serdata *sample, bool (*pred) (const void *sample))
|
||||||
|
|
|
@ -186,7 +186,7 @@ static char *dds_string_dup_reuse (char *old, const char *src)
|
||||||
return memcpy (new, src, size);
|
return memcpy (new, src, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static dds_qos_t *dds_qos_from_xqos_reuse (dds_qos_t *old, const nn_xqos_t *src)
|
static dds_qos_t *dds_qos_from_xqos_reuse (dds_qos_t *old, const dds_qos_t *src)
|
||||||
{
|
{
|
||||||
if (old == NULL)
|
if (old == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -188,7 +188,7 @@ static dds_return_t dds_topic_qos_validate (const dds_qos_t *qos, bool enabled)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
if ((qos->present & QP_DURABILITY_SERVICE) && validate_durability_service_qospolicy(&qos->durability_service) < 0)
|
if ((qos->present & QP_DURABILITY_SERVICE) && validate_durability_service_qospolicy(&qos->durability_service) < 0)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
if ((qos->present & QP_LIFESPAN) && validate_duration(&qos->lifespan.duration) < 0)
|
if ((qos->present & QP_LIFESPAN) && validate_duration(qos->lifespan.duration) < 0)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
if ((qos->present & QP_HISTORY) && (qos->present & QP_RESOURCE_LIMITS) && validate_history_and_resource_limits(&qos->history, &qos->resource_limits) < 0)
|
if ((qos->present & QP_HISTORY) && (qos->present & QP_RESOURCE_LIMITS) && validate_history_and_resource_limits(&qos->history, &qos->resource_limits) < 0)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
|
|
|
@ -96,7 +96,7 @@ static dds_return_t deliver_locally (struct writer *wr, struct ddsi_serdata *pay
|
||||||
struct reader ** const rdary = wr->rdary.rdary;
|
struct reader ** const rdary = wr->rdary.rdary;
|
||||||
if (rdary[0])
|
if (rdary[0])
|
||||||
{
|
{
|
||||||
dds_duration_t max_block_ms = nn_from_ddsi_duration (wr->xqos->reliability.max_blocking_time);
|
dds_duration_t max_block_ms = wr->xqos->reliability.max_blocking_time;
|
||||||
struct proxy_writer_info pwr_info;
|
struct proxy_writer_info pwr_info;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
make_proxy_writer_info (&pwr_info, &wr->e, wr->xqos);
|
make_proxy_writer_info (&pwr_info, &wr->e, wr->xqos);
|
||||||
|
@ -121,7 +121,7 @@ static dds_return_t deliver_locally (struct writer *wr, struct ddsi_serdata *pay
|
||||||
ddsrt_avl_iter_t it;
|
ddsrt_avl_iter_t it;
|
||||||
struct pwr_rd_match *m;
|
struct pwr_rd_match *m;
|
||||||
struct proxy_writer_info pwr_info;
|
struct proxy_writer_info pwr_info;
|
||||||
dds_duration_t max_block_ms = nn_from_ddsi_duration (wr->xqos->reliability.max_blocking_time);
|
dds_duration_t max_block_ms = wr->xqos->reliability.max_blocking_time;
|
||||||
ddsrt_mutex_unlock (&wr->rdary.rdary_lock);
|
ddsrt_mutex_unlock (&wr->rdary.rdary_lock);
|
||||||
make_proxy_writer_info (&pwr_info, &wr->e, wr->xqos);
|
make_proxy_writer_info (&pwr_info, &wr->e, wr->xqos);
|
||||||
ddsrt_mutex_lock (&wr->e.lock);
|
ddsrt_mutex_lock (&wr->e.lock);
|
||||||
|
|
|
@ -162,7 +162,7 @@ static void dds_writer_status_cb (void *ventity, const status_cb_data_t *data)
|
||||||
ddsrt_mutex_unlock (&entity->m_observers_lock);
|
ddsrt_mutex_unlock (&entity->m_observers_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t get_bandwidth_limit (nn_transport_priority_qospolicy_t transport_priority)
|
static uint32_t get_bandwidth_limit (dds_transport_priority_qospolicy_t transport_priority)
|
||||||
{
|
{
|
||||||
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
||||||
struct config_channel_listelem *channel = find_channel (transport_priority);
|
struct config_channel_listelem *channel = find_channel (transport_priority);
|
||||||
|
@ -214,7 +214,7 @@ static dds_return_t dds_writer_qos_validate (const dds_qos_t *qos, bool enabled)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
if ((qos->present & QP_DURABILITY_SERVICE) && validate_durability_service_qospolicy (&qos->durability_service) < 0)
|
if ((qos->present & QP_DURABILITY_SERVICE) && validate_durability_service_qospolicy (&qos->durability_service) < 0)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
if ((qos->present & QP_LIFESPAN) && validate_duration (&qos->lifespan.duration) < 0)
|
if ((qos->present & QP_LIFESPAN) && validate_duration (qos->lifespan.duration) < 0)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
if ((qos->present & QP_HISTORY) && (qos->present & QP_RESOURCE_LIMITS) && validate_history_and_resource_limits(&qos->history, &qos->resource_limits) < 0)
|
if ((qos->present & QP_HISTORY) && (qos->present & QP_RESOURCE_LIMITS) && validate_history_and_resource_limits(&qos->history, &qos->resource_limits) < 0)
|
||||||
return DDS_RETCODE_INCONSISTENT_POLICY;
|
return DDS_RETCODE_INCONSISTENT_POLICY;
|
||||||
|
@ -264,8 +264,8 @@ static struct whc *make_whc (const dds_qos_t *qos)
|
||||||
/* Construct WHC -- if aggressive_keep_last1 is set, the WHC will
|
/* Construct WHC -- if aggressive_keep_last1 is set, the WHC will
|
||||||
drop all samples for which a later update is available. This
|
drop all samples for which a later update is available. This
|
||||||
forces it to maintain a tlidx. */
|
forces it to maintain a tlidx. */
|
||||||
handle_as_transient_local = (qos->durability.kind == NN_TRANSIENT_LOCAL_DURABILITY_QOS);
|
handle_as_transient_local = (qos->durability.kind == DDS_DURABILITY_TRANSIENT_LOCAL);
|
||||||
if (qos->history.kind == NN_KEEP_ALL_HISTORY_QOS)
|
if (qos->history.kind == DDS_HISTORY_KEEP_ALL)
|
||||||
hdepth = 0;
|
hdepth = 0;
|
||||||
else
|
else
|
||||||
hdepth = (unsigned) qos->history.depth;
|
hdepth = (unsigned) qos->history.depth;
|
||||||
|
@ -273,7 +273,7 @@ static struct whc *make_whc (const dds_qos_t *qos)
|
||||||
tldepth = 0;
|
tldepth = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (qos->durability_service.history.kind == NN_KEEP_ALL_HISTORY_QOS)
|
if (qos->durability_service.history.kind == DDS_HISTORY_KEEP_ALL)
|
||||||
tldepth = 0;
|
tldepth = 0;
|
||||||
else
|
else
|
||||||
tldepth = (unsigned) qos->durability_service.history.depth;
|
tldepth = (unsigned) qos->durability_service.history.depth;
|
||||||
|
|
|
@ -41,7 +41,14 @@ static dds_time_t waitTimeout = DDS_SECS (2);
|
||||||
static dds_time_t shortTimeout = DDS_MSECS (10);
|
static dds_time_t shortTimeout = DDS_MSECS (10);
|
||||||
static dds_publication_matched_status_t publication_matched;
|
static dds_publication_matched_status_t publication_matched;
|
||||||
static dds_subscription_matched_status_t subscription_matched;
|
static dds_subscription_matched_status_t subscription_matched;
|
||||||
static dds_resource_limits_qospolicy_t resource_limits = {1,1,1};
|
|
||||||
|
struct reslimits {
|
||||||
|
int32_t max_samples;
|
||||||
|
int32_t max_instances;
|
||||||
|
int32_t max_samples_per_instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct reslimits resource_limits = {1,1,1};
|
||||||
|
|
||||||
static dds_instance_handle_t reader_i_hdl = 0;
|
static dds_instance_handle_t reader_i_hdl = 0;
|
||||||
static dds_instance_handle_t writer_i_hdl = 0;
|
static dds_instance_handle_t writer_i_hdl = 0;
|
||||||
|
|
|
@ -17,7 +17,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct rhc;
|
struct rhc;
|
||||||
struct nn_xqos;
|
struct dds_qos;
|
||||||
struct ddsi_tkmap_instance;
|
struct ddsi_tkmap_instance;
|
||||||
struct ddsi_serdata;
|
struct ddsi_serdata;
|
||||||
struct ddsi_sertopic;
|
struct ddsi_sertopic;
|
||||||
|
@ -41,10 +41,10 @@ struct ddsi_rhc_plugin
|
||||||
(struct rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info);
|
(struct rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info);
|
||||||
void (*rhc_relinquish_ownership_fn)
|
void (*rhc_relinquish_ownership_fn)
|
||||||
(struct rhc * __restrict rhc, const uint64_t wr_iid);
|
(struct rhc * __restrict rhc, const uint64_t wr_iid);
|
||||||
void (*rhc_set_qos_fn) (struct rhc * rhc, const struct nn_xqos * qos);
|
void (*rhc_set_qos_fn) (struct rhc * rhc, const struct dds_qos * qos);
|
||||||
};
|
};
|
||||||
|
|
||||||
DDS_EXPORT void make_proxy_writer_info(struct proxy_writer_info *pwr_info, const struct entity_common *e, const struct nn_xqos *xqos);
|
DDS_EXPORT void make_proxy_writer_info(struct proxy_writer_info *pwr_info, const struct entity_common *e, const struct dds_qos *xqos);
|
||||||
|
|
||||||
#if defined (__cplusplus)
|
#if defined (__cplusplus)
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ struct nn_rdata;
|
||||||
struct addrset;
|
struct addrset;
|
||||||
struct ddsi_sertopic;
|
struct ddsi_sertopic;
|
||||||
struct whc;
|
struct whc;
|
||||||
struct nn_xqos;
|
struct dds_qos;
|
||||||
struct nn_plist;
|
struct nn_plist;
|
||||||
struct lease;
|
struct lease;
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ struct writer
|
||||||
nn_count_t hbfragcount; /* last hb frag seq number */
|
nn_count_t hbfragcount; /* last hb frag seq number */
|
||||||
int throttling; /* non-zero when some thread is waiting for the WHC to shrink */
|
int throttling; /* non-zero when some thread is waiting for the WHC to shrink */
|
||||||
struct hbcontrol hbcontrol; /* controls heartbeat timing, piggybacking */
|
struct hbcontrol hbcontrol; /* controls heartbeat timing, piggybacking */
|
||||||
struct nn_xqos *xqos;
|
struct dds_qos *xqos;
|
||||||
enum writer_state state;
|
enum writer_state state;
|
||||||
unsigned reliable: 1; /* iff 1, writer is reliable <=> heartbeat_xevent != NULL */
|
unsigned reliable: 1; /* iff 1, writer is reliable <=> heartbeat_xevent != NULL */
|
||||||
unsigned handle_as_transient_local: 1; /* controls whether data is retained in WHC */
|
unsigned handle_as_transient_local: 1; /* controls whether data is retained in WHC */
|
||||||
|
@ -270,7 +270,7 @@ struct reader
|
||||||
status_cb_t status_cb;
|
status_cb_t status_cb;
|
||||||
void * status_cb_entity;
|
void * status_cb_entity;
|
||||||
struct rhc * rhc; /* reader history, tracks registrations and data */
|
struct rhc * rhc; /* reader history, tracks registrations and data */
|
||||||
struct nn_xqos *xqos;
|
struct dds_qos *xqos;
|
||||||
unsigned reliable: 1; /* 1 iff reader is reliable */
|
unsigned reliable: 1; /* 1 iff reader is reliable */
|
||||||
unsigned handle_as_transient_local: 1; /* 1 iff reader wants historical data from proxy writers */
|
unsigned handle_as_transient_local: 1; /* 1 iff reader wants historical data from proxy writers */
|
||||||
#ifdef DDSI_INCLUDE_SSM
|
#ifdef DDSI_INCLUDE_SSM
|
||||||
|
@ -323,7 +323,7 @@ struct proxy_group {
|
||||||
nn_guid_t guid;
|
nn_guid_t guid;
|
||||||
char *name;
|
char *name;
|
||||||
struct proxy_participant *proxypp; /* uncounted backref to proxy participant */
|
struct proxy_participant *proxypp; /* uncounted backref to proxy participant */
|
||||||
struct nn_xqos *xqos; /* publisher/subscriber QoS */
|
struct dds_qos *xqos; /* publisher/subscriber QoS */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct proxy_endpoint_common
|
struct proxy_endpoint_common
|
||||||
|
@ -331,7 +331,7 @@ struct proxy_endpoint_common
|
||||||
struct proxy_participant *proxypp; /* counted backref to proxy participant */
|
struct proxy_participant *proxypp; /* counted backref to proxy participant */
|
||||||
struct proxy_endpoint_common *next_ep; /* next \ endpoint belonging to this proxy participant */
|
struct proxy_endpoint_common *next_ep; /* next \ endpoint belonging to this proxy participant */
|
||||||
struct proxy_endpoint_common *prev_ep; /* prev / -- this is in arbitrary ordering */
|
struct proxy_endpoint_common *prev_ep; /* prev / -- this is in arbitrary ordering */
|
||||||
struct nn_xqos *xqos; /* proxy endpoint QoS lives here; FIXME: local ones should have it moved to common as well */
|
struct dds_qos *xqos; /* proxy endpoint QoS lives here; FIXME: local ones should have it moved to common as well */
|
||||||
struct ddsi_sertopic * topic; /* topic may be NULL: for built-ins, but also for never-yet matched proxies (so we don't have to know the topic; when we match, we certainly do know) */
|
struct ddsi_sertopic * topic; /* topic may be NULL: for built-ins, but also for never-yet matched proxies (so we don't have to know the topic; when we match, we certainly do know) */
|
||||||
struct addrset *as; /* address set to use for communicating with this endpoint */
|
struct addrset *as; /* address set to use for communicating with this endpoint */
|
||||||
nn_guid_t group_guid; /* 0:0:0:0 if not available */
|
nn_guid_t group_guid; /* 0:0:0:0 if not available */
|
||||||
|
@ -539,9 +539,9 @@ struct writer *get_builtin_writer (const struct participant *pp, unsigned entity
|
||||||
GUID "ppguid". May return NULL if participant unknown or
|
GUID "ppguid". May return NULL if participant unknown or
|
||||||
writer/reader already known. */
|
writer/reader already known. */
|
||||||
|
|
||||||
dds_return_t new_writer (struct writer **wr_out, struct nn_guid *wrguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc * whc, status_cb_t status_cb, void *status_cb_arg);
|
dds_return_t new_writer (struct writer **wr_out, struct nn_guid *wrguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct whc * whc, status_cb_t status_cb, void *status_cb_arg);
|
||||||
|
|
||||||
dds_return_t new_reader (struct reader **rd_out, struct nn_guid *rdguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct rhc * rhc, status_cb_t status_cb, void *status_cb_arg);
|
dds_return_t new_reader (struct reader **rd_out, struct nn_guid *rdguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct rhc * rhc, status_cb_t status_cb, void *status_cb_arg);
|
||||||
|
|
||||||
struct whc_node;
|
struct whc_node;
|
||||||
struct whc_state;
|
struct whc_state;
|
||||||
|
@ -561,7 +561,7 @@ uint64_t reader_instance_id (const struct nn_guid *guid);
|
||||||
struct local_orphan_writer {
|
struct local_orphan_writer {
|
||||||
struct writer wr;
|
struct writer wr;
|
||||||
};
|
};
|
||||||
struct local_orphan_writer *new_local_orphan_writer (nn_entityid_t entityid, struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc *whc);
|
struct local_orphan_writer *new_local_orphan_writer (nn_entityid_t entityid, struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct whc *whc);
|
||||||
void delete_local_orphan_writer (struct local_orphan_writer *wr);
|
void delete_local_orphan_writer (struct local_orphan_writer *wr);
|
||||||
|
|
||||||
/* To create or delete a new proxy participant: "guid" MUST have the
|
/* To create or delete a new proxy participant: "guid" MUST have the
|
||||||
|
@ -623,7 +623,7 @@ int delete_proxy_reader (const struct nn_guid *guid, nn_wctime_t timestamp, int
|
||||||
void update_proxy_reader (struct proxy_reader * prd, struct addrset *as);
|
void update_proxy_reader (struct proxy_reader * prd, struct addrset *as);
|
||||||
void update_proxy_writer (struct proxy_writer * pwr, struct addrset *as);
|
void update_proxy_writer (struct proxy_writer * pwr, struct addrset *as);
|
||||||
|
|
||||||
int new_proxy_group (const struct nn_guid *guid, const char *name, const struct nn_xqos *xqos, nn_wctime_t timestamp);
|
int new_proxy_group (const struct nn_guid *guid, const char *name, const struct dds_qos *xqos, nn_wctime_t timestamp);
|
||||||
void delete_proxy_group (const struct nn_guid *guid, nn_wctime_t timestamp, int isimplicit);
|
void delete_proxy_group (const struct nn_guid *guid, nn_wctime_t timestamp, int isimplicit);
|
||||||
|
|
||||||
uint64_t writer_instance_id (const struct nn_guid *guid);
|
uint64_t writer_instance_id (const struct nn_guid *guid);
|
||||||
|
|
|
@ -233,15 +233,15 @@ struct q_globals {
|
||||||
packets); plus the actual QoSs needed for the builtin
|
packets); plus the actual QoSs needed for the builtin
|
||||||
endpoints. */
|
endpoints. */
|
||||||
nn_plist_t default_plist_pp;
|
nn_plist_t default_plist_pp;
|
||||||
nn_xqos_t default_xqos_rd;
|
dds_qos_t default_xqos_rd;
|
||||||
nn_xqos_t default_xqos_wr;
|
dds_qos_t default_xqos_wr;
|
||||||
nn_xqos_t default_xqos_wr_nad;
|
dds_qos_t default_xqos_wr_nad;
|
||||||
nn_xqos_t default_xqos_tp;
|
dds_qos_t default_xqos_tp;
|
||||||
nn_xqos_t default_xqos_sub;
|
dds_qos_t default_xqos_sub;
|
||||||
nn_xqos_t default_xqos_pub;
|
dds_qos_t default_xqos_pub;
|
||||||
nn_xqos_t spdp_endpoint_xqos;
|
dds_qos_t spdp_endpoint_xqos;
|
||||||
nn_xqos_t builtin_endpoint_xqos_rd;
|
dds_qos_t builtin_endpoint_xqos_rd;
|
||||||
nn_xqos_t builtin_endpoint_xqos_wr;
|
dds_qos_t builtin_endpoint_xqos_wr;
|
||||||
|
|
||||||
/* SPDP packets get very special treatment (they're the only packets
|
/* SPDP packets get very special treatment (they're the only packets
|
||||||
we accept from writers we don't know) and have their very own
|
we accept from writers we don't know) and have their very own
|
||||||
|
|
|
@ -137,7 +137,7 @@ typedef struct nn_plist {
|
||||||
uint64_t aliased;
|
uint64_t aliased;
|
||||||
int unalias_needs_bswap;
|
int unalias_needs_bswap;
|
||||||
|
|
||||||
nn_xqos_t qos;
|
dds_qos_t qos;
|
||||||
|
|
||||||
nn_protocol_version_t protocol_version;
|
nn_protocol_version_t protocol_version;
|
||||||
nn_vendorid_t vendorid;
|
nn_vendorid_t vendorid;
|
||||||
|
@ -151,7 +151,7 @@ typedef struct nn_plist {
|
||||||
unsigned char expects_inline_qos;
|
unsigned char expects_inline_qos;
|
||||||
nn_count_t participant_manual_liveliness_count;
|
nn_count_t participant_manual_liveliness_count;
|
||||||
unsigned participant_builtin_endpoints;
|
unsigned participant_builtin_endpoints;
|
||||||
nn_duration_t participant_lease_duration;
|
dds_duration_t participant_lease_duration;
|
||||||
/* nn_content_filter_property_t content_filter_property; */
|
/* nn_content_filter_property_t content_filter_property; */
|
||||||
nn_guid_t participant_guid;
|
nn_guid_t participant_guid;
|
||||||
nn_guid_t endpoint_guid;
|
nn_guid_t endpoint_guid;
|
||||||
|
@ -245,20 +245,19 @@ DDS_EXPORT void nn_plist_fini (nn_plist_t *ps);
|
||||||
DDS_EXPORT void nn_plist_addtomsg (struct nn_xmsg *m, const nn_plist_t *ps, uint64_t pwanted, uint64_t qwanted);
|
DDS_EXPORT void nn_plist_addtomsg (struct nn_xmsg *m, const nn_plist_t *ps, uint64_t pwanted, uint64_t qwanted);
|
||||||
DDS_EXPORT void nn_plist_init_default_participant (nn_plist_t *plist);
|
DDS_EXPORT void nn_plist_init_default_participant (nn_plist_t *plist);
|
||||||
|
|
||||||
DDS_EXPORT dds_return_t validate_history_qospolicy (const nn_history_qospolicy_t *q);
|
DDS_EXPORT dds_return_t validate_history_qospolicy (const dds_history_qospolicy_t *q);
|
||||||
DDS_EXPORT dds_return_t validate_durability_qospolicy (const nn_durability_qospolicy_t *q);
|
DDS_EXPORT dds_return_t validate_durability_qospolicy (const dds_durability_qospolicy_t *q);
|
||||||
DDS_EXPORT dds_return_t validate_resource_limits_qospolicy (const nn_resource_limits_qospolicy_t *q);
|
DDS_EXPORT dds_return_t validate_resource_limits_qospolicy (const dds_resource_limits_qospolicy_t *q);
|
||||||
DDS_EXPORT dds_return_t validate_history_and_resource_limits (const nn_history_qospolicy_t *qh, const nn_resource_limits_qospolicy_t *qr);
|
DDS_EXPORT dds_return_t validate_history_and_resource_limits (const dds_history_qospolicy_t *qh, const dds_resource_limits_qospolicy_t *qr);
|
||||||
DDS_EXPORT dds_return_t validate_durability_service_qospolicy (const nn_durability_service_qospolicy_t *q);
|
DDS_EXPORT dds_return_t validate_durability_service_qospolicy (const dds_durability_service_qospolicy_t *q);
|
||||||
DDS_EXPORT dds_return_t validate_liveliness_qospolicy (const nn_liveliness_qospolicy_t *q);
|
DDS_EXPORT dds_return_t validate_liveliness_qospolicy (const dds_liveliness_qospolicy_t *q);
|
||||||
DDS_EXPORT dds_return_t validate_destination_order_qospolicy (const nn_destination_order_qospolicy_t *q);
|
DDS_EXPORT dds_return_t validate_destination_order_qospolicy (const dds_destination_order_qospolicy_t *q);
|
||||||
DDS_EXPORT dds_return_t validate_ownership_qospolicy (const nn_ownership_qospolicy_t *q);
|
DDS_EXPORT dds_return_t validate_ownership_qospolicy (const dds_ownership_qospolicy_t *q);
|
||||||
DDS_EXPORT dds_return_t validate_ownership_strength_qospolicy (const nn_ownership_strength_qospolicy_t *q);
|
DDS_EXPORT dds_return_t validate_ownership_strength_qospolicy (const dds_ownership_strength_qospolicy_t *q);
|
||||||
DDS_EXPORT dds_return_t validate_presentation_qospolicy (const nn_presentation_qospolicy_t *q);
|
DDS_EXPORT dds_return_t validate_presentation_qospolicy (const dds_presentation_qospolicy_t *q);
|
||||||
DDS_EXPORT dds_return_t validate_transport_priority_qospolicy (const nn_transport_priority_qospolicy_t *q);
|
DDS_EXPORT dds_return_t validate_transport_priority_qospolicy (const dds_transport_priority_qospolicy_t *q);
|
||||||
DDS_EXPORT dds_return_t validate_reader_data_lifecycle (const nn_reader_data_lifecycle_qospolicy_t *q);
|
DDS_EXPORT dds_return_t validate_reader_data_lifecycle (const dds_reader_data_lifecycle_qospolicy_t *q);
|
||||||
DDS_EXPORT dds_return_t validate_duration (const nn_duration_t *d);
|
DDS_EXPORT dds_return_t validate_duration (const dds_duration_t d);
|
||||||
|
|
||||||
|
|
||||||
struct nn_rmsg;
|
struct nn_rmsg;
|
||||||
struct nn_rsample_info;
|
struct nn_rsample_info;
|
||||||
|
|
|
@ -167,7 +167,7 @@ typedef enum SubmessageKind {
|
||||||
|
|
||||||
typedef struct InfoTimestamp {
|
typedef struct InfoTimestamp {
|
||||||
SubmessageHeader_t smhdr;
|
SubmessageHeader_t smhdr;
|
||||||
nn_ddsi_time_t time;
|
ddsi_time_t time;
|
||||||
} InfoTimestamp_t;
|
} InfoTimestamp_t;
|
||||||
|
|
||||||
typedef struct EntityId {
|
typedef struct EntityId {
|
||||||
|
@ -196,7 +196,7 @@ typedef struct InfoSRC {
|
||||||
#define PL_CDR_LE 0x0003u
|
#define PL_CDR_LE 0x0003u
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef unsigned short nn_parameterid_t; /* spec says short */
|
typedef uint16_t nn_parameterid_t; /* spec says short */
|
||||||
typedef struct nn_parameter {
|
typedef struct nn_parameter {
|
||||||
nn_parameterid_t parameterid;
|
nn_parameterid_t parameterid;
|
||||||
uint16_t length; /* spec says signed short */
|
uint16_t length; /* spec says signed short */
|
||||||
|
@ -257,7 +257,7 @@ typedef struct Gap {
|
||||||
|
|
||||||
typedef struct InfoTS {
|
typedef struct InfoTS {
|
||||||
SubmessageHeader_t smhdr;
|
SubmessageHeader_t smhdr;
|
||||||
nn_ddsi_time_t time;
|
ddsi_time_t time;
|
||||||
} InfoTS_t;
|
} InfoTS_t;
|
||||||
#define INFOTS_INVALIDATE_FLAG 0x2u
|
#define INFOTS_INVALIDATE_FLAG 0x2u
|
||||||
|
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct nn_xqos;
|
struct dds_qos;
|
||||||
|
|
||||||
int partitions_match_p (const struct nn_xqos *a, const struct nn_xqos *b);
|
int partitions_match_p (const struct dds_qos *a, const struct dds_qos *b);
|
||||||
|
|
||||||
/* Returns -1 on success, or QoS id of first mismatch (>=0) */
|
/* Returns -1 on success, or QoS id of first mismatch (>=0) */
|
||||||
|
|
||||||
int32_t qos_match_p (const struct nn_xqos *rd, const struct nn_xqos *wr);
|
bool qos_match_p (const struct dds_qos *rd, const struct dds_qos *wr, dds_qos_policy_id_t *reason) ddsrt_nonnull ((1, 2));
|
||||||
|
|
||||||
#if defined (__cplusplus)
|
#if defined (__cplusplus)
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ struct nn_rsample_info {
|
||||||
struct proxy_writer *pwr;
|
struct proxy_writer *pwr;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
uint32_t fragsize;
|
uint32_t fragsize;
|
||||||
nn_ddsi_time_t timestamp;
|
nn_wctime_t timestamp;
|
||||||
nn_wctime_t reception_timestamp; /* OpenSplice extension -- but we get it essentially for free, so why not? */
|
nn_wctime_t reception_timestamp; /* OpenSplice extension -- but we get it essentially for free, so why not? */
|
||||||
unsigned statusinfo: 2; /* just the two defined bits from the status info */
|
unsigned statusinfo: 2; /* just the two defined bits from the status info */
|
||||||
unsigned pt_wr_info_zoff: 16; /* PrismTech writer info offset */
|
unsigned pt_wr_info_zoff: 16; /* PrismTech writer info offset */
|
||||||
|
|
|
@ -26,11 +26,13 @@ extern "C" {
|
||||||
#define T_MICROSECOND (T_MILLISECOND/1000)
|
#define T_MICROSECOND (T_MILLISECOND/1000)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int seconds;
|
int32_t seconds;
|
||||||
unsigned fraction;
|
uint32_t fraction;
|
||||||
} nn_ddsi_time_t;
|
} ddsi_time_t;
|
||||||
|
#define DDSI_TIME_INFINITE ((ddsi_time_t) { INT32_MAX, UINT32_MAX })
|
||||||
|
#define DDSI_TIME_INVALID ((ddsi_time_t) { -1, UINT32_MAX })
|
||||||
|
|
||||||
typedef nn_ddsi_time_t nn_duration_t;
|
typedef ddsi_time_t ddsi_duration_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int64_t v;
|
int64_t v;
|
||||||
|
@ -44,11 +46,9 @@ typedef struct {
|
||||||
int64_t v;
|
int64_t v;
|
||||||
} nn_etime_t;
|
} nn_etime_t;
|
||||||
|
|
||||||
extern const nn_ddsi_time_t invalid_ddsi_timestamp;
|
#define NN_WCTIME_INVALID ((nn_wctime_t) { INT64_MIN })
|
||||||
extern const nn_ddsi_time_t ddsi_time_infinite;
|
|
||||||
extern const nn_duration_t duration_infinite;
|
|
||||||
|
|
||||||
int valid_ddsi_timestamp (nn_ddsi_time_t t);
|
int valid_ddsi_timestamp (ddsi_time_t t);
|
||||||
|
|
||||||
DDS_EXPORT nn_wctime_t now (void); /* wall clock time */
|
DDS_EXPORT nn_wctime_t now (void); /* wall clock time */
|
||||||
DDS_EXPORT nn_mtime_t now_mt (void); /* monotonic time */
|
DDS_EXPORT nn_mtime_t now_mt (void); /* monotonic time */
|
||||||
|
@ -61,10 +61,10 @@ DDS_EXPORT nn_mtime_t add_duration_to_mtime (nn_mtime_t t, int64_t d);
|
||||||
DDS_EXPORT nn_wctime_t add_duration_to_wctime (nn_wctime_t t, int64_t d);
|
DDS_EXPORT nn_wctime_t add_duration_to_wctime (nn_wctime_t t, int64_t d);
|
||||||
DDS_EXPORT nn_etime_t add_duration_to_etime (nn_etime_t t, int64_t d);
|
DDS_EXPORT nn_etime_t add_duration_to_etime (nn_etime_t t, int64_t d);
|
||||||
|
|
||||||
DDS_EXPORT nn_ddsi_time_t nn_wctime_to_ddsi_time (nn_wctime_t t);
|
DDS_EXPORT ddsi_time_t nn_wctime_to_ddsi_time (nn_wctime_t t);
|
||||||
DDS_EXPORT nn_wctime_t nn_wctime_from_ddsi_time (nn_ddsi_time_t x);
|
DDS_EXPORT nn_wctime_t nn_wctime_from_ddsi_time (ddsi_time_t x);
|
||||||
DDS_EXPORT nn_duration_t nn_to_ddsi_duration (int64_t t);
|
DDS_EXPORT ddsi_duration_t nn_to_ddsi_duration (int64_t t);
|
||||||
DDS_EXPORT int64_t nn_from_ddsi_duration (nn_duration_t x);
|
DDS_EXPORT int64_t nn_from_ddsi_duration (ddsi_duration_t x);
|
||||||
|
|
||||||
#if defined (__cplusplus)
|
#if defined (__cplusplus)
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,21 +121,25 @@ void nn_xmsg_submsg_setnext (struct nn_xmsg *msg, struct nn_xmsg_marker marker);
|
||||||
void nn_xmsg_submsg_init (struct nn_xmsg *msg, struct nn_xmsg_marker marker, SubmessageKind_t smkind);
|
void nn_xmsg_submsg_init (struct nn_xmsg *msg, struct nn_xmsg_marker marker, SubmessageKind_t smkind);
|
||||||
void nn_xmsg_add_timestamp (struct nn_xmsg *m, nn_wctime_t t);
|
void nn_xmsg_add_timestamp (struct nn_xmsg *m, nn_wctime_t t);
|
||||||
void nn_xmsg_add_entityid (struct nn_xmsg * m);
|
void nn_xmsg_add_entityid (struct nn_xmsg * m);
|
||||||
void *nn_xmsg_addpar (struct nn_xmsg *m, unsigned pid, size_t len);
|
void *nn_xmsg_addpar (struct nn_xmsg *m, nn_parameterid_t pid, size_t len);
|
||||||
void nn_xmsg_addpar_string (struct nn_xmsg *m, unsigned pid, const char *str);
|
void nn_xmsg_addpar_string (struct nn_xmsg *m, nn_parameterid_t pid, const char *str);
|
||||||
void nn_xmsg_addpar_octetseq (struct nn_xmsg *m, unsigned pid, const nn_octetseq_t *oseq);
|
void nn_xmsg_addpar_octetseq (struct nn_xmsg *m, nn_parameterid_t pid, const ddsi_octetseq_t *oseq);
|
||||||
void nn_xmsg_addpar_stringseq (struct nn_xmsg *m, unsigned pid, const nn_stringseq_t *sseq);
|
void nn_xmsg_addpar_stringseq (struct nn_xmsg *m, nn_parameterid_t pid, const ddsi_stringseq_t *sseq);
|
||||||
void nn_xmsg_addpar_guid (struct nn_xmsg *m, unsigned pid, const nn_guid_t *guid);
|
void nn_xmsg_addpar_guid (struct nn_xmsg *m, nn_parameterid_t pid, const nn_guid_t *guid);
|
||||||
void nn_xmsg_addpar_BE4u (struct nn_xmsg *m, unsigned pid, unsigned x);
|
void nn_xmsg_addpar_BE4u (struct nn_xmsg *m, nn_parameterid_t pid, uint32_t x);
|
||||||
void nn_xmsg_addpar_4u (struct nn_xmsg *m, unsigned pid, unsigned x);
|
void nn_xmsg_addpar_4u (struct nn_xmsg *m, nn_parameterid_t pid, uint32_t x);
|
||||||
void nn_xmsg_addpar_keyhash (struct nn_xmsg *m, const struct ddsi_serdata *serdata);
|
void nn_xmsg_addpar_keyhash (struct nn_xmsg *m, const struct ddsi_serdata *serdata);
|
||||||
void nn_xmsg_addpar_statusinfo (struct nn_xmsg *m, unsigned statusinfo);
|
void nn_xmsg_addpar_statusinfo (struct nn_xmsg *m, uint32_t statusinfo);
|
||||||
void nn_xmsg_addpar_reliability (struct nn_xmsg *m, unsigned pid, const struct nn_reliability_qospolicy *rq);
|
void nn_xmsg_addpar_reliability (struct nn_xmsg *m, nn_parameterid_t pid, const struct dds_reliability_qospolicy *rq);
|
||||||
void nn_xmsg_addpar_share (struct nn_xmsg *m, unsigned pid, const struct nn_share_qospolicy *rq);
|
void nn_xmsg_addpar_duration (struct nn_xmsg *m, nn_parameterid_t pid, const dds_duration_t dur);
|
||||||
void nn_xmsg_addpar_subscription_keys (struct nn_xmsg *m, unsigned pid, const struct nn_subscription_keys_qospolicy *rq);
|
void nn_xmsg_addpar_subscription_keys (struct nn_xmsg *m, nn_parameterid_t pid, const struct dds_subscription_keys_qospolicy *rq);
|
||||||
|
void nn_xmsg_addpar_durability_service (struct nn_xmsg *m, nn_parameterid_t pid, const dds_durability_service_qospolicy_t *rq);
|
||||||
|
void nn_xmsg_addpar_reader_lifespan (struct nn_xmsg *m, nn_parameterid_t pid, const dds_reader_lifespan_qospolicy_t *rq);
|
||||||
|
void nn_xmsg_addpar_reader_data_lifecycle (struct nn_xmsg *m, nn_parameterid_t pid, const dds_reader_data_lifecycle_qospolicy_t *rq);
|
||||||
|
void nn_xmsg_addpar_liveliness (struct nn_xmsg *m, nn_parameterid_t pid, const dds_liveliness_qospolicy_t *rq);
|
||||||
|
|
||||||
void nn_xmsg_addpar_parvinfo (struct nn_xmsg *m, unsigned pid, const struct nn_prismtech_participant_version_info *pvi);
|
void nn_xmsg_addpar_parvinfo (struct nn_xmsg *m, nn_parameterid_t pid, const struct nn_prismtech_participant_version_info *pvi);
|
||||||
void nn_xmsg_addpar_eotinfo (struct nn_xmsg *m, unsigned pid, const struct nn_prismtech_eotinfo *txnid);
|
void nn_xmsg_addpar_eotinfo (struct nn_xmsg *m, nn_parameterid_t pid, const struct nn_prismtech_eotinfo *txnid);
|
||||||
void nn_xmsg_addpar_sentinel (struct nn_xmsg *m);
|
void nn_xmsg_addpar_sentinel (struct nn_xmsg *m);
|
||||||
int nn_xmsg_addpar_sentinel_ifparam (struct nn_xmsg *m);
|
int nn_xmsg_addpar_sentinel_ifparam (struct nn_xmsg *m);
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#ifndef NN_XQOS_H
|
#ifndef NN_XQOS_H
|
||||||
#define NN_XQOS_H
|
#define NN_XQOS_H
|
||||||
|
|
||||||
|
#include "dds/ddsc/dds_public_qosdefs.h"
|
||||||
/*XXX*/
|
/*XXX*/
|
||||||
#include "dds/ddsi/q_protocol.h"
|
#include "dds/ddsi/q_protocol.h"
|
||||||
#include "dds/ddsi/q_rtps.h"
|
#include "dds/ddsi/q_rtps.h"
|
||||||
|
@ -22,198 +23,164 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NN_DDS_LENGTH_UNLIMITED -1
|
typedef struct ddsi_octetseq {
|
||||||
|
|
||||||
typedef struct nn_octetseq {
|
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
unsigned char *value;
|
unsigned char *value;
|
||||||
} nn_octetseq_t;
|
} ddsi_octetseq_t;
|
||||||
|
|
||||||
typedef nn_octetseq_t nn_userdata_qospolicy_t;
|
typedef ddsi_octetseq_t dds_userdata_qospolicy_t;
|
||||||
typedef nn_octetseq_t nn_topicdata_qospolicy_t;
|
typedef ddsi_octetseq_t dds_topicdata_qospolicy_t;
|
||||||
typedef nn_octetseq_t nn_groupdata_qospolicy_t;
|
typedef ddsi_octetseq_t dds_groupdata_qospolicy_t;
|
||||||
|
|
||||||
typedef enum nn_durability_kind {
|
typedef struct dds_durability_qospolicy {
|
||||||
NN_VOLATILE_DURABILITY_QOS,
|
dds_durability_kind_t kind;
|
||||||
NN_TRANSIENT_LOCAL_DURABILITY_QOS,
|
} dds_durability_qospolicy_t;
|
||||||
NN_TRANSIENT_DURABILITY_QOS,
|
|
||||||
NN_PERSISTENT_DURABILITY_QOS
|
|
||||||
} nn_durability_kind_t;
|
|
||||||
|
|
||||||
typedef struct nn_durability_qospolicy {
|
typedef struct dds_history_qospolicy {
|
||||||
nn_durability_kind_t kind;
|
dds_history_kind_t kind;
|
||||||
} nn_durability_qospolicy_t;
|
|
||||||
|
|
||||||
typedef enum nn_history_kind {
|
|
||||||
NN_KEEP_LAST_HISTORY_QOS,
|
|
||||||
NN_KEEP_ALL_HISTORY_QOS
|
|
||||||
} nn_history_kind_t;
|
|
||||||
|
|
||||||
typedef struct nn_history_qospolicy {
|
|
||||||
nn_history_kind_t kind;
|
|
||||||
int32_t depth;
|
int32_t depth;
|
||||||
} nn_history_qospolicy_t;
|
} dds_history_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_resource_limits_qospolicy {
|
typedef struct dds_resource_limits_qospolicy {
|
||||||
int32_t max_samples;
|
int32_t max_samples;
|
||||||
int32_t max_instances;
|
int32_t max_instances;
|
||||||
int32_t max_samples_per_instance;
|
int32_t max_samples_per_instance;
|
||||||
} nn_resource_limits_qospolicy_t;
|
} dds_resource_limits_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_durability_service_qospolicy {
|
typedef struct dds_durability_service_qospolicy {
|
||||||
nn_duration_t service_cleanup_delay;
|
dds_duration_t service_cleanup_delay;
|
||||||
nn_history_qospolicy_t history;
|
dds_history_qospolicy_t history;
|
||||||
nn_resource_limits_qospolicy_t resource_limits;
|
dds_resource_limits_qospolicy_t resource_limits;
|
||||||
} nn_durability_service_qospolicy_t;
|
} dds_durability_service_qospolicy_t;
|
||||||
|
|
||||||
typedef enum nn_presentation_access_scope_kind {
|
typedef struct dds_external_durability_service_qospolicy {
|
||||||
NN_INSTANCE_PRESENTATION_QOS,
|
ddsi_duration_t service_cleanup_delay;
|
||||||
NN_TOPIC_PRESENTATION_QOS,
|
dds_history_qospolicy_t history;
|
||||||
NN_GROUP_PRESENTATION_QOS
|
dds_resource_limits_qospolicy_t resource_limits;
|
||||||
} nn_presentation_access_scope_kind_t;
|
} dds_external_durability_service_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_presentation_qospolicy {
|
typedef struct dds_presentation_qospolicy {
|
||||||
nn_presentation_access_scope_kind_t access_scope;
|
dds_presentation_access_scope_kind_t access_scope;
|
||||||
unsigned char coherent_access;
|
unsigned char coherent_access;
|
||||||
unsigned char ordered_access;
|
unsigned char ordered_access;
|
||||||
} nn_presentation_qospolicy_t;
|
} dds_presentation_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_deadline_qospolicy {
|
typedef struct dds_deadline_qospolicy {
|
||||||
nn_duration_t deadline;
|
dds_duration_t deadline;
|
||||||
} nn_deadline_qospolicy_t;
|
} dds_deadline_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_latency_budget_qospolicy {
|
typedef struct dds_external_deadline_qospolicy {
|
||||||
nn_duration_t duration;
|
ddsi_duration_t deadline;
|
||||||
} nn_latency_budget_qospolicy_t;
|
} dds_external_deadline_qospolicy_t;
|
||||||
|
|
||||||
typedef enum nn_ownership_kind {
|
typedef struct dds_latency_budget_qospolicy {
|
||||||
NN_SHARED_OWNERSHIP_QOS,
|
dds_duration_t duration;
|
||||||
NN_EXCLUSIVE_OWNERSHIP_QOS
|
} dds_latency_budget_qospolicy_t;
|
||||||
} nn_ownership_kind_t;
|
|
||||||
|
|
||||||
typedef struct nn_ownership_qospolicy {
|
typedef struct dds_external_latency_budget_qospolicy {
|
||||||
nn_ownership_kind_t kind;
|
ddsi_duration_t duration;
|
||||||
} nn_ownership_qospolicy_t;
|
} dds_external_latency_budget_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_ownership_strength_qospolicy {
|
typedef struct dds_ownership_qospolicy {
|
||||||
|
dds_ownership_kind_t kind;
|
||||||
|
} dds_ownership_qospolicy_t;
|
||||||
|
|
||||||
|
typedef struct dds_ownership_strength_qospolicy {
|
||||||
int32_t value;
|
int32_t value;
|
||||||
} nn_ownership_strength_qospolicy_t;
|
} dds_ownership_strength_qospolicy_t;
|
||||||
|
|
||||||
typedef enum nn_liveliness_kind {
|
typedef struct dds_liveliness_qospolicy {
|
||||||
NN_AUTOMATIC_LIVELINESS_QOS,
|
dds_liveliness_kind_t kind;
|
||||||
NN_MANUAL_BY_PARTICIPANT_LIVELINESS_QOS,
|
dds_duration_t lease_duration;
|
||||||
NN_MANUAL_BY_TOPIC_LIVELINESS_QOS
|
} dds_liveliness_qospolicy_t;
|
||||||
} nn_liveliness_kind_t;
|
|
||||||
|
|
||||||
typedef struct nn_liveliness_qospolicy {
|
typedef struct dds_external_liveliness_qospolicy {
|
||||||
nn_liveliness_kind_t kind;
|
dds_liveliness_kind_t kind;
|
||||||
nn_duration_t lease_duration;
|
ddsi_duration_t lease_duration;
|
||||||
} nn_liveliness_qospolicy_t;
|
} dds_external_liveliness_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_time_based_filter_qospolicy {
|
typedef struct dds_time_based_filter_qospolicy {
|
||||||
nn_duration_t minimum_separation;
|
dds_duration_t minimum_separation;
|
||||||
} nn_time_based_filter_qospolicy_t;
|
} dds_time_based_filter_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_stringseq {
|
typedef struct dds_external_time_based_filter_qospolicy {
|
||||||
|
ddsi_duration_t minimum_separation;
|
||||||
|
} dds_external_time_based_filter_qospolicy_t;
|
||||||
|
|
||||||
|
typedef struct ddsi_stringseq {
|
||||||
uint32_t n;
|
uint32_t n;
|
||||||
char **strs;
|
char **strs;
|
||||||
} nn_stringseq_t;
|
} ddsi_stringseq_t;
|
||||||
|
|
||||||
typedef nn_stringseq_t nn_partition_qospolicy_t;
|
typedef ddsi_stringseq_t dds_partition_qospolicy_t;
|
||||||
|
|
||||||
typedef enum nn_reliability_kind {
|
typedef struct dds_reliability_qospolicy {
|
||||||
NN_BEST_EFFORT_RELIABILITY_QOS,
|
dds_reliability_kind_t kind;
|
||||||
NN_RELIABLE_RELIABILITY_QOS
|
dds_duration_t max_blocking_time;
|
||||||
} nn_reliability_kind_t;
|
} dds_reliability_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_reliability_qospolicy {
|
typedef enum dds_external_reliability_kind {
|
||||||
nn_reliability_kind_t kind;
|
DDS_EXTERNAL_RELIABILITY_BEST_EFFORT = 1,
|
||||||
nn_duration_t max_blocking_time;
|
DDS_EXTERNAL_RELIABILITY_RELIABLE = 2
|
||||||
} nn_reliability_qospolicy_t;
|
} dds_external_reliability_kind_t;
|
||||||
|
|
||||||
typedef struct nn_external_reliability_qospolicy {
|
typedef struct dds_external_reliability_qospolicy {
|
||||||
uint32_t kind;
|
dds_external_reliability_kind_t kind;
|
||||||
nn_duration_t max_blocking_time;
|
ddsi_duration_t max_blocking_time;
|
||||||
} nn_external_reliability_qospolicy_t;
|
} dds_external_reliability_qospolicy_t;
|
||||||
|
|
||||||
#define NN_PEDANTIC_BEST_EFFORT_RELIABILITY_QOS 1
|
typedef struct dds_transport_priority_qospolicy {
|
||||||
#define NN_PEDANTIC_RELIABLE_RELIABILITY_QOS 3 /* <= see DDSI 2.1, table 9.4 */
|
|
||||||
#define NN_INTEROP_BEST_EFFORT_RELIABILITY_QOS 1
|
|
||||||
#define NN_INTEROP_RELIABLE_RELIABILITY_QOS 2
|
|
||||||
|
|
||||||
typedef struct nn_transport_priority_qospolicy {
|
|
||||||
int32_t value;
|
int32_t value;
|
||||||
} nn_transport_priority_qospolicy_t;
|
} dds_transport_priority_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_lifespan_qospolicy {
|
typedef struct dds_lifespan_qospolicy {
|
||||||
nn_duration_t duration;
|
dds_duration_t duration;
|
||||||
} nn_lifespan_qospolicy_t;
|
} dds_lifespan_qospolicy_t;
|
||||||
|
|
||||||
typedef enum nn_destination_order_kind {
|
typedef struct dds_external_lifespan_qospolicy {
|
||||||
NN_BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS,
|
ddsi_duration_t duration;
|
||||||
NN_BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS
|
} dds_external_lifespan_qospolicy_t;
|
||||||
} nn_destination_order_kind_t;
|
|
||||||
|
|
||||||
typedef struct nn_destination_order_qospolicy {
|
typedef struct dds_destination_order_qospolicy {
|
||||||
nn_destination_order_kind_t kind;
|
dds_destination_order_kind_t kind;
|
||||||
} nn_destination_order_qospolicy_t;
|
} dds_destination_order_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_entity_factory_qospolicy {
|
typedef struct dds_entity_factory_qospolicy {
|
||||||
unsigned char autoenable_created_entities;
|
unsigned char autoenable_created_entities;
|
||||||
} nn_entity_factory_qospolicy_t;
|
} dds_entity_factory_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_writer_data_lifecycle_qospolicy {
|
typedef struct dds_writer_data_lifecycle_qospolicy {
|
||||||
unsigned char autodispose_unregistered_instances;
|
unsigned char autodispose_unregistered_instances;
|
||||||
nn_duration_t autopurge_suspended_samples_delay; /* OpenSplice extension */
|
} dds_writer_data_lifecycle_qospolicy_t;
|
||||||
nn_duration_t autounregister_instance_delay; /* OpenSplice extension */
|
|
||||||
} nn_writer_data_lifecycle_qospolicy_t;
|
|
||||||
|
|
||||||
typedef enum nn_invalid_sample_visibility_kind {
|
typedef struct dds_reader_data_lifecycle_qospolicy {
|
||||||
NN_NO_INVALID_SAMPLE_VISIBILITY_QOS,
|
dds_duration_t autopurge_nowriter_samples_delay;
|
||||||
NN_MINIMUM_INVALID_SAMPLE_VISIBILITY_QOS,
|
dds_duration_t autopurge_disposed_samples_delay;
|
||||||
NN_ALL_INVALID_SAMPLE_VISIBILITY_QOS
|
} dds_reader_data_lifecycle_qospolicy_t;
|
||||||
} nn_invalid_sample_visibility_kind_t;
|
|
||||||
|
|
||||||
typedef struct nn_reader_data_lifecycle_qospolicy {
|
typedef struct dds_external_reader_data_lifecycle_qospolicy {
|
||||||
nn_duration_t autopurge_nowriter_samples_delay;
|
ddsi_duration_t autopurge_nowriter_samples_delay;
|
||||||
nn_duration_t autopurge_disposed_samples_delay;
|
ddsi_duration_t autopurge_disposed_samples_delay;
|
||||||
unsigned char autopurge_dispose_all; /* OpenSplice extension */
|
} dds_external_reader_data_lifecycle_qospolicy_t;
|
||||||
unsigned char enable_invalid_samples; /* OpenSplice extension */
|
|
||||||
nn_invalid_sample_visibility_kind_t invalid_sample_visibility; /* OpenSplice extension */
|
|
||||||
} nn_reader_data_lifecycle_qospolicy_t;
|
|
||||||
|
|
||||||
typedef struct nn_synchronous_endpoint_qospolicy {
|
typedef struct dds_subscription_keys_qospolicy {
|
||||||
unsigned char value;
|
|
||||||
} nn_synchronous_endpoint_qospolicy_t;
|
|
||||||
|
|
||||||
typedef struct nn_relaxed_qos_matching_qospolicy {
|
|
||||||
unsigned char value;
|
|
||||||
} nn_relaxed_qos_matching_qospolicy_t;
|
|
||||||
|
|
||||||
typedef struct nn_subscription_keys_qospolicy {
|
|
||||||
unsigned char use_key_list;
|
unsigned char use_key_list;
|
||||||
nn_stringseq_t key_list;
|
ddsi_stringseq_t key_list;
|
||||||
} nn_subscription_keys_qospolicy_t;
|
} dds_subscription_keys_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_reader_lifespan_qospolicy {
|
typedef struct dds_reader_lifespan_qospolicy {
|
||||||
unsigned char use_lifespan;
|
unsigned char use_lifespan;
|
||||||
nn_duration_t duration;
|
dds_duration_t duration;
|
||||||
} nn_reader_lifespan_qospolicy_t;
|
} dds_reader_lifespan_qospolicy_t;
|
||||||
|
|
||||||
typedef struct nn_share_qospolicy {
|
typedef struct dds_external_reader_lifespan_qospolicy {
|
||||||
unsigned char enable;
|
unsigned char use_lifespan;
|
||||||
char *name;
|
ddsi_duration_t duration;
|
||||||
} nn_share_qospolicy_t;
|
} dds_external_reader_lifespan_qospolicy_t;
|
||||||
|
|
||||||
typedef enum nn_ignorelocal_kind {
|
typedef struct dds_ignorelocal_qospolicy {
|
||||||
NN_NONE_IGNORELOCAL_QOS,
|
dds_ignorelocal_kind_t value;
|
||||||
NN_PARTICIPANT_IGNORELOCAL_QOS,
|
} dds_ignorelocal_qospolicy_t;
|
||||||
NN_PROCESS_IGNORELOCAL_QOS
|
|
||||||
} nn_ignorelocal_kind_t;
|
|
||||||
|
|
||||||
typedef struct nn_ignorelocal_qospolicy {
|
|
||||||
nn_ignorelocal_kind_t value;
|
|
||||||
} nn_ignorelocal_qospolicy_t;
|
|
||||||
|
|
||||||
/***/
|
/***/
|
||||||
|
|
||||||
|
@ -241,11 +208,9 @@ typedef struct nn_ignorelocal_qospolicy {
|
||||||
#define QP_TIME_BASED_FILTER ((uint64_t)1 << 20)
|
#define QP_TIME_BASED_FILTER ((uint64_t)1 << 20)
|
||||||
#define QP_PRISMTECH_WRITER_DATA_LIFECYCLE ((uint64_t)1 << 21)
|
#define QP_PRISMTECH_WRITER_DATA_LIFECYCLE ((uint64_t)1 << 21)
|
||||||
#define QP_PRISMTECH_READER_DATA_LIFECYCLE ((uint64_t)1 << 22)
|
#define QP_PRISMTECH_READER_DATA_LIFECYCLE ((uint64_t)1 << 22)
|
||||||
#define QP_PRISMTECH_RELAXED_QOS_MATCHING ((uint64_t)1 << 23)
|
|
||||||
#define QP_PRISMTECH_READER_LIFESPAN ((uint64_t)1 << 24)
|
#define QP_PRISMTECH_READER_LIFESPAN ((uint64_t)1 << 24)
|
||||||
#define QP_PRISMTECH_SUBSCRIPTION_KEYS ((uint64_t)1 << 25)
|
#define QP_PRISMTECH_SUBSCRIPTION_KEYS ((uint64_t)1 << 25)
|
||||||
#define QP_PRISMTECH_ENTITY_FACTORY ((uint64_t)1 << 27)
|
#define QP_PRISMTECH_ENTITY_FACTORY ((uint64_t)1 << 27)
|
||||||
#define QP_PRISMTECH_SYNCHRONOUS_ENDPOINT ((uint64_t)1 << 28)
|
|
||||||
#define QP_RTI_TYPECODE ((uint64_t)1 << 29)
|
#define QP_RTI_TYPECODE ((uint64_t)1 << 29)
|
||||||
#define QP_CYCLONE_IGNORELOCAL ((uint64_t)1 << 30)
|
#define QP_CYCLONE_IGNORELOCAL ((uint64_t)1 << 30)
|
||||||
|
|
||||||
|
@ -253,13 +218,13 @@ typedef struct nn_ignorelocal_qospolicy {
|
||||||
section 7.1.3), but communication will not take place unless it
|
section 7.1.3), but communication will not take place unless it
|
||||||
matches. Same for topic and type. Relaxed qos matching is a bit of
|
matches. Same for topic and type. Relaxed qos matching is a bit of
|
||||||
a weird one, but it affects matching, so ... */
|
a weird one, but it affects matching, so ... */
|
||||||
#define QP_RXO_MASK (QP_DURABILITY | QP_PRESENTATION | QP_DEADLINE | QP_LATENCY_BUDGET | QP_OWNERSHIP | QP_LIVELINESS | QP_RELIABILITY | QP_DESTINATION_ORDER | QP_PRISMTECH_RELAXED_QOS_MATCHING | QP_PRISMTECH_SYNCHRONOUS_ENDPOINT)
|
#define QP_RXO_MASK (QP_DURABILITY | QP_PRESENTATION | QP_DEADLINE | QP_LATENCY_BUDGET | QP_OWNERSHIP | QP_LIVELINESS | QP_RELIABILITY | QP_DESTINATION_ORDER)
|
||||||
#define QP_CHANGEABLE_MASK (QP_USER_DATA | QP_TOPIC_DATA | QP_GROUP_DATA | QP_DEADLINE | QP_LATENCY_BUDGET | QP_OWNERSHIP_STRENGTH | QP_TIME_BASED_FILTER | QP_PARTITION | QP_TRANSPORT_PRIORITY | QP_LIFESPAN | QP_PRISMTECH_ENTITY_FACTORY | QP_PRISMTECH_WRITER_DATA_LIFECYCLE | QP_PRISMTECH_READER_DATA_LIFECYCLE)
|
#define QP_CHANGEABLE_MASK (QP_USER_DATA | QP_TOPIC_DATA | QP_GROUP_DATA | QP_DEADLINE | QP_LATENCY_BUDGET | QP_OWNERSHIP_STRENGTH | QP_TIME_BASED_FILTER | QP_PARTITION | QP_TRANSPORT_PRIORITY | QP_LIFESPAN | QP_PRISMTECH_ENTITY_FACTORY | QP_PRISMTECH_WRITER_DATA_LIFECYCLE | QP_PRISMTECH_READER_DATA_LIFECYCLE)
|
||||||
#define QP_UNRECOGNIZED_INCOMPATIBLE_MASK (QP_PRISMTECH_RELAXED_QOS_MATCHING)
|
#define QP_UNRECOGNIZED_INCOMPATIBLE_MASK ((uint64_t) 0)
|
||||||
|
|
||||||
/* readers & writers have an extended qos, hence why it is a separate
|
/* readers & writers have an extended qos, hence why it is a separate
|
||||||
type */
|
type */
|
||||||
typedef struct nn_xqos {
|
struct dds_qos {
|
||||||
/* Entries present, for sparse QoS */
|
/* Entries present, for sparse QoS */
|
||||||
uint64_t present;
|
uint64_t present;
|
||||||
uint64_t aliased;
|
uint64_t aliased;
|
||||||
|
@ -272,57 +237,54 @@ typedef struct nn_xqos {
|
||||||
/* xx */char *topic_name;
|
/* xx */char *topic_name;
|
||||||
/* xx */char *type_name;
|
/* xx */char *type_name;
|
||||||
/* PublisherQos, SubscriberQos: */
|
/* PublisherQos, SubscriberQos: */
|
||||||
/*xxx */nn_presentation_qospolicy_t presentation;
|
/*xxx */dds_presentation_qospolicy_t presentation;
|
||||||
/*xxx */nn_partition_qospolicy_t partition;
|
/*xxx */dds_partition_qospolicy_t partition;
|
||||||
/*xxx */nn_groupdata_qospolicy_t group_data;
|
/*xxx */dds_groupdata_qospolicy_t group_data;
|
||||||
/*x xX*/nn_entity_factory_qospolicy_t entity_factory;
|
/*x xX*/dds_entity_factory_qospolicy_t entity_factory;
|
||||||
/* TopicQos: */
|
/* TopicQos: */
|
||||||
/*xxx */nn_topicdata_qospolicy_t topic_data;
|
/*xxx */dds_topicdata_qospolicy_t topic_data;
|
||||||
/* DataWriterQos, DataReaderQos: */
|
/* DataWriterQos, DataReaderQos: */
|
||||||
/*xxx */nn_durability_qospolicy_t durability;
|
/*xxx */dds_durability_qospolicy_t durability;
|
||||||
/*xxx */nn_durability_service_qospolicy_t durability_service;
|
/*xxx */dds_durability_service_qospolicy_t durability_service;
|
||||||
/*xxx */nn_deadline_qospolicy_t deadline;
|
/*xxx */dds_deadline_qospolicy_t deadline;
|
||||||
/*xxx */nn_latency_budget_qospolicy_t latency_budget;
|
/*xxx */dds_latency_budget_qospolicy_t latency_budget;
|
||||||
/*xxx */nn_liveliness_qospolicy_t liveliness;
|
/*xxx */dds_liveliness_qospolicy_t liveliness;
|
||||||
/*xxx */nn_reliability_qospolicy_t reliability;
|
/*xxx */dds_reliability_qospolicy_t reliability;
|
||||||
/*xxx */nn_destination_order_qospolicy_t destination_order;
|
/*xxx */dds_destination_order_qospolicy_t destination_order;
|
||||||
/*x x */nn_history_qospolicy_t history;
|
/*x x */dds_history_qospolicy_t history;
|
||||||
/*x x */nn_resource_limits_qospolicy_t resource_limits;
|
/*x x */dds_resource_limits_qospolicy_t resource_limits;
|
||||||
/*x x */nn_transport_priority_qospolicy_t transport_priority;
|
/*x x */dds_transport_priority_qospolicy_t transport_priority;
|
||||||
/*xxx */nn_lifespan_qospolicy_t lifespan;
|
/*xxx */dds_lifespan_qospolicy_t lifespan;
|
||||||
/*xxx */nn_userdata_qospolicy_t user_data;
|
/*xxx */dds_userdata_qospolicy_t user_data;
|
||||||
/*xxx */nn_ownership_qospolicy_t ownership;
|
/*xxx */dds_ownership_qospolicy_t ownership;
|
||||||
/*xxxW*/nn_ownership_strength_qospolicy_t ownership_strength;
|
/*xxxW*/dds_ownership_strength_qospolicy_t ownership_strength;
|
||||||
/*xxxR*/nn_time_based_filter_qospolicy_t time_based_filter;
|
/*xxxR*/dds_time_based_filter_qospolicy_t time_based_filter;
|
||||||
/*x W*/nn_writer_data_lifecycle_qospolicy_t writer_data_lifecycle;
|
/*x W*/dds_writer_data_lifecycle_qospolicy_t writer_data_lifecycle;
|
||||||
/*x xR*/nn_reader_data_lifecycle_qospolicy_t reader_data_lifecycle;
|
/*x xR*/dds_reader_data_lifecycle_qospolicy_t reader_data_lifecycle;
|
||||||
/*x x */nn_relaxed_qos_matching_qospolicy_t relaxed_qos_matching;
|
/*x xR*/dds_subscription_keys_qospolicy_t subscription_keys;
|
||||||
/*x xR*/nn_subscription_keys_qospolicy_t subscription_keys;
|
/*x xR*/dds_reader_lifespan_qospolicy_t reader_lifespan;
|
||||||
/*x xR*/nn_reader_lifespan_qospolicy_t reader_lifespan;
|
/* x */dds_ignorelocal_qospolicy_t ignorelocal;
|
||||||
/*x xR*/nn_share_qospolicy_t share;
|
|
||||||
/*xxx */nn_synchronous_endpoint_qospolicy_t synchronous_endpoint;
|
|
||||||
/* x */nn_ignorelocal_qospolicy_t ignorelocal;
|
|
||||||
|
|
||||||
/* X*/nn_octetseq_t rti_typecode;
|
/* X*/ddsi_octetseq_t rti_typecode;
|
||||||
} nn_xqos_t;
|
};
|
||||||
|
|
||||||
struct nn_xmsg;
|
struct nn_xmsg;
|
||||||
|
|
||||||
DDS_EXPORT void nn_xqos_init_empty (nn_xqos_t *xqos);
|
DDS_EXPORT void nn_xqos_init_empty (dds_qos_t *xqos);
|
||||||
DDS_EXPORT void nn_xqos_init_default_reader (nn_xqos_t *xqos);
|
DDS_EXPORT void nn_xqos_init_default_reader (dds_qos_t *xqos);
|
||||||
DDS_EXPORT void nn_xqos_init_default_writer (nn_xqos_t *xqos);
|
DDS_EXPORT void nn_xqos_init_default_writer (dds_qos_t *xqos);
|
||||||
DDS_EXPORT void nn_xqos_init_default_writer_noautodispose (nn_xqos_t *xqos);
|
DDS_EXPORT void nn_xqos_init_default_writer_noautodispose (dds_qos_t *xqos);
|
||||||
DDS_EXPORT void nn_xqos_init_default_subscriber (nn_xqos_t *xqos);
|
DDS_EXPORT void nn_xqos_init_default_subscriber (dds_qos_t *xqos);
|
||||||
DDS_EXPORT void nn_xqos_init_default_publisher (nn_xqos_t *xqos);
|
DDS_EXPORT void nn_xqos_init_default_publisher (dds_qos_t *xqos);
|
||||||
DDS_EXPORT void nn_xqos_init_default_topic (nn_xqos_t *xqos);
|
DDS_EXPORT void nn_xqos_init_default_topic (dds_qos_t *xqos);
|
||||||
DDS_EXPORT void nn_xqos_copy (nn_xqos_t *dst, const nn_xqos_t *src);
|
DDS_EXPORT void nn_xqos_copy (dds_qos_t *dst, const dds_qos_t *src);
|
||||||
DDS_EXPORT void nn_xqos_unalias (nn_xqos_t *xqos);
|
DDS_EXPORT void nn_xqos_unalias (dds_qos_t *xqos);
|
||||||
DDS_EXPORT void nn_xqos_fini (nn_xqos_t *xqos);
|
DDS_EXPORT void nn_xqos_fini (dds_qos_t *xqos);
|
||||||
DDS_EXPORT void nn_xqos_mergein_missing (nn_xqos_t *a, const nn_xqos_t *b);
|
DDS_EXPORT void nn_xqos_mergein_missing (dds_qos_t *a, const dds_qos_t *b);
|
||||||
DDS_EXPORT uint64_t nn_xqos_delta (const nn_xqos_t *a, const nn_xqos_t *b, uint64_t mask);
|
DDS_EXPORT uint64_t nn_xqos_delta (const dds_qos_t *a, const dds_qos_t *b, uint64_t mask);
|
||||||
DDS_EXPORT void nn_xqos_addtomsg (struct nn_xmsg *m, const nn_xqos_t *xqos, uint64_t wanted);
|
DDS_EXPORT void nn_xqos_addtomsg (struct nn_xmsg *m, const dds_qos_t *xqos, uint64_t wanted);
|
||||||
DDS_EXPORT void nn_log_xqos (uint32_t cat, const nn_xqos_t *xqos);
|
DDS_EXPORT void nn_log_xqos (uint32_t cat, const dds_qos_t *xqos);
|
||||||
DDS_EXPORT nn_xqos_t *nn_xqos_dup (const nn_xqos_t *src);
|
DDS_EXPORT dds_qos_t *nn_xqos_dup (const dds_qos_t *src);
|
||||||
|
|
||||||
#if defined (__cplusplus)
|
#if defined (__cplusplus)
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "dds/ddsi/q_xqos.h"
|
#include "dds/ddsi/q_xqos.h"
|
||||||
#include "dds/ddsi/ddsi_rhc_plugin.h"
|
#include "dds/ddsi/ddsi_rhc_plugin.h"
|
||||||
|
|
||||||
DDS_EXPORT void make_proxy_writer_info(struct proxy_writer_info *pwr_info, const struct entity_common *e, const struct nn_xqos *xqos)
|
DDS_EXPORT void make_proxy_writer_info(struct proxy_writer_info *pwr_info, const struct entity_common *e, const struct dds_qos *xqos)
|
||||||
{
|
{
|
||||||
pwr_info->guid = e->guid;
|
pwr_info->guid = e->guid;
|
||||||
pwr_info->ownership_strength = xqos->ownership_strength.value;
|
pwr_info->ownership_strength = xqos->ownership_strength.value;
|
||||||
|
|
|
@ -284,7 +284,7 @@ int spdp_write (struct participant *pp)
|
||||||
meta_multi_loc_one.loc = gv.loc_meta_mc;
|
meta_multi_loc_one.loc = gv.loc_meta_mc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ps.participant_lease_duration = nn_to_ddsi_duration (pp->lease_duration);
|
ps.participant_lease_duration = pp->lease_duration;
|
||||||
|
|
||||||
/* Add PrismTech specific version information */
|
/* Add PrismTech specific version information */
|
||||||
{
|
{
|
||||||
|
@ -515,7 +515,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
||||||
unsigned builtin_endpoint_set;
|
unsigned builtin_endpoint_set;
|
||||||
unsigned prismtech_builtin_endpoint_set;
|
unsigned prismtech_builtin_endpoint_set;
|
||||||
nn_guid_t privileged_pp_guid;
|
nn_guid_t privileged_pp_guid;
|
||||||
nn_duration_t lease_duration;
|
dds_duration_t lease_duration;
|
||||||
unsigned custom_flags = 0;
|
unsigned custom_flags = 0;
|
||||||
|
|
||||||
if (!(datap->present & PP_PARTICIPANT_GUID) || !(datap->present & PP_BUILTIN_ENDPOINT_SET))
|
if (!(datap->present & PP_PARTICIPANT_GUID) || !(datap->present & PP_BUILTIN_ENDPOINT_SET))
|
||||||
|
@ -611,7 +611,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DDS_LOG(DDS_LC_DISCOVERY, " (PARTICIPANT_LEASE_DURATION defaulting to 100s)");
|
DDS_LOG(DDS_LC_DISCOVERY, " (PARTICIPANT_LEASE_DURATION defaulting to 100s)");
|
||||||
lease_duration = nn_to_ddsi_duration (100 * T_SECOND);
|
lease_duration = 100 * T_SECOND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (datap->present & PP_PRISMTECH_PARTICIPANT_VERSION_INFO) {
|
if (datap->present & PP_PRISMTECH_PARTICIPANT_VERSION_INFO) {
|
||||||
|
@ -645,7 +645,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
||||||
DDS_LOG(DDS_LC_DISCOVERY, " (depends on "PGUIDFMT")", PGUID (privileged_pp_guid));
|
DDS_LOG(DDS_LC_DISCOVERY, " (depends on "PGUIDFMT")", PGUID (privileged_pp_guid));
|
||||||
/* never expire lease for this proxy: it won't actually expire
|
/* never expire lease for this proxy: it won't actually expire
|
||||||
until the "privileged" one expires anyway */
|
until the "privileged" one expires anyway */
|
||||||
lease_duration = nn_to_ddsi_duration (T_NEVER);
|
lease_duration = T_NEVER;
|
||||||
}
|
}
|
||||||
else if (vendor_is_eclipse_or_opensplice (rst->vendor) && !(custom_flags & CF_PARTICIPANT_IS_DDSI2))
|
else if (vendor_is_eclipse_or_opensplice (rst->vendor) && !(custom_flags & CF_PARTICIPANT_IS_DDSI2))
|
||||||
{
|
{
|
||||||
|
@ -657,7 +657,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
privileged_pp_guid.prefix = ddsi2->e.guid.prefix;
|
privileged_pp_guid.prefix = ddsi2->e.guid.prefix;
|
||||||
lease_duration = nn_to_ddsi_duration (T_NEVER);
|
lease_duration = T_NEVER;
|
||||||
DDS_LOG(DDS_LC_DISCOVERY, " (depends on "PGUIDFMT")", PGUID (privileged_pp_guid));
|
DDS_LOG(DDS_LC_DISCOVERY, " (depends on "PGUIDFMT")", PGUID (privileged_pp_guid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -735,7 +735,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
||||||
as_default,
|
as_default,
|
||||||
as_meta,
|
as_meta,
|
||||||
datap,
|
datap,
|
||||||
nn_from_ddsi_duration (lease_duration),
|
lease_duration,
|
||||||
rst->vendor,
|
rst->vendor,
|
||||||
custom_flags,
|
custom_flags,
|
||||||
timestamp
|
timestamp
|
||||||
|
@ -865,9 +865,9 @@ static int sedp_write_endpoint
|
||||||
(
|
(
|
||||||
struct writer *wr, int alive, const nn_guid_t *epguid,
|
struct writer *wr, int alive, const nn_guid_t *epguid,
|
||||||
const struct entity_common *common, const struct endpoint_common *epcommon,
|
const struct entity_common *common, const struct endpoint_common *epcommon,
|
||||||
const nn_xqos_t *xqos, struct addrset *as)
|
const dds_qos_t *xqos, struct addrset *as)
|
||||||
{
|
{
|
||||||
const nn_xqos_t *defqos = is_writer_entityid (epguid->entityid) ? &gv.default_xqos_wr : &gv.default_xqos_rd;
|
const dds_qos_t *defqos = is_writer_entityid (epguid->entityid) ? &gv.default_xqos_wr : &gv.default_xqos_rd;
|
||||||
struct nn_xmsg *mpayload;
|
struct nn_xmsg *mpayload;
|
||||||
uint64_t qosdiff;
|
uint64_t qosdiff;
|
||||||
nn_plist_t ps;
|
nn_plist_t ps;
|
||||||
|
@ -1006,14 +1006,14 @@ int sedp_dispose_unregister_reader (struct reader *rd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *durability_to_string (nn_durability_kind_t k)
|
static const char *durability_to_string (dds_durability_kind_t k)
|
||||||
{
|
{
|
||||||
switch (k)
|
switch (k)
|
||||||
{
|
{
|
||||||
case NN_VOLATILE_DURABILITY_QOS: return "volatile";
|
case DDS_DURABILITY_VOLATILE: return "volatile";
|
||||||
case NN_TRANSIENT_LOCAL_DURABILITY_QOS: return "transient-local";
|
case DDS_DURABILITY_TRANSIENT_LOCAL: return "transient-local";
|
||||||
case NN_TRANSIENT_DURABILITY_QOS: return "transient";
|
case DDS_DURABILITY_TRANSIENT: return "transient";
|
||||||
case NN_PERSISTENT_DURABILITY_QOS: return "persistent";
|
case DDS_DURABILITY_PERSISTENT: return "persistent";
|
||||||
}
|
}
|
||||||
return "undefined-durability";
|
return "undefined-durability";
|
||||||
}
|
}
|
||||||
|
@ -1105,7 +1105,7 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat
|
||||||
struct proxy_writer * pwr = NULL;
|
struct proxy_writer * pwr = NULL;
|
||||||
struct proxy_reader * prd = NULL;
|
struct proxy_reader * prd = NULL;
|
||||||
nn_guid_t ppguid;
|
nn_guid_t ppguid;
|
||||||
nn_xqos_t *xqos;
|
dds_qos_t *xqos;
|
||||||
int reliable;
|
int reliable;
|
||||||
struct addrset *as;
|
struct addrset *as;
|
||||||
int is_writer;
|
int is_writer;
|
||||||
|
@ -1158,7 +1158,7 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat
|
||||||
assert ((xqos->present & datap->qos.present) == datap->qos.present);
|
assert ((xqos->present & datap->qos.present) == datap->qos.present);
|
||||||
assert (xqos->present & QP_RELIABILITY);
|
assert (xqos->present & QP_RELIABILITY);
|
||||||
assert (xqos->present & QP_DURABILITY);
|
assert (xqos->present & QP_DURABILITY);
|
||||||
reliable = (xqos->reliability.kind == NN_RELIABLE_RELIABILITY_QOS);
|
reliable = (xqos->reliability.kind == DDS_RELIABILITY_RELIABLE);
|
||||||
|
|
||||||
DDS_LOG(DDS_LC_DISCOVERY, " %s %s %s: %s%s.%s/%s",
|
DDS_LOG(DDS_LC_DISCOVERY, " %s %s %s: %s%s.%s/%s",
|
||||||
reliable ? "reliable" : "best-effort",
|
reliable ? "reliable" : "best-effort",
|
||||||
|
@ -1860,7 +1860,7 @@ int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const str
|
||||||
goto done_upd_deliv;
|
goto done_upd_deliv;
|
||||||
}
|
}
|
||||||
|
|
||||||
timestamp = valid_ddsi_timestamp(sampleinfo->timestamp) ? nn_wctime_from_ddsi_time(sampleinfo->timestamp): now();
|
timestamp = (sampleinfo->timestamp.v != NN_WCTIME_INVALID.v) ? sampleinfo->timestamp : now ();
|
||||||
switch (srcguid.entityid.u)
|
switch (srcguid.entityid.u)
|
||||||
{
|
{
|
||||||
case NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER:
|
case NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER:
|
||||||
|
|
|
@ -107,7 +107,7 @@ static int print_addrset_if_notempty (ddsi_tran_conn_t conn, const char *prefix,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int print_any_endpoint_common (ddsi_tran_conn_t conn, const char *label, const struct entity_common *e,
|
static int print_any_endpoint_common (ddsi_tran_conn_t conn, const char *label, const struct entity_common *e,
|
||||||
const struct nn_xqos *xqos, const struct ddsi_sertopic *topic)
|
const struct dds_qos *xqos, const struct ddsi_sertopic *topic)
|
||||||
{
|
{
|
||||||
int x = 0;
|
int x = 0;
|
||||||
x += cpf (conn, " %s %x:%x:%x:%x ", label, PGUID (e->guid));
|
x += cpf (conn, " %s %x:%x:%x:%x ", label, PGUID (e->guid));
|
||||||
|
@ -126,7 +126,7 @@ static int print_any_endpoint_common (ddsi_tran_conn_t conn, const char *label,
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int print_endpoint_common (ddsi_tran_conn_t conn, const char *label, const struct entity_common *e, const struct endpoint_common *c, const struct nn_xqos *xqos, const struct ddsi_sertopic *topic)
|
static int print_endpoint_common (ddsi_tran_conn_t conn, const char *label, const struct entity_common *e, const struct endpoint_common *c, const struct dds_qos *xqos, const struct ddsi_sertopic *topic)
|
||||||
{
|
{
|
||||||
DDSRT_UNUSED_ARG (c);
|
DDSRT_UNUSED_ARG (c);
|
||||||
return print_any_endpoint_common (conn, label, e, xqos, topic);
|
return print_any_endpoint_common (conn, label, e, xqos, topic);
|
||||||
|
|
|
@ -87,8 +87,8 @@ static const unsigned prismtech_builtin_writers_besmask =
|
||||||
NN_DISC_BUILTIN_ENDPOINT_CM_PUBLISHER_WRITER |
|
NN_DISC_BUILTIN_ENDPOINT_CM_PUBLISHER_WRITER |
|
||||||
NN_DISC_BUILTIN_ENDPOINT_CM_SUBSCRIBER_WRITER;
|
NN_DISC_BUILTIN_ENDPOINT_CM_SUBSCRIBER_WRITER;
|
||||||
|
|
||||||
static dds_return_t new_writer_guid (struct writer **wr_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc *whc, status_cb_t status_cb, void *status_cbarg);
|
static dds_return_t new_writer_guid (struct writer **wr_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct whc *whc, status_cb_t status_cb, void *status_cbarg);
|
||||||
static dds_return_t new_reader_guid (struct reader **rd_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct rhc *rhc, status_cb_t status_cb, void *status_cbarg);
|
static dds_return_t new_reader_guid (struct reader **rd_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct rhc *rhc, status_cb_t status_cb, void *status_cbarg);
|
||||||
static struct participant *ref_participant (struct participant *pp, const struct nn_guid *guid_of_refing_entity);
|
static struct participant *ref_participant (struct participant *pp, const struct nn_guid *guid_of_refing_entity);
|
||||||
static void unref_participant (struct participant *pp, const struct nn_guid *guid_of_refing_entity);
|
static void unref_participant (struct participant *pp, const struct nn_guid *guid_of_refing_entity);
|
||||||
static void delete_proxy_group_locked (struct proxy_group *pgroup, nn_wctime_t timestamp, int isimplicit);
|
static void delete_proxy_group_locked (struct proxy_group *pgroup, nn_wctime_t timestamp, int isimplicit);
|
||||||
|
@ -1545,7 +1545,7 @@ static void writer_add_connection (struct writer *wr, struct proxy_reader *prd)
|
||||||
ddsrt_avl_ipath_t path;
|
ddsrt_avl_ipath_t path;
|
||||||
int pretend_everything_acked;
|
int pretend_everything_acked;
|
||||||
m->prd_guid = prd->e.guid;
|
m->prd_guid = prd->e.guid;
|
||||||
m->is_reliable = (prd->c.xqos->reliability.kind > NN_BEST_EFFORT_RELIABILITY_QOS);
|
m->is_reliable = (prd->c.xqos->reliability.kind > DDS_RELIABILITY_BEST_EFFORT);
|
||||||
m->assumed_in_sync = (config.retransmit_merging == REXMIT_MERGE_ALWAYS);
|
m->assumed_in_sync = (config.retransmit_merging == REXMIT_MERGE_ALWAYS);
|
||||||
m->has_replied_to_hb = !m->is_reliable;
|
m->has_replied_to_hb = !m->is_reliable;
|
||||||
m->all_have_replied_to_hb = 0;
|
m->all_have_replied_to_hb = 0;
|
||||||
|
@ -1655,7 +1655,7 @@ static void writer_add_local_connection (struct writer *wr, struct reader *rd)
|
||||||
historical data for best-effort data over the wire, so also not locally).
|
historical data for best-effort data over the wire, so also not locally).
|
||||||
FIXME: should limit ourselves to what it is available because of durability history,
|
FIXME: should limit ourselves to what it is available because of durability history,
|
||||||
not writer history */
|
not writer history */
|
||||||
if (rd->xqos->reliability.kind > NN_BEST_EFFORT_RELIABILITY_QOS && rd->xqos->durability.kind > NN_VOLATILE_DURABILITY_QOS)
|
if (rd->xqos->reliability.kind > DDS_RELIABILITY_BEST_EFFORT && rd->xqos->durability.kind > DDS_DURABILITY_VOLATILE)
|
||||||
{
|
{
|
||||||
struct whc_sample_iter it;
|
struct whc_sample_iter it;
|
||||||
struct whc_borrowed_sample sample;
|
struct whc_borrowed_sample sample;
|
||||||
|
@ -2021,7 +2021,7 @@ static nn_entityid_t builtin_entityid_match (nn_entityid_t x)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void writer_qos_mismatch (struct writer * wr, uint32_t reason)
|
static void writer_qos_mismatch (struct writer * wr, dds_qos_policy_id_t reason)
|
||||||
{
|
{
|
||||||
/* When the reason is DDS_INVALID_QOS_POLICY_ID, it means that we compared
|
/* When the reason is DDS_INVALID_QOS_POLICY_ID, it means that we compared
|
||||||
* readers/writers from different topics: ignore that. */
|
* readers/writers from different topics: ignore that. */
|
||||||
|
@ -2041,7 +2041,7 @@ static void writer_qos_mismatch (struct writer * wr, uint32_t reason)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reader_qos_mismatch (struct reader * rd, uint32_t reason)
|
static void reader_qos_mismatch (struct reader * rd, dds_qos_policy_id_t reason)
|
||||||
{
|
{
|
||||||
/* When the reason is DDS_INVALID_QOS_POLICY_ID, it means that we compared
|
/* When the reason is DDS_INVALID_QOS_POLICY_ID, it means that we compared
|
||||||
* readers/writers from different topics: ignore that. */
|
* readers/writers from different topics: ignore that. */
|
||||||
|
@ -2066,15 +2066,15 @@ static void connect_writer_with_proxy_reader (struct writer *wr, struct proxy_re
|
||||||
{
|
{
|
||||||
const int isb0 = (is_builtin_entityid (wr->e.guid.entityid, NN_VENDORID_ECLIPSE) != 0);
|
const int isb0 = (is_builtin_entityid (wr->e.guid.entityid, NN_VENDORID_ECLIPSE) != 0);
|
||||||
const int isb1 = (is_builtin_entityid (prd->e.guid.entityid, prd->c.vendor) != 0);
|
const int isb1 = (is_builtin_entityid (prd->e.guid.entityid, prd->c.vendor) != 0);
|
||||||
int32_t reason;
|
dds_qos_policy_id_t reason;
|
||||||
DDSRT_UNUSED_ARG(tnow);
|
DDSRT_UNUSED_ARG(tnow);
|
||||||
if (isb0 != isb1)
|
if (isb0 != isb1)
|
||||||
return;
|
return;
|
||||||
if (wr->e.onlylocal)
|
if (wr->e.onlylocal)
|
||||||
return;
|
return;
|
||||||
if (!isb0 && (reason = qos_match_p (prd->c.xqos, wr->xqos)) >= 0)
|
if (!isb0 && !qos_match_p (prd->c.xqos, wr->xqos, &reason))
|
||||||
{
|
{
|
||||||
writer_qos_mismatch (wr, (uint32_t)reason);
|
writer_qos_mismatch (wr, reason);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
proxy_reader_add_connection (prd, wr);
|
proxy_reader_add_connection (prd, wr);
|
||||||
|
@ -2085,41 +2085,41 @@ static void connect_proxy_writer_with_reader (struct proxy_writer *pwr, struct r
|
||||||
{
|
{
|
||||||
const int isb0 = (is_builtin_entityid (pwr->e.guid.entityid, pwr->c.vendor) != 0);
|
const int isb0 = (is_builtin_entityid (pwr->e.guid.entityid, pwr->c.vendor) != 0);
|
||||||
const int isb1 = (is_builtin_entityid (rd->e.guid.entityid, NN_VENDORID_ECLIPSE) != 0);
|
const int isb1 = (is_builtin_entityid (rd->e.guid.entityid, NN_VENDORID_ECLIPSE) != 0);
|
||||||
int32_t reason;
|
dds_qos_policy_id_t reason;
|
||||||
nn_count_t init_count;
|
nn_count_t init_count;
|
||||||
if (isb0 != isb1)
|
if (isb0 != isb1)
|
||||||
return;
|
return;
|
||||||
if (rd->e.onlylocal)
|
if (rd->e.onlylocal)
|
||||||
return;
|
return;
|
||||||
if (!isb0 && (reason = qos_match_p (rd->xqos, pwr->c.xqos)) >= 0)
|
if (!isb0 && !qos_match_p (rd->xqos, pwr->c.xqos, &reason))
|
||||||
{
|
{
|
||||||
reader_qos_mismatch (rd, (uint32_t)reason);
|
reader_qos_mismatch (rd, reason);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
reader_add_connection (rd, pwr, &init_count);
|
reader_add_connection (rd, pwr, &init_count);
|
||||||
proxy_writer_add_connection (pwr, rd, tnow, init_count);
|
proxy_writer_add_connection (pwr, rd, tnow, init_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ignore_local_p (const nn_guid_t *guid1, const nn_guid_t *guid2, const struct nn_xqos *xqos1, const struct nn_xqos *xqos2)
|
static bool ignore_local_p (const nn_guid_t *guid1, const nn_guid_t *guid2, const struct dds_qos *xqos1, const struct dds_qos *xqos2)
|
||||||
{
|
{
|
||||||
assert (xqos1->present & QP_CYCLONE_IGNORELOCAL);
|
assert (xqos1->present & QP_CYCLONE_IGNORELOCAL);
|
||||||
assert (xqos2->present & QP_CYCLONE_IGNORELOCAL);
|
assert (xqos2->present & QP_CYCLONE_IGNORELOCAL);
|
||||||
switch (xqos1->ignorelocal.value)
|
switch (xqos1->ignorelocal.value)
|
||||||
{
|
{
|
||||||
case NN_NONE_IGNORELOCAL_QOS:
|
case DDS_IGNORELOCAL_NONE:
|
||||||
break;
|
break;
|
||||||
case NN_PARTICIPANT_IGNORELOCAL_QOS:
|
case DDS_IGNORELOCAL_PARTICIPANT:
|
||||||
return memcmp (&guid1->prefix, &guid2->prefix, sizeof (guid1->prefix)) == 0;
|
return memcmp (&guid1->prefix, &guid2->prefix, sizeof (guid1->prefix)) == 0;
|
||||||
case NN_PROCESS_IGNORELOCAL_QOS:
|
case DDS_IGNORELOCAL_PROCESS:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
switch (xqos2->ignorelocal.value)
|
switch (xqos2->ignorelocal.value)
|
||||||
{
|
{
|
||||||
case NN_NONE_IGNORELOCAL_QOS:
|
case DDS_IGNORELOCAL_NONE:
|
||||||
break;
|
break;
|
||||||
case NN_PARTICIPANT_IGNORELOCAL_QOS:
|
case DDS_IGNORELOCAL_PARTICIPANT:
|
||||||
return memcmp (&guid1->prefix, &guid2->prefix, sizeof (guid1->prefix)) == 0;
|
return memcmp (&guid1->prefix, &guid2->prefix, sizeof (guid1->prefix)) == 0;
|
||||||
case NN_PROCESS_IGNORELOCAL_QOS:
|
case DDS_IGNORELOCAL_PROCESS:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -2127,16 +2127,16 @@ static bool ignore_local_p (const nn_guid_t *guid1, const nn_guid_t *guid2, cons
|
||||||
|
|
||||||
static void connect_writer_with_reader (struct writer *wr, struct reader *rd, nn_mtime_t tnow)
|
static void connect_writer_with_reader (struct writer *wr, struct reader *rd, nn_mtime_t tnow)
|
||||||
{
|
{
|
||||||
int32_t reason;
|
dds_qos_policy_id_t reason;
|
||||||
(void)tnow;
|
(void)tnow;
|
||||||
if (!is_local_orphan_endpoint (&wr->e) && (is_builtin_entityid (wr->e.guid.entityid, NN_VENDORID_ECLIPSE) || is_builtin_entityid (rd->e.guid.entityid, NN_VENDORID_ECLIPSE)))
|
if (!is_local_orphan_endpoint (&wr->e) && (is_builtin_entityid (wr->e.guid.entityid, NN_VENDORID_ECLIPSE) || is_builtin_entityid (rd->e.guid.entityid, NN_VENDORID_ECLIPSE)))
|
||||||
return;
|
return;
|
||||||
if (ignore_local_p (&wr->e.guid, &rd->e.guid, wr->xqos, rd->xqos))
|
if (ignore_local_p (&wr->e.guid, &rd->e.guid, wr->xqos, rd->xqos))
|
||||||
return;
|
return;
|
||||||
if ((reason = qos_match_p (rd->xqos, wr->xqos)) >= 0)
|
if (!qos_match_p (rd->xqos, wr->xqos, &reason))
|
||||||
{
|
{
|
||||||
writer_qos_mismatch (wr, (uint32_t)reason);
|
writer_qos_mismatch (wr, reason);
|
||||||
reader_qos_mismatch (rd, (uint32_t)reason);
|
reader_qos_mismatch (rd, reason);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
reader_add_local_connection (rd, wr);
|
reader_add_local_connection (rd, wr);
|
||||||
|
@ -2402,7 +2402,7 @@ static void match_proxy_reader_with_writers (struct proxy_reader *prd, nn_mtime_
|
||||||
|
|
||||||
/* ENDPOINT --------------------------------------------------------- */
|
/* ENDPOINT --------------------------------------------------------- */
|
||||||
|
|
||||||
static void new_reader_writer_common (const struct nn_guid *guid, const struct ddsi_sertopic * topic, const struct nn_xqos *xqos)
|
static void new_reader_writer_common (const struct nn_guid *guid, const struct ddsi_sertopic * topic, const struct dds_qos *xqos)
|
||||||
{
|
{
|
||||||
const char *partition = "(default)";
|
const char *partition = "(default)";
|
||||||
const char *partition_suffix = "";
|
const char *partition_suffix = "";
|
||||||
|
@ -2452,7 +2452,7 @@ static void endpoint_common_fini (struct entity_common *e, struct endpoint_commo
|
||||||
entity_common_fini (e);
|
entity_common_fini (e);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int set_topic_type_name (nn_xqos_t *xqos, const struct ddsi_sertopic * topic)
|
static int set_topic_type_name (dds_qos_t *xqos, const struct ddsi_sertopic * topic)
|
||||||
{
|
{
|
||||||
if (!(xqos->present & QP_TYPE_NAME) && topic)
|
if (!(xqos->present & QP_TYPE_NAME) && topic)
|
||||||
{
|
{
|
||||||
|
@ -2655,7 +2655,7 @@ unsigned remove_acked_messages (struct writer *wr, struct whc_state *whcst, stru
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void new_writer_guid_common_init (struct writer *wr, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc *whc, status_cb_t status_cb, void * status_entity)
|
static void new_writer_guid_common_init (struct writer *wr, const struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct whc *whc, status_cb_t status_cb, void * status_entity)
|
||||||
{
|
{
|
||||||
ddsrt_cond_init (&wr->throttle_cond);
|
ddsrt_cond_init (&wr->throttle_cond);
|
||||||
wr->seq = 0;
|
wr->seq = 0;
|
||||||
|
@ -2693,14 +2693,14 @@ static void new_writer_guid_common_init (struct writer *wr, const struct ddsi_se
|
||||||
DDS_LOG(DDS_LC_DISCOVERY, "}\n");
|
DDS_LOG(DDS_LC_DISCOVERY, "}\n");
|
||||||
|
|
||||||
assert (wr->xqos->present & QP_RELIABILITY);
|
assert (wr->xqos->present & QP_RELIABILITY);
|
||||||
wr->reliable = (wr->xqos->reliability.kind != NN_BEST_EFFORT_RELIABILITY_QOS);
|
wr->reliable = (wr->xqos->reliability.kind != DDS_RELIABILITY_BEST_EFFORT);
|
||||||
assert (wr->xqos->present & QP_DURABILITY);
|
assert (wr->xqos->present & QP_DURABILITY);
|
||||||
if (is_builtin_entityid (wr->e.guid.entityid, NN_VENDORID_ECLIPSE))
|
if (is_builtin_entityid (wr->e.guid.entityid, NN_VENDORID_ECLIPSE))
|
||||||
{
|
{
|
||||||
assert (wr->xqos->history.kind == NN_KEEP_LAST_HISTORY_QOS);
|
assert (wr->xqos->history.kind == DDS_HISTORY_KEEP_LAST);
|
||||||
assert (wr->xqos->durability.kind == NN_TRANSIENT_LOCAL_DURABILITY_QOS);
|
assert (wr->xqos->durability.kind == DDS_DURABILITY_TRANSIENT_LOCAL);
|
||||||
}
|
}
|
||||||
wr->handle_as_transient_local = (wr->xqos->durability.kind == NN_TRANSIENT_LOCAL_DURABILITY_QOS);
|
wr->handle_as_transient_local = (wr->xqos->durability.kind == DDS_DURABILITY_TRANSIENT_LOCAL);
|
||||||
wr->include_keyhash =
|
wr->include_keyhash =
|
||||||
config.generate_keyhash &&
|
config.generate_keyhash &&
|
||||||
((wr->e.guid.entityid.u & NN_ENTITYID_KIND_MASK) == NN_ENTITYID_KIND_WRITER_WITH_KEY);
|
((wr->e.guid.entityid.u & NN_ENTITYID_KIND_MASK) == NN_ENTITYID_KIND_WRITER_WITH_KEY);
|
||||||
|
@ -2790,15 +2790,14 @@ static void new_writer_guid_common_init (struct writer *wr, const struct ddsi_se
|
||||||
wr->heartbeat_xevent = NULL;
|
wr->heartbeat_xevent = NULL;
|
||||||
}
|
}
|
||||||
assert (wr->xqos->present & QP_LIVELINESS);
|
assert (wr->xqos->present & QP_LIVELINESS);
|
||||||
if (wr->xqos->liveliness.kind != NN_AUTOMATIC_LIVELINESS_QOS ||
|
if (wr->xqos->liveliness.kind != DDS_LIVELINESS_AUTOMATIC || wr->xqos->liveliness.lease_duration != T_NEVER)
|
||||||
nn_from_ddsi_duration (wr->xqos->liveliness.lease_duration) != T_NEVER)
|
|
||||||
{
|
{
|
||||||
DDS_LOG(DDS_LC_DISCOVERY, "writer "PGUIDFMT": incorrectly treating it as of automatic liveliness kind with lease duration = inf (%d, %"PRId64")\n", PGUID (wr->e.guid), (int) wr->xqos->liveliness.kind, nn_from_ddsi_duration (wr->xqos->liveliness.lease_duration));
|
DDS_LOG(DDS_LC_DISCOVERY, "writer "PGUIDFMT": incorrectly treating it as of automatic liveliness kind with lease duration = inf (%d, %"PRId64")\n", PGUID (wr->e.guid), (int) wr->xqos->liveliness.kind, wr->xqos->liveliness.lease_duration);
|
||||||
}
|
}
|
||||||
wr->lease_duration = T_NEVER; /* FIXME */
|
wr->lease_duration = T_NEVER; /* FIXME */
|
||||||
|
|
||||||
wr->whc = whc;
|
wr->whc = whc;
|
||||||
if (wr->xqos->history.kind == NN_KEEP_LAST_HISTORY_QOS)
|
if (wr->xqos->history.kind == DDS_HISTORY_KEEP_LAST)
|
||||||
{
|
{
|
||||||
/* hdepth > 0 => "aggressive keep last", and in that case: why
|
/* hdepth > 0 => "aggressive keep last", and in that case: why
|
||||||
bother blocking for a slow receiver when the entire point of
|
bother blocking for a slow receiver when the entire point of
|
||||||
|
@ -2820,7 +2819,7 @@ static void new_writer_guid_common_init (struct writer *wr, const struct ddsi_se
|
||||||
local_reader_ary_init (&wr->rdary);
|
local_reader_ary_init (&wr->rdary);
|
||||||
}
|
}
|
||||||
|
|
||||||
static dds_return_t new_writer_guid (struct writer **wr_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc *whc, status_cb_t status_cb, void *status_entity)
|
static dds_return_t new_writer_guid (struct writer **wr_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct whc *whc, status_cb_t status_cb, void *status_entity)
|
||||||
{
|
{
|
||||||
struct writer *wr;
|
struct writer *wr;
|
||||||
nn_mtime_t tnow = now_mt ();
|
nn_mtime_t tnow = now_mt ();
|
||||||
|
@ -2870,7 +2869,7 @@ static dds_return_t new_writer_guid (struct writer **wr_out, const struct nn_gui
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
dds_return_t new_writer (struct writer **wr_out, struct nn_guid *wrguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc * whc, status_cb_t status_cb, void *status_cb_arg)
|
dds_return_t new_writer (struct writer **wr_out, struct nn_guid *wrguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct whc * whc, status_cb_t status_cb, void *status_cb_arg)
|
||||||
{
|
{
|
||||||
struct participant *pp;
|
struct participant *pp;
|
||||||
dds_return_t rc;
|
dds_return_t rc;
|
||||||
|
@ -2889,7 +2888,7 @@ dds_return_t new_writer (struct writer **wr_out, struct nn_guid *wrguid, const s
|
||||||
return new_writer_guid (wr_out, wrguid, group_guid, pp, topic, xqos, whc, status_cb, status_cb_arg);
|
return new_writer_guid (wr_out, wrguid, group_guid, pp, topic, xqos, whc, status_cb, status_cb_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct local_orphan_writer *new_local_orphan_writer (nn_entityid_t entityid, struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc *whc)
|
struct local_orphan_writer *new_local_orphan_writer (nn_entityid_t entityid, struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct whc *whc)
|
||||||
{
|
{
|
||||||
nn_guid_t guid;
|
nn_guid_t guid;
|
||||||
struct local_orphan_writer *lowr;
|
struct local_orphan_writer *lowr;
|
||||||
|
@ -3203,7 +3202,7 @@ static dds_return_t new_reader_guid
|
||||||
const struct nn_guid *group_guid,
|
const struct nn_guid *group_guid,
|
||||||
struct participant *pp,
|
struct participant *pp,
|
||||||
const struct ddsi_sertopic *topic,
|
const struct ddsi_sertopic *topic,
|
||||||
const struct nn_xqos *xqos,
|
const struct dds_qos *xqos,
|
||||||
struct rhc *rhc,
|
struct rhc *rhc,
|
||||||
status_cb_t status_cb,
|
status_cb_t status_cb,
|
||||||
void * status_entity
|
void * status_entity
|
||||||
|
@ -3239,9 +3238,9 @@ static dds_return_t new_reader_guid
|
||||||
DDS_LOG(DDS_LC_DISCOVERY, "}\n");
|
DDS_LOG(DDS_LC_DISCOVERY, "}\n");
|
||||||
}
|
}
|
||||||
assert (rd->xqos->present & QP_RELIABILITY);
|
assert (rd->xqos->present & QP_RELIABILITY);
|
||||||
rd->reliable = (rd->xqos->reliability.kind != NN_BEST_EFFORT_RELIABILITY_QOS);
|
rd->reliable = (rd->xqos->reliability.kind != DDS_RELIABILITY_BEST_EFFORT);
|
||||||
assert (rd->xqos->present & QP_DURABILITY);
|
assert (rd->xqos->present & QP_DURABILITY);
|
||||||
rd->handle_as_transient_local = (rd->xqos->durability.kind == NN_TRANSIENT_LOCAL_DURABILITY_QOS);
|
rd->handle_as_transient_local = (rd->xqos->durability.kind == DDS_DURABILITY_TRANSIENT_LOCAL);
|
||||||
rd->topic = ddsi_sertopic_ref (topic);
|
rd->topic = ddsi_sertopic_ref (topic);
|
||||||
rd->ddsi2direct_cb = 0;
|
rd->ddsi2direct_cb = 0;
|
||||||
rd->ddsi2direct_cbarg = 0;
|
rd->ddsi2direct_cbarg = 0;
|
||||||
|
@ -3262,10 +3261,9 @@ static dds_return_t new_reader_guid
|
||||||
(ddsi_plugin.rhc_plugin.rhc_set_qos_fn) (rd->rhc, rd->xqos);
|
(ddsi_plugin.rhc_plugin.rhc_set_qos_fn) (rd->rhc, rd->xqos);
|
||||||
}
|
}
|
||||||
assert (rd->xqos->present & QP_LIVELINESS);
|
assert (rd->xqos->present & QP_LIVELINESS);
|
||||||
if (rd->xqos->liveliness.kind != NN_AUTOMATIC_LIVELINESS_QOS ||
|
if (rd->xqos->liveliness.kind != DDS_LIVELINESS_AUTOMATIC || rd->xqos->liveliness.lease_duration != T_NEVER)
|
||||||
nn_from_ddsi_duration (rd->xqos->liveliness.lease_duration) != T_NEVER)
|
|
||||||
{
|
{
|
||||||
DDS_LOG(DDS_LC_DISCOVERY, "reader "PGUIDFMT": incorrectly treating it as of automatic liveliness kind with lease duration = inf (%d, %"PRId64")\n", PGUID (rd->e.guid), (int) rd->xqos->liveliness.kind, nn_from_ddsi_duration (rd->xqos->liveliness.lease_duration));
|
DDS_LOG(DDS_LC_DISCOVERY, "reader "PGUIDFMT": incorrectly treating it as of automatic liveliness kind with lease duration = inf (%d, %"PRId64")\n", PGUID (rd->e.guid), (int) rd->xqos->liveliness.kind, rd->xqos->liveliness.lease_duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
|
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
|
||||||
|
@ -3342,7 +3340,7 @@ dds_return_t new_reader
|
||||||
const struct nn_guid *group_guid,
|
const struct nn_guid *group_guid,
|
||||||
const struct nn_guid *ppguid,
|
const struct nn_guid *ppguid,
|
||||||
const struct ddsi_sertopic *topic,
|
const struct ddsi_sertopic *topic,
|
||||||
const struct nn_xqos *xqos,
|
const struct dds_qos *xqos,
|
||||||
struct rhc * rhc,
|
struct rhc * rhc,
|
||||||
status_cb_t status_cb,
|
status_cb_t status_cb,
|
||||||
void * status_cbarg
|
void * status_cbarg
|
||||||
|
@ -3947,7 +3945,7 @@ uint64_t participant_instance_id (const struct nn_guid *guid)
|
||||||
|
|
||||||
/* PROXY-GROUP --------------------------------------------------- */
|
/* PROXY-GROUP --------------------------------------------------- */
|
||||||
|
|
||||||
int new_proxy_group (const struct nn_guid *guid, const char *name, const struct nn_xqos *xqos, nn_wctime_t timestamp)
|
int new_proxy_group (const struct nn_guid *guid, const char *name, const struct dds_qos *xqos, nn_wctime_t timestamp)
|
||||||
{
|
{
|
||||||
struct proxy_participant *proxypp;
|
struct proxy_participant *proxypp;
|
||||||
nn_guid_t ppguid;
|
nn_guid_t ppguid;
|
||||||
|
@ -4121,7 +4119,7 @@ int new_proxy_writer (const struct nn_guid *ppguid, const struct nn_guid *guid,
|
||||||
/* The DDSI built-in proxy writers always deliver
|
/* The DDSI built-in proxy writers always deliver
|
||||||
asynchronously */
|
asynchronously */
|
||||||
pwr->deliver_synchronously = 0;
|
pwr->deliver_synchronously = 0;
|
||||||
} else if (nn_from_ddsi_duration (pwr->c.xqos->latency_budget.duration) <= config.synchronous_delivery_latency_bound &&
|
} else if (pwr->c.xqos->latency_budget.duration <= config.synchronous_delivery_latency_bound &&
|
||||||
pwr->c.xqos->transport_priority.value >= config.synchronous_delivery_priority_threshold) {
|
pwr->c.xqos->transport_priority.value >= config.synchronous_delivery_priority_threshold) {
|
||||||
/* Regular proxy-writers with a sufficiently low latency_budget
|
/* Regular proxy-writers with a sufficiently low latency_budget
|
||||||
and a sufficiently high transport_priority deliver
|
and a sufficiently high transport_priority deliver
|
||||||
|
@ -4131,7 +4129,7 @@ int new_proxy_writer (const struct nn_guid *ppguid, const struct nn_guid *guid,
|
||||||
pwr->deliver_synchronously = 0;
|
pwr->deliver_synchronously = 0;
|
||||||
}
|
}
|
||||||
/* Pretend we have seen a heartbeat if the proxy writer is a best-effort one */
|
/* Pretend we have seen a heartbeat if the proxy writer is a best-effort one */
|
||||||
isreliable = (pwr->c.xqos->reliability.kind != NN_BEST_EFFORT_RELIABILITY_QOS);
|
isreliable = (pwr->c.xqos->reliability.kind != DDS_RELIABILITY_BEST_EFFORT);
|
||||||
pwr->have_seen_heartbeat = !isreliable;
|
pwr->have_seen_heartbeat = !isreliable;
|
||||||
pwr->local_matching_inprogress = 1;
|
pwr->local_matching_inprogress = 1;
|
||||||
#ifdef DDSI_INCLUDE_SSM
|
#ifdef DDSI_INCLUDE_SSM
|
||||||
|
@ -4144,7 +4142,7 @@ int new_proxy_writer (const struct nn_guid *ppguid, const struct nn_guid *guid,
|
||||||
(unsigned) !!config.arrival_of_data_asserts_pp_and_ep_liveliness;
|
(unsigned) !!config.arrival_of_data_asserts_pp_and_ep_liveliness;
|
||||||
|
|
||||||
assert (pwr->c.xqos->present & QP_LIVELINESS);
|
assert (pwr->c.xqos->present & QP_LIVELINESS);
|
||||||
if (pwr->c.xqos->liveliness.kind != NN_AUTOMATIC_LIVELINESS_QOS)
|
if (pwr->c.xqos->liveliness.kind != DDS_LIVELINESS_AUTOMATIC)
|
||||||
DDS_LOG(DDS_LC_DISCOVERY, " FIXME: only AUTOMATIC liveliness supported");
|
DDS_LOG(DDS_LC_DISCOVERY, " FIXME: only AUTOMATIC liveliness supported");
|
||||||
#if 0
|
#if 0
|
||||||
pwr->tlease_dur = nn_from_ddsi_duration (pwr->c.xqos->liveliness.lease_duration);
|
pwr->tlease_dur = nn_from_ddsi_duration (pwr->c.xqos->liveliness.lease_duration);
|
||||||
|
|
|
@ -131,12 +131,12 @@ static int make_uc_sockets (uint32_t * pdisc, uint32_t * pdata, int ppid)
|
||||||
return gv.data_conn_uc ? 0 : -1;
|
return gv.data_conn_uc ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void make_builtin_endpoint_xqos (nn_xqos_t *q, const nn_xqos_t *template)
|
static void make_builtin_endpoint_xqos (dds_qos_t *q, const dds_qos_t *template)
|
||||||
{
|
{
|
||||||
nn_xqos_copy (q, template);
|
nn_xqos_copy (q, template);
|
||||||
q->reliability.kind = NN_RELIABLE_RELIABILITY_QOS;
|
q->reliability.kind = DDS_RELIABILITY_RELIABLE;
|
||||||
q->reliability.max_blocking_time = nn_to_ddsi_duration (100 * T_MILLISECOND);
|
q->reliability.max_blocking_time = 100 * T_MILLISECOND;
|
||||||
q->durability.kind = NN_TRANSIENT_LOCAL_DURABILITY_QOS;
|
q->durability.kind = DDS_DURABILITY_TRANSIENT_LOCAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int set_recvips (void)
|
static int set_recvips (void)
|
||||||
|
@ -1006,7 +1006,7 @@ int rtps_init (void)
|
||||||
nn_xqos_init_default_subscriber (&gv.default_xqos_sub);
|
nn_xqos_init_default_subscriber (&gv.default_xqos_sub);
|
||||||
nn_xqos_init_default_publisher (&gv.default_xqos_pub);
|
nn_xqos_init_default_publisher (&gv.default_xqos_pub);
|
||||||
nn_xqos_copy (&gv.spdp_endpoint_xqos, &gv.default_xqos_rd);
|
nn_xqos_copy (&gv.spdp_endpoint_xqos, &gv.default_xqos_rd);
|
||||||
gv.spdp_endpoint_xqos.durability.kind = NN_TRANSIENT_LOCAL_DURABILITY_QOS;
|
gv.spdp_endpoint_xqos.durability.kind = DDS_DURABILITY_TRANSIENT_LOCAL;
|
||||||
make_builtin_endpoint_xqos (&gv.builtin_endpoint_xqos_rd, &gv.default_xqos_rd);
|
make_builtin_endpoint_xqos (&gv.builtin_endpoint_xqos_rd, &gv.default_xqos_rd);
|
||||||
make_builtin_endpoint_xqos (&gv.builtin_endpoint_xqos_wr, &gv.default_xqos_wr);
|
make_builtin_endpoint_xqos (&gv.builtin_endpoint_xqos_wr, &gv.default_xqos_wr);
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -35,7 +35,7 @@ static int partition_patmatch_p (const char *pat, const char *name)
|
||||||
return ddsi2_patmatch (pat, name);
|
return ddsi2_patmatch (pat, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int partitions_match_default (const nn_xqos_t *x)
|
static int partitions_match_default (const dds_qos_t *x)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
if (!(x->present & QP_PARTITION) || x->partition.n == 0)
|
if (!(x->present & QP_PARTITION) || x->partition.n == 0)
|
||||||
|
@ -46,7 +46,7 @@ static int partitions_match_default (const nn_xqos_t *x)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int partitions_match_p (const nn_xqos_t *a, const nn_xqos_t *b)
|
int partitions_match_p (const dds_qos_t *a, const dds_qos_t *b)
|
||||||
{
|
{
|
||||||
if (!(a->present & QP_PARTITION) || a->partition.n == 0)
|
if (!(a->present & QP_PARTITION) || a->partition.n == 0)
|
||||||
return partitions_match_default (b);
|
return partitions_match_default (b);
|
||||||
|
@ -66,117 +66,74 @@ int partitions_match_p (const nn_xqos_t *a, const nn_xqos_t *b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ddsi_duration_is_lt (nn_duration_t a0, nn_duration_t b0)
|
static bool qos_match_internal_p (const dds_qos_t *rd, const dds_qos_t *wr, dds_qos_policy_id_t *reason) ddsrt_nonnull_all;
|
||||||
{
|
|
||||||
/* inf counts as <= inf */
|
|
||||||
const int64_t a = nn_from_ddsi_duration (a0);
|
|
||||||
const int64_t b = nn_from_ddsi_duration (b0);
|
|
||||||
if (a == T_NEVER)
|
|
||||||
return 0;
|
|
||||||
else if (b == T_NEVER)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return a < b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Duplicates of DDS policy ids to avoid inclusion of actual definitions */
|
static bool qos_match_internal_p (const dds_qos_t *rd, const dds_qos_t *wr, dds_qos_policy_id_t *reason)
|
||||||
|
|
||||||
#define Q_INVALID_QOS_POLICY_ID 0
|
|
||||||
#define Q_USERDATA_QOS_POLICY_ID 1
|
|
||||||
#define Q_DURABILITY_QOS_POLICY_ID 2
|
|
||||||
#define Q_PRESENTATION_QOS_POLICY_ID 3
|
|
||||||
#define Q_DEADLINE_QOS_POLICY_ID 4
|
|
||||||
#define Q_LATENCYBUDGET_QOS_POLICY_ID 5
|
|
||||||
#define Q_OWNERSHIP_QOS_POLICY_ID 6
|
|
||||||
#define Q_OWNERSHIPSTRENGTH_QOS_POLICY_ID 7
|
|
||||||
#define Q_LIVELINESS_QOS_POLICY_ID 8
|
|
||||||
#define Q_TIMEBASEDFILTER_QOS_POLICY_ID 9
|
|
||||||
#define Q_PARTITION_QOS_POLICY_ID 10
|
|
||||||
#define Q_RELIABILITY_QOS_POLICY_ID 11
|
|
||||||
#define Q_DESTINATIONORDER_QOS_POLICY_ID 12
|
|
||||||
#define Q_HISTORY_QOS_POLICY_ID 13
|
|
||||||
#define Q_RESOURCELIMITS_QOS_POLICY_ID 14
|
|
||||||
#define Q_ENTITYFACTORY_QOS_POLICY_ID 15
|
|
||||||
#define Q_WRITERDATALIFECYCLE_QOS_POLICY_ID 16
|
|
||||||
#define Q_READERDATALIFECYCLE_QOS_POLICY_ID 17
|
|
||||||
#define Q_TOPICDATA_QOS_POLICY_ID 18
|
|
||||||
#define Q_GROUPDATA_QOS_POLICY_ID 19
|
|
||||||
#define Q_TRANSPORTPRIORITY_QOS_POLICY_ID 20
|
|
||||||
#define Q_LIFESPAN_QOS_POLICY_ID 21
|
|
||||||
#define Q_DURABILITYSERVICE_QOS_POLICY_ID 22
|
|
||||||
|
|
||||||
int32_t qos_match_p (const nn_xqos_t *rd, const nn_xqos_t *wr)
|
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
unsigned musthave = (QP_RXO_MASK | QP_PARTITION | QP_TOPIC_NAME | QP_TYPE_NAME);
|
unsigned musthave = (QP_RXO_MASK | QP_PARTITION | QP_TOPIC_NAME | QP_TYPE_NAME);
|
||||||
assert ((rd->present & musthave) == musthave);
|
assert ((rd->present & musthave) == musthave);
|
||||||
assert ((wr->present & musthave) == musthave);
|
assert ((wr->present & musthave) == musthave);
|
||||||
#endif
|
#endif
|
||||||
|
*reason = DDS_INVALID_QOS_POLICY_ID;
|
||||||
if (strcmp (rd->topic_name, wr->topic_name) != 0)
|
if (strcmp (rd->topic_name, wr->topic_name) != 0)
|
||||||
{
|
return false;
|
||||||
return Q_INVALID_QOS_POLICY_ID;
|
|
||||||
}
|
|
||||||
if (strcmp (rd->type_name, wr->type_name) != 0)
|
if (strcmp (rd->type_name, wr->type_name) != 0)
|
||||||
{
|
return false;
|
||||||
return Q_INVALID_QOS_POLICY_ID;
|
|
||||||
|
if (rd->reliability.kind > wr->reliability.kind) {
|
||||||
|
*reason = DDS_RELIABILITY_QOS_POLICY_ID;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
if (rd->relaxed_qos_matching.value || wr->relaxed_qos_matching.value)
|
if (rd->durability.kind > wr->durability.kind) {
|
||||||
{
|
*reason = DDS_DURABILITY_QOS_POLICY_ID;
|
||||||
if (rd->reliability.kind != wr->reliability.kind)
|
return false;
|
||||||
{
|
|
||||||
return Q_RELIABILITY_QOS_POLICY_ID;
|
|
||||||
}
|
}
|
||||||
|
if (rd->presentation.access_scope > wr->presentation.access_scope) {
|
||||||
|
*reason = DDS_PRESENTATION_QOS_POLICY_ID;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else
|
if (rd->presentation.coherent_access > wr->presentation.coherent_access) {
|
||||||
{
|
*reason = DDS_PRESENTATION_QOS_POLICY_ID;
|
||||||
if (rd->reliability.kind > wr->reliability.kind)
|
return false;
|
||||||
{
|
|
||||||
return Q_RELIABILITY_QOS_POLICY_ID;
|
|
||||||
}
|
}
|
||||||
if (rd->durability.kind > wr->durability.kind)
|
if (rd->presentation.ordered_access > wr->presentation.ordered_access) {
|
||||||
{
|
*reason = DDS_PRESENTATION_QOS_POLICY_ID;
|
||||||
return Q_DURABILITY_QOS_POLICY_ID;
|
return false;
|
||||||
}
|
}
|
||||||
if (rd->presentation.access_scope > wr->presentation.access_scope)
|
if (rd->deadline.deadline < wr->deadline.deadline) {
|
||||||
{
|
*reason = DDS_DEADLINE_QOS_POLICY_ID;
|
||||||
return Q_PRESENTATION_QOS_POLICY_ID;
|
return false;
|
||||||
}
|
}
|
||||||
if (rd->presentation.coherent_access > wr->presentation.coherent_access)
|
if (rd->latency_budget.duration < wr->latency_budget.duration) {
|
||||||
{
|
*reason = DDS_LATENCYBUDGET_QOS_POLICY_ID;
|
||||||
return Q_PRESENTATION_QOS_POLICY_ID;
|
return false;
|
||||||
}
|
}
|
||||||
if (rd->presentation.ordered_access > wr->presentation.ordered_access)
|
if (rd->ownership.kind != wr->ownership.kind) {
|
||||||
{
|
*reason = DDS_OWNERSHIP_QOS_POLICY_ID;
|
||||||
return Q_PRESENTATION_QOS_POLICY_ID;
|
return false;
|
||||||
}
|
}
|
||||||
if (ddsi_duration_is_lt (rd->deadline.deadline, wr->deadline.deadline))
|
if (rd->liveliness.kind > wr->liveliness.kind) {
|
||||||
{
|
*reason = DDS_LIVELINESS_QOS_POLICY_ID;
|
||||||
return Q_DEADLINE_QOS_POLICY_ID;
|
return false;
|
||||||
}
|
}
|
||||||
if (ddsi_duration_is_lt (rd->latency_budget.duration, wr->latency_budget.duration))
|
if (rd->liveliness.lease_duration < wr->liveliness.lease_duration) {
|
||||||
{
|
*reason = DDS_LIVELINESS_QOS_POLICY_ID;
|
||||||
return Q_LATENCYBUDGET_QOS_POLICY_ID;
|
return false;
|
||||||
}
|
}
|
||||||
if (rd->ownership.kind != wr->ownership.kind)
|
if (rd->destination_order.kind > wr->destination_order.kind) {
|
||||||
{
|
*reason = DDS_DESTINATIONORDER_QOS_POLICY_ID;
|
||||||
return Q_OWNERSHIP_QOS_POLICY_ID;
|
return false;
|
||||||
}
|
}
|
||||||
if (rd->liveliness.kind > wr->liveliness.kind)
|
if (!partitions_match_p (rd, wr)) {
|
||||||
{
|
*reason = DDS_PARTITION_QOS_POLICY_ID;
|
||||||
return Q_LIVELINESS_QOS_POLICY_ID;
|
return false;
|
||||||
}
|
}
|
||||||
if (ddsi_duration_is_lt (rd->liveliness.lease_duration, wr->liveliness.lease_duration))
|
return true;
|
||||||
{
|
}
|
||||||
return Q_LIVELINESS_QOS_POLICY_ID;
|
|
||||||
}
|
bool qos_match_p (const dds_qos_t *rd, const dds_qos_t *wr, dds_qos_policy_id_t *reason)
|
||||||
if (rd->destination_order.kind > wr->destination_order.kind)
|
{
|
||||||
{
|
dds_qos_policy_id_t dummy;
|
||||||
return Q_DESTINATIONORDER_QOS_POLICY_ID;
|
return qos_match_internal_p (rd, wr, reason ? reason : &dummy);
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!partitions_match_p (rd, wr))
|
|
||||||
{
|
|
||||||
return Q_PARTITION_QOS_POLICY_ID;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -657,7 +657,7 @@ static int accept_ack_or_hb_w_timeout (nn_count_t new_count, nn_count_t *exp_cou
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handle_AckNack (struct receiver_state *rst, nn_etime_t tnow, const AckNack_t *msg, nn_ddsi_time_t timestamp)
|
static int handle_AckNack (struct receiver_state *rst, nn_etime_t tnow, const AckNack_t *msg, nn_wctime_t timestamp)
|
||||||
{
|
{
|
||||||
struct proxy_reader *prd;
|
struct proxy_reader *prd;
|
||||||
struct wr_prd_match *rn;
|
struct wr_prd_match *rn;
|
||||||
|
@ -757,11 +757,10 @@ static int handle_AckNack (struct receiver_state *rst, nn_etime_t tnow, const Ac
|
||||||
work so well if the timestamp can be a left over from some other
|
work so well if the timestamp can be a left over from some other
|
||||||
submessage -- but then, it is no more than a quick hack at the
|
submessage -- but then, it is no more than a quick hack at the
|
||||||
moment. */
|
moment. */
|
||||||
if (config.meas_hb_to_ack_latency && valid_ddsi_timestamp (timestamp))
|
if (config.meas_hb_to_ack_latency && timestamp.v)
|
||||||
{
|
{
|
||||||
nn_wctime_t tstamp_now = now ();
|
nn_wctime_t tstamp_now = now ();
|
||||||
nn_wctime_t tstamp_msg = nn_wctime_from_ddsi_time (timestamp);
|
nn_lat_estim_update (&rn->hb_to_ack_latency, tstamp_now.v - timestamp.v);
|
||||||
nn_lat_estim_update (&rn->hb_to_ack_latency, tstamp_now.v - tstamp_msg.v);
|
|
||||||
if ((dds_get_log_mask() & DDS_LC_TRACE) && tstamp_now.v > rn->hb_to_ack_latency_tlastlog.v + 10 * T_SECOND)
|
if ((dds_get_log_mask() & DDS_LC_TRACE) && tstamp_now.v > rn->hb_to_ack_latency_tlastlog.v + 10 * T_SECOND)
|
||||||
{
|
{
|
||||||
nn_lat_estim_log (DDS_LC_TRACE, NULL, &rn->hb_to_ack_latency);
|
nn_lat_estim_log (DDS_LC_TRACE, NULL, &rn->hb_to_ack_latency);
|
||||||
|
@ -794,7 +793,7 @@ static int handle_AckNack (struct receiver_state *rst, nn_etime_t tnow, const Ac
|
||||||
|
|
||||||
/* If this reader was marked as "non-responsive" in the past, it's now responding again,
|
/* If this reader was marked as "non-responsive" in the past, it's now responding again,
|
||||||
so update its status */
|
so update its status */
|
||||||
if (rn->seq == MAX_SEQ_NUMBER && prd->c.xqos->reliability.kind == NN_RELIABLE_RELIABILITY_QOS)
|
if (rn->seq == MAX_SEQ_NUMBER && prd->c.xqos->reliability.kind == DDS_RELIABILITY_RELIABLE)
|
||||||
{
|
{
|
||||||
seqno_t oldest_seq;
|
seqno_t oldest_seq;
|
||||||
oldest_seq = WHCST_ISEMPTY(&whcst) ? wr->seq : whcst.max_seq;
|
oldest_seq = WHCST_ISEMPTY(&whcst) ? wr->seq : whcst.max_seq;
|
||||||
|
@ -888,7 +887,7 @@ static int handle_AckNack (struct receiver_state *rst, nn_etime_t tnow, const Ac
|
||||||
a future request'll fix it. */
|
a future request'll fix it. */
|
||||||
enqueued = 1;
|
enqueued = 1;
|
||||||
seq_xmit = READ_SEQ_XMIT(wr);
|
seq_xmit = READ_SEQ_XMIT(wr);
|
||||||
const bool gap_for_already_acked = vendor_is_eclipse (rst->vendor) && prd->c.xqos->durability.kind == NN_VOLATILE_DURABILITY_QOS && seqbase <= rn->seq;
|
const bool gap_for_already_acked = vendor_is_eclipse (rst->vendor) && prd->c.xqos->durability.kind == DDS_DURABILITY_VOLATILE && seqbase <= rn->seq;
|
||||||
const seqno_t min_seq_to_rexmit = gap_for_already_acked ? rn->seq + 1 : 0;
|
const seqno_t min_seq_to_rexmit = gap_for_already_acked ? rn->seq + 1 : 0;
|
||||||
for (i = 0; i < numbits && seqbase + i <= seq_xmit && enqueued; i++)
|
for (i = 0; i < numbits && seqbase + i <= seq_xmit && enqueued; i++)
|
||||||
{
|
{
|
||||||
|
@ -1088,7 +1087,7 @@ struct handle_Heartbeat_helper_arg {
|
||||||
struct receiver_state *rst;
|
struct receiver_state *rst;
|
||||||
const Heartbeat_t *msg;
|
const Heartbeat_t *msg;
|
||||||
struct proxy_writer *pwr;
|
struct proxy_writer *pwr;
|
||||||
nn_ddsi_time_t timestamp;
|
nn_wctime_t timestamp;
|
||||||
nn_etime_t tnow;
|
nn_etime_t tnow;
|
||||||
nn_mtime_t tnow_mt;
|
nn_mtime_t tnow_mt;
|
||||||
};
|
};
|
||||||
|
@ -1145,13 +1144,13 @@ static void handle_Heartbeat_helper (struct pwr_rd_match * const wn, struct hand
|
||||||
}
|
}
|
||||||
if (resched_xevent_if_earlier (wn->acknack_xevent, tsched))
|
if (resched_xevent_if_earlier (wn->acknack_xevent, tsched))
|
||||||
{
|
{
|
||||||
if (config.meas_hb_to_ack_latency && valid_ddsi_timestamp (arg->timestamp))
|
if (config.meas_hb_to_ack_latency && arg->timestamp.v)
|
||||||
wn->hb_timestamp = nn_wctime_from_ddsi_time (arg->timestamp);
|
wn->hb_timestamp = arg->timestamp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handle_Heartbeat (struct receiver_state *rst, nn_etime_t tnow, struct nn_rmsg *rmsg, const Heartbeat_t *msg, nn_ddsi_time_t timestamp)
|
static int handle_Heartbeat (struct receiver_state *rst, nn_etime_t tnow, struct nn_rmsg *rmsg, const Heartbeat_t *msg, nn_wctime_t timestamp)
|
||||||
{
|
{
|
||||||
/* We now cheat: and process the heartbeat for _all_ readers,
|
/* We now cheat: and process the heartbeat for _all_ readers,
|
||||||
always, regardless of the destination address in the Heartbeat
|
always, regardless of the destination address in the Heartbeat
|
||||||
|
@ -1567,22 +1566,19 @@ static int handle_InfoSRC (struct receiver_state *rst, const InfoSRC_t *msg)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handle_InfoTS (const InfoTS_t *msg, nn_ddsi_time_t *timestamp)
|
static int handle_InfoTS (const InfoTS_t *msg, nn_wctime_t *timestamp)
|
||||||
{
|
{
|
||||||
DDS_TRACE("INFOTS(");
|
DDS_TRACE("INFOTS(");
|
||||||
if (msg->smhdr.flags & INFOTS_INVALIDATE_FLAG)
|
if (msg->smhdr.flags & INFOTS_INVALIDATE_FLAG)
|
||||||
{
|
{
|
||||||
*timestamp = invalid_ddsi_timestamp;
|
*timestamp = NN_WCTIME_INVALID;
|
||||||
DDS_TRACE("invalidate");
|
DDS_TRACE("invalidate");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*timestamp = msg->time;
|
*timestamp = nn_wctime_from_ddsi_time (msg->time);
|
||||||
if (dds_get_log_mask() & DDS_LC_TRACE)
|
if (dds_get_log_mask() & DDS_LC_TRACE)
|
||||||
{
|
DDS_TRACE("%d.%09d", (int) (timestamp->v / 1000000000), (int) (timestamp->v % 1000000000));
|
||||||
nn_wctime_t t = nn_wctime_from_ddsi_time (* timestamp);
|
|
||||||
DDS_TRACE("%d.%09d", (int) (t.v / 1000000000), (int) (t.v % 1000000000));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
DDS_TRACE(")");
|
DDS_TRACE(")");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1974,8 +1970,8 @@ static int deliver_user_data (const struct nn_rsample_info *sampleinfo, const st
|
||||||
worry about it. */
|
worry about it. */
|
||||||
{
|
{
|
||||||
nn_wctime_t tstamp;
|
nn_wctime_t tstamp;
|
||||||
if (valid_ddsi_timestamp (sampleinfo->timestamp))
|
if (sampleinfo->timestamp.v != NN_WCTIME_INVALID.v)
|
||||||
tstamp = nn_wctime_from_ddsi_time (sampleinfo->timestamp);
|
tstamp = sampleinfo->timestamp;
|
||||||
else
|
else
|
||||||
tstamp.v = 0;
|
tstamp.v = 0;
|
||||||
payload = extract_sample_from_data (sampleinfo, data_smhdr_flags, &qos, fragchain, statusinfo, tstamp, topic);
|
payload = extract_sample_from_data (sampleinfo, data_smhdr_flags, &qos, fragchain, statusinfo, tstamp, topic);
|
||||||
|
@ -2663,7 +2659,7 @@ static int handle_submsg_sequence
|
||||||
Header_t * hdr = (Header_t *) msg;
|
Header_t * hdr = (Header_t *) msg;
|
||||||
struct receiver_state *rst;
|
struct receiver_state *rst;
|
||||||
int rst_live, ts_for_latmeas;
|
int rst_live, ts_for_latmeas;
|
||||||
nn_ddsi_time_t timestamp;
|
nn_wctime_t timestamp;
|
||||||
size_t submsg_size = 0;
|
size_t submsg_size = 0;
|
||||||
unsigned char * end = msg + len;
|
unsigned char * end = msg + len;
|
||||||
struct nn_dqueue *deferred_wakeup = NULL;
|
struct nn_dqueue *deferred_wakeup = NULL;
|
||||||
|
@ -2693,7 +2689,7 @@ static int handle_submsg_sequence
|
||||||
rst->srcloc = *srcloc;
|
rst->srcloc = *srcloc;
|
||||||
rst_live = 0;
|
rst_live = 0;
|
||||||
ts_for_latmeas = 0;
|
ts_for_latmeas = 0;
|
||||||
timestamp = invalid_ddsi_timestamp;
|
timestamp = NN_WCTIME_INVALID;
|
||||||
|
|
||||||
assert (thread_is_asleep ());
|
assert (thread_is_asleep ());
|
||||||
thread_state_awake (ts1);
|
thread_state_awake (ts1);
|
||||||
|
@ -2748,14 +2744,14 @@ static int handle_submsg_sequence
|
||||||
state = "parse:acknack";
|
state = "parse:acknack";
|
||||||
if (!valid_AckNack (&sm->acknack, submsg_size, byteswap))
|
if (!valid_AckNack (&sm->acknack, submsg_size, byteswap))
|
||||||
goto malformed;
|
goto malformed;
|
||||||
handle_AckNack (rst, tnowE, &sm->acknack, ts_for_latmeas ? timestamp : invalid_ddsi_timestamp);
|
handle_AckNack (rst, tnowE, &sm->acknack, ts_for_latmeas ? timestamp : NN_WCTIME_INVALID);
|
||||||
ts_for_latmeas = 0;
|
ts_for_latmeas = 0;
|
||||||
break;
|
break;
|
||||||
case SMID_HEARTBEAT:
|
case SMID_HEARTBEAT:
|
||||||
state = "parse:heartbeat";
|
state = "parse:heartbeat";
|
||||||
if (!valid_Heartbeat (&sm->heartbeat, submsg_size, byteswap))
|
if (!valid_Heartbeat (&sm->heartbeat, submsg_size, byteswap))
|
||||||
goto malformed;
|
goto malformed;
|
||||||
handle_Heartbeat (rst, tnowE, rmsg, &sm->heartbeat, ts_for_latmeas ? timestamp : invalid_ddsi_timestamp);
|
handle_Heartbeat (rst, tnowE, rmsg, &sm->heartbeat, ts_for_latmeas ? timestamp : NN_WCTIME_INVALID);
|
||||||
ts_for_latmeas = 0;
|
ts_for_latmeas = 0;
|
||||||
break;
|
break;
|
||||||
case SMID_GAP:
|
case SMID_GAP:
|
||||||
|
|
|
@ -14,10 +14,6 @@
|
||||||
#include "dds/ddsrt/time.h"
|
#include "dds/ddsrt/time.h"
|
||||||
#include "dds/ddsi/q_time.h"
|
#include "dds/ddsi/q_time.h"
|
||||||
|
|
||||||
const nn_ddsi_time_t invalid_ddsi_timestamp = { -1, UINT32_MAX };
|
|
||||||
const nn_ddsi_time_t ddsi_time_infinite = { INT32_MAX, UINT32_MAX };
|
|
||||||
const nn_duration_t duration_infinite = { INT32_MAX, UINT32_MAX };
|
|
||||||
|
|
||||||
nn_wctime_t now (void)
|
nn_wctime_t now (void)
|
||||||
{
|
{
|
||||||
/* This function uses the wall clock.
|
/* This function uses the wall clock.
|
||||||
|
@ -131,21 +127,21 @@ nn_etime_t add_duration_to_etime (nn_etime_t t, int64_t d)
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
int valid_ddsi_timestamp (nn_ddsi_time_t t)
|
int valid_ddsi_timestamp (ddsi_time_t t)
|
||||||
{
|
{
|
||||||
return t.seconds != invalid_ddsi_timestamp.seconds && t.fraction != invalid_ddsi_timestamp.fraction;
|
return t.seconds != DDSI_TIME_INVALID.seconds && t.fraction != DDSI_TIME_INVALID.fraction;
|
||||||
}
|
}
|
||||||
|
|
||||||
static nn_ddsi_time_t nn_to_ddsi_time (int64_t t)
|
static ddsi_time_t nn_to_ddsi_time (int64_t t)
|
||||||
{
|
{
|
||||||
if (t == T_NEVER)
|
if (t == T_NEVER)
|
||||||
return ddsi_time_infinite;
|
return DDSI_TIME_INFINITE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* ceiling(ns * 2^32/10^9) -- can't change the ceiling to round-to-nearest
|
/* ceiling(ns * 2^32/10^9) -- can't change the ceiling to round-to-nearest
|
||||||
because that would break backwards compatibility, but round-to-nearest
|
because that would break backwards compatibility, but round-to-nearest
|
||||||
of the inverse is correctly rounded anyway, so it shouldn't ever matter. */
|
of the inverse is correctly rounded anyway, so it shouldn't ever matter. */
|
||||||
nn_ddsi_time_t x;
|
ddsi_time_t x;
|
||||||
int ns = (int) (t % T_SECOND);
|
int ns = (int) (t % T_SECOND);
|
||||||
x.seconds = (int) (t / T_SECOND);
|
x.seconds = (int) (t / T_SECOND);
|
||||||
x.fraction = (unsigned) (((T_SECOND-1) + ((int64_t) ns << 32)) / T_SECOND);
|
x.fraction = (unsigned) (((T_SECOND-1) + ((int64_t) ns << 32)) / T_SECOND);
|
||||||
|
@ -153,14 +149,14 @@ static nn_ddsi_time_t nn_to_ddsi_time (int64_t t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nn_ddsi_time_t nn_wctime_to_ddsi_time (nn_wctime_t t)
|
ddsi_time_t nn_wctime_to_ddsi_time (nn_wctime_t t)
|
||||||
{
|
{
|
||||||
return nn_to_ddsi_time (t.v);
|
return nn_to_ddsi_time (t.v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t nn_from_ddsi_time (nn_ddsi_time_t x)
|
static int64_t nn_from_ddsi_time (ddsi_time_t x)
|
||||||
{
|
{
|
||||||
if (x.seconds == ddsi_time_infinite.seconds && x.fraction == ddsi_time_infinite.fraction)
|
if (x.seconds == DDSI_TIME_INFINITE.seconds && x.fraction == DDSI_TIME_INFINITE.fraction)
|
||||||
return T_NEVER;
|
return T_NEVER;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -170,19 +166,19 @@ static int64_t nn_from_ddsi_time (nn_ddsi_time_t x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nn_wctime_t nn_wctime_from_ddsi_time (nn_ddsi_time_t x)
|
nn_wctime_t nn_wctime_from_ddsi_time (ddsi_time_t x)
|
||||||
{
|
{
|
||||||
nn_wctime_t t;
|
nn_wctime_t t;
|
||||||
t.v = nn_from_ddsi_time (x);
|
t.v = nn_from_ddsi_time (x);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
nn_duration_t nn_to_ddsi_duration (int64_t x)
|
ddsi_duration_t nn_to_ddsi_duration (int64_t x)
|
||||||
{
|
{
|
||||||
return nn_to_ddsi_time (x);
|
return nn_to_ddsi_time (x);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t nn_from_ddsi_duration (nn_duration_t x)
|
int64_t nn_from_ddsi_duration (ddsi_duration_t x)
|
||||||
{
|
{
|
||||||
return nn_from_ddsi_time (x);
|
return nn_from_ddsi_time (x);
|
||||||
}
|
}
|
||||||
|
|
|
@ -424,7 +424,7 @@ static dds_return_t create_fragment_message_simple (struct writer *wr, seqno_t s
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nn_xmsg_setdstN (*pmsg, wr->as, wr->as_group);
|
nn_xmsg_setdstN (*pmsg, wr->as, wr->as_group);
|
||||||
nn_xmsg_setmaxdelay (*pmsg, nn_from_ddsi_duration (wr->xqos->latency_budget.duration));
|
nn_xmsg_setmaxdelay (*pmsg, wr->xqos->latency_budget.duration);
|
||||||
nn_xmsg_add_timestamp (*pmsg, serdata->timestamp);
|
nn_xmsg_add_timestamp (*pmsg, serdata->timestamp);
|
||||||
data = nn_xmsg_append (*pmsg, &sm_marker, sizeof (Data_t));
|
data = nn_xmsg_append (*pmsg, &sm_marker, sizeof (Data_t));
|
||||||
|
|
||||||
|
@ -521,7 +521,7 @@ dds_return_t create_fragment_message (struct writer *wr, seqno_t seq, const stru
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nn_xmsg_setdstN (*pmsg, wr->as, wr->as_group);
|
nn_xmsg_setdstN (*pmsg, wr->as, wr->as_group);
|
||||||
nn_xmsg_setmaxdelay (*pmsg, nn_from_ddsi_duration (wr->xqos->latency_budget.duration));
|
nn_xmsg_setmaxdelay (*pmsg, wr->xqos->latency_budget.duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Timestamp only needed once, for the first fragment */
|
/* Timestamp only needed once, for the first fragment */
|
||||||
|
@ -938,7 +938,7 @@ static dds_return_t throttle_writer (struct thread_state1 * const ts1, struct nn
|
||||||
|
|
||||||
dds_return_t result = DDS_RETCODE_OK;
|
dds_return_t result = DDS_RETCODE_OK;
|
||||||
nn_mtime_t tnow = now_mt ();
|
nn_mtime_t tnow = now_mt ();
|
||||||
const nn_mtime_t abstimeout = add_duration_to_mtime (tnow, nn_from_ddsi_duration (wr->xqos->reliability.max_blocking_time));
|
const nn_mtime_t abstimeout = add_duration_to_mtime (tnow, wr->xqos->reliability.max_blocking_time);
|
||||||
struct whc_state whcst;
|
struct whc_state whcst;
|
||||||
whc_get_state (wr->whc, &whcst);
|
whc_get_state (wr->whc, &whcst);
|
||||||
|
|
||||||
|
@ -1024,7 +1024,7 @@ static int write_sample_eot (struct thread_state1 * const ts1, struct nn_xpack *
|
||||||
nn_mtime_t tnow;
|
nn_mtime_t tnow;
|
||||||
|
|
||||||
/* If GC not allowed, we must be sure to never block when writing. That is only the case for (true, aggressive) KEEP_LAST writers, and also only if there is no limit to how much unacknowledged data the WHC may contain. */
|
/* If GC not allowed, we must be sure to never block when writing. That is only the case for (true, aggressive) KEEP_LAST writers, and also only if there is no limit to how much unacknowledged data the WHC may contain. */
|
||||||
assert(gc_allowed || (wr->xqos->history.kind == NN_KEEP_LAST_HISTORY_QOS && wr->whc_low == INT32_MAX));
|
assert(gc_allowed || (wr->xqos->history.kind == DDS_HISTORY_KEEP_LAST && wr->whc_low == INT32_MAX));
|
||||||
(void)gc_allowed;
|
(void)gc_allowed;
|
||||||
|
|
||||||
if (ddsi_serdata_size (serdata) > config.max_sample_size)
|
if (ddsi_serdata_size (serdata) > config.max_sample_size)
|
||||||
|
|
|
@ -782,7 +782,7 @@ size_t nn_xmsg_add_string_padded(unsigned char *buf, char *str)
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t nn_xmsg_add_octseq_padded(unsigned char *buf, nn_octetseq_t *seq)
|
size_t nn_xmsg_add_octseq_padded(unsigned char *buf, ddsi_octetseq_t *seq)
|
||||||
{
|
{
|
||||||
unsigned len = seq->length;
|
unsigned len = seq->length;
|
||||||
if (buf) {
|
if (buf) {
|
||||||
|
@ -799,15 +799,16 @@ size_t nn_xmsg_add_octseq_padded(unsigned char *buf, nn_octetseq_t *seq)
|
||||||
align4u(len); /* seqlen + possible padding */
|
align4u(len); /* seqlen + possible padding */
|
||||||
}
|
}
|
||||||
|
|
||||||
void * nn_xmsg_addpar (struct nn_xmsg *m, unsigned pid, size_t len)
|
void *nn_xmsg_addpar (struct nn_xmsg *m, nn_parameterid_t pid, size_t len)
|
||||||
{
|
{
|
||||||
const size_t len4 = (len + 3) & (size_t)-4; /* must alloc a multiple of 4 */
|
const size_t len4 = (len + 3) & ~(size_t)3; /* must alloc a multiple of 4 */
|
||||||
nn_parameter_t *phdr;
|
nn_parameter_t *phdr;
|
||||||
char *p;
|
char *p;
|
||||||
|
assert (len4 < UINT16_MAX); /* FIXME: return error */
|
||||||
m->have_params = 1;
|
m->have_params = 1;
|
||||||
phdr = nn_xmsg_append (m, NULL, sizeof (nn_parameter_t) + len4);
|
phdr = nn_xmsg_append (m, NULL, sizeof (nn_parameter_t) + len4);
|
||||||
phdr->parameterid = (nn_parameterid_t) pid;
|
phdr->parameterid = pid;
|
||||||
phdr->length = (unsigned short) len4;
|
phdr->length = (uint16_t) len4;
|
||||||
p = (char *) (phdr + 1);
|
p = (char *) (phdr + 1);
|
||||||
if (len4 > len)
|
if (len4 > len)
|
||||||
{
|
{
|
||||||
|
@ -819,23 +820,23 @@ void * nn_xmsg_addpar (struct nn_xmsg *m, unsigned pid, size_t len)
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nn_xmsg_addpar_string (struct nn_xmsg *m, unsigned pid, const char *str)
|
void nn_xmsg_addpar_string (struct nn_xmsg *m, nn_parameterid_t pid, const char *str)
|
||||||
{
|
{
|
||||||
struct cdrstring *p;
|
struct cdrstring *p;
|
||||||
unsigned len = (unsigned) strlen (str) + 1;
|
size_t len = strlen (str) + 1;
|
||||||
p = nn_xmsg_addpar (m, pid, 4 + len);
|
p = nn_xmsg_addpar (m, pid, 4 + len);
|
||||||
p->length = len;
|
p->length = (uint32_t) len;
|
||||||
memcpy (p->contents, str, len);
|
memcpy (p->contents, str, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nn_xmsg_addpar_octetseq (struct nn_xmsg *m, unsigned pid, const nn_octetseq_t *oseq)
|
void nn_xmsg_addpar_octetseq (struct nn_xmsg *m, nn_parameterid_t pid, const ddsi_octetseq_t *oseq)
|
||||||
{
|
{
|
||||||
char *p = nn_xmsg_addpar (m, pid, 4 + oseq->length);
|
char *p = nn_xmsg_addpar (m, pid, 4 + oseq->length);
|
||||||
*((unsigned *) p) = oseq->length;
|
*((unsigned *) p) = oseq->length;
|
||||||
memcpy (p + sizeof (int), oseq->value, oseq->length);
|
memcpy (p + sizeof (int), oseq->value, oseq->length);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nn_xmsg_addpar_stringseq (struct nn_xmsg *m, unsigned pid, const nn_stringseq_t *sseq)
|
void nn_xmsg_addpar_stringseq (struct nn_xmsg *m, nn_parameterid_t pid, const ddsi_stringseq_t *sseq)
|
||||||
{
|
{
|
||||||
unsigned char *tmp;
|
unsigned char *tmp;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
@ -866,7 +867,7 @@ void nn_xmsg_addpar_keyhash (struct nn_xmsg *m, const struct ddsi_serdata *serda
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nn_xmsg_addpar_guid (struct nn_xmsg *m, unsigned pid, const nn_guid_t *guid)
|
void nn_xmsg_addpar_guid (struct nn_xmsg *m, nn_parameterid_t pid, const nn_guid_t *guid)
|
||||||
{
|
{
|
||||||
unsigned *pu;
|
unsigned *pu;
|
||||||
int i;
|
int i;
|
||||||
|
@ -878,50 +879,68 @@ void nn_xmsg_addpar_guid (struct nn_xmsg *m, unsigned pid, const nn_guid_t *guid
|
||||||
pu[i] = toBE4u (guid->entityid.u);
|
pu[i] = toBE4u (guid->entityid.u);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nn_xmsg_addpar_reliability (struct nn_xmsg *m, unsigned pid, const struct nn_reliability_qospolicy *rq)
|
void nn_xmsg_addpar_reliability (struct nn_xmsg *m, nn_parameterid_t pid, const struct dds_reliability_qospolicy *rq)
|
||||||
{
|
{
|
||||||
struct nn_external_reliability_qospolicy *p;
|
struct dds_external_reliability_qospolicy *p;
|
||||||
p = nn_xmsg_addpar (m, pid, sizeof (*p));
|
p = nn_xmsg_addpar (m, pid, sizeof (*p));
|
||||||
if (NN_PEDANTIC_P)
|
|
||||||
{
|
|
||||||
switch (rq->kind)
|
switch (rq->kind)
|
||||||
{
|
{
|
||||||
case NN_BEST_EFFORT_RELIABILITY_QOS:
|
case DDS_RELIABILITY_BEST_EFFORT:
|
||||||
p->kind = NN_PEDANTIC_BEST_EFFORT_RELIABILITY_QOS;
|
p->kind = DDS_EXTERNAL_RELIABILITY_BEST_EFFORT;
|
||||||
break;
|
break;
|
||||||
case NN_RELIABLE_RELIABILITY_QOS:
|
case DDS_RELIABILITY_RELIABLE:
|
||||||
p->kind = NN_PEDANTIC_RELIABLE_RELIABILITY_QOS;
|
p->kind = DDS_EXTERNAL_RELIABILITY_RELIABLE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert (0);
|
assert (0);
|
||||||
}
|
}
|
||||||
}
|
p->max_blocking_time = nn_to_ddsi_duration (rq->max_blocking_time);
|
||||||
else
|
|
||||||
{
|
|
||||||
switch (rq->kind)
|
|
||||||
{
|
|
||||||
case NN_BEST_EFFORT_RELIABILITY_QOS:
|
|
||||||
p->kind = NN_INTEROP_BEST_EFFORT_RELIABILITY_QOS;
|
|
||||||
break;
|
|
||||||
case NN_RELIABLE_RELIABILITY_QOS:
|
|
||||||
p->kind = NN_INTEROP_RELIABLE_RELIABILITY_QOS;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
assert (0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p->max_blocking_time = rq->max_blocking_time;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nn_xmsg_addpar_4u (struct nn_xmsg *m, unsigned pid, unsigned x)
|
void nn_xmsg_addpar_duration (struct nn_xmsg *m, nn_parameterid_t pid, const dds_duration_t rq)
|
||||||
{
|
{
|
||||||
unsigned *p = nn_xmsg_addpar (m, pid, 4);
|
ddsi_duration_t *p = nn_xmsg_addpar (m, pid, sizeof (*p));
|
||||||
|
*p = nn_to_ddsi_duration (rq);
|
||||||
|
}
|
||||||
|
|
||||||
|
void nn_xmsg_addpar_durability_service (struct nn_xmsg *m, nn_parameterid_t pid, const dds_durability_service_qospolicy_t *rq)
|
||||||
|
{
|
||||||
|
dds_external_durability_service_qospolicy_t *p = nn_xmsg_addpar (m, pid, sizeof (*p));
|
||||||
|
p->history = rq->history;
|
||||||
|
p->resource_limits = rq->resource_limits;
|
||||||
|
p->service_cleanup_delay = nn_to_ddsi_duration (rq->service_cleanup_delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
void nn_xmsg_addpar_reader_lifespan (struct nn_xmsg *m, nn_parameterid_t pid, const dds_reader_lifespan_qospolicy_t *rq)
|
||||||
|
{
|
||||||
|
dds_external_reader_lifespan_qospolicy_t *p = nn_xmsg_addpar (m, pid, sizeof (*p));
|
||||||
|
p->use_lifespan = rq->use_lifespan;
|
||||||
|
p->duration = nn_to_ddsi_duration (rq->duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
void nn_xmsg_addpar_reader_data_lifecycle (struct nn_xmsg *m, nn_parameterid_t pid, const dds_reader_data_lifecycle_qospolicy_t *rq)
|
||||||
|
{
|
||||||
|
dds_external_reader_data_lifecycle_qospolicy_t *p = nn_xmsg_addpar (m, pid, sizeof (*p));
|
||||||
|
p->autopurge_disposed_samples_delay = nn_to_ddsi_duration (rq->autopurge_disposed_samples_delay);
|
||||||
|
p->autopurge_nowriter_samples_delay = nn_to_ddsi_duration (rq->autopurge_nowriter_samples_delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
void nn_xmsg_addpar_liveliness (struct nn_xmsg *m, nn_parameterid_t pid, const dds_liveliness_qospolicy_t *rq)
|
||||||
|
{
|
||||||
|
dds_external_liveliness_qospolicy_t *p = nn_xmsg_addpar (m, pid, sizeof (*p));
|
||||||
|
p->kind = rq->kind;
|
||||||
|
p->lease_duration = nn_to_ddsi_duration (rq->lease_duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
void nn_xmsg_addpar_4u (struct nn_xmsg *m, nn_parameterid_t pid, uint32_t x)
|
||||||
|
{
|
||||||
|
unsigned *p = nn_xmsg_addpar (m, pid, sizeof (x));
|
||||||
*p = x;
|
*p = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nn_xmsg_addpar_BE4u (struct nn_xmsg *m, unsigned pid, unsigned x)
|
void nn_xmsg_addpar_BE4u (struct nn_xmsg *m, nn_parameterid_t pid, uint32_t x)
|
||||||
{
|
{
|
||||||
unsigned *p = nn_xmsg_addpar (m, pid, 4);
|
unsigned *p = nn_xmsg_addpar (m, pid, sizeof (x));
|
||||||
*p = toBE4u (x);
|
*p = toBE4u (x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -941,28 +960,7 @@ void nn_xmsg_addpar_statusinfo (struct nn_xmsg *m, unsigned statusinfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void nn_xmsg_addpar_subscription_keys (struct nn_xmsg *m, nn_parameterid_t pid, const struct dds_subscription_keys_qospolicy *q)
|
||||||
void nn_xmsg_addpar_share (struct nn_xmsg *m, unsigned pid, const struct nn_share_qospolicy *q)
|
|
||||||
{
|
|
||||||
/* Written thus to allow q->name to be a null pointer if enable = false */
|
|
||||||
const unsigned fixed_len = 4 + 4;
|
|
||||||
const unsigned len = (q->enable ? (unsigned) strlen (q->name) : 0) + 1;
|
|
||||||
unsigned char *p;
|
|
||||||
struct cdrstring *ps;
|
|
||||||
p = nn_xmsg_addpar (m, pid, fixed_len + len);
|
|
||||||
p[0] = q->enable;
|
|
||||||
p[1] = 0;
|
|
||||||
p[2] = 0;
|
|
||||||
p[3] = 0;
|
|
||||||
ps = (struct cdrstring *) (p + 4);
|
|
||||||
ps->length = len;
|
|
||||||
if (q->enable)
|
|
||||||
memcpy (ps->contents, q->name, len);
|
|
||||||
else
|
|
||||||
ps->contents[0] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void nn_xmsg_addpar_subscription_keys (struct nn_xmsg *m, unsigned pid, const struct nn_subscription_keys_qospolicy *q)
|
|
||||||
{
|
{
|
||||||
unsigned char *tmp;
|
unsigned char *tmp;
|
||||||
size_t len = 8; /* use_key_list, length of key_list */
|
size_t len = 8; /* use_key_list, length of key_list */
|
||||||
|
@ -1012,7 +1010,7 @@ int nn_xmsg_addpar_sentinel_ifparam (struct nn_xmsg * m)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nn_xmsg_addpar_parvinfo (struct nn_xmsg *m, unsigned pid, const struct nn_prismtech_participant_version_info *pvi)
|
void nn_xmsg_addpar_parvinfo (struct nn_xmsg *m, nn_parameterid_t pid, const struct nn_prismtech_participant_version_info *pvi)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned slen;
|
unsigned slen;
|
||||||
|
@ -1033,7 +1031,7 @@ void nn_xmsg_addpar_parvinfo (struct nn_xmsg *m, unsigned pid, const struct nn_p
|
||||||
memcpy(ps->contents, pvi->internals, slen);
|
memcpy(ps->contents, pvi->internals, slen);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nn_xmsg_addpar_eotinfo (struct nn_xmsg *m, unsigned pid, const struct nn_prismtech_eotinfo *txnid)
|
void nn_xmsg_addpar_eotinfo (struct nn_xmsg *m, nn_parameterid_t pid, const struct nn_prismtech_eotinfo *txnid)
|
||||||
{
|
{
|
||||||
uint32_t *pu, i;
|
uint32_t *pu, i;
|
||||||
pu = nn_xmsg_addpar (m, pid, 2 * sizeof (uint32_t) + txnid->n * sizeof (txnid->tids[0]));
|
pu = nn_xmsg_addpar (m, pid, 2 * sizeof (uint32_t) + txnid->n * sizeof (txnid->tids[0]));
|
||||||
|
|
|
@ -140,7 +140,7 @@ static uint64_t store (struct rhc *rhc, struct proxy_writer *wr, struct ddsi_ser
|
||||||
static struct proxy_writer *mkwr (bool auto_dispose)
|
static struct proxy_writer *mkwr (bool auto_dispose)
|
||||||
{
|
{
|
||||||
struct proxy_writer *pwr;
|
struct proxy_writer *pwr;
|
||||||
struct nn_xqos *xqos;
|
struct dds_qos *xqos;
|
||||||
uint64_t wr_iid;
|
uint64_t wr_iid;
|
||||||
pwr = ddsrt_malloc (sizeof (*pwr));
|
pwr = ddsrt_malloc (sizeof (*pwr));
|
||||||
xqos = ddsrt_malloc (sizeof (*xqos));
|
xqos = ddsrt_malloc (sizeof (*xqos));
|
||||||
|
@ -161,10 +161,10 @@ static void fwr (struct proxy_writer *wr)
|
||||||
free (wr);
|
free (wr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct rhc *mkrhc (dds_reader *rd, nn_history_kind_t hk, int32_t hdepth, nn_destination_order_kind_t dok)
|
static struct rhc *mkrhc (dds_reader *rd, dds_history_kind_t hk, int32_t hdepth, dds_destination_order_kind_t dok)
|
||||||
{
|
{
|
||||||
struct rhc *rhc;
|
struct rhc *rhc;
|
||||||
nn_xqos_t rqos;
|
dds_qos_t rqos;
|
||||||
nn_xqos_init_empty (&rqos);
|
nn_xqos_init_empty (&rqos);
|
||||||
rqos.present |= QP_HISTORY | QP_DESTINATION_ORDER;
|
rqos.present |= QP_HISTORY | QP_DESTINATION_ORDER;
|
||||||
rqos.history.kind = hk;
|
rqos.history.kind = hk;
|
||||||
|
@ -848,7 +848,7 @@ int main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
if (print)
|
if (print)
|
||||||
printf ("************* 0 *************\n");
|
printf ("************* 0 *************\n");
|
||||||
struct rhc *rhc = mkrhc (NULL, NN_KEEP_LAST_HISTORY_QOS, 1, NN_BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS);
|
struct rhc *rhc = mkrhc (NULL, DDS_HISTORY_KEEP_LAST, 1, DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP);
|
||||||
struct proxy_writer *wr0 = mkwr (1);
|
struct proxy_writer *wr0 = mkwr (1);
|
||||||
uint64_t iid0, iid1, iid_t;
|
uint64_t iid0, iid1, iid_t;
|
||||||
iid0 = store (rhc, wr0, mksample (0, 0), print);
|
iid0 = store (rhc, wr0, mksample (0, 0), print);
|
||||||
|
@ -894,7 +894,7 @@ int main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
if (print)
|
if (print)
|
||||||
printf ("************* 1 *************\n");
|
printf ("************* 1 *************\n");
|
||||||
struct rhc *rhc = mkrhc (NULL, NN_KEEP_LAST_HISTORY_QOS, 4, NN_BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS);
|
struct rhc *rhc = mkrhc (NULL, DDS_HISTORY_KEEP_LAST, 4, DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP);
|
||||||
struct proxy_writer *wr[] = { mkwr (0), mkwr (0), mkwr (0) };
|
struct proxy_writer *wr[] = { mkwr (0), mkwr (0), mkwr (0) };
|
||||||
uint64_t iid0, iid_t;
|
uint64_t iid0, iid_t;
|
||||||
int nregs = 3, isreg[] = { 1, 1, 1 };
|
int nregs = 3, isreg[] = { 1, 1, 1 };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue