Rearrange things to make RHC interface public
This makes it possible to write one's own RHC implementation. This is not a stable interface. It shuffles a few things around and renames some types used throughout the code to stick to having a "dds" prefix for all the external things. Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
		
							parent
							
								
									801ae26872
								
							
						
					
					
						commit
						57d20e07a4
					
				
					 50 changed files with 574 additions and 555 deletions
				
			
		| 
						 | 
				
			
			@ -50,6 +50,7 @@ PREPEND(hdrs_public_ddsc "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/dd
 | 
			
		|||
    ddsc/dds_public_qos.h
 | 
			
		||||
    ddsc/dds_public_qosdefs.h
 | 
			
		||||
    ddsc/dds_public_status.h
 | 
			
		||||
    ddsc/dds_rhc.h
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
PREPEND(hdrs_private_ddsc "${CMAKE_CURRENT_LIST_DIR}/src"
 | 
			
		||||
| 
						 | 
				
			
			@ -67,7 +68,6 @@ PREPEND(hdrs_private_ddsc "${CMAKE_CURRENT_LIST_DIR}/src"
 | 
			
		|||
    dds__readcond.h
 | 
			
		||||
    dds__guardcond.h
 | 
			
		||||
    dds__reader.h
 | 
			
		||||
    dds__rhc.h
 | 
			
		||||
    dds__rhc_default.h
 | 
			
		||||
    dds__stream.h
 | 
			
		||||
    dds__subscriber.h
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,8 +13,7 @@
 | 
			
		|||
#define _DDS_RHC_H_
 | 
			
		||||
 | 
			
		||||
#include "dds/ddsrt/static_assert.h"
 | 
			
		||||
#include "dds/ddsi/q_rhc.h"
 | 
			
		||||
#include "dds__types.h" /* for dds_readcond */
 | 
			
		||||
#include "dds/ddsi/ddsi_rhc.h"
 | 
			
		||||
 | 
			
		||||
#define NO_STATE_MASK_SET   (DDS_ANY_STATE + 1)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -23,20 +22,21 @@ extern "C" {
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
struct dds_rhc;
 | 
			
		||||
struct dds_readcond;
 | 
			
		||||
 | 
			
		||||
typedef int (*dds_rhc_read_t) (struct dds_rhc *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, struct dds_readcond *cond);
 | 
			
		||||
typedef int (*dds_rhc_take_t) (struct dds_rhc *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, struct dds_readcond *cond);
 | 
			
		||||
typedef int (*dds_rhc_takecdr_t) (struct dds_rhc *rhc, bool lock, struct ddsi_serdata **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t sample_states, uint32_t view_states, uint32_t instance_states, dds_instance_handle_t handle);
 | 
			
		||||
 | 
			
		||||
typedef bool (*dds_rhc_add_readcondition_t) (struct dds_readcond *cond);
 | 
			
		||||
typedef void (*dds_rhc_remove_readcondition_t) (struct dds_readcond *cond);
 | 
			
		||||
typedef bool (*dds_rhc_add_readcondition_t) (struct dds_rhc *rhc, struct dds_readcond *cond);
 | 
			
		||||
typedef void (*dds_rhc_remove_readcondition_t) (struct dds_rhc *rhc, struct dds_readcond *cond);
 | 
			
		||||
 | 
			
		||||
typedef uint32_t (*dds_rhc_lock_samples_t) (struct dds_rhc *rhc);
 | 
			
		||||
 | 
			
		||||
struct dds_rhc_ops {
 | 
			
		||||
  /* A copy of DDSI rhc ops comes first so we can use either interface without
 | 
			
		||||
     additional indirections */
 | 
			
		||||
  struct rhc_ops rhc_ops;
 | 
			
		||||
  struct ddsi_rhc_ops rhc_ops;
 | 
			
		||||
  dds_rhc_read_t read;
 | 
			
		||||
  dds_rhc_take_t take;
 | 
			
		||||
  dds_rhc_takecdr_t takecdr;
 | 
			
		||||
| 
						 | 
				
			
			@ -48,16 +48,16 @@ struct dds_rhc_ops {
 | 
			
		|||
struct dds_rhc {
 | 
			
		||||
  union {
 | 
			
		||||
    const struct dds_rhc_ops *ops;
 | 
			
		||||
    struct rhc rhc;
 | 
			
		||||
    struct ddsi_rhc rhc;
 | 
			
		||||
  } common;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DDSRT_STATIC_ASSERT (offsetof (struct dds_rhc, common.ops) == offsetof (struct rhc, ops));
 | 
			
		||||
DDSRT_STATIC_ASSERT (offsetof (struct dds_rhc, common.ops) == offsetof (struct ddsi_rhc, ops));
 | 
			
		||||
 | 
			
		||||
DDS_EXPORT inline bool dds_rhc_store (struct dds_rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk) {
 | 
			
		||||
DDS_EXPORT inline bool dds_rhc_store (struct dds_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict pwr_info, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk) {
 | 
			
		||||
  return rhc->common.ops->rhc_ops.store (&rhc->common.rhc, pwr_info, sample, tk);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline void dds_rhc_unregister_wr (struct dds_rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info) {
 | 
			
		||||
DDS_EXPORT inline void dds_rhc_unregister_wr (struct dds_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict pwr_info) {
 | 
			
		||||
  rhc->common.ops->rhc_ops.unregister_wr (&rhc->common.rhc, pwr_info);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline void dds_rhc_relinquish_ownership (struct dds_rhc * __restrict rhc, const uint64_t wr_iid) {
 | 
			
		||||
| 
						 | 
				
			
			@ -78,11 +78,11 @@ DDS_EXPORT inline int dds_rhc_take (struct dds_rhc *rhc, bool lock, void **value
 | 
			
		|||
DDS_EXPORT inline int dds_rhc_takecdr (struct dds_rhc *rhc, bool lock, struct ddsi_serdata **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t sample_states, uint32_t view_states, uint32_t instance_states, dds_instance_handle_t handle) {
 | 
			
		||||
  return rhc->common.ops->takecdr (rhc, lock, values, info_seq, max_samples, sample_states, view_states, instance_states, handle);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline bool dds_rhc_add_readcondition (struct dds_readcond *cond) {
 | 
			
		||||
  return cond->m_rhc->common.ops->add_readcondition (cond);
 | 
			
		||||
DDS_EXPORT inline bool dds_rhc_add_readcondition (struct dds_rhc *rhc, struct dds_readcond *cond) {
 | 
			
		||||
  return rhc->common.ops->add_readcondition (rhc, cond);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline void dds_rhc_remove_readcondition (struct dds_readcond *cond) {
 | 
			
		||||
  cond->m_rhc->common.ops->remove_readcondition (cond);
 | 
			
		||||
DDS_EXPORT inline void dds_rhc_remove_readcondition (struct dds_rhc *rhc, struct dds_readcond *cond) {
 | 
			
		||||
  rhc->common.ops->remove_readcondition (rhc, cond);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline uint32_t dds_rhc_lock_samples (struct dds_rhc *rhc) {
 | 
			
		||||
  return rhc->common.ops->lock_samples (rhc);
 | 
			
		||||
| 
						 | 
				
			
			@ -22,7 +22,7 @@ extern "C" {
 | 
			
		|||
 | 
			
		||||
struct ddsi_serdata_builtintopic {
 | 
			
		||||
  struct ddsi_serdata c;
 | 
			
		||||
  nn_guid_t key;
 | 
			
		||||
  ddsi_guid_t key;
 | 
			
		||||
  dds_instance_handle_t pphandle;
 | 
			
		||||
  dds_qos_t xqos;
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,7 +39,7 @@ struct dds_guardcond;
 | 
			
		|||
struct dds_statuscond;
 | 
			
		||||
 | 
			
		||||
struct ddsi_sertopic;
 | 
			
		||||
struct rhc;
 | 
			
		||||
struct ddsi_rhc;
 | 
			
		||||
 | 
			
		||||
typedef uint16_t status_mask_t;
 | 
			
		||||
typedef ddsrt_atomic_uint32_t status_and_enabled_t;
 | 
			
		||||
| 
						 | 
				
			
			@ -124,7 +124,7 @@ typedef struct dds_entity {
 | 
			
		|||
  ddsrt_avl_tree_t m_children;      /* [m_mutex] tree on m_iid using m_avlnode_child */
 | 
			
		||||
  struct dds_domain *m_domain;      /* constant */
 | 
			
		||||
  dds_qos_t *m_qos;                 /* [m_mutex] */
 | 
			
		||||
  nn_guid_t m_guid;                 /* unique (if not 0) and constant; FIXME: set during creation, but possibly after becoming visible */
 | 
			
		||||
  ddsi_guid_t m_guid;                 /* unique (if not 0) and constant; FIXME: set during creation, but possibly after becoming visible */
 | 
			
		||||
  dds_instance_handle_t m_iid;      /* unique for all time, constant; FIXME: like GUID */
 | 
			
		||||
  uint32_t m_flags;                 /* [m_mutex] */
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -290,12 +290,10 @@ typedef uint32_t dds_querycond_mask_t;
 | 
			
		|||
 | 
			
		||||
typedef struct dds_readcond {
 | 
			
		||||
  dds_entity m_entity;
 | 
			
		||||
  struct dds_rhc *m_rhc;
 | 
			
		||||
  uint32_t m_qminv;
 | 
			
		||||
  uint32_t m_sample_states;
 | 
			
		||||
  uint32_t m_view_states;
 | 
			
		||||
  uint32_t m_instance_states;
 | 
			
		||||
  nn_guid_t m_rd_guid;
 | 
			
		||||
  struct dds_readcond *m_next;
 | 
			
		||||
  struct {
 | 
			
		||||
    dds_querycondition_filter_fn m_filter;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -162,7 +162,7 @@ static bool dds__builtin_is_builtintopic (const struct ddsi_sertopic *tp, void *
 | 
			
		|||
  return tp->ops == &ddsi_sertopic_ops_builtintopic;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool dds__builtin_is_visible (const nn_guid_t *guid, nn_vendorid_t vendorid, void *vdomain)
 | 
			
		||||
static bool dds__builtin_is_visible (const ddsi_guid_t *guid, nn_vendorid_t vendorid, void *vdomain)
 | 
			
		||||
{
 | 
			
		||||
  (void) vdomain;
 | 
			
		||||
  if (is_builtin_endpoint (guid->entityid, vendorid))
 | 
			
		||||
| 
						 | 
				
			
			@ -170,7 +170,7 @@ static bool dds__builtin_is_visible (const nn_guid_t *guid, nn_vendorid_t vendor
 | 
			
		|||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct ddsi_tkmap_instance *dds__builtin_get_tkmap_entry (const struct nn_guid *guid, void *vdomain)
 | 
			
		||||
static struct ddsi_tkmap_instance *dds__builtin_get_tkmap_entry (const struct ddsi_guid *guid, void *vdomain)
 | 
			
		||||
{
 | 
			
		||||
  struct dds_domain *domain = vdomain;
 | 
			
		||||
  struct ddsi_tkmap_instance *tk;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,7 @@
 | 
			
		|||
#include "dds/ddsrt/process.h"
 | 
			
		||||
#include "dds/ddsrt/heap.h"
 | 
			
		||||
#include "dds__init.h"
 | 
			
		||||
#include "dds__rhc.h"
 | 
			
		||||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
#include "dds__domain.h"
 | 
			
		||||
#include "dds__builtin.h"
 | 
			
		||||
#include "dds__whc_builtintopic.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@
 | 
			
		|||
#include "dds/ddsrt/process.h"
 | 
			
		||||
#include "dds/ddsrt/heap.h"
 | 
			
		||||
#include "dds__init.h"
 | 
			
		||||
#include "dds__rhc.h"
 | 
			
		||||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
#include "dds__domain.h"
 | 
			
		||||
#include "dds__builtin.h"
 | 
			
		||||
#include "dds__whc_builtintopic.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@
 | 
			
		|||
#include "dds__entity.h"
 | 
			
		||||
#include "dds__write.h"
 | 
			
		||||
#include "dds__writer.h"
 | 
			
		||||
#include "dds__rhc.h"
 | 
			
		||||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_tkmap.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_serdata.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -123,10 +123,10 @@ dds_return_t dds_get_matched_publications (dds_entity_t reader, dds_instance_han
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static dds_builtintopic_endpoint_t *make_builtintopic_endpoint (const nn_guid_t *guid, const nn_guid_t *ppguid, dds_instance_handle_t ppiid, const dds_qos_t *qos)
 | 
			
		||||
static dds_builtintopic_endpoint_t *make_builtintopic_endpoint (const ddsi_guid_t *guid, const ddsi_guid_t *ppguid, dds_instance_handle_t ppiid, const dds_qos_t *qos)
 | 
			
		||||
{
 | 
			
		||||
  dds_builtintopic_endpoint_t *ep;
 | 
			
		||||
  nn_guid_t tmp;
 | 
			
		||||
  ddsi_guid_t tmp;
 | 
			
		||||
  ep = dds_alloc (sizeof (*ep));
 | 
			
		||||
  tmp = nn_hton_guid (*guid);
 | 
			
		||||
  memcpy (&ep->key, &tmp, sizeof (ep->key));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -77,7 +77,7 @@ dds_entity_t dds_create_participant (const dds_domainid_t domain, const dds_qos_
 | 
			
		|||
{
 | 
			
		||||
  dds_domain *dom;
 | 
			
		||||
  dds_entity_t ret;
 | 
			
		||||
  nn_guid_t guid;
 | 
			
		||||
  ddsi_guid_t guid;
 | 
			
		||||
  dds_participant * pp;
 | 
			
		||||
  nn_plist_t plist;
 | 
			
		||||
  dds_qos_t *new_qos = NULL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@
 | 
			
		|||
#include "dds__entity.h"
 | 
			
		||||
#include "dds__reader.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_tkmap.h"
 | 
			
		||||
#include "dds__rhc.h"
 | 
			
		||||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
#include "dds/ddsi/q_thread.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,7 +12,7 @@
 | 
			
		|||
#include <assert.h>
 | 
			
		||||
#include "dds__reader.h"
 | 
			
		||||
#include "dds__readcond.h"
 | 
			
		||||
#include "dds__rhc.h"
 | 
			
		||||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
#include "dds__entity.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_iid.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -23,7 +23,9 @@ static dds_return_t dds_readcond_delete (dds_entity *e) ddsrt_nonnull_all;
 | 
			
		|||
 | 
			
		||||
static dds_return_t dds_readcond_delete (dds_entity *e)
 | 
			
		||||
{
 | 
			
		||||
  dds_rhc_remove_readcondition ((dds_readcond *) e);
 | 
			
		||||
  struct dds_reader * const rd = (struct dds_reader *) e->m_parent;
 | 
			
		||||
  assert (dds_entity_kind (&rd->m_entity) == DDS_KIND_READER);
 | 
			
		||||
  dds_rhc_remove_readcondition (rd->m_rhc, (dds_readcond *) e);
 | 
			
		||||
  return DDS_RETCODE_OK;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -41,17 +43,15 @@ dds_readcond *dds_create_readcond (dds_reader *rd, dds_entity_kind_t kind, uint3
 | 
			
		|||
  (void) dds_entity_init (&cond->m_entity, &rd->m_entity, kind, NULL, NULL, 0);
 | 
			
		||||
  cond->m_entity.m_iid = ddsi_iid_gen ();
 | 
			
		||||
  dds_entity_register_child (&rd->m_entity, &cond->m_entity);
 | 
			
		||||
  cond->m_rhc = rd->m_rhc;
 | 
			
		||||
  cond->m_sample_states = mask & DDS_ANY_SAMPLE_STATE;
 | 
			
		||||
  cond->m_view_states = mask & DDS_ANY_VIEW_STATE;
 | 
			
		||||
  cond->m_instance_states = mask & DDS_ANY_INSTANCE_STATE;
 | 
			
		||||
  cond->m_rd_guid = rd->m_entity.m_guid;
 | 
			
		||||
  if (kind == DDS_KIND_COND_QUERY)
 | 
			
		||||
  {
 | 
			
		||||
    cond->m_query.m_filter = filter;
 | 
			
		||||
    cond->m_query.m_qcmask = 0;
 | 
			
		||||
  }
 | 
			
		||||
  if (!dds_rhc_add_readcondition (cond))
 | 
			
		||||
  if (!dds_rhc_add_readcondition (rd->m_rhc, cond))
 | 
			
		||||
  {
 | 
			
		||||
    /* FIXME: current entity management code can't deal with an error late in the creation of the
 | 
			
		||||
       entity because it doesn't allow deleting it again ... */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@
 | 
			
		|||
#include "dds__reader.h"
 | 
			
		||||
#include "dds__listener.h"
 | 
			
		||||
#include "dds__init.h"
 | 
			
		||||
#include "dds__rhc.h"
 | 
			
		||||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
#include "dds__rhc_default.h"
 | 
			
		||||
#include "dds__topic.h"
 | 
			
		||||
#include "dds__get_status.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -437,7 +437,7 @@ void dds_reader_ddsi2direct (dds_entity_t entity, ddsi2direct_directread_cb_t cb
 | 
			
		|||
 | 
			
		||||
  dds_reader *dds_rd = (dds_reader *) dds_entity;
 | 
			
		||||
  struct reader *rd = dds_rd->m_rd;
 | 
			
		||||
  nn_guid_t pwrguid;
 | 
			
		||||
  ddsi_guid_t pwrguid;
 | 
			
		||||
  struct proxy_writer *pwr;
 | 
			
		||||
  struct rd_pwr_match *m;
 | 
			
		||||
  memset (&pwrguid, 0, sizeof (pwrguid));
 | 
			
		||||
| 
						 | 
				
			
			@ -450,7 +450,7 @@ void dds_reader_ddsi2direct (dds_entity_t entity, ddsi2direct_directread_cb_t cb
 | 
			
		|||
    /* have to be careful walking the tree -- pretty is different, but
 | 
			
		||||
       I want to check this before I write a lookup_succ function. */
 | 
			
		||||
    struct rd_pwr_match *m_next;
 | 
			
		||||
    nn_guid_t pwrguid_next;
 | 
			
		||||
    ddsi_guid_t pwrguid_next;
 | 
			
		||||
    pwrguid = m->pwr_guid;
 | 
			
		||||
    if ((m_next = ddsrt_avl_find_succ (&rd_writers_treedef, &rd->writers, m)) != NULL)
 | 
			
		||||
      pwrguid_next = m_next->pwr_guid;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,17 +11,17 @@
 | 
			
		|||
 */
 | 
			
		||||
 | 
			
		||||
#include "dds/dds.h"
 | 
			
		||||
#include "dds/ddsi/q_rhc.h"
 | 
			
		||||
#include "dds__rhc.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_rhc.h"
 | 
			
		||||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
 | 
			
		||||
extern inline bool dds_rhc_store (struct dds_rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk);
 | 
			
		||||
extern inline void dds_rhc_unregister_wr (struct dds_rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info);
 | 
			
		||||
extern inline bool dds_rhc_store (struct dds_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict pwr_info, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk);
 | 
			
		||||
extern inline void dds_rhc_unregister_wr (struct dds_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict pwr_info);
 | 
			
		||||
extern inline void dds_rhc_relinquish_ownership (struct dds_rhc * __restrict rhc, const uint64_t wr_iid);
 | 
			
		||||
extern inline void dds_rhc_set_qos (struct dds_rhc *rhc, const struct dds_qos *qos);
 | 
			
		||||
extern inline void dds_rhc_free (struct dds_rhc *rhc);
 | 
			
		||||
extern inline int dds_rhc_read (struct dds_rhc *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, dds_readcond *cond);
 | 
			
		||||
extern inline int dds_rhc_take (struct dds_rhc *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, dds_readcond *cond);
 | 
			
		||||
extern inline int dds_rhc_read (struct dds_rhc *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, struct dds_readcond *cond);
 | 
			
		||||
extern inline int dds_rhc_take (struct dds_rhc *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, struct dds_readcond *cond);
 | 
			
		||||
extern inline int dds_rhc_takecdr (struct dds_rhc *rhc, bool lock, struct ddsi_serdata **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t sample_states, uint32_t view_states, uint32_t instance_states, dds_instance_handle_t handle);
 | 
			
		||||
extern inline bool dds_rhc_add_readcondition (struct dds_readcond *cond);
 | 
			
		||||
extern inline void dds_rhc_remove_readcondition (struct dds_readcond *cond);
 | 
			
		||||
extern inline bool dds_rhc_add_readcondition (struct dds_rhc *rhc, struct dds_readcond *cond);
 | 
			
		||||
extern inline void dds_rhc_remove_readcondition (struct dds_rhc *rhc, struct dds_readcond *cond);
 | 
			
		||||
extern inline uint32_t dds_rhc_lock_samples (struct dds_rhc *rhc);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,12 +25,12 @@
 | 
			
		|||
 | 
			
		||||
#include "dds__entity.h"
 | 
			
		||||
#include "dds__reader.h"
 | 
			
		||||
#include "dds__rhc.h"
 | 
			
		||||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
#include "dds__rhc_default.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_tkmap.h"
 | 
			
		||||
#include "dds/ddsrt/hopscotch.h"
 | 
			
		||||
#include "dds/ddsrt/avl.h"
 | 
			
		||||
#include "dds/ddsi/q_rhc.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_rhc.h"
 | 
			
		||||
#include "dds/ddsi/q_xqos.h"
 | 
			
		||||
#include "dds/ddsi/q_unused.h"
 | 
			
		||||
#include "dds/ddsi/q_config.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -263,7 +263,7 @@ struct rhc_instance {
 | 
			
		|||
  uint32_t disposed_gen;       /* bloody generation counters - worst invention of mankind */
 | 
			
		||||
  uint32_t no_writers_gen;     /* __/ */
 | 
			
		||||
  int32_t strength;            /* "current" ownership strength */
 | 
			
		||||
  nn_guid_t wr_guid;           /* guid of last writer (if wr_iid != 0 then wr_guid is the corresponding guid, else undef) */
 | 
			
		||||
  ddsi_guid_t wr_guid;           /* guid of last writer (if wr_iid != 0 then wr_guid is the corresponding guid, else undef) */
 | 
			
		||||
  nn_wctime_t tstamp;          /* source time stamp of last update */
 | 
			
		||||
  struct rhc_instance *next;   /* next non-empty instance in arbitrary ordering */
 | 
			
		||||
  struct rhc_instance *prev;
 | 
			
		||||
| 
						 | 
				
			
			@ -346,30 +346,30 @@ struct trigger_info_post {
 | 
			
		|||
};
 | 
			
		||||
 | 
			
		||||
static void dds_rhc_default_free (struct dds_rhc_default *rhc);
 | 
			
		||||
static bool dds_rhc_default_store (struct dds_rhc_default * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk);
 | 
			
		||||
static void dds_rhc_default_unregister_wr (struct dds_rhc_default * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info);
 | 
			
		||||
static bool dds_rhc_default_store (struct dds_rhc_default * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk);
 | 
			
		||||
static void dds_rhc_default_unregister_wr (struct dds_rhc_default * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo);
 | 
			
		||||
static void dds_rhc_default_relinquish_ownership (struct dds_rhc_default * __restrict rhc, const uint64_t wr_iid);
 | 
			
		||||
static void dds_rhc_default_set_qos (struct dds_rhc_default *rhc, const struct dds_qos *qos);
 | 
			
		||||
static int dds_rhc_default_read (struct dds_rhc_default *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, dds_readcond *cond);
 | 
			
		||||
static int dds_rhc_default_take (struct dds_rhc_default *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, dds_readcond *cond);
 | 
			
		||||
static int dds_rhc_default_takecdr (struct dds_rhc_default *rhc, bool lock, struct ddsi_serdata ** values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t sample_states, uint32_t view_states, uint32_t instance_states, dds_instance_handle_t handle);
 | 
			
		||||
static bool dds_rhc_default_add_readcondition (dds_readcond *cond);
 | 
			
		||||
static void dds_rhc_default_remove_readcondition (dds_readcond *cond);
 | 
			
		||||
static bool dds_rhc_default_add_readcondition (struct dds_rhc_default *rhc, dds_readcond *cond);
 | 
			
		||||
static void dds_rhc_default_remove_readcondition (struct dds_rhc_default *rhc, dds_readcond *cond);
 | 
			
		||||
static uint32_t dds_rhc_default_lock_samples (struct dds_rhc_default *rhc);
 | 
			
		||||
 | 
			
		||||
static void dds_rhc_default_free_wrap (struct rhc *rhc) {
 | 
			
		||||
static void dds_rhc_default_free_wrap (struct ddsi_rhc *rhc) {
 | 
			
		||||
  dds_rhc_default_free ((struct dds_rhc_default *) rhc);
 | 
			
		||||
}
 | 
			
		||||
static bool dds_rhc_default_store_wrap (struct rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk) {
 | 
			
		||||
  return dds_rhc_default_store ((struct dds_rhc_default *) rhc, pwr_info, sample, tk);
 | 
			
		||||
static bool dds_rhc_default_store_wrap (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk) {
 | 
			
		||||
  return dds_rhc_default_store ((struct dds_rhc_default *) rhc, wrinfo, sample, tk);
 | 
			
		||||
}
 | 
			
		||||
static void dds_rhc_default_unregister_wr_wrap (struct rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info) {
 | 
			
		||||
  dds_rhc_default_unregister_wr ((struct dds_rhc_default *) rhc, pwr_info);
 | 
			
		||||
static void dds_rhc_default_unregister_wr_wrap (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo) {
 | 
			
		||||
  dds_rhc_default_unregister_wr ((struct dds_rhc_default *) rhc, wrinfo);
 | 
			
		||||
}
 | 
			
		||||
static void dds_rhc_default_relinquish_ownership_wrap (struct rhc * __restrict rhc, const uint64_t wr_iid) {
 | 
			
		||||
static void dds_rhc_default_relinquish_ownership_wrap (struct ddsi_rhc * __restrict rhc, const uint64_t wr_iid) {
 | 
			
		||||
  dds_rhc_default_relinquish_ownership ((struct dds_rhc_default *) rhc, wr_iid);
 | 
			
		||||
}
 | 
			
		||||
static void dds_rhc_default_set_qos_wrap (struct rhc *rhc, const struct dds_qos *qos) {
 | 
			
		||||
static void dds_rhc_default_set_qos_wrap (struct ddsi_rhc *rhc, const struct dds_qos *qos) {
 | 
			
		||||
  dds_rhc_default_set_qos ((struct dds_rhc_default *) rhc, qos);
 | 
			
		||||
}
 | 
			
		||||
static int dds_rhc_default_read_wrap (struct dds_rhc *rhc, bool lock, void **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t mask, dds_instance_handle_t handle, dds_readcond *cond) {
 | 
			
		||||
| 
						 | 
				
			
			@ -381,11 +381,11 @@ static int dds_rhc_default_take_wrap (struct dds_rhc *rhc, bool lock, void **val
 | 
			
		|||
static int dds_rhc_default_takecdr_wrap (struct dds_rhc *rhc, bool lock, struct ddsi_serdata **values, dds_sample_info_t *info_seq, uint32_t max_samples, uint32_t sample_states, uint32_t view_states, uint32_t instance_states, dds_instance_handle_t handle) {
 | 
			
		||||
  return dds_rhc_default_takecdr ((struct dds_rhc_default *) rhc, lock, values, info_seq, max_samples, sample_states, view_states, instance_states, handle);
 | 
			
		||||
}
 | 
			
		||||
static bool dds_rhc_default_add_readcondition_wrap (dds_readcond *cond) {
 | 
			
		||||
  return dds_rhc_default_add_readcondition (cond);
 | 
			
		||||
static bool dds_rhc_default_add_readcondition_wrap (struct dds_rhc *rhc, dds_readcond *cond) {
 | 
			
		||||
  return dds_rhc_default_add_readcondition ((struct dds_rhc_default *) rhc, cond);
 | 
			
		||||
}
 | 
			
		||||
static void dds_rhc_default_remove_readcondition_wrap (dds_readcond *cond) {
 | 
			
		||||
  dds_rhc_default_remove_readcondition (cond);
 | 
			
		||||
static void dds_rhc_default_remove_readcondition_wrap (struct dds_rhc *rhc, dds_readcond *cond) {
 | 
			
		||||
  dds_rhc_default_remove_readcondition ((struct dds_rhc_default *) rhc, cond);
 | 
			
		||||
}
 | 
			
		||||
static uint32_t dds_rhc_default_lock_samples_wrap (struct dds_rhc *rhc) {
 | 
			
		||||
  return dds_rhc_default_lock_samples ((struct dds_rhc_default *) rhc);
 | 
			
		||||
| 
						 | 
				
			
			@ -758,7 +758,7 @@ static bool trigger_info_differs (const struct dds_rhc_default *rhc, const struc
 | 
			
		|||
            trig_qc->dec_sample_read != trig_qc->inc_sample_read);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool add_sample (struct dds_rhc_default *rhc, struct rhc_instance *inst, const struct proxy_writer_info *pwr_info, const struct ddsi_serdata *sample, status_cb_data_t *cb_data, struct trigger_info_qcond *trig_qc)
 | 
			
		||||
static bool add_sample (struct dds_rhc_default *rhc, struct rhc_instance *inst, const struct ddsi_writer_info *wrinfo, const struct ddsi_serdata *sample, status_cb_data_t *cb_data, struct trigger_info_qcond *trig_qc)
 | 
			
		||||
{
 | 
			
		||||
  struct rhc_sample *s;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -832,7 +832,7 @@ static bool add_sample (struct dds_rhc_default *rhc, struct rhc_instance *inst,
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  s->sample = ddsi_serdata_ref (sample); /* drops const (tho refcount does change) */
 | 
			
		||||
  s->wr_iid = pwr_info->iid;
 | 
			
		||||
  s->wr_iid = wrinfo->iid;
 | 
			
		||||
  s->isread = false;
 | 
			
		||||
  s->disposed_gen = inst->disposed_gen;
 | 
			
		||||
  s->no_writers_gen = inst->no_writers_gen;
 | 
			
		||||
| 
						 | 
				
			
			@ -867,12 +867,12 @@ static bool content_filter_accepts (const dds_reader *reader, const struct ddsi_
 | 
			
		|||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int inst_accepts_sample_by_writer_guid (const struct rhc_instance *inst, const struct proxy_writer_info *pwr_info)
 | 
			
		||||
static int inst_accepts_sample_by_writer_guid (const struct rhc_instance *inst, const struct ddsi_writer_info *wrinfo)
 | 
			
		||||
{
 | 
			
		||||
  return (inst->wr_iid_islive && inst->wr_iid == pwr_info->iid) || memcmp (&pwr_info->guid, &inst->wr_guid, sizeof (inst->wr_guid)) < 0;
 | 
			
		||||
  return (inst->wr_iid_islive && inst->wr_iid == wrinfo->iid) || memcmp (&wrinfo->guid, &inst->wr_guid, sizeof (inst->wr_guid)) < 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int inst_accepts_sample (const struct dds_rhc_default *rhc, const struct rhc_instance *inst, const struct proxy_writer_info *pwr_info, const struct ddsi_serdata *sample, const bool has_data)
 | 
			
		||||
static int inst_accepts_sample (const struct dds_rhc_default *rhc, const struct rhc_instance *inst, const struct ddsi_writer_info *wrinfo, const struct ddsi_serdata *sample, const bool has_data)
 | 
			
		||||
{
 | 
			
		||||
  if (rhc->by_source_ordering)
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -884,7 +884,7 @@ static int inst_accepts_sample (const struct dds_rhc_default *rhc, const struct
 | 
			
		|||
    {
 | 
			
		||||
      return 0;
 | 
			
		||||
    }
 | 
			
		||||
    else if (inst_accepts_sample_by_writer_guid (inst, pwr_info))
 | 
			
		||||
    else if (inst_accepts_sample_by_writer_guid (inst, wrinfo))
 | 
			
		||||
    {
 | 
			
		||||
      /* ok */
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -893,14 +893,14 @@ static int inst_accepts_sample (const struct dds_rhc_default *rhc, const struct
 | 
			
		|||
      return 0;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  if (rhc->exclusive_ownership && inst->wr_iid_islive && inst->wr_iid != pwr_info->iid)
 | 
			
		||||
  if (rhc->exclusive_ownership && inst->wr_iid_islive && inst->wr_iid != wrinfo->iid)
 | 
			
		||||
  {
 | 
			
		||||
    int32_t strength = pwr_info->ownership_strength;
 | 
			
		||||
    int32_t strength = wrinfo->ownership_strength;
 | 
			
		||||
    if (strength > inst->strength) {
 | 
			
		||||
      /* ok */
 | 
			
		||||
    } else if (strength < inst->strength) {
 | 
			
		||||
      return 0;
 | 
			
		||||
    } else if (inst_accepts_sample_by_writer_guid (inst, pwr_info)) {
 | 
			
		||||
    } else if (inst_accepts_sample_by_writer_guid (inst, wrinfo)) {
 | 
			
		||||
      /* ok */
 | 
			
		||||
    } else {
 | 
			
		||||
      return 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -913,17 +913,17 @@ static int inst_accepts_sample (const struct dds_rhc_default *rhc, const struct
 | 
			
		|||
  return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void update_inst (struct rhc_instance *inst, const struct proxy_writer_info * __restrict pwr_info, bool wr_iid_valid, nn_wctime_t tstamp)
 | 
			
		||||
static void update_inst (struct rhc_instance *inst, const struct ddsi_writer_info * __restrict wrinfo, bool wr_iid_valid, nn_wctime_t tstamp)
 | 
			
		||||
{
 | 
			
		||||
  inst->tstamp = tstamp;
 | 
			
		||||
  inst->wr_iid_islive = wr_iid_valid;
 | 
			
		||||
  if (wr_iid_valid)
 | 
			
		||||
  {
 | 
			
		||||
    inst->wr_iid = pwr_info->iid;
 | 
			
		||||
    if (inst->wr_iid != pwr_info->iid)
 | 
			
		||||
      inst->wr_guid = pwr_info->guid;
 | 
			
		||||
    inst->wr_iid = wrinfo->iid;
 | 
			
		||||
    if (inst->wr_iid != wrinfo->iid)
 | 
			
		||||
      inst->wr_guid = wrinfo->guid;
 | 
			
		||||
  }
 | 
			
		||||
  inst->strength = pwr_info->ownership_strength;
 | 
			
		||||
  inst->strength = wrinfo->ownership_strength;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void drop_instance_noupdate_no_writers (struct dds_rhc_default *rhc, struct rhc_instance *inst)
 | 
			
		||||
| 
						 | 
				
			
			@ -1109,13 +1109,13 @@ static int rhc_unregister_isreg_w_sideeffects (struct dds_rhc_default *rhc, cons
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int rhc_unregister_updateinst (struct dds_rhc_default *rhc, struct rhc_instance *inst, const struct proxy_writer_info * __restrict pwr_info, nn_wctime_t tstamp, struct trigger_info_qcond *trig_qc, bool *nda)
 | 
			
		||||
static int rhc_unregister_updateinst (struct dds_rhc_default *rhc, struct rhc_instance *inst, const struct ddsi_writer_info * __restrict wrinfo, nn_wctime_t tstamp, struct trigger_info_qcond *trig_qc, bool *nda)
 | 
			
		||||
{
 | 
			
		||||
  assert (inst->wrcount > 0);
 | 
			
		||||
 | 
			
		||||
  if (--inst->wrcount > 0)
 | 
			
		||||
  {
 | 
			
		||||
    if (inst->wr_iid_islive && pwr_info->iid == inst->wr_iid)
 | 
			
		||||
    if (inst->wr_iid_islive && wrinfo->iid == inst->wr_iid)
 | 
			
		||||
    {
 | 
			
		||||
      /* Next register will have to do real work before we have a cached
 | 
			
		||||
       wr_iid again */
 | 
			
		||||
| 
						 | 
				
			
			@ -1142,7 +1142,7 @@ static int rhc_unregister_updateinst (struct dds_rhc_default *rhc, struct rhc_in
 | 
			
		|||
      if (inst->latest == NULL || inst->latest->isread)
 | 
			
		||||
      {
 | 
			
		||||
        inst_set_invsample (rhc, inst, trig_qc, nda);
 | 
			
		||||
        update_inst (inst, pwr_info, false, tstamp);
 | 
			
		||||
        update_inst (inst, wrinfo, false, tstamp);
 | 
			
		||||
      }
 | 
			
		||||
      if (!inst->isdisposed)
 | 
			
		||||
      {
 | 
			
		||||
| 
						 | 
				
			
			@ -1164,7 +1164,7 @@ static int rhc_unregister_updateinst (struct dds_rhc_default *rhc, struct rhc_in
 | 
			
		|||
      TRACE (",#0,empty,nowriters");
 | 
			
		||||
      assert (inst_is_empty (inst));
 | 
			
		||||
      inst_set_invsample (rhc, inst, trig_qc, nda);
 | 
			
		||||
      update_inst (inst, pwr_info, false, tstamp);
 | 
			
		||||
      update_inst (inst, wrinfo, false, tstamp);
 | 
			
		||||
      account_for_empty_to_nonempty_transition (rhc, inst);
 | 
			
		||||
      inst->wr_iid_islive = 0;
 | 
			
		||||
      return 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -1172,18 +1172,18 @@ static int rhc_unregister_updateinst (struct dds_rhc_default *rhc, struct rhc_in
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool dds_rhc_unregister (struct dds_rhc_default *rhc, struct rhc_instance *inst, const struct proxy_writer_info * __restrict pwr_info, nn_wctime_t tstamp, struct trigger_info_post *post, struct trigger_info_qcond *trig_qc)
 | 
			
		||||
static bool dds_rhc_unregister (struct dds_rhc_default *rhc, struct rhc_instance *inst, const struct ddsi_writer_info * __restrict wrinfo, nn_wctime_t tstamp, struct trigger_info_post *post, struct trigger_info_qcond *trig_qc)
 | 
			
		||||
{
 | 
			
		||||
  bool notify_data_available = false;
 | 
			
		||||
 | 
			
		||||
  /* 'post' always gets set; instance may have been freed upon return. */
 | 
			
		||||
  TRACE (" unregister:");
 | 
			
		||||
  if (!rhc_unregister_isreg_w_sideeffects (rhc, inst, pwr_info->iid))
 | 
			
		||||
  if (!rhc_unregister_isreg_w_sideeffects (rhc, inst, wrinfo->iid))
 | 
			
		||||
  {
 | 
			
		||||
    /* other registrations remain */
 | 
			
		||||
    get_trigger_info_cmn (&post->c, inst);
 | 
			
		||||
  }
 | 
			
		||||
  else if (rhc_unregister_updateinst (rhc, inst, pwr_info, tstamp, trig_qc, ¬ify_data_available))
 | 
			
		||||
  else if (rhc_unregister_updateinst (rhc, inst, wrinfo, tstamp, trig_qc, ¬ify_data_available))
 | 
			
		||||
  {
 | 
			
		||||
    /* instance dropped */
 | 
			
		||||
    init_trigger_info_cmn_nonmatch (&post->c);
 | 
			
		||||
| 
						 | 
				
			
			@ -1196,7 +1196,7 @@ static bool dds_rhc_unregister (struct dds_rhc_default *rhc, struct rhc_instance
 | 
			
		|||
  return notify_data_available;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct rhc_instance *alloc_new_instance (const struct dds_rhc_default *rhc, const struct proxy_writer_info *pwr_info, struct ddsi_serdata *serdata, struct ddsi_tkmap_instance *tk)
 | 
			
		||||
static struct rhc_instance *alloc_new_instance (const struct dds_rhc_default *rhc, const struct ddsi_writer_info *wrinfo, struct ddsi_serdata *serdata, struct ddsi_tkmap_instance *tk)
 | 
			
		||||
{
 | 
			
		||||
  struct rhc_instance *inst;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1210,11 +1210,11 @@ static struct rhc_instance *alloc_new_instance (const struct dds_rhc_default *rh
 | 
			
		|||
  inst->isnew = 1;
 | 
			
		||||
  inst->a_sample_free = 1;
 | 
			
		||||
  inst->conds = 0;
 | 
			
		||||
  inst->wr_iid = pwr_info->iid;
 | 
			
		||||
  inst->wr_iid = wrinfo->iid;
 | 
			
		||||
  inst->wr_iid_islive = (inst->wrcount != 0);
 | 
			
		||||
  inst->wr_guid = pwr_info->guid;
 | 
			
		||||
  inst->wr_guid = wrinfo->guid;
 | 
			
		||||
  inst->tstamp = serdata->timestamp;
 | 
			
		||||
  inst->strength = pwr_info->ownership_strength;
 | 
			
		||||
  inst->strength = wrinfo->ownership_strength;
 | 
			
		||||
 | 
			
		||||
  if (rhc->nqconds != 0)
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -1230,7 +1230,7 @@ static struct rhc_instance *alloc_new_instance (const struct dds_rhc_default *rh
 | 
			
		|||
  return inst;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static rhc_store_result_t rhc_store_new_instance (struct rhc_instance **out_inst, struct dds_rhc_default *rhc, const struct proxy_writer_info *pwr_info, struct ddsi_serdata *sample, struct ddsi_tkmap_instance *tk, const bool has_data, status_cb_data_t *cb_data, struct trigger_info_post *post, struct trigger_info_qcond *trig_qc)
 | 
			
		||||
static rhc_store_result_t rhc_store_new_instance (struct rhc_instance **out_inst, struct dds_rhc_default *rhc, const struct ddsi_writer_info *wrinfo, struct ddsi_serdata *sample, struct ddsi_tkmap_instance *tk, const bool has_data, status_cb_data_t *cb_data, struct trigger_info_post *post, struct trigger_info_qcond *trig_qc)
 | 
			
		||||
{
 | 
			
		||||
  struct rhc_instance *inst;
 | 
			
		||||
  int ret;
 | 
			
		||||
| 
						 | 
				
			
			@ -1265,10 +1265,10 @@ static rhc_store_result_t rhc_store_new_instance (struct rhc_instance **out_inst
 | 
			
		|||
    return RHC_REJECTED;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  inst = alloc_new_instance (rhc, pwr_info, sample, tk);
 | 
			
		||||
  inst = alloc_new_instance (rhc, wrinfo, sample, tk);
 | 
			
		||||
  if (has_data)
 | 
			
		||||
  {
 | 
			
		||||
    if (!add_sample (rhc, inst, pwr_info, sample, cb_data, trig_qc))
 | 
			
		||||
    if (!add_sample (rhc, inst, wrinfo, sample, cb_data, trig_qc))
 | 
			
		||||
    {
 | 
			
		||||
      free_empty_instance (inst, rhc);
 | 
			
		||||
      return RHC_REJECTED;
 | 
			
		||||
| 
						 | 
				
			
			@ -1298,9 +1298,9 @@ static rhc_store_result_t rhc_store_new_instance (struct rhc_instance **out_inst
 | 
			
		|||
  delivered (true unless a reliable sample rejected).
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
static bool dds_rhc_default_store (struct dds_rhc_default * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk)
 | 
			
		||||
static bool dds_rhc_default_store (struct dds_rhc_default * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk)
 | 
			
		||||
{
 | 
			
		||||
  const uint64_t wr_iid = pwr_info->iid;
 | 
			
		||||
  const uint64_t wr_iid = wrinfo->iid;
 | 
			
		||||
  const unsigned statusinfo = sample->statusinfo;
 | 
			
		||||
  const bool has_data = (sample->kind == SDK_DATA);
 | 
			
		||||
  const int is_dispose = (statusinfo & NN_STATUSINFO_DISPOSE) != 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -1347,7 +1347,7 @@ static bool dds_rhc_default_store (struct dds_rhc_default * __restrict rhc, cons
 | 
			
		|||
    else
 | 
			
		||||
    {
 | 
			
		||||
      TRACE (" new instance");
 | 
			
		||||
      stored = rhc_store_new_instance (&inst, rhc, pwr_info, sample, tk, has_data, &cb_data, &post, &trig_qc);
 | 
			
		||||
      stored = rhc_store_new_instance (&inst, rhc, wrinfo, sample, tk, has_data, &cb_data, &post, &trig_qc);
 | 
			
		||||
      if (stored != RHC_STORED)
 | 
			
		||||
      {
 | 
			
		||||
        goto error_or_nochange;
 | 
			
		||||
| 
						 | 
				
			
			@ -1356,7 +1356,7 @@ static bool dds_rhc_default_store (struct dds_rhc_default * __restrict rhc, cons
 | 
			
		|||
      notify_data_available = true;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  else if (!inst_accepts_sample (rhc, inst, pwr_info, sample, has_data))
 | 
			
		||||
  else if (!inst_accepts_sample (rhc, inst, wrinfo, sample, has_data))
 | 
			
		||||
  {
 | 
			
		||||
    /* Rejected samples (and disposes) should still register the writer;
 | 
			
		||||
       unregister *must* be processed, or we have a memory leak. (We
 | 
			
		||||
| 
						 | 
				
			
			@ -1372,7 +1372,7 @@ static bool dds_rhc_default_store (struct dds_rhc_default * __restrict rhc, cons
 | 
			
		|||
    }
 | 
			
		||||
    if (statusinfo & NN_STATUSINFO_UNREGISTER)
 | 
			
		||||
    {
 | 
			
		||||
      if (dds_rhc_unregister (rhc, inst, pwr_info, sample->timestamp, &post, &trig_qc))
 | 
			
		||||
      if (dds_rhc_unregister (rhc, inst, wrinfo, sample->timestamp, &post, &trig_qc))
 | 
			
		||||
        notify_data_available = true;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
| 
						 | 
				
			
			@ -1450,7 +1450,7 @@ static bool dds_rhc_default_store (struct dds_rhc_default * __restrict rhc, cons
 | 
			
		|||
      if (has_data)
 | 
			
		||||
      {
 | 
			
		||||
        TRACE (" add_sample");
 | 
			
		||||
        if (!add_sample (rhc, inst, pwr_info, sample, &cb_data, &trig_qc))
 | 
			
		||||
        if (!add_sample (rhc, inst, wrinfo, sample, &cb_data, &trig_qc))
 | 
			
		||||
        {
 | 
			
		||||
          TRACE ("(reject)");
 | 
			
		||||
          stored = RHC_REJECTED;
 | 
			
		||||
| 
						 | 
				
			
			@ -1469,7 +1469,7 @@ static bool dds_rhc_default_store (struct dds_rhc_default * __restrict rhc, cons
 | 
			
		|||
      if (inst_became_disposed && inst->latest == NULL)
 | 
			
		||||
        inst_set_invsample (rhc, inst, &trig_qc, ¬ify_data_available);
 | 
			
		||||
 | 
			
		||||
      update_inst (inst, pwr_info, true, sample->timestamp);
 | 
			
		||||
      update_inst (inst, wrinfo, true, sample->timestamp);
 | 
			
		||||
 | 
			
		||||
      /* Can only add samples => only need to give special treatment
 | 
			
		||||
         to instances that were empty before.  It is, however, not
 | 
			
		||||
| 
						 | 
				
			
			@ -1513,7 +1513,7 @@ static bool dds_rhc_default_store (struct dds_rhc_default * __restrict rhc, cons
 | 
			
		|||
         mean an application reading "x" after the write and reading it
 | 
			
		||||
         again after the unregister will see a change in the
 | 
			
		||||
         no_writers_generation field? */
 | 
			
		||||
      dds_rhc_unregister (rhc, inst, pwr_info, sample->timestamp, &post, &trig_qc);
 | 
			
		||||
      dds_rhc_unregister (rhc, inst, wrinfo, sample->timestamp, &post, &trig_qc);
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -1559,7 +1559,7 @@ error_or_nochange:
 | 
			
		|||
  return delivered;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void dds_rhc_default_unregister_wr (struct dds_rhc_default * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info)
 | 
			
		||||
static void dds_rhc_default_unregister_wr (struct dds_rhc_default * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo)
 | 
			
		||||
{
 | 
			
		||||
  /* Only to be called when writer with ID WR_IID has died.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1579,8 +1579,8 @@ static void dds_rhc_default_unregister_wr (struct dds_rhc_default * __restrict r
 | 
			
		|||
  bool notify_data_available = false;
 | 
			
		||||
  struct rhc_instance *inst;
 | 
			
		||||
  struct ddsrt_hh_iter iter;
 | 
			
		||||
  const uint64_t wr_iid = pwr_info->iid;
 | 
			
		||||
  const int auto_dispose = pwr_info->auto_dispose;
 | 
			
		||||
  const uint64_t wr_iid = wrinfo->iid;
 | 
			
		||||
  const int auto_dispose = wrinfo->auto_dispose;
 | 
			
		||||
 | 
			
		||||
  size_t ntriggers = SIZE_MAX;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1620,7 +1620,7 @@ static void dds_rhc_default_unregister_wr (struct dds_rhc_default * __restrict r
 | 
			
		|||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      dds_rhc_unregister (rhc, inst, pwr_info, inst->tstamp, &post, &trig_qc);
 | 
			
		||||
      dds_rhc_unregister (rhc, inst, wrinfo, inst->tstamp, &post, &trig_qc);
 | 
			
		||||
 | 
			
		||||
      TRACE ("\n");
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -2292,13 +2292,12 @@ static bool cond_is_sample_state_dependent (const struct dds_readcond *cond)
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool dds_rhc_default_add_readcondition (dds_readcond *cond)
 | 
			
		||||
static bool dds_rhc_default_add_readcondition (struct dds_rhc_default *rhc, dds_readcond *cond)
 | 
			
		||||
{
 | 
			
		||||
  /* On the assumption that a readcondition will be attached to a
 | 
			
		||||
     waitset for nearly all of its life, we keep track of all
 | 
			
		||||
     readconditions on a reader in one set, without distinguishing
 | 
			
		||||
     between those attached to a waitset or not. */
 | 
			
		||||
  struct dds_rhc_default *rhc = (struct dds_rhc_default *) cond->m_rhc;
 | 
			
		||||
  struct ddsrt_hh_iter it;
 | 
			
		||||
 | 
			
		||||
  assert ((dds_entity_kind (&cond->m_entity) == DDS_KIND_COND_READ && cond->m_query.m_filter == 0) ||
 | 
			
		||||
| 
						 | 
				
			
			@ -2397,9 +2396,8 @@ static bool dds_rhc_default_add_readcondition (dds_readcond *cond)
 | 
			
		|||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void dds_rhc_default_remove_readcondition (dds_readcond *cond)
 | 
			
		||||
static void dds_rhc_default_remove_readcondition (struct dds_rhc_default *rhc, dds_readcond *cond)
 | 
			
		||||
{
 | 
			
		||||
  struct dds_rhc_default *rhc = (struct dds_rhc_default *) cond->m_rhc;
 | 
			
		||||
  dds_readcond **ptr;
 | 
			
		||||
  ddsrt_mutex_lock (&rhc->lock);
 | 
			
		||||
  ptr = &rhc->conds;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,7 +32,7 @@ static const uint64_t unihashconsts[] = {
 | 
			
		|||
  UINT64_C (16728792139623414127)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static uint32_t hash_guid (const nn_guid_t *g)
 | 
			
		||||
static uint32_t hash_guid (const ddsi_guid_t *g)
 | 
			
		||||
{
 | 
			
		||||
  return
 | 
			
		||||
  (uint32_t) (((((uint32_t) g->prefix.u[0] + unihashconsts[0]) *
 | 
			
		||||
| 
						 | 
				
			
			@ -131,7 +131,7 @@ static struct ddsi_serdata *ddsi_serdata_builtin_from_keyhash (const struct ddsi
 | 
			
		|||
  /* FIXME: not quite elegant to manage the creation of a serdata for a built-in topic via this function, but I also find it quite unelegant to let from_sample read straight from the underlying internal entity, and to_sample convert to the external format ... I could claim the internal entity is the "serialised form", but that forces wrapping it in a fragchain in one way or another, which, though possible, is also a bit lacking in elegance. */
 | 
			
		||||
  const struct ddsi_sertopic_builtintopic *tp = (const struct ddsi_sertopic_builtintopic *)tpcmn;
 | 
			
		||||
  /* keyhash must in host format (which the GUIDs always are internally) */
 | 
			
		||||
  struct entity_common *entity = ephash_lookup_guid_untyped (tp->gv->guid_hash, (const nn_guid_t *) keyhash->value);
 | 
			
		||||
  struct entity_common *entity = ephash_lookup_guid_untyped (tp->gv->guid_hash, (const ddsi_guid_t *) keyhash->value);
 | 
			
		||||
  struct ddsi_serdata_builtintopic *d = serdata_builtin_new(tp, entity ? SDK_DATA : SDK_KEY);
 | 
			
		||||
  memcpy (&d->key, keyhash->value, sizeof (d->key));
 | 
			
		||||
  if (entity)
 | 
			
		||||
| 
						 | 
				
			
			@ -175,9 +175,9 @@ static struct ddsi_serdata *serdata_builtin_to_topicless (const struct ddsi_serd
 | 
			
		|||
  return ddsi_serdata_ref (serdata_common);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void convkey (dds_builtintopic_guid_t *key, const nn_guid_t *guid)
 | 
			
		||||
static void convkey (dds_builtintopic_guid_t *key, const ddsi_guid_t *guid)
 | 
			
		||||
{
 | 
			
		||||
  nn_guid_t tmp;
 | 
			
		||||
  ddsi_guid_t tmp;
 | 
			
		||||
  tmp = nn_hton_guid (*guid);
 | 
			
		||||
  memcpy (key, &tmp, sizeof (*key));
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -214,7 +214,7 @@ static bool to_sample_pp (const struct ddsi_serdata_builtintopic *d, struct dds_
 | 
			
		|||
 | 
			
		||||
static bool to_sample_endpoint (const struct ddsi_serdata_builtintopic *d, struct dds_builtintopic_endpoint *sample)
 | 
			
		||||
{
 | 
			
		||||
  nn_guid_t ppguid;
 | 
			
		||||
  ddsi_guid_t ppguid;
 | 
			
		||||
  convkey (&sample->key, &d->key);
 | 
			
		||||
  ppguid = d->key;
 | 
			
		||||
  ppguid.entityid.u = NN_ENTITYID_PARTICIPANT;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@
 | 
			
		|||
#include "dds__querycond.h"
 | 
			
		||||
#include "dds__readcond.h"
 | 
			
		||||
#include "dds__init.h"
 | 
			
		||||
#include "dds__rhc.h"
 | 
			
		||||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_iid.h"
 | 
			
		||||
 | 
			
		||||
DEFINE_ENTITY_LOCK_UNLOCK_ONLY (static, dds_waitset, DDS_KIND_WAITSET)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@
 | 
			
		|||
#include "dds/ddsi/ddsi_tkmap.h"
 | 
			
		||||
#include "dds/ddsi/q_thread.h"
 | 
			
		||||
#include "dds/ddsi/q_xmsg.h"
 | 
			
		||||
#include "dds/ddsi/q_rhc.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_rhc.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_serdata.h"
 | 
			
		||||
#include "dds__stream.h"
 | 
			
		||||
#include "dds/ddsi/q_transmit.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -71,9 +71,9 @@ dds_return_t dds_write_ts (dds_entity_t writer, const void *data, dds_time_t tim
 | 
			
		|||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static dds_return_t try_store (struct rhc *rhc, const struct proxy_writer_info *pwr_info, struct ddsi_serdata *payload, struct ddsi_tkmap_instance *tk, dds_duration_t *max_block_ms)
 | 
			
		||||
static dds_return_t try_store (struct ddsi_rhc *rhc, const struct ddsi_writer_info *pwr_info, struct ddsi_serdata *payload, struct ddsi_tkmap_instance *tk, dds_duration_t *max_block_ms)
 | 
			
		||||
{
 | 
			
		||||
  while (! rhc_store (rhc, pwr_info, payload, tk))
 | 
			
		||||
  while (! ddsi_rhc_store (rhc, pwr_info, payload, tk))
 | 
			
		||||
  {
 | 
			
		||||
    if (*max_block_ms > 0)
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -98,8 +98,8 @@ static dds_return_t deliver_locally (struct writer *wr, struct ddsi_serdata *pay
 | 
			
		|||
    if (rdary[0])
 | 
			
		||||
    {
 | 
			
		||||
      dds_duration_t max_block_ms = wr->xqos->reliability.max_blocking_time;
 | 
			
		||||
      struct proxy_writer_info pwr_info;
 | 
			
		||||
      make_proxy_writer_info (&pwr_info, &wr->e, wr->xqos);
 | 
			
		||||
      struct ddsi_writer_info pwr_info;
 | 
			
		||||
      ddsi_make_writer_info (&pwr_info, &wr->e, wr->xqos);
 | 
			
		||||
      for (uint32_t i = 0; rdary[i]; i++) {
 | 
			
		||||
        DDS_CTRACE (&wr->e.gv->logconfig, "reader "PGUIDFMT"\n", PGUID (rdary[i]->e.guid));
 | 
			
		||||
        if ((ret = try_store (rdary[i]->rhc, &pwr_info, payload, tk, &max_block_ms)) != DDS_RETCODE_OK)
 | 
			
		||||
| 
						 | 
				
			
			@ -120,11 +120,11 @@ static dds_return_t deliver_locally (struct writer *wr, struct ddsi_serdata *pay
 | 
			
		|||
       reliable samples that are rejected are simply discarded. */
 | 
			
		||||
    ddsrt_avl_iter_t it;
 | 
			
		||||
    struct pwr_rd_match *m;
 | 
			
		||||
    struct proxy_writer_info pwr_info;
 | 
			
		||||
    struct ddsi_writer_info wrinfo;
 | 
			
		||||
    const struct ephash *gh = wr->e.gv->guid_hash;
 | 
			
		||||
    dds_duration_t max_block_ms = wr->xqos->reliability.max_blocking_time;
 | 
			
		||||
    ddsrt_mutex_unlock (&wr->rdary.rdary_lock);
 | 
			
		||||
    make_proxy_writer_info (&pwr_info, &wr->e, wr->xqos);
 | 
			
		||||
    ddsi_make_writer_info (&wrinfo, &wr->e, wr->xqos);
 | 
			
		||||
    ddsrt_mutex_lock (&wr->e.lock);
 | 
			
		||||
    for (m = ddsrt_avl_iter_first (&wr_local_readers_treedef, &wr->local_readers, &it); m != NULL; m = ddsrt_avl_iter_next (&it))
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			@ -133,7 +133,7 @@ static dds_return_t deliver_locally (struct writer *wr, struct ddsi_serdata *pay
 | 
			
		|||
      {
 | 
			
		||||
        DDS_CTRACE (&wr->e.gv->logconfig, "reader-via-guid "PGUIDFMT"\n", PGUID (rd->e.guid));
 | 
			
		||||
        /* Copied the return value ignore from DDSI deliver_user_data () function. */
 | 
			
		||||
        if ((ret = try_store (rd->rhc, &pwr_info, payload, tk, &max_block_ms)) != DDS_RETCODE_OK)
 | 
			
		||||
        if ((ret = try_store (rd->rhc, &wrinfo, payload, tk, &max_block_ms)) != DDS_RETCODE_OK)
 | 
			
		||||
          break;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,6 +26,7 @@ PREPEND(srcs_ddsi "${CMAKE_CURRENT_LIST_DIR}/src"
 | 
			
		|||
    ddsi_tkmap.c
 | 
			
		||||
    ddsi_vendor.c
 | 
			
		||||
    ddsi_threadmon.c
 | 
			
		||||
    ddsi_rhc.c
 | 
			
		||||
    q_addrset.c
 | 
			
		||||
    q_bitset_inlines.c
 | 
			
		||||
    q_bswap.c
 | 
			
		||||
| 
						 | 
				
			
			@ -53,7 +54,6 @@ PREPEND(srcs_ddsi "${CMAKE_CURRENT_LIST_DIR}/src"
 | 
			
		|||
    q_transmit.c
 | 
			
		||||
    q_inverse_uint32_set.c
 | 
			
		||||
    q_whc.c
 | 
			
		||||
    q_rhc.c
 | 
			
		||||
    q_xevent.c
 | 
			
		||||
    q_xmsg.c
 | 
			
		||||
    q_freelist.c
 | 
			
		||||
| 
						 | 
				
			
			@ -78,6 +78,8 @@ PREPEND(hdrs_private_ddsi "${CMAKE_CURRENT_LIST_DIR}/include/dds/ddsi"
 | 
			
		|||
    ddsi_vendor.h
 | 
			
		||||
    ddsi_threadmon.h
 | 
			
		||||
    ddsi_builtin_topic_if.h
 | 
			
		||||
    ddsi_rhc.h
 | 
			
		||||
    ddsi_guid.h
 | 
			
		||||
    q_addrset.h
 | 
			
		||||
    q_bitset.h
 | 
			
		||||
    q_bswap.h
 | 
			
		||||
| 
						 | 
				
			
			@ -102,7 +104,6 @@ PREPEND(hdrs_private_ddsi "${CMAKE_CURRENT_LIST_DIR}/include/dds/ddsi"
 | 
			
		|||
    q_qosmatch.h
 | 
			
		||||
    q_radmin.h
 | 
			
		||||
    q_receive.h
 | 
			
		||||
    q_rhc.h
 | 
			
		||||
    q_rtps.h
 | 
			
		||||
    q_security.h
 | 
			
		||||
    q_sockwaitset.h
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,24 +22,24 @@ extern "C" {
 | 
			
		|||
struct entity_common;
 | 
			
		||||
struct ddsi_tkmap_instance;
 | 
			
		||||
struct ddsi_sertopic;
 | 
			
		||||
struct nn_guid;
 | 
			
		||||
struct ddsi_guid;
 | 
			
		||||
 | 
			
		||||
struct ddsi_builtin_topic_interface {
 | 
			
		||||
  void *arg;
 | 
			
		||||
 | 
			
		||||
  bool (*builtintopic_is_builtintopic) (const struct ddsi_sertopic *topic, void *arg);
 | 
			
		||||
  bool (*builtintopic_is_visible) (const struct nn_guid *guid, nn_vendorid_t vendorid, void *arg);
 | 
			
		||||
  struct ddsi_tkmap_instance * (*builtintopic_get_tkmap_entry) (const struct nn_guid *guid, void *arg);
 | 
			
		||||
  bool (*builtintopic_is_visible) (const struct ddsi_guid *guid, nn_vendorid_t vendorid, void *arg);
 | 
			
		||||
  struct ddsi_tkmap_instance * (*builtintopic_get_tkmap_entry) (const struct ddsi_guid *guid, void *arg);
 | 
			
		||||
  void (*builtintopic_write) (const struct entity_common *e, nn_wctime_t timestamp, bool alive, void *arg);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
inline bool builtintopic_is_visible (const struct ddsi_builtin_topic_interface *btif, const struct nn_guid *guid, nn_vendorid_t vendorid) {
 | 
			
		||||
inline bool builtintopic_is_visible (const struct ddsi_builtin_topic_interface *btif, const struct ddsi_guid *guid, nn_vendorid_t vendorid) {
 | 
			
		||||
  return btif ? btif->builtintopic_is_visible (guid, vendorid, btif->arg) : false;
 | 
			
		||||
}
 | 
			
		||||
inline bool builtintopic_is_builtintopic (const struct ddsi_builtin_topic_interface *btif, const struct ddsi_sertopic *topic) {
 | 
			
		||||
  return btif ? btif->builtintopic_is_builtintopic (topic, btif->arg) : false;
 | 
			
		||||
}
 | 
			
		||||
inline struct ddsi_tkmap_instance *builtintopic_get_tkmap_entry (const struct ddsi_builtin_topic_interface *btif, const struct nn_guid *guid) {
 | 
			
		||||
inline struct ddsi_tkmap_instance *builtintopic_get_tkmap_entry (const struct ddsi_builtin_topic_interface *btif, const struct ddsi_guid *guid) {
 | 
			
		||||
  return btif ? btif->builtintopic_get_tkmap_entry (guid, btif->arg) : NULL;
 | 
			
		||||
}
 | 
			
		||||
inline void builtintopic_write (const struct ddsi_builtin_topic_interface *btif, const struct entity_common *e, nn_wctime_t timestamp, bool alive) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										37
									
								
								src/core/ddsi/include/dds/ddsi/ddsi_guid.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								src/core/ddsi/include/dds/ddsi/ddsi_guid.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,37 @@
 | 
			
		|||
/*
 | 
			
		||||
 * Copyright(c) 2019 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
 | 
			
		||||
 */
 | 
			
		||||
#ifndef DDSI_GUID_H
 | 
			
		||||
#define DDSI_GUID_H
 | 
			
		||||
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
typedef union ddsi_guid_prefix {
 | 
			
		||||
  unsigned char s[12];
 | 
			
		||||
  uint32_t u[3];
 | 
			
		||||
} ddsi_guid_prefix_t;
 | 
			
		||||
typedef union ddsi_entityid {
 | 
			
		||||
  uint32_t u;
 | 
			
		||||
} ddsi_entityid_t;
 | 
			
		||||
typedef struct ddsi_guid {
 | 
			
		||||
  ddsi_guid_prefix_t prefix;
 | 
			
		||||
  ddsi_entityid_t entityid;
 | 
			
		||||
} ddsi_guid_t;
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										81
									
								
								src/core/ddsi/include/dds/ddsi/ddsi_rhc.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								src/core/ddsi/include/dds/ddsi/ddsi_rhc.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,81 @@
 | 
			
		|||
/*
 | 
			
		||||
 * 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
 | 
			
		||||
 */
 | 
			
		||||
#ifndef DDSI_RHC_H
 | 
			
		||||
#define DDSI_RHC_H
 | 
			
		||||
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
#include <stdbool.h>
 | 
			
		||||
 | 
			
		||||
#include "dds/export.h"
 | 
			
		||||
 | 
			
		||||
/* DDS_EXPORT inline i.c.w. __attributes__((visibility...)) and some compilers: */
 | 
			
		||||
#include "dds/ddsrt/attributes.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_guid.h"
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
struct dds_qos;
 | 
			
		||||
struct ddsi_rhc;
 | 
			
		||||
struct ddsi_tkmap_instance;
 | 
			
		||||
struct ddsi_serdata;
 | 
			
		||||
struct ddsi_sertopic;
 | 
			
		||||
 | 
			
		||||
struct ddsi_writer_info
 | 
			
		||||
{
 | 
			
		||||
  ddsi_guid_t guid;
 | 
			
		||||
  bool auto_dispose;
 | 
			
		||||
  int32_t ownership_strength;
 | 
			
		||||
  uint64_t iid;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef void (*ddsi_rhc_free_t) (struct ddsi_rhc *rhc);
 | 
			
		||||
typedef bool (*ddsi_rhc_store_t) (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk);
 | 
			
		||||
typedef void (*ddsi_rhc_unregister_wr_t) (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo);
 | 
			
		||||
typedef void (*ddsi_rhc_relinquish_ownership_t) (struct ddsi_rhc * __restrict rhc, const uint64_t wr_iid);
 | 
			
		||||
typedef void (*ddsi_rhc_set_qos_t) (struct ddsi_rhc *rhc, const struct dds_qos *qos);
 | 
			
		||||
 | 
			
		||||
struct ddsi_rhc_ops {
 | 
			
		||||
  ddsi_rhc_store_t store;
 | 
			
		||||
  ddsi_rhc_unregister_wr_t unregister_wr;
 | 
			
		||||
  ddsi_rhc_relinquish_ownership_t relinquish_ownership;
 | 
			
		||||
  ddsi_rhc_set_qos_t set_qos;
 | 
			
		||||
  ddsi_rhc_free_t free;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct ddsi_rhc {
 | 
			
		||||
  const struct ddsi_rhc_ops *ops;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DDS_EXPORT inline bool ddsi_rhc_store (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict pwr_info, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk) {
 | 
			
		||||
  return rhc->ops->store (rhc, pwr_info, sample, tk);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline void ddsi_rhc_unregister_wr (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict pwr_info) {
 | 
			
		||||
  rhc->ops->unregister_wr (rhc, pwr_info);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline void ddsi_rhc_relinquish_ownership (struct ddsi_rhc * __restrict rhc, const uint64_t wr_iid) {
 | 
			
		||||
  rhc->ops->relinquish_ownership (rhc, wr_iid);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline void ddsi_rhc_set_qos (struct ddsi_rhc *rhc, const struct dds_qos *qos) {
 | 
			
		||||
  rhc->ops->set_qos (rhc, qos);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline void ddsi_rhc_free (struct ddsi_rhc *rhc) {
 | 
			
		||||
  rhc->ops->free (rhc);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* DDSI_RHC_H */
 | 
			
		||||
| 
						 | 
				
			
			@ -88,12 +88,12 @@ inline void bswapSN (nn_sequence_number_t *sn)
 | 
			
		|||
#define fromBE8u(x) (x)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
nn_guid_prefix_t nn_hton_guid_prefix (nn_guid_prefix_t p);
 | 
			
		||||
nn_guid_prefix_t nn_ntoh_guid_prefix (nn_guid_prefix_t p);
 | 
			
		||||
nn_entityid_t nn_hton_entityid (nn_entityid_t e);
 | 
			
		||||
nn_entityid_t nn_ntoh_entityid (nn_entityid_t e);
 | 
			
		||||
nn_guid_t nn_hton_guid (nn_guid_t g);
 | 
			
		||||
nn_guid_t nn_ntoh_guid (nn_guid_t g);
 | 
			
		||||
ddsi_guid_prefix_t nn_hton_guid_prefix (ddsi_guid_prefix_t p);
 | 
			
		||||
ddsi_guid_prefix_t nn_ntoh_guid_prefix (ddsi_guid_prefix_t p);
 | 
			
		||||
ddsi_entityid_t nn_hton_entityid (ddsi_entityid_t e);
 | 
			
		||||
ddsi_entityid_t nn_ntoh_entityid (ddsi_entityid_t e);
 | 
			
		||||
ddsi_guid_t nn_hton_guid (ddsi_guid_t g);
 | 
			
		||||
ddsi_guid_t nn_ntoh_guid (ddsi_guid_t g);
 | 
			
		||||
 | 
			
		||||
void bswap_sequence_number_set_hdr (nn_sequence_number_set_header_t *snset);
 | 
			
		||||
void bswap_sequence_number_set_bitmap (nn_sequence_number_set_header_t *snset, uint32_t *bits);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ int sedp_dispose_unregister_reader (struct reader *rd);
 | 
			
		|||
int sedp_write_topic (struct participant *pp, const struct nn_plist *datap);
 | 
			
		||||
int sedp_write_cm_participant (struct participant *pp, int alive);
 | 
			
		||||
 | 
			
		||||
int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, const nn_guid_t *rdguid, void *qarg);
 | 
			
		||||
int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, const ddsi_guid_t *rdguid, void *qarg);
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -59,12 +59,12 @@ typedef void (*status_cb_t) (void *entity, const status_cb_data_t *data);
 | 
			
		|||
 | 
			
		||||
struct prd_wr_match {
 | 
			
		||||
  ddsrt_avl_node_t avlnode;
 | 
			
		||||
  nn_guid_t wr_guid;
 | 
			
		||||
  ddsi_guid_t wr_guid;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct rd_pwr_match {
 | 
			
		||||
  ddsrt_avl_node_t avlnode;
 | 
			
		||||
  nn_guid_t pwr_guid;
 | 
			
		||||
  ddsi_guid_t pwr_guid;
 | 
			
		||||
#ifdef DDSI_INCLUDE_SSM
 | 
			
		||||
  nn_locator_t ssm_mc_loc;
 | 
			
		||||
  nn_locator_t ssm_src_loc;
 | 
			
		||||
| 
						 | 
				
			
			@ -73,17 +73,17 @@ struct rd_pwr_match {
 | 
			
		|||
 | 
			
		||||
struct wr_rd_match {
 | 
			
		||||
  ddsrt_avl_node_t avlnode;
 | 
			
		||||
  nn_guid_t rd_guid;
 | 
			
		||||
  ddsi_guid_t rd_guid;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct rd_wr_match {
 | 
			
		||||
  ddsrt_avl_node_t avlnode;
 | 
			
		||||
  nn_guid_t wr_guid;
 | 
			
		||||
  ddsi_guid_t wr_guid;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct wr_prd_match {
 | 
			
		||||
  ddsrt_avl_node_t avlnode;
 | 
			
		||||
  nn_guid_t prd_guid; /* guid of the proxy reader */
 | 
			
		||||
  ddsi_guid_t prd_guid; /* guid of the proxy reader */
 | 
			
		||||
  unsigned assumed_in_sync: 1; /* set to 1 upon receipt of ack not nack'ing msgs */
 | 
			
		||||
  unsigned has_replied_to_hb: 1; /* we must keep sending HBs until all readers have this set */
 | 
			
		||||
  unsigned all_have_replied_to_hb: 1; /* true iff 'has_replied_to_hb' for all readers in subtree */
 | 
			
		||||
| 
						 | 
				
			
			@ -92,7 +92,7 @@ struct wr_prd_match {
 | 
			
		|||
  seqno_t max_seq; /* sort-of highest ack'd seq nr in subtree (see augment function) */
 | 
			
		||||
  seqno_t seq; /* highest acknowledged seq nr */
 | 
			
		||||
  int num_reliable_readers_where_seq_equals_max;
 | 
			
		||||
  nn_guid_t arbitrary_unacked_reader;
 | 
			
		||||
  ddsi_guid_t arbitrary_unacked_reader;
 | 
			
		||||
  nn_count_t next_acknack; /* next acceptable acknack sequence number */
 | 
			
		||||
  nn_count_t next_nackfrag; /* next acceptable nackfrag sequence number */
 | 
			
		||||
  nn_etime_t t_acknack_accepted; /* (local) time an acknack was last accepted */
 | 
			
		||||
| 
						 | 
				
			
			@ -110,7 +110,7 @@ enum pwr_rd_match_syncstate {
 | 
			
		|||
 | 
			
		||||
struct pwr_rd_match {
 | 
			
		||||
  ddsrt_avl_node_t avlnode;
 | 
			
		||||
  nn_guid_t rd_guid;
 | 
			
		||||
  ddsi_guid_t rd_guid;
 | 
			
		||||
  nn_mtime_t tcreate;
 | 
			
		||||
  nn_count_t count; /* most recent acknack sequence number */
 | 
			
		||||
  nn_count_t next_heartbeat; /* next acceptable heartbeat (see also add_proxy_writer_to_reader) */
 | 
			
		||||
| 
						 | 
				
			
			@ -134,7 +134,7 @@ struct ddsi_tkmap_instance;
 | 
			
		|||
 | 
			
		||||
struct entity_common {
 | 
			
		||||
  enum entity_kind kind;
 | 
			
		||||
  nn_guid_t guid;
 | 
			
		||||
  ddsi_guid_t guid;
 | 
			
		||||
  nn_wctime_t tupdate; /* timestamp of last update */
 | 
			
		||||
  char *name;
 | 
			
		||||
  uint64_t iid;
 | 
			
		||||
| 
						 | 
				
			
			@ -188,7 +188,7 @@ struct participant
 | 
			
		|||
 | 
			
		||||
struct endpoint_common {
 | 
			
		||||
  struct participant *pp;
 | 
			
		||||
  nn_guid_t group_guid;
 | 
			
		||||
  ddsi_guid_t group_guid;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct generic_endpoint { /* FIXME: currently only local endpoints; proxies use entity_common + proxy_endpoint common */
 | 
			
		||||
| 
						 | 
				
			
			@ -281,7 +281,7 @@ struct reader
 | 
			
		|||
  struct endpoint_common c;
 | 
			
		||||
  status_cb_t status_cb;
 | 
			
		||||
  void * status_cb_entity;
 | 
			
		||||
  struct rhc * rhc; /* reader history, tracks registrations and data */
 | 
			
		||||
  struct ddsi_rhc * rhc; /* reader history, tracks registrations and data */
 | 
			
		||||
  struct dds_qos *xqos;
 | 
			
		||||
  unsigned reliable: 1; /* 1 iff reader is reliable */
 | 
			
		||||
  unsigned handle_as_transient_local: 1; /* 1 iff reader wants historical data from proxy writers */
 | 
			
		||||
| 
						 | 
				
			
			@ -306,7 +306,7 @@ struct proxy_participant
 | 
			
		|||
  nn_vendorid_t vendor; /* vendor code from discovery */
 | 
			
		||||
  unsigned bes; /* built-in endpoint set */
 | 
			
		||||
  unsigned prismtech_bes; /* prismtech-specific extension of built-in endpoints set */
 | 
			
		||||
  nn_guid_t privileged_pp_guid; /* if this PP depends on another PP for its SEDP writing */
 | 
			
		||||
  ddsi_guid_t privileged_pp_guid; /* if this PP depends on another PP for its SEDP writing */
 | 
			
		||||
  struct nn_plist *plist; /* settings/QoS for this participant */
 | 
			
		||||
  ddsrt_atomic_voidp_t lease; /* lease object for this participant, for automatic leases */
 | 
			
		||||
  struct addrset *as_default; /* default address set to use for user data traffic */
 | 
			
		||||
| 
						 | 
				
			
			@ -333,7 +333,7 @@ struct proxy_participant
 | 
			
		|||
   participant. */
 | 
			
		||||
struct proxy_group {
 | 
			
		||||
  ddsrt_avl_node_t avlnode;
 | 
			
		||||
  nn_guid_t guid;
 | 
			
		||||
  ddsi_guid_t guid;
 | 
			
		||||
  char *name;
 | 
			
		||||
  struct proxy_participant *proxypp; /* uncounted backref to proxy participant */
 | 
			
		||||
  struct dds_qos *xqos; /* publisher/subscriber QoS */
 | 
			
		||||
| 
						 | 
				
			
			@ -346,7 +346,7 @@ struct proxy_endpoint_common
 | 
			
		|||
  struct proxy_endpoint_common *prev_ep; /* prev / -- this is in arbitrary ordering */
 | 
			
		||||
  struct dds_qos *xqos; /* proxy endpoint QoS lives here; FIXME: local ones should have it moved to common as well */
 | 
			
		||||
  struct addrset *as; /* address set to use for communicating with this endpoint */
 | 
			
		||||
  nn_guid_t group_guid; /* 0:0:0:0 if not available */
 | 
			
		||||
  ddsi_guid_t group_guid; /* 0:0:0:0 if not available */
 | 
			
		||||
  nn_vendorid_t vendor; /* cached from proxypp->vendor */
 | 
			
		||||
  seqno_t seq; /* sequence number of most recent SEDP message */
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			@ -401,15 +401,15 @@ extern const ddsrt_avl_treedef_t deleted_participants_treedef;
 | 
			
		|||
struct deleted_participants_admin;
 | 
			
		||||
struct deleted_participants_admin *deleted_participants_admin_new (int64_t delay);
 | 
			
		||||
void deleted_participants_admin_free (struct deleted_participants_admin *admin);
 | 
			
		||||
int is_deleted_participant_guid (struct deleted_participants_admin *admin, const struct nn_guid *guid, unsigned for_what);
 | 
			
		||||
int is_deleted_participant_guid (struct deleted_participants_admin *admin, const struct ddsi_guid *guid, unsigned for_what);
 | 
			
		||||
 | 
			
		||||
nn_entityid_t to_entityid (unsigned u);
 | 
			
		||||
int is_builtin_entityid (nn_entityid_t id, nn_vendorid_t vendorid);
 | 
			
		||||
int is_builtin_endpoint (nn_entityid_t id, nn_vendorid_t vendorid);
 | 
			
		||||
ddsi_entityid_t to_entityid (unsigned u);
 | 
			
		||||
int is_builtin_entityid (ddsi_entityid_t id, nn_vendorid_t vendorid);
 | 
			
		||||
int is_builtin_endpoint (ddsi_entityid_t id, nn_vendorid_t vendorid);
 | 
			
		||||
bool is_local_orphan_endpoint (const struct entity_common *e);
 | 
			
		||||
int is_writer_entityid (nn_entityid_t id);
 | 
			
		||||
int is_reader_entityid (nn_entityid_t id);
 | 
			
		||||
int is_keyed_endpoint_entityid (nn_entityid_t id);
 | 
			
		||||
int is_writer_entityid (ddsi_entityid_t id);
 | 
			
		||||
int is_reader_entityid (ddsi_entityid_t id);
 | 
			
		||||
int is_keyed_endpoint_entityid (ddsi_entityid_t id);
 | 
			
		||||
nn_vendorid_t get_entity_vendorid (const struct entity_common *e);
 | 
			
		||||
 | 
			
		||||
/* Interface for glue code between the OpenSplice kernel and the DDSI
 | 
			
		||||
| 
						 | 
				
			
			@ -490,7 +490,7 @@ nn_vendorid_t get_entity_vendorid (const struct entity_common *e);
 | 
			
		|||
 * @retval DDS_RETCODE_OUT_OF_RESOURCES
 | 
			
		||||
 *               The configured maximum number of participants has been reached.
 | 
			
		||||
 */
 | 
			
		||||
dds_return_t new_participant_guid (const nn_guid_t *ppguid, struct q_globals *gv, unsigned flags, const struct nn_plist *plist);
 | 
			
		||||
dds_return_t new_participant_guid (const ddsi_guid_t *ppguid, struct q_globals *gv, unsigned flags, const struct nn_plist *plist);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Create a new participant in the domain.  See also new_participant_guid.
 | 
			
		||||
| 
						 | 
				
			
			@ -514,7 +514,7 @@ dds_return_t new_participant_guid (const nn_guid_t *ppguid, struct q_globals *gv
 | 
			
		|||
 * @retval DDS_RETCODE_OUT_OF_RESOURCES
 | 
			
		||||
 *               The configured maximum number of participants has been reached.
 | 
			
		||||
*/
 | 
			
		||||
dds_return_t new_participant (struct nn_guid *ppguid, struct q_globals *gv, unsigned flags, const struct nn_plist *plist);
 | 
			
		||||
dds_return_t new_participant (struct ddsi_guid *ppguid, struct q_globals *gv, unsigned flags, const struct nn_plist *plist);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Initiate the deletion of the participant:
 | 
			
		||||
| 
						 | 
				
			
			@ -540,9 +540,9 @@ dds_return_t new_participant (struct nn_guid *ppguid, struct q_globals *gv, unsi
 | 
			
		|||
 * @retval DDS_RETCODE_BAD_PARAMETER
 | 
			
		||||
 *               ppguid lookup failed.
 | 
			
		||||
*/
 | 
			
		||||
dds_return_t delete_participant (struct q_globals *gv, const struct nn_guid *ppguid);
 | 
			
		||||
dds_return_t delete_participant (struct q_globals *gv, const struct ddsi_guid *ppguid);
 | 
			
		||||
void update_participant_plist (struct participant *pp, const struct nn_plist *plist);
 | 
			
		||||
uint64_t get_entity_instance_id (const struct q_globals *gv, const struct nn_guid *guid);
 | 
			
		||||
uint64_t get_entity_instance_id (const struct q_globals *gv, const struct ddsi_guid *guid);
 | 
			
		||||
 | 
			
		||||
/* To obtain the builtin writer to be used for publishing SPDP, SEDP,
 | 
			
		||||
   PMD stuff for PP and its endpoints, given the entityid.  If PP has
 | 
			
		||||
| 
						 | 
				
			
			@ -553,9 +553,9 @@ struct writer *get_builtin_writer (const struct participant *pp, unsigned entity
 | 
			
		|||
   GUID "ppguid". May return NULL if participant unknown or
 | 
			
		||||
   writer/reader already known. */
 | 
			
		||||
 | 
			
		||||
dds_return_t new_writer (struct writer **wr_out, struct q_globals *gv, 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_writer (struct writer **wr_out, struct q_globals *gv, struct ddsi_guid *wrguid, const struct ddsi_guid *group_guid, const struct ddsi_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 q_globals *gv, 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);
 | 
			
		||||
dds_return_t new_reader (struct reader **rd_out, struct q_globals *gv, struct ddsi_guid *rdguid, const struct ddsi_guid *group_guid, const struct ddsi_guid *ppguid, const struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct ddsi_rhc * rhc, status_cb_t status_cb, void *status_cb_arg);
 | 
			
		||||
 | 
			
		||||
void update_reader_qos (struct reader *rd, const struct dds_qos *xqos);
 | 
			
		||||
void update_writer_qos (struct writer *wr, const struct dds_qos *xqos);
 | 
			
		||||
| 
						 | 
				
			
			@ -568,16 +568,16 @@ int writer_must_have_hb_scheduled (const struct writer *wr, const struct whc_sta
 | 
			
		|||
void writer_set_retransmitting (struct writer *wr);
 | 
			
		||||
void writer_clear_retransmitting (struct writer *wr);
 | 
			
		||||
 | 
			
		||||
dds_return_t delete_writer (struct q_globals *gv, const struct nn_guid *guid);
 | 
			
		||||
dds_return_t delete_writer_nolinger (struct q_globals *gv, const struct nn_guid *guid);
 | 
			
		||||
dds_return_t delete_writer (struct q_globals *gv, const struct ddsi_guid *guid);
 | 
			
		||||
dds_return_t delete_writer_nolinger (struct q_globals *gv, const struct ddsi_guid *guid);
 | 
			
		||||
dds_return_t delete_writer_nolinger_locked (struct writer *wr);
 | 
			
		||||
 | 
			
		||||
dds_return_t delete_reader (struct q_globals *gv, const struct nn_guid *guid);
 | 
			
		||||
dds_return_t delete_reader (struct q_globals *gv, const struct ddsi_guid *guid);
 | 
			
		||||
 | 
			
		||||
struct local_orphan_writer {
 | 
			
		||||
  struct writer wr;
 | 
			
		||||
};
 | 
			
		||||
struct local_orphan_writer *new_local_orphan_writer (struct q_globals *gv, nn_entityid_t entityid, struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct whc *whc);
 | 
			
		||||
struct local_orphan_writer *new_local_orphan_writer (struct q_globals *gv, ddsi_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);
 | 
			
		||||
 | 
			
		||||
/* To create or delete a new proxy participant: "guid" MUST have the
 | 
			
		||||
| 
						 | 
				
			
			@ -604,8 +604,8 @@ void delete_local_orphan_writer (struct local_orphan_writer *wr);
 | 
			
		|||
/* Set when this proxy participant is not to be announced on the built-in topics yet */
 | 
			
		||||
#define CF_PROXYPP_NO_SPDP                     (1 << 3)
 | 
			
		||||
 | 
			
		||||
void new_proxy_participant (struct q_globals *gv, const struct nn_guid *guid, unsigned bes, unsigned prismtech_bes, const struct nn_guid *privileged_pp_guid, struct addrset *as_default, struct addrset *as_meta, const struct nn_plist *plist, dds_duration_t tlease_dur, nn_vendorid_t vendor, unsigned custom_flags, nn_wctime_t timestamp, seqno_t seq);
 | 
			
		||||
int delete_proxy_participant_by_guid (struct q_globals *gv, const struct nn_guid *guid, nn_wctime_t timestamp, int isimplicit);
 | 
			
		||||
void new_proxy_participant (struct q_globals *gv, const struct ddsi_guid *guid, unsigned bes, unsigned prismtech_bes, const struct ddsi_guid *privileged_pp_guid, struct addrset *as_default, struct addrset *as_meta, const struct nn_plist *plist, dds_duration_t tlease_dur, nn_vendorid_t vendor, unsigned custom_flags, nn_wctime_t timestamp, seqno_t seq);
 | 
			
		||||
int delete_proxy_participant_by_guid (struct q_globals *gv, const struct ddsi_guid *guid, nn_wctime_t timestamp, int isimplicit);
 | 
			
		||||
 | 
			
		||||
enum update_proxy_participant_source {
 | 
			
		||||
  UPD_PROXYPP_SPDP,
 | 
			
		||||
| 
						 | 
				
			
			@ -620,8 +620,8 @@ void purge_proxy_participants (struct q_globals *gv, const nn_locator_t *loc, bo
 | 
			
		|||
 | 
			
		||||
/* To create a new proxy writer or reader; the proxy participant is
 | 
			
		||||
   determined from the GUID and must exist. */
 | 
			
		||||
  int new_proxy_writer (struct q_globals *gv, const struct nn_guid *ppguid, const struct nn_guid *guid, struct addrset *as, const struct nn_plist *plist, struct nn_dqueue *dqueue, struct xeventq *evq, nn_wctime_t timestamp, seqno_t seq);
 | 
			
		||||
int new_proxy_reader (struct q_globals *gv, const struct nn_guid *ppguid, const struct nn_guid *guid, struct addrset *as, const struct nn_plist *plist, nn_wctime_t timestamp, seqno_t seq
 | 
			
		||||
  int new_proxy_writer (struct q_globals *gv, const struct ddsi_guid *ppguid, const struct ddsi_guid *guid, struct addrset *as, const struct nn_plist *plist, struct nn_dqueue *dqueue, struct xeventq *evq, nn_wctime_t timestamp, seqno_t seq);
 | 
			
		||||
int new_proxy_reader (struct q_globals *gv, const struct ddsi_guid *ppguid, const struct ddsi_guid *guid, struct addrset *as, const struct nn_plist *plist, nn_wctime_t timestamp, seqno_t seq
 | 
			
		||||
#ifdef DDSI_INCLUDE_SSM
 | 
			
		||||
                      , int favours_ssm
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -632,22 +632,24 @@ int new_proxy_reader (struct q_globals *gv, const struct nn_guid *ppguid, const
 | 
			
		|||
   reader or writer. Actual deletion is scheduled in the future, when
 | 
			
		||||
   no outstanding references may still exist (determined by checking
 | 
			
		||||
   thread progress, &c.). */
 | 
			
		||||
int delete_proxy_writer (struct q_globals *gv, const struct nn_guid *guid, nn_wctime_t timestamp, int isimplicit);
 | 
			
		||||
int delete_proxy_reader (struct q_globals *gv, const struct nn_guid *guid, nn_wctime_t timestamp, int isimplicit);
 | 
			
		||||
int delete_proxy_writer (struct q_globals *gv, const struct ddsi_guid *guid, nn_wctime_t timestamp, int isimplicit);
 | 
			
		||||
int delete_proxy_reader (struct q_globals *gv, const struct ddsi_guid *guid, nn_wctime_t timestamp, int isimplicit);
 | 
			
		||||
 | 
			
		||||
void update_proxy_reader (struct proxy_reader *prd, seqno_t seq, struct addrset *as, const struct dds_qos *xqos, nn_wctime_t timestamp);
 | 
			
		||||
void update_proxy_writer (struct proxy_writer *pwr, seqno_t seq, struct addrset *as, const struct dds_qos *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 (struct ephash *guid_hash, const struct nn_guid *guid, nn_wctime_t timestamp, int isimplicit);
 | 
			
		||||
int new_proxy_group (const struct ddsi_guid *guid, const char *name, const struct dds_qos *xqos, nn_wctime_t timestamp);
 | 
			
		||||
void delete_proxy_group (struct ephash *guid_hash, const struct ddsi_guid *guid, nn_wctime_t timestamp, int isimplicit);
 | 
			
		||||
 | 
			
		||||
/* Call this to empty all address sets of all writers to stop all outgoing traffic, or to
 | 
			
		||||
   rebuild them all (which only makes sense after previously having emptied them all). */
 | 
			
		||||
void rebuild_or_clear_writer_addrsets(struct q_globals *gv, int rebuild);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void local_reader_ary_setfastpath_ok (struct local_reader_ary *x, bool fastpath_ok);
 | 
			
		||||
 | 
			
		||||
struct ddsi_writer_info;
 | 
			
		||||
DDS_EXPORT void ddsi_make_writer_info(struct ddsi_writer_info *wrinfo, const struct entity_common *e, const struct dds_qos *xqos);
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,7 @@ struct writer;
 | 
			
		|||
struct proxy_participant;
 | 
			
		||||
struct proxy_reader;
 | 
			
		||||
struct proxy_writer;
 | 
			
		||||
struct nn_guid;
 | 
			
		||||
struct ddsi_guid;
 | 
			
		||||
 | 
			
		||||
  enum entity_kind {
 | 
			
		||||
    EK_PARTICIPANT,
 | 
			
		||||
| 
						 | 
				
			
			@ -80,15 +80,15 @@ void ephash_remove_reader_guid (struct ephash *eh, struct reader *rd);
 | 
			
		|||
void ephash_remove_proxy_writer_guid (struct ephash *eh, struct proxy_writer *pwr);
 | 
			
		||||
void ephash_remove_proxy_reader_guid (struct ephash *eh, struct proxy_reader *prd);
 | 
			
		||||
 | 
			
		||||
void *ephash_lookup_guid_untyped (const struct ephash *eh, const struct nn_guid *guid);
 | 
			
		||||
void *ephash_lookup_guid (const struct ephash *eh, const struct nn_guid *guid, enum entity_kind kind);
 | 
			
		||||
void *ephash_lookup_guid_untyped (const struct ephash *eh, const struct ddsi_guid *guid);
 | 
			
		||||
void *ephash_lookup_guid (const struct ephash *eh, const struct ddsi_guid *guid, enum entity_kind kind);
 | 
			
		||||
 | 
			
		||||
struct participant *ephash_lookup_participant_guid (const struct ephash *eh, const struct nn_guid *guid);
 | 
			
		||||
struct proxy_participant *ephash_lookup_proxy_participant_guid (const struct ephash *eh, const struct nn_guid *guid);
 | 
			
		||||
struct writer *ephash_lookup_writer_guid (const struct ephash *eh, const struct nn_guid *guid);
 | 
			
		||||
struct reader *ephash_lookup_reader_guid (const struct ephash *eh, const struct nn_guid *guid);
 | 
			
		||||
struct proxy_writer *ephash_lookup_proxy_writer_guid (const struct ephash *eh, const struct nn_guid *guid);
 | 
			
		||||
struct proxy_reader *ephash_lookup_proxy_reader_guid (const struct ephash *eh, const struct nn_guid *guid);
 | 
			
		||||
struct participant *ephash_lookup_participant_guid (const struct ephash *eh, const struct ddsi_guid *guid);
 | 
			
		||||
struct proxy_participant *ephash_lookup_proxy_participant_guid (const struct ephash *eh, const struct ddsi_guid *guid);
 | 
			
		||||
struct writer *ephash_lookup_writer_guid (const struct ephash *eh, const struct ddsi_guid *guid);
 | 
			
		||||
struct reader *ephash_lookup_reader_guid (const struct ephash *eh, const struct ddsi_guid *guid);
 | 
			
		||||
struct proxy_writer *ephash_lookup_proxy_writer_guid (const struct ephash *eh, const struct ddsi_guid *guid);
 | 
			
		||||
struct proxy_reader *ephash_lookup_proxy_reader_guid (const struct ephash *eh, const struct ddsi_guid *guid);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Enumeration of entries in the hash table:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -158,7 +158,7 @@ struct q_globals {
 | 
			
		|||
 | 
			
		||||
  /* GUID to be used in next call to new_participant; also protected
 | 
			
		||||
     by privileged_pp_lock */
 | 
			
		||||
  struct nn_guid ppguid_base;
 | 
			
		||||
  struct ddsi_guid ppguid_base;
 | 
			
		||||
 | 
			
		||||
  /* number of up, non-loopback, IPv4/IPv6 interfaces, the index of
 | 
			
		||||
     the selected/preferred one, and the discovered interfaces. */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -116,7 +116,7 @@ typedef struct nn_prismtech_participant_version_info
 | 
			
		|||
} nn_prismtech_participant_version_info_t;
 | 
			
		||||
 | 
			
		||||
typedef struct nn_prismtech_eotgroup_tid {
 | 
			
		||||
  nn_entityid_t writer_entityid;
 | 
			
		||||
  ddsi_entityid_t writer_entityid;
 | 
			
		||||
  uint32_t transactionId;
 | 
			
		||||
} nn_prismtech_eotgroup_tid_t;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -140,9 +140,9 @@ typedef struct nn_plist {
 | 
			
		|||
  uint32_t participant_builtin_endpoints;
 | 
			
		||||
  dds_duration_t participant_lease_duration;
 | 
			
		||||
  /* nn_content_filter_property_t content_filter_property; */
 | 
			
		||||
  nn_guid_t participant_guid;
 | 
			
		||||
  nn_guid_t endpoint_guid;
 | 
			
		||||
  nn_guid_t group_guid;
 | 
			
		||||
  ddsi_guid_t participant_guid;
 | 
			
		||||
  ddsi_guid_t endpoint_guid;
 | 
			
		||||
  ddsi_guid_t group_guid;
 | 
			
		||||
#if 0 /* reserved, rather than NIY */
 | 
			
		||||
  nn_entityid_t participant_entityid;
 | 
			
		||||
  nn_entityid_t group_entityid;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -116,7 +116,7 @@ typedef struct Header {
 | 
			
		|||
  nn_protocolid_t protocol;
 | 
			
		||||
  nn_protocol_version_t version;
 | 
			
		||||
  nn_vendorid_t vendorid;
 | 
			
		||||
  nn_guid_prefix_t guid_prefix;
 | 
			
		||||
  ddsi_guid_prefix_t guid_prefix;
 | 
			
		||||
} Header_t;
 | 
			
		||||
#if DDSRT_ENDIAN == DDSRT_LITTLE_ENDIAN
 | 
			
		||||
#define NN_PROTOCOLID_AS_UINT32 (((uint32_t)'R' << 0) | ((uint32_t)'T' << 8) | ((uint32_t)'P' << 16) | ((uint32_t)'S' << 24))
 | 
			
		||||
| 
						 | 
				
			
			@ -162,12 +162,12 @@ typedef struct InfoTimestamp {
 | 
			
		|||
 | 
			
		||||
typedef struct EntityId {
 | 
			
		||||
  SubmessageHeader_t smhdr;
 | 
			
		||||
  nn_entityid_t entityid;
 | 
			
		||||
  ddsi_entityid_t entityid;
 | 
			
		||||
} EntityId_t;
 | 
			
		||||
 | 
			
		||||
typedef struct InfoDST {
 | 
			
		||||
  SubmessageHeader_t smhdr;
 | 
			
		||||
  nn_guid_prefix_t guid_prefix;
 | 
			
		||||
  ddsi_guid_prefix_t guid_prefix;
 | 
			
		||||
} InfoDST_t;
 | 
			
		||||
 | 
			
		||||
typedef struct InfoSRC {
 | 
			
		||||
| 
						 | 
				
			
			@ -175,7 +175,7 @@ typedef struct InfoSRC {
 | 
			
		|||
  unsigned unused;
 | 
			
		||||
  nn_protocol_version_t version;
 | 
			
		||||
  nn_vendorid_t vendorid;
 | 
			
		||||
  nn_guid_prefix_t guid_prefix;
 | 
			
		||||
  ddsi_guid_prefix_t guid_prefix;
 | 
			
		||||
} InfoSRC_t;
 | 
			
		||||
 | 
			
		||||
#if DDSRT_ENDIAN == DDSRT_LITTLE_ENDIAN
 | 
			
		||||
| 
						 | 
				
			
			@ -197,8 +197,8 @@ typedef struct Data_DataFrag_common {
 | 
			
		|||
  SubmessageHeader_t smhdr;
 | 
			
		||||
  uint16_t extraFlags;
 | 
			
		||||
  uint16_t octetsToInlineQos;
 | 
			
		||||
  nn_entityid_t readerId;
 | 
			
		||||
  nn_entityid_t writerId;
 | 
			
		||||
  ddsi_entityid_t readerId;
 | 
			
		||||
  ddsi_entityid_t writerId;
 | 
			
		||||
  nn_sequence_number_t writerSN;
 | 
			
		||||
} Data_DataFrag_common_t;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -227,8 +227,8 @@ typedef struct MsgLen {
 | 
			
		|||
DDSRT_WARNING_MSVC_OFF(4200)
 | 
			
		||||
typedef struct AckNack {
 | 
			
		||||
  SubmessageHeader_t smhdr;
 | 
			
		||||
  nn_entityid_t readerId;
 | 
			
		||||
  nn_entityid_t writerId;
 | 
			
		||||
  ddsi_entityid_t readerId;
 | 
			
		||||
  ddsi_entityid_t writerId;
 | 
			
		||||
  nn_sequence_number_set_header_t readerSNState;
 | 
			
		||||
  uint32_t bits[];
 | 
			
		||||
  /* nn_count_t count; */
 | 
			
		||||
| 
						 | 
				
			
			@ -241,8 +241,8 @@ DDSRT_WARNING_MSVC_ON(4200)
 | 
			
		|||
DDSRT_WARNING_MSVC_OFF(4200)
 | 
			
		||||
typedef struct Gap {
 | 
			
		||||
  SubmessageHeader_t smhdr;
 | 
			
		||||
  nn_entityid_t readerId;
 | 
			
		||||
  nn_entityid_t writerId;
 | 
			
		||||
  ddsi_entityid_t readerId;
 | 
			
		||||
  ddsi_entityid_t writerId;
 | 
			
		||||
  nn_sequence_number_t gapStart;
 | 
			
		||||
  nn_sequence_number_set_header_t gapList;
 | 
			
		||||
  uint32_t bits[];
 | 
			
		||||
| 
						 | 
				
			
			@ -259,8 +259,8 @@ typedef struct InfoTS {
 | 
			
		|||
 | 
			
		||||
typedef struct Heartbeat {
 | 
			
		||||
  SubmessageHeader_t smhdr;
 | 
			
		||||
  nn_entityid_t readerId;
 | 
			
		||||
  nn_entityid_t writerId;
 | 
			
		||||
  ddsi_entityid_t readerId;
 | 
			
		||||
  ddsi_entityid_t writerId;
 | 
			
		||||
  nn_sequence_number_t firstSN;
 | 
			
		||||
  nn_sequence_number_t lastSN;
 | 
			
		||||
  nn_count_t count;
 | 
			
		||||
| 
						 | 
				
			
			@ -270,8 +270,8 @@ typedef struct Heartbeat {
 | 
			
		|||
 | 
			
		||||
typedef struct HeartbeatFrag {
 | 
			
		||||
  SubmessageHeader_t smhdr;
 | 
			
		||||
  nn_entityid_t readerId;
 | 
			
		||||
  nn_entityid_t writerId;
 | 
			
		||||
  ddsi_entityid_t readerId;
 | 
			
		||||
  ddsi_entityid_t writerId;
 | 
			
		||||
  nn_sequence_number_t writerSN;
 | 
			
		||||
  nn_fragment_number_t lastFragmentNum;
 | 
			
		||||
  nn_count_t count;
 | 
			
		||||
| 
						 | 
				
			
			@ -280,8 +280,8 @@ typedef struct HeartbeatFrag {
 | 
			
		|||
DDSRT_WARNING_MSVC_OFF(4200)
 | 
			
		||||
typedef struct NackFrag {
 | 
			
		||||
  SubmessageHeader_t smhdr;
 | 
			
		||||
  nn_entityid_t readerId;
 | 
			
		||||
  nn_entityid_t writerId;
 | 
			
		||||
  ddsi_entityid_t readerId;
 | 
			
		||||
  ddsi_entityid_t writerId;
 | 
			
		||||
  nn_sequence_number_t writerSN;
 | 
			
		||||
  nn_fragment_number_set_header_t fragmentNumberState;
 | 
			
		||||
  uint32_t bits[];
 | 
			
		||||
| 
						 | 
				
			
			@ -314,7 +314,7 @@ typedef union Submessage {
 | 
			
		|||
 | 
			
		||||
DDSRT_WARNING_MSVC_OFF(4200)
 | 
			
		||||
typedef struct ParticipantMessageData {
 | 
			
		||||
  nn_guid_prefix_t participantGuidPrefix;
 | 
			
		||||
  ddsi_guid_prefix_t participantGuidPrefix;
 | 
			
		||||
  uint32_t kind; /* really 4 octets */
 | 
			
		||||
  uint32_t length;
 | 
			
		||||
  char value[];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,14 +30,14 @@ struct nn_rsample_info;
 | 
			
		|||
struct nn_defrag;
 | 
			
		||||
struct nn_reorder;
 | 
			
		||||
struct nn_dqueue;
 | 
			
		||||
struct nn_guid;
 | 
			
		||||
struct ddsi_guid;
 | 
			
		||||
 | 
			
		||||
struct proxy_writer;
 | 
			
		||||
 | 
			
		||||
struct nn_fragment_number_set;
 | 
			
		||||
struct nn_sequence_number_set;
 | 
			
		||||
 | 
			
		||||
typedef int (*nn_dqueue_handler_t) (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, const struct nn_guid *rdguid, void *qarg);
 | 
			
		||||
typedef int (*nn_dqueue_handler_t) (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, const struct ddsi_guid *rdguid, void *qarg);
 | 
			
		||||
 | 
			
		||||
struct nn_rmsg_chunk {
 | 
			
		||||
  struct nn_rbuf *rbuf;
 | 
			
		||||
| 
						 | 
				
			
			@ -102,8 +102,8 @@ struct nn_rmsg {
 | 
			
		|||
#define NN_RMSG_PAYLOADOFF(m, o) (NN_RMSG_PAYLOAD (m) + (o))
 | 
			
		||||
 | 
			
		||||
struct receiver_state {
 | 
			
		||||
  nn_guid_prefix_t src_guid_prefix;       /* 12 */
 | 
			
		||||
  nn_guid_prefix_t dst_guid_prefix;       /* 12 */
 | 
			
		||||
  ddsi_guid_prefix_t src_guid_prefix;       /* 12 */
 | 
			
		||||
  ddsi_guid_prefix_t dst_guid_prefix;       /* 12 */
 | 
			
		||||
  struct addrset *reply_locators;         /* 4/8 */
 | 
			
		||||
  int forme;                              /* 4 */
 | 
			
		||||
  nn_vendorid_t vendor;                   /* 2 */
 | 
			
		||||
| 
						 | 
				
			
			@ -234,7 +234,7 @@ void nn_dqueue_free (struct nn_dqueue *q);
 | 
			
		|||
bool nn_dqueue_enqueue_deferred_wakeup (struct nn_dqueue *q, struct nn_rsample_chain *sc, nn_reorder_result_t rres);
 | 
			
		||||
void dd_dqueue_enqueue_trigger (struct nn_dqueue *q);
 | 
			
		||||
void nn_dqueue_enqueue (struct nn_dqueue *q, struct nn_rsample_chain *sc, nn_reorder_result_t rres);
 | 
			
		||||
void nn_dqueue_enqueue1 (struct nn_dqueue *q, const nn_guid_t *rdguid, struct nn_rsample_chain *sc, nn_reorder_result_t rres);
 | 
			
		||||
void nn_dqueue_enqueue1 (struct nn_dqueue *q, const ddsi_guid_t *rdguid, struct nn_rsample_chain *sc, nn_reorder_result_t rres);
 | 
			
		||||
void nn_dqueue_enqueue_callback (struct nn_dqueue *q, nn_dqueue_callback_t cb, void *arg);
 | 
			
		||||
int  nn_dqueue_is_full (struct nn_dqueue *q);
 | 
			
		||||
void nn_dqueue_wait_until_empty_if_full (struct nn_dqueue *q);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,7 @@ struct recv_thread_arg;
 | 
			
		|||
void trigger_recv_threads (const struct q_globals *gv);
 | 
			
		||||
uint32_t recv_thread (void *vrecv_thread_arg);
 | 
			
		||||
uint32_t listen_thread (struct ddsi_tran_listener * listener);
 | 
			
		||||
int user_dqueue_handler (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, const nn_guid_t *rdguid, void *qarg);
 | 
			
		||||
int user_dqueue_handler (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, const ddsi_guid_t *rdguid, void *qarg);
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,86 +0,0 @@
 | 
			
		|||
/*
 | 
			
		||||
 * 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
 | 
			
		||||
 */
 | 
			
		||||
#ifndef Q_RHC_H
 | 
			
		||||
#define Q_RHC_H
 | 
			
		||||
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
#include <stdbool.h>
 | 
			
		||||
 | 
			
		||||
#include "dds/export.h"
 | 
			
		||||
 | 
			
		||||
/* DDS_EXPORT inline i.c.w. __attributes__((visibility...)) and some compilers: */
 | 
			
		||||
#include "dds/ddsrt/attributes.h"
 | 
			
		||||
 | 
			
		||||
#include "dds/ddsi/q_rtps.h"
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
struct dds_qos;
 | 
			
		||||
struct ddsi_tkmap_instance;
 | 
			
		||||
struct ddsi_serdata;
 | 
			
		||||
struct ddsi_sertopic;
 | 
			
		||||
struct entity_common;
 | 
			
		||||
 | 
			
		||||
struct proxy_writer_info
 | 
			
		||||
{
 | 
			
		||||
  nn_guid_t guid;
 | 
			
		||||
  bool auto_dispose;
 | 
			
		||||
  int32_t ownership_strength;
 | 
			
		||||
  uint64_t iid;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct rhc;
 | 
			
		||||
 | 
			
		||||
typedef void (*rhc_free_t) (struct rhc *rhc);
 | 
			
		||||
typedef bool (*rhc_store_t) (struct rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk);
 | 
			
		||||
typedef void (*rhc_unregister_wr_t) (struct rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info);
 | 
			
		||||
typedef void (*rhc_relinquish_ownership_t) (struct rhc * __restrict rhc, const uint64_t wr_iid);
 | 
			
		||||
typedef void (*rhc_set_qos_t) (struct rhc *rhc, const struct dds_qos *qos);
 | 
			
		||||
 | 
			
		||||
struct rhc_ops {
 | 
			
		||||
  rhc_store_t store;
 | 
			
		||||
  rhc_unregister_wr_t unregister_wr;
 | 
			
		||||
  rhc_relinquish_ownership_t relinquish_ownership;
 | 
			
		||||
  rhc_set_qos_t set_qos;
 | 
			
		||||
  rhc_free_t free;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct rhc {
 | 
			
		||||
  const struct rhc_ops *ops;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
DDS_EXPORT inline bool rhc_store (struct rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk) {
 | 
			
		||||
  return rhc->ops->store (rhc, pwr_info, sample, tk);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline void rhc_unregister_wr (struct rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info) {
 | 
			
		||||
  rhc->ops->unregister_wr (rhc, pwr_info);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline void rhc_relinquish_ownership (struct rhc * __restrict rhc, const uint64_t wr_iid) {
 | 
			
		||||
  rhc->ops->relinquish_ownership (rhc, wr_iid);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline void rhc_set_qos (struct rhc *rhc, const struct dds_qos *qos) {
 | 
			
		||||
  rhc->ops->set_qos (rhc, qos);
 | 
			
		||||
}
 | 
			
		||||
DDS_EXPORT inline void rhc_free (struct rhc *rhc) {
 | 
			
		||||
  rhc->ops->free (rhc);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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)
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* Q_RHC_H */
 | 
			
		||||
| 
						 | 
				
			
			@ -13,6 +13,7 @@
 | 
			
		|||
#define NN_RTPS_H
 | 
			
		||||
 | 
			
		||||
#include "dds/ddsi/ddsi_vendor.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_guid.h"
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
extern "C" {
 | 
			
		||||
| 
						 | 
				
			
			@ -21,17 +22,6 @@ extern "C" {
 | 
			
		|||
typedef struct {
 | 
			
		||||
  uint8_t major, minor;
 | 
			
		||||
} nn_protocol_version_t;
 | 
			
		||||
typedef union nn_guid_prefix {
 | 
			
		||||
  unsigned char s[12];
 | 
			
		||||
  uint32_t u[3];
 | 
			
		||||
} nn_guid_prefix_t;
 | 
			
		||||
typedef union nn_entityid {
 | 
			
		||||
  uint32_t u;
 | 
			
		||||
} nn_entityid_t;
 | 
			
		||||
typedef struct nn_guid {
 | 
			
		||||
  nn_guid_prefix_t prefix;
 | 
			
		||||
  nn_entityid_t entityid;
 | 
			
		||||
} nn_guid_t;
 | 
			
		||||
typedef int64_t seqno_t;
 | 
			
		||||
#define MAX_SEQ_NUMBER INT64_MAX
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ int write_sample_nogc_notk (struct thread_state1 * const ts1, struct nn_xpack *x
 | 
			
		|||
/* When calling the following functions, wr->lock must be held */
 | 
			
		||||
dds_return_t create_fragment_message (struct writer *wr, seqno_t seq, const struct nn_plist *plist, struct ddsi_serdata *serdata, unsigned fragnum, struct proxy_reader *prd,struct nn_xmsg **msg, int isnew);
 | 
			
		||||
int enqueue_sample_wrlock_held (struct writer *wr, seqno_t seq, const struct nn_plist *plist, struct ddsi_serdata *serdata, struct proxy_reader *prd, int isnew);
 | 
			
		||||
void add_Heartbeat (struct nn_xmsg *msg, struct writer *wr, const struct whc_state *whcst, int hbansreq, nn_entityid_t dst, int issync);
 | 
			
		||||
void add_Heartbeat (struct nn_xmsg *msg, struct writer *wr, const struct whc_state *whcst, int hbansreq, ddsi_entityid_t dst, int issync);
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -46,8 +46,8 @@ DDS_EXPORT dds_return_t xeventq_start (struct xeventq *evq, const char *name); /
 | 
			
		|||
DDS_EXPORT void xeventq_stop (struct xeventq *evq);
 | 
			
		||||
 | 
			
		||||
DDS_EXPORT void qxev_msg (struct xeventq *evq, struct nn_xmsg *msg);
 | 
			
		||||
DDS_EXPORT void qxev_pwr_entityid (struct proxy_writer * pwr, nn_guid_prefix_t * id);
 | 
			
		||||
DDS_EXPORT void qxev_prd_entityid (struct proxy_reader * prd, nn_guid_prefix_t * id);
 | 
			
		||||
DDS_EXPORT void qxev_pwr_entityid (struct proxy_writer * pwr, ddsi_guid_prefix_t * id);
 | 
			
		||||
DDS_EXPORT void qxev_prd_entityid (struct proxy_reader * prd, ddsi_guid_prefix_t * id);
 | 
			
		||||
 | 
			
		||||
/* Returns 1 if queued, 0 otherwise (no point in returning the
 | 
			
		||||
   event, you can't do anything with it anyway) */
 | 
			
		||||
| 
						 | 
				
			
			@ -57,11 +57,11 @@ DDS_EXPORT int qxev_msg_rexmit_wrlock_held (struct xeventq *evq, struct nn_xmsg
 | 
			
		|||
DDS_EXPORT void delete_xevent (struct xevent *ev);
 | 
			
		||||
DDS_EXPORT int resched_xevent_if_earlier (struct xevent *ev, nn_mtime_t tsched);
 | 
			
		||||
 | 
			
		||||
DDS_EXPORT struct xevent *qxev_heartbeat (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_t *wr_guid);
 | 
			
		||||
DDS_EXPORT struct xevent *qxev_acknack (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_t *pwr_guid, const nn_guid_t *rd_guid);
 | 
			
		||||
DDS_EXPORT struct xevent *qxev_spdp (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_t *pp_guid, const nn_guid_t *proxypp_guid);
 | 
			
		||||
DDS_EXPORT struct xevent *qxev_pmd_update (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_t *pp_guid);
 | 
			
		||||
DDS_EXPORT struct xevent *qxev_delete_writer (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_t *guid);
 | 
			
		||||
DDS_EXPORT struct xevent *qxev_heartbeat (struct xeventq *evq, nn_mtime_t tsched, const ddsi_guid_t *wr_guid);
 | 
			
		||||
DDS_EXPORT struct xevent *qxev_acknack (struct xeventq *evq, nn_mtime_t tsched, const ddsi_guid_t *pwr_guid, const ddsi_guid_t *rd_guid);
 | 
			
		||||
DDS_EXPORT struct xevent *qxev_spdp (struct xeventq *evq, nn_mtime_t tsched, const ddsi_guid_t *pp_guid, const ddsi_guid_t *proxypp_guid);
 | 
			
		||||
DDS_EXPORT struct xevent *qxev_pmd_update (struct xeventq *evq, nn_mtime_t tsched, const ddsi_guid_t *pp_guid);
 | 
			
		||||
DDS_EXPORT struct xevent *qxev_delete_writer (struct xeventq *evq, nn_mtime_t tsched, const ddsi_guid_t *guid);
 | 
			
		||||
 | 
			
		||||
/* cb will be called with now = T_NEVER if the event is still enqueued when when xeventq_free starts cleaning up */
 | 
			
		||||
DDS_EXPORT struct xevent *qxev_callback (struct xeventq *evq, nn_mtime_t tsched, void (*cb) (struct xevent *xev, void *arg, nn_mtime_t now), void *arg);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,10 +54,10 @@ void nn_xmsgpool_free (struct nn_xmsgpool *pool);
 | 
			
		|||
/* To allocate a new xmsg from the pool; if expected_size is NOT
 | 
			
		||||
   exceeded, no reallocs will be performed, else the address of the
 | 
			
		||||
   xmsg may change because of reallocing when appending to it. */
 | 
			
		||||
struct nn_xmsg *nn_xmsg_new (struct nn_xmsgpool *pool, const nn_guid_prefix_t *src_guid_prefix, size_t expected_size, enum nn_xmsg_kind kind);
 | 
			
		||||
struct nn_xmsg *nn_xmsg_new (struct nn_xmsgpool *pool, const ddsi_guid_prefix_t *src_guid_prefix, size_t expected_size, enum nn_xmsg_kind kind);
 | 
			
		||||
 | 
			
		||||
/* For sending to a particular destination (participant) */
 | 
			
		||||
void nn_xmsg_setdst1 (struct nn_xmsg *m, const nn_guid_prefix_t *gp, const nn_locator_t *addr);
 | 
			
		||||
void nn_xmsg_setdst1 (struct nn_xmsg *m, const ddsi_guid_prefix_t *gp, const nn_locator_t *addr);
 | 
			
		||||
 | 
			
		||||
/* For sending to a particular proxy reader; this is a convenience
 | 
			
		||||
   routine that extracts a suitable address from the proxy reader's
 | 
			
		||||
| 
						 | 
				
			
			@ -80,7 +80,7 @@ int nn_xmsg_setencoderid (struct nn_xmsg *msg, uint32_t encoderid);
 | 
			
		|||
   M must be a rexmit, and for all rexmits this must be called.  It is
 | 
			
		||||
   a separate function because the location may only become known at a
 | 
			
		||||
   late-ish stage in the construction of the message. */
 | 
			
		||||
void nn_xmsg_set_data_readerId (struct nn_xmsg *m, nn_entityid_t *readerId);
 | 
			
		||||
void nn_xmsg_set_data_readerId (struct nn_xmsg *m, ddsi_entityid_t *readerId);
 | 
			
		||||
 | 
			
		||||
/* If M and MADD are both xmsg's containing the same retransmit
 | 
			
		||||
   message, this will merge the destination embedded in MADD into M.
 | 
			
		||||
| 
						 | 
				
			
			@ -97,8 +97,8 @@ int nn_xmsg_merge_rexmit_destinations_wrlock_held (struct q_globals *gv, struct
 | 
			
		|||
/* To set writer ids for updating last transmitted sequence number;
 | 
			
		||||
   wrfragid is 0 based, unlike DDSI but like other places where
 | 
			
		||||
   fragment numbers are handled internally. */
 | 
			
		||||
void nn_xmsg_setwriterseq (struct nn_xmsg *msg, const nn_guid_t *wrguid, seqno_t wrseq);
 | 
			
		||||
void nn_xmsg_setwriterseq_fragid (struct nn_xmsg *msg, const nn_guid_t *wrguid, seqno_t wrseq, nn_fragment_number_t wrfragid);
 | 
			
		||||
void nn_xmsg_setwriterseq (struct nn_xmsg *msg, const ddsi_guid_t *wrguid, seqno_t wrseq);
 | 
			
		||||
void nn_xmsg_setwriterseq_fragid (struct nn_xmsg *msg, const ddsi_guid_t *wrguid, seqno_t wrseq, nn_fragment_number_t wrfragid);
 | 
			
		||||
 | 
			
		||||
/* Comparison function for retransmits: orders messages on writer
 | 
			
		||||
   guid, sequence number and fragment id */
 | 
			
		||||
| 
						 | 
				
			
			@ -109,7 +109,7 @@ size_t nn_xmsg_size (const struct nn_xmsg *m);
 | 
			
		|||
void *nn_xmsg_payload (size_t *sz, struct nn_xmsg *m);
 | 
			
		||||
void nn_xmsg_payload_to_plistsample (struct ddsi_plist_sample *dst, nn_parameterid_t keyparam, const struct nn_xmsg *m);
 | 
			
		||||
enum nn_xmsg_kind nn_xmsg_kind (const struct nn_xmsg *m);
 | 
			
		||||
void nn_xmsg_guid_seq_fragid (const struct nn_xmsg *m, nn_guid_t *wrguid, seqno_t *wrseq, nn_fragment_number_t *wrfragid);
 | 
			
		||||
void nn_xmsg_guid_seq_fragid (const struct nn_xmsg *m, ddsi_guid_t *wrguid, seqno_t *wrseq, nn_fragment_number_t *wrfragid);
 | 
			
		||||
 | 
			
		||||
void *nn_xmsg_submsg_from_marker (struct nn_xmsg *msg, struct nn_xmsg_marker marker);
 | 
			
		||||
void *nn_xmsg_append (struct nn_xmsg *m, struct nn_xmsg_marker *marker, size_t sz);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										18
									
								
								src/core/ddsi/src/ddsi_rhc.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/core/ddsi/src/ddsi_rhc.c
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
/*
 | 
			
		||||
 * 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
 | 
			
		||||
 */
 | 
			
		||||
#include "dds/ddsi/ddsi_rhc.h"
 | 
			
		||||
 | 
			
		||||
extern inline void ddsi_rhc_free (struct ddsi_rhc *rhc);
 | 
			
		||||
extern inline bool ddsi_rhc_store (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk);
 | 
			
		||||
extern inline void ddsi_rhc_unregister_wr (struct ddsi_rhc * __restrict rhc, const struct ddsi_writer_info * __restrict wrinfo);
 | 
			
		||||
extern inline void ddsi_rhc_relinquish_ownership (struct ddsi_rhc * __restrict rhc, const uint64_t wr_iid);
 | 
			
		||||
extern inline void ddsi_rhc_set_qos (struct ddsi_rhc *rhc, const struct dds_qos *qos);
 | 
			
		||||
| 
						 | 
				
			
			@ -11,7 +11,7 @@
 | 
			
		|||
 */
 | 
			
		||||
#include "dds/ddsi/q_bswap.h"
 | 
			
		||||
 | 
			
		||||
nn_guid_prefix_t nn_hton_guid_prefix (nn_guid_prefix_t p)
 | 
			
		||||
ddsi_guid_prefix_t nn_hton_guid_prefix (ddsi_guid_prefix_t p)
 | 
			
		||||
{
 | 
			
		||||
  int i;
 | 
			
		||||
  for (i = 0; i < 3; i++)
 | 
			
		||||
| 
						 | 
				
			
			@ -19,7 +19,7 @@ nn_guid_prefix_t nn_hton_guid_prefix (nn_guid_prefix_t p)
 | 
			
		|||
  return p;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
nn_guid_prefix_t nn_ntoh_guid_prefix (nn_guid_prefix_t p)
 | 
			
		||||
ddsi_guid_prefix_t nn_ntoh_guid_prefix (ddsi_guid_prefix_t p)
 | 
			
		||||
{
 | 
			
		||||
  int i;
 | 
			
		||||
  for (i = 0; i < 3; i++)
 | 
			
		||||
| 
						 | 
				
			
			@ -27,26 +27,26 @@ nn_guid_prefix_t nn_ntoh_guid_prefix (nn_guid_prefix_t p)
 | 
			
		|||
  return p;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
nn_entityid_t nn_hton_entityid (nn_entityid_t e)
 | 
			
		||||
ddsi_entityid_t nn_hton_entityid (ddsi_entityid_t e)
 | 
			
		||||
{
 | 
			
		||||
  e.u = toBE4u (e.u);
 | 
			
		||||
  return e;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
nn_entityid_t nn_ntoh_entityid (nn_entityid_t e)
 | 
			
		||||
ddsi_entityid_t nn_ntoh_entityid (ddsi_entityid_t e)
 | 
			
		||||
{
 | 
			
		||||
  e.u = fromBE4u (e.u);
 | 
			
		||||
  return e;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
nn_guid_t nn_hton_guid (nn_guid_t g)
 | 
			
		||||
ddsi_guid_t nn_hton_guid (ddsi_guid_t g)
 | 
			
		||||
{
 | 
			
		||||
  g.prefix = nn_hton_guid_prefix (g.prefix);
 | 
			
		||||
  g.entityid = nn_hton_entityid (g.entityid);
 | 
			
		||||
  return g;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
nn_guid_t nn_ntoh_guid (nn_guid_t g)
 | 
			
		||||
ddsi_guid_t nn_ntoh_guid (ddsi_guid_t g)
 | 
			
		||||
{
 | 
			
		||||
  g.prefix = nn_ntoh_guid_prefix (g.prefix);
 | 
			
		||||
  g.entityid = nn_ntoh_entityid (g.entityid);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -352,7 +352,7 @@ int spdp_dispose_unregister (struct participant *pp)
 | 
			
		|||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static unsigned pseudo_random_delay (const nn_guid_t *x, const nn_guid_t *y, nn_mtime_t tnow)
 | 
			
		||||
static unsigned pseudo_random_delay (const ddsi_guid_t *x, const ddsi_guid_t *y, nn_mtime_t tnow)
 | 
			
		||||
{
 | 
			
		||||
  /* You know, an ordinary random generator would be even better, but
 | 
			
		||||
     the C library doesn't have a reentrant one and I don't feel like
 | 
			
		||||
| 
						 | 
				
			
			@ -381,7 +381,7 @@ static unsigned pseudo_random_delay (const nn_guid_t *x, const nn_guid_t *y, nn_
 | 
			
		|||
  return (unsigned) (m >> 32);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void respond_to_spdp (const struct q_globals *gv, const nn_guid_t *dest_proxypp_guid)
 | 
			
		||||
static void respond_to_spdp (const struct q_globals *gv, const ddsi_guid_t *dest_proxypp_guid)
 | 
			
		||||
{
 | 
			
		||||
  struct ephash_enum_participant est;
 | 
			
		||||
  struct participant *pp;
 | 
			
		||||
| 
						 | 
				
			
			@ -409,7 +409,7 @@ static void respond_to_spdp (const struct q_globals *gv, const nn_guid_t *dest_p
 | 
			
		|||
static int handle_SPDP_dead (const struct receiver_state *rst, nn_wctime_t timestamp, const nn_plist_t *datap, unsigned statusinfo)
 | 
			
		||||
{
 | 
			
		||||
  struct q_globals * const gv = rst->gv;
 | 
			
		||||
  nn_guid_t guid;
 | 
			
		||||
  ddsi_guid_t guid;
 | 
			
		||||
 | 
			
		||||
  if (!(gv->logconfig.c.mask & DDS_LC_DISCOVERY))
 | 
			
		||||
    GVLOGDISC ("SPDP ST%x", statusinfo);
 | 
			
		||||
| 
						 | 
				
			
			@ -455,7 +455,7 @@ static void allowmulticast_aware_add_to_addrset (const struct q_globals *gv, uin
 | 
			
		|||
  add_to_addrset (gv, as, loc);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct proxy_participant *find_ddsi2_proxy_participant (const struct ephash *guid_hash, const nn_guid_t *ppguid)
 | 
			
		||||
static struct proxy_participant *find_ddsi2_proxy_participant (const struct ephash *guid_hash, const ddsi_guid_t *ppguid)
 | 
			
		||||
{
 | 
			
		||||
  struct ephash_enum_proxy_participant it;
 | 
			
		||||
  struct proxy_participant *pp;
 | 
			
		||||
| 
						 | 
				
			
			@ -469,7 +469,7 @@ static struct proxy_participant *find_ddsi2_proxy_participant (const struct epha
 | 
			
		|||
  return pp;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void make_participants_dependent_on_ddsi2 (struct q_globals *gv, const nn_guid_t *ddsi2guid, nn_wctime_t timestamp)
 | 
			
		||||
static void make_participants_dependent_on_ddsi2 (struct q_globals *gv, const ddsi_guid_t *ddsi2guid, nn_wctime_t timestamp)
 | 
			
		||||
{
 | 
			
		||||
  struct ephash_enum_proxy_participant it;
 | 
			
		||||
  struct proxy_participant *pp, *d2pp;
 | 
			
		||||
| 
						 | 
				
			
			@ -517,7 +517,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, seqno_t seq, nn_
 | 
			
		|||
  struct proxy_participant *proxypp;
 | 
			
		||||
  unsigned builtin_endpoint_set;
 | 
			
		||||
  unsigned prismtech_builtin_endpoint_set;
 | 
			
		||||
  nn_guid_t privileged_pp_guid;
 | 
			
		||||
  ddsi_guid_t privileged_pp_guid;
 | 
			
		||||
  dds_duration_t lease_duration;
 | 
			
		||||
  unsigned custom_flags = 0;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -646,7 +646,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, seqno_t seq, nn_
 | 
			
		|||
  privileged_pp_guid.prefix = rst->src_guid_prefix;
 | 
			
		||||
  privileged_pp_guid.entityid.u = NN_ENTITYID_PARTICIPANT;
 | 
			
		||||
  if ((builtin_endpoint_set & bes_sedp_announcer_mask) != bes_sedp_announcer_mask &&
 | 
			
		||||
      memcmp (&privileged_pp_guid, &datap->participant_guid, sizeof (nn_guid_t)) != 0)
 | 
			
		||||
      memcmp (&privileged_pp_guid, &datap->participant_guid, sizeof (ddsi_guid_t)) != 0)
 | 
			
		||||
  {
 | 
			
		||||
    GVLOGDISC (" (depends on "PGUIDFMT")", PGUID (privileged_pp_guid));
 | 
			
		||||
    /* never expire lease for this proxy: it won't actually expire
 | 
			
		||||
| 
						 | 
				
			
			@ -881,7 +881,7 @@ static void add_locator_to_ps (const nn_locator_t *loc, void *varg)
 | 
			
		|||
 | 
			
		||||
static int sedp_write_endpoint
 | 
			
		||||
(
 | 
			
		||||
   struct writer *wr, int alive, const nn_guid_t *epguid,
 | 
			
		||||
   struct writer *wr, int alive, const ddsi_guid_t *epguid,
 | 
			
		||||
   const struct entity_common *common, const struct endpoint_common *epcommon,
 | 
			
		||||
   const dds_qos_t *xqos, struct addrset *as)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -1040,9 +1040,9 @@ static const char *durability_to_string (dds_durability_kind_t k)
 | 
			
		|||
  return "undefined-durability";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct proxy_participant *implicitly_create_proxypp (struct q_globals *gv, const nn_guid_t *ppguid, nn_plist_t *datap /* note: potentially modifies datap */, const nn_guid_prefix_t *src_guid_prefix, nn_vendorid_t vendorid, nn_wctime_t timestamp, seqno_t seq)
 | 
			
		||||
static struct proxy_participant *implicitly_create_proxypp (struct q_globals *gv, const ddsi_guid_t *ppguid, nn_plist_t *datap /* note: potentially modifies datap */, const ddsi_guid_prefix_t *src_guid_prefix, nn_vendorid_t vendorid, nn_wctime_t timestamp, seqno_t seq)
 | 
			
		||||
{
 | 
			
		||||
  nn_guid_t privguid;
 | 
			
		||||
  ddsi_guid_t privguid;
 | 
			
		||||
  nn_plist_t pp_plist;
 | 
			
		||||
 | 
			
		||||
  if (memcmp (&ppguid->prefix, src_guid_prefix, sizeof (ppguid->prefix)) == 0)
 | 
			
		||||
| 
						 | 
				
			
			@ -1120,14 +1120,14 @@ static struct proxy_participant *implicitly_create_proxypp (struct q_globals *gv
 | 
			
		|||
  return ephash_lookup_proxy_participant_guid (gv->guid_hash, ppguid);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void handle_SEDP_alive (const struct receiver_state *rst, seqno_t seq, nn_plist_t *datap /* note: potentially modifies datap */, const nn_guid_prefix_t *src_guid_prefix, nn_vendorid_t vendorid, nn_wctime_t timestamp)
 | 
			
		||||
static void handle_SEDP_alive (const struct receiver_state *rst, seqno_t seq, nn_plist_t *datap /* note: potentially modifies datap */, const ddsi_guid_prefix_t *src_guid_prefix, nn_vendorid_t vendorid, nn_wctime_t timestamp)
 | 
			
		||||
{
 | 
			
		||||
#define E(msg, lbl) do { GVLOGDISC (msg); goto lbl; } while (0)
 | 
			
		||||
  struct q_globals * const gv = rst->gv;
 | 
			
		||||
  struct proxy_participant *pp;
 | 
			
		||||
  struct proxy_writer * pwr = NULL;
 | 
			
		||||
  struct proxy_reader * prd = NULL;
 | 
			
		||||
  nn_guid_t ppguid;
 | 
			
		||||
  ddsi_guid_t ppguid;
 | 
			
		||||
  dds_qos_t *xqos;
 | 
			
		||||
  int reliable;
 | 
			
		||||
  struct addrset *as;
 | 
			
		||||
| 
						 | 
				
			
			@ -1466,7 +1466,7 @@ int sedp_write_cm_participant (struct participant *pp, int alive)
 | 
			
		|||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void handle_SEDP_CM (const struct receiver_state *rst, nn_entityid_t wr_entity_id, nn_wctime_t timestamp, uint32_t statusinfo, const void *vdata, uint32_t len)
 | 
			
		||||
static void handle_SEDP_CM (const struct receiver_state *rst, ddsi_entityid_t wr_entity_id, nn_wctime_t timestamp, uint32_t statusinfo, const void *vdata, uint32_t len)
 | 
			
		||||
{
 | 
			
		||||
  struct q_globals * const gv = rst->gv;
 | 
			
		||||
  const struct CDRHeader *data = vdata; /* built-ins not deserialized (yet) */
 | 
			
		||||
| 
						 | 
				
			
			@ -1552,7 +1552,7 @@ static int defragment (unsigned char **datap, const struct nn_rdata *fragchain,
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, UNUSED_ARG (const nn_guid_t *rdguid), UNUSED_ARG (void *qarg))
 | 
			
		||||
int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, UNUSED_ARG (const ddsi_guid_t *rdguid), UNUSED_ARG (void *qarg))
 | 
			
		||||
{
 | 
			
		||||
  struct q_globals * const gv = sampleinfo->rst->gv;
 | 
			
		||||
  struct proxy_writer *pwr;
 | 
			
		||||
| 
						 | 
				
			
			@ -1564,7 +1564,7 @@ int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const str
 | 
			
		|||
  } keyhash_payload;
 | 
			
		||||
  unsigned statusinfo;
 | 
			
		||||
  int need_keyhash;
 | 
			
		||||
  nn_guid_t srcguid;
 | 
			
		||||
  ddsi_guid_t srcguid;
 | 
			
		||||
  Data_DataFrag_common_t *msg;
 | 
			
		||||
  unsigned char data_smhdr_flags;
 | 
			
		||||
  nn_plist_t qos;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@
 | 
			
		|||
#include "dds/ddsi/ddsi_mcgroup.h"
 | 
			
		||||
#include "dds/ddsi/q_receive.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_udp.h" /* nn_mc4gen_address_t */
 | 
			
		||||
#include "dds/ddsi/q_rhc.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_rhc.h"
 | 
			
		||||
 | 
			
		||||
#include "dds/ddsi/sysdeps.h"
 | 
			
		||||
#include "dds__whc.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -51,7 +51,7 @@
 | 
			
		|||
 | 
			
		||||
struct deleted_participant {
 | 
			
		||||
  ddsrt_avl_node_t avlnode;
 | 
			
		||||
  nn_guid_t guid;
 | 
			
		||||
  ddsi_guid_t guid;
 | 
			
		||||
  unsigned for_what;
 | 
			
		||||
  nn_mtime_t t_prune;
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			@ -92,10 +92,10 @@ static const unsigned prismtech_builtin_writers_besmask =
 | 
			
		|||
  NN_DISC_BUILTIN_ENDPOINT_CM_PUBLISHER_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 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 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 void unref_participant (struct participant *pp, const struct nn_guid *guid_of_refing_entity);
 | 
			
		||||
static dds_return_t new_writer_guid (struct writer **wr_out, const struct ddsi_guid *guid, const struct ddsi_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 ddsi_guid *guid, const struct ddsi_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct ddsi_rhc *rhc, status_cb_t status_cb, void *status_cbarg);
 | 
			
		||||
static struct participant *ref_participant (struct participant *pp, const struct ddsi_guid *guid_of_refing_entity);
 | 
			
		||||
static void unref_participant (struct participant *pp, const struct ddsi_guid *guid_of_refing_entity);
 | 
			
		||||
 | 
			
		||||
static int gcreq_participant (struct participant *pp);
 | 
			
		||||
static int gcreq_writer (struct writer *wr);
 | 
			
		||||
| 
						 | 
				
			
			@ -104,24 +104,24 @@ static int gcreq_proxy_participant (struct proxy_participant *proxypp);
 | 
			
		|||
static int gcreq_proxy_writer (struct proxy_writer *pwr);
 | 
			
		||||
static int gcreq_proxy_reader (struct proxy_reader *prd);
 | 
			
		||||
 | 
			
		||||
extern inline bool builtintopic_is_visible (const struct ddsi_builtin_topic_interface *btif, const struct nn_guid *guid, nn_vendorid_t vendorid);
 | 
			
		||||
extern inline bool builtintopic_is_visible (const struct ddsi_builtin_topic_interface *btif, const struct ddsi_guid *guid, nn_vendorid_t vendorid);
 | 
			
		||||
extern inline bool builtintopic_is_builtintopic (const struct ddsi_builtin_topic_interface *btif, const struct ddsi_sertopic *topic);
 | 
			
		||||
extern inline struct ddsi_tkmap_instance *builtintopic_get_tkmap_entry (const struct ddsi_builtin_topic_interface *btif, const struct nn_guid *guid);
 | 
			
		||||
extern inline struct ddsi_tkmap_instance *builtintopic_get_tkmap_entry (const struct ddsi_builtin_topic_interface *btif, const struct ddsi_guid *guid);
 | 
			
		||||
extern inline void builtintopic_write (const struct ddsi_builtin_topic_interface *btif, const struct entity_common *e, nn_wctime_t timestamp, bool alive);
 | 
			
		||||
 | 
			
		||||
static int compare_guid (const void *va, const void *vb)
 | 
			
		||||
{
 | 
			
		||||
  return memcmp (va, vb, sizeof (nn_guid_t));
 | 
			
		||||
  return memcmp (va, vb, sizeof (ddsi_guid_t));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
nn_entityid_t to_entityid (unsigned u)
 | 
			
		||||
ddsi_entityid_t to_entityid (unsigned u)
 | 
			
		||||
{
 | 
			
		||||
  nn_entityid_t e;
 | 
			
		||||
  ddsi_entityid_t e;
 | 
			
		||||
  e.u = u;
 | 
			
		||||
  return e;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int is_writer_entityid (nn_entityid_t id)
 | 
			
		||||
int is_writer_entityid (ddsi_entityid_t id)
 | 
			
		||||
{
 | 
			
		||||
  switch (id.u & NN_ENTITYID_KIND_MASK)
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -133,7 +133,7 @@ int is_writer_entityid (nn_entityid_t id)
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int is_reader_entityid (nn_entityid_t id)
 | 
			
		||||
int is_reader_entityid (ddsi_entityid_t id)
 | 
			
		||||
{
 | 
			
		||||
  switch (id.u & NN_ENTITYID_KIND_MASK)
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -145,7 +145,7 @@ int is_reader_entityid (nn_entityid_t id)
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int is_keyed_endpoint_entityid (nn_entityid_t id)
 | 
			
		||||
int is_keyed_endpoint_entityid (ddsi_entityid_t id)
 | 
			
		||||
{
 | 
			
		||||
  switch (id.u & NN_ENTITYID_KIND_MASK)
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -160,7 +160,7 @@ int is_keyed_endpoint_entityid (nn_entityid_t id)
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int is_builtin_entityid (nn_entityid_t id, nn_vendorid_t vendorid)
 | 
			
		||||
int is_builtin_entityid (ddsi_entityid_t id, nn_vendorid_t vendorid)
 | 
			
		||||
{
 | 
			
		||||
  if ((id.u & NN_ENTITYID_SOURCE_MASK) == NN_ENTITYID_SOURCE_BUILTIN)
 | 
			
		||||
    return 1;
 | 
			
		||||
| 
						 | 
				
			
			@ -175,7 +175,7 @@ int is_builtin_entityid (nn_entityid_t id, nn_vendorid_t vendorid)
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int is_builtin_endpoint (nn_entityid_t id, nn_vendorid_t vendorid)
 | 
			
		||||
int is_builtin_endpoint (ddsi_entityid_t id, nn_vendorid_t vendorid)
 | 
			
		||||
{
 | 
			
		||||
  return is_builtin_entityid (id, vendorid) && id.u != NN_ENTITYID_PARTICIPANT;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -186,7 +186,7 @@ bool is_local_orphan_endpoint (const struct entity_common *e)
 | 
			
		|||
          is_builtin_endpoint (e->guid.entityid, NN_VENDORID_ECLIPSE));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void entity_common_init (struct entity_common *e, struct q_globals *gv, const struct nn_guid *guid, const char *name, enum entity_kind kind, nn_wctime_t tcreate, nn_vendorid_t vendorid, bool onlylocal)
 | 
			
		||||
static void entity_common_init (struct entity_common *e, struct q_globals *gv, const struct ddsi_guid *guid, const char *name, enum entity_kind kind, nn_wctime_t tcreate, nn_vendorid_t vendorid, bool onlylocal)
 | 
			
		||||
{
 | 
			
		||||
  e->guid = *guid;
 | 
			
		||||
  e->kind = kind;
 | 
			
		||||
| 
						 | 
				
			
			@ -296,6 +296,14 @@ nn_vendorid_t get_entity_vendorid (const struct entity_common *e)
 | 
			
		|||
  return NN_VENDORID_UNKNOWN;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ddsi_make_writer_info(struct ddsi_writer_info *wrinfo, const struct entity_common *e, const struct dds_qos *xqos)
 | 
			
		||||
{
 | 
			
		||||
  wrinfo->guid = e->guid;
 | 
			
		||||
  wrinfo->ownership_strength = xqos->ownership_strength.value;
 | 
			
		||||
  wrinfo->auto_dispose = xqos->writer_data_lifecycle.autodispose_unregistered_instances;
 | 
			
		||||
  wrinfo->iid = e->iid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* DELETED PARTICIPANTS --------------------------------------------- */
 | 
			
		||||
 | 
			
		||||
struct deleted_participants_admin *deleted_participants_admin_new (int64_t delay)
 | 
			
		||||
| 
						 | 
				
			
			@ -340,7 +348,7 @@ static void prune_deleted_participant_guids (struct deleted_participants_admin *
 | 
			
		|||
  ddsrt_mutex_unlock (&admin->deleted_participants_lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void remember_deleted_participant_guid (struct deleted_participants_admin *admin, const struct nn_guid *guid)
 | 
			
		||||
static void remember_deleted_participant_guid (struct deleted_participants_admin *admin, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  struct deleted_participant *n;
 | 
			
		||||
  ddsrt_avl_ipath_t path;
 | 
			
		||||
| 
						 | 
				
			
			@ -358,7 +366,7 @@ static void remember_deleted_participant_guid (struct deleted_participants_admin
 | 
			
		|||
  ddsrt_mutex_unlock (&admin->deleted_participants_lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int is_deleted_participant_guid (struct deleted_participants_admin *admin, const struct nn_guid *guid, unsigned for_what)
 | 
			
		||||
int is_deleted_participant_guid (struct deleted_participants_admin *admin, const struct ddsi_guid *guid, unsigned for_what)
 | 
			
		||||
{
 | 
			
		||||
  struct deleted_participant *n;
 | 
			
		||||
  int known;
 | 
			
		||||
| 
						 | 
				
			
			@ -372,7 +380,7 @@ int is_deleted_participant_guid (struct deleted_participants_admin *admin, const
 | 
			
		|||
  return known;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void remove_deleted_participant_guid (ddsrt_log_cfg_t *logcfg, struct deleted_participants_admin *admin, const struct nn_guid *guid, unsigned for_what)
 | 
			
		||||
static void remove_deleted_participant_guid (ddsrt_log_cfg_t *logcfg, struct deleted_participants_admin *admin, const struct ddsi_guid *guid, unsigned for_what)
 | 
			
		||||
{
 | 
			
		||||
  struct deleted_participant *n;
 | 
			
		||||
  DDS_CLOG (DDS_LC_DISCOVERY, logcfg, "remove_deleted_participant_guid("PGUIDFMT" for_what=%x)\n", PGUID (*guid), for_what);
 | 
			
		||||
| 
						 | 
				
			
			@ -417,7 +425,7 @@ static bool update_qos_locked (struct entity_common *e, dds_qos_t *ent_qos, cons
 | 
			
		|||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static dds_return_t pp_allocate_entityid(nn_entityid_t *id, uint32_t kind, struct participant *pp)
 | 
			
		||||
static dds_return_t pp_allocate_entityid(ddsi_entityid_t *id, uint32_t kind, struct participant *pp)
 | 
			
		||||
{
 | 
			
		||||
  uint32_t id1;
 | 
			
		||||
  int ret = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -436,17 +444,17 @@ static dds_return_t pp_allocate_entityid(nn_entityid_t *id, uint32_t kind, struc
 | 
			
		|||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void pp_release_entityid(struct participant *pp, nn_entityid_t id)
 | 
			
		||||
static void pp_release_entityid(struct participant *pp, ddsi_entityid_t id)
 | 
			
		||||
{
 | 
			
		||||
  ddsrt_mutex_lock (&pp->e.lock);
 | 
			
		||||
  inverse_uint32_set_free(&pp->avail_entityids.x, id.u / NN_ENTITYID_ALLOCSTEP);
 | 
			
		||||
  ddsrt_mutex_unlock (&pp->e.lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dds_return_t new_participant_guid (const nn_guid_t *ppguid, struct q_globals *gv, unsigned flags, const nn_plist_t *plist)
 | 
			
		||||
dds_return_t new_participant_guid (const ddsi_guid_t *ppguid, struct q_globals *gv, unsigned flags, const nn_plist_t *plist)
 | 
			
		||||
{
 | 
			
		||||
  struct participant *pp;
 | 
			
		||||
  nn_guid_t subguid, group_guid;
 | 
			
		||||
  ddsi_guid_t subguid, group_guid;
 | 
			
		||||
 | 
			
		||||
  /* no reserved bits may be set */
 | 
			
		||||
  assert ((flags & ~(RTPS_PF_NO_BUILTIN_READERS | RTPS_PF_NO_BUILTIN_WRITERS | RTPS_PF_PRIVILEGED_PP | RTPS_PF_IS_DDSI2_PP | RTPS_PF_ONLY_LOCAL)) == 0);
 | 
			
		||||
| 
						 | 
				
			
			@ -699,7 +707,7 @@ dds_return_t new_participant_guid (const nn_guid_t *ppguid, struct q_globals *gv
 | 
			
		|||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dds_return_t new_participant (nn_guid_t *p_ppguid, struct q_globals *gv, unsigned flags, const nn_plist_t *plist)
 | 
			
		||||
dds_return_t new_participant (ddsi_guid_t *p_ppguid, struct q_globals *gv, unsigned flags, const nn_plist_t *plist)
 | 
			
		||||
{
 | 
			
		||||
  union { uint64_t u64; uint32_t u32[2]; } u;
 | 
			
		||||
  u.u32[0] = gv->ppguid_base.prefix.u[1];
 | 
			
		||||
| 
						 | 
				
			
			@ -720,9 +728,9 @@ void update_participant_plist (struct participant *pp, const nn_plist_t *plist)
 | 
			
		|||
  ddsrt_mutex_unlock (&pp->e.lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void delete_builtin_endpoint (struct q_globals *gv, const struct nn_guid *ppguid, unsigned entityid)
 | 
			
		||||
static void delete_builtin_endpoint (struct q_globals *gv, const struct ddsi_guid *ppguid, unsigned entityid)
 | 
			
		||||
{
 | 
			
		||||
  nn_guid_t guid;
 | 
			
		||||
  ddsi_guid_t guid;
 | 
			
		||||
  guid.prefix = ppguid->prefix;
 | 
			
		||||
  guid.entityid.u = entityid;
 | 
			
		||||
  assert (is_builtin_entityid (to_entityid (entityid), NN_VENDORID_ECLIPSE));
 | 
			
		||||
| 
						 | 
				
			
			@ -732,9 +740,9 @@ static void delete_builtin_endpoint (struct q_globals *gv, const struct nn_guid
 | 
			
		|||
    (void)delete_reader (gv, &guid);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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 ddsi_guid *guid_of_refing_entity)
 | 
			
		||||
{
 | 
			
		||||
  nn_guid_t stguid;
 | 
			
		||||
  ddsi_guid_t stguid;
 | 
			
		||||
  ddsrt_mutex_lock (&pp->refc_lock);
 | 
			
		||||
  if (guid_of_refing_entity && is_builtin_endpoint (guid_of_refing_entity->entityid, NN_VENDORID_ECLIPSE))
 | 
			
		||||
    pp->builtin_refc++;
 | 
			
		||||
| 
						 | 
				
			
			@ -751,7 +759,7 @@ static struct participant *ref_participant (struct participant *pp, const struct
 | 
			
		|||
  return pp;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void unref_participant (struct participant *pp, const struct nn_guid *guid_of_refing_entity)
 | 
			
		||||
static void unref_participant (struct participant *pp, const struct ddsi_guid *guid_of_refing_entity)
 | 
			
		||||
{
 | 
			
		||||
  static const unsigned builtin_endpoints_tab[] = {
 | 
			
		||||
    NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER,
 | 
			
		||||
| 
						 | 
				
			
			@ -772,7 +780,7 @@ static void unref_participant (struct participant *pp, const struct nn_guid *gui
 | 
			
		|||
    NN_ENTITYID_SEDP_BUILTIN_CM_SUBSCRIBER_WRITER,
 | 
			
		||||
    NN_ENTITYID_SEDP_BUILTIN_CM_SUBSCRIBER_READER
 | 
			
		||||
  };
 | 
			
		||||
  nn_guid_t stguid;
 | 
			
		||||
  ddsi_guid_t stguid;
 | 
			
		||||
 | 
			
		||||
  ddsrt_mutex_lock (&pp->refc_lock);
 | 
			
		||||
  if (guid_of_refing_entity && is_builtin_endpoint (guid_of_refing_entity->entityid, NN_VENDORID_ECLIPSE))
 | 
			
		||||
| 
						 | 
				
			
			@ -903,7 +911,7 @@ static void gc_delete_participant (struct gcreq *gcreq)
 | 
			
		|||
  unref_participant (pp, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dds_return_t delete_participant (struct q_globals *gv, const struct nn_guid *ppguid)
 | 
			
		||||
dds_return_t delete_participant (struct q_globals *gv, const struct ddsi_guid *ppguid)
 | 
			
		||||
{
 | 
			
		||||
  struct participant *pp;
 | 
			
		||||
  if ((pp = ephash_lookup_participant_guid (gv->guid_hash, ppguid)) == NULL)
 | 
			
		||||
| 
						 | 
				
			
			@ -917,7 +925,7 @@ dds_return_t delete_participant (struct q_globals *gv, const struct nn_guid *ppg
 | 
			
		|||
 | 
			
		||||
struct writer *get_builtin_writer (const struct participant *pp, unsigned entityid)
 | 
			
		||||
{
 | 
			
		||||
  nn_guid_t bwr_guid;
 | 
			
		||||
  ddsi_guid_t bwr_guid;
 | 
			
		||||
  unsigned bes_mask = 0, prismtech_bes_mask = 0;
 | 
			
		||||
 | 
			
		||||
  if (pp->e.onlylocal) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1387,7 +1395,7 @@ static void free_wr_rd_match (struct wr_rd_match *m)
 | 
			
		|||
  if (m) ddsrt_free (m);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void writer_drop_connection (const struct nn_guid *wr_guid, const struct proxy_reader *prd)
 | 
			
		||||
static void writer_drop_connection (const struct ddsi_guid *wr_guid, const struct proxy_reader *prd)
 | 
			
		||||
{
 | 
			
		||||
  struct writer *wr;
 | 
			
		||||
  if ((wr = ephash_lookup_writer_guid (prd->e.gv->guid_hash, wr_guid)) != NULL)
 | 
			
		||||
| 
						 | 
				
			
			@ -1417,7 +1425,7 @@ static void writer_drop_connection (const struct nn_guid *wr_guid, const struct
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void writer_drop_local_connection (const struct nn_guid *wr_guid, struct reader *rd)
 | 
			
		||||
static void writer_drop_local_connection (const struct ddsi_guid *wr_guid, struct reader *rd)
 | 
			
		||||
{
 | 
			
		||||
  /* Only called by gc_delete_reader, so we actually have a reader pointer */
 | 
			
		||||
  struct writer *wr;
 | 
			
		||||
| 
						 | 
				
			
			@ -1444,7 +1452,7 @@ static void writer_drop_local_connection (const struct nn_guid *wr_guid, struct
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void reader_drop_connection (const struct nn_guid *rd_guid, const struct proxy_writer *pwr)
 | 
			
		||||
static void reader_drop_connection (const struct ddsi_guid *rd_guid, const struct proxy_writer *pwr)
 | 
			
		||||
{
 | 
			
		||||
  struct reader *rd;
 | 
			
		||||
  if ((rd = ephash_lookup_reader_guid (pwr->e.gv->guid_hash, rd_guid)) != NULL)
 | 
			
		||||
| 
						 | 
				
			
			@ -1458,9 +1466,9 @@ static void reader_drop_connection (const struct nn_guid *rd_guid, const struct
 | 
			
		|||
    {
 | 
			
		||||
      if (rd->rhc)
 | 
			
		||||
      {
 | 
			
		||||
        struct proxy_writer_info pwr_info;
 | 
			
		||||
        make_proxy_writer_info (&pwr_info, &pwr->e, pwr->c.xqos);
 | 
			
		||||
        rhc_unregister_wr (rd->rhc, &pwr_info);
 | 
			
		||||
        struct ddsi_writer_info wrinfo;
 | 
			
		||||
        ddsi_make_writer_info (&wrinfo, &pwr->e, pwr->c.xqos);
 | 
			
		||||
        ddsi_rhc_unregister_wr (rd->rhc, &wrinfo);
 | 
			
		||||
      }
 | 
			
		||||
      if (rd->status_cb)
 | 
			
		||||
      {
 | 
			
		||||
| 
						 | 
				
			
			@ -1480,7 +1488,7 @@ static void reader_drop_connection (const struct nn_guid *rd_guid, const struct
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void reader_drop_local_connection (const struct nn_guid *rd_guid, const struct writer *wr)
 | 
			
		||||
static void reader_drop_local_connection (const struct ddsi_guid *rd_guid, const struct writer *wr)
 | 
			
		||||
{
 | 
			
		||||
  struct reader *rd;
 | 
			
		||||
  if ((rd = ephash_lookup_reader_guid (wr->e.gv->guid_hash, rd_guid)) != NULL)
 | 
			
		||||
| 
						 | 
				
			
			@ -1495,9 +1503,9 @@ static void reader_drop_local_connection (const struct nn_guid *rd_guid, const s
 | 
			
		|||
      if (rd->rhc)
 | 
			
		||||
      {
 | 
			
		||||
        /* FIXME: */
 | 
			
		||||
        struct proxy_writer_info pwr_info;
 | 
			
		||||
        make_proxy_writer_info(&pwr_info, &wr->e, wr->xqos);
 | 
			
		||||
        rhc_unregister_wr (rd->rhc, &pwr_info);
 | 
			
		||||
        struct ddsi_writer_info wrinfo;
 | 
			
		||||
        ddsi_make_writer_info (&wrinfo, &wr->e, wr->xqos);
 | 
			
		||||
        ddsi_rhc_unregister_wr (rd->rhc, &wrinfo);
 | 
			
		||||
      }
 | 
			
		||||
      if (rd->status_cb)
 | 
			
		||||
      {
 | 
			
		||||
| 
						 | 
				
			
			@ -1517,7 +1525,7 @@ static void reader_drop_local_connection (const struct nn_guid *rd_guid, const s
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void update_reader_init_acknack_count (const ddsrt_log_cfg_t *logcfg, const struct ephash *guid_hash, const struct nn_guid *rd_guid, nn_count_t count)
 | 
			
		||||
static void update_reader_init_acknack_count (const ddsrt_log_cfg_t *logcfg, const struct ephash *guid_hash, const struct ddsi_guid *rd_guid, nn_count_t count)
 | 
			
		||||
{
 | 
			
		||||
  struct reader *rd;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1539,7 +1547,7 @@ static void update_reader_init_acknack_count (const ddsrt_log_cfg_t *logcfg, con
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void proxy_writer_drop_connection (const struct nn_guid *pwr_guid, struct reader *rd)
 | 
			
		||||
static void proxy_writer_drop_connection (const struct ddsi_guid *pwr_guid, struct reader *rd)
 | 
			
		||||
{
 | 
			
		||||
  /* Only called by gc_delete_reader, so we actually have a reader pointer */
 | 
			
		||||
  struct proxy_writer *pwr;
 | 
			
		||||
| 
						 | 
				
			
			@ -1574,7 +1582,7 @@ static void proxy_writer_drop_connection (const struct nn_guid *pwr_guid, struct
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void proxy_reader_drop_connection (const struct nn_guid *prd_guid, struct writer *wr)
 | 
			
		||||
static void proxy_reader_drop_connection (const struct ddsi_guid *prd_guid, struct writer *wr)
 | 
			
		||||
{
 | 
			
		||||
  struct proxy_reader *prd;
 | 
			
		||||
  if ((prd = ephash_lookup_proxy_reader_guid (wr->e.gv->guid_hash, prd_guid)) != NULL)
 | 
			
		||||
| 
						 | 
				
			
			@ -1719,12 +1727,12 @@ static void writer_add_local_connection (struct writer *wr, struct reader *rd)
 | 
			
		|||
    whc_sample_iter_init(wr->whc, &it);
 | 
			
		||||
    while (whc_sample_iter_borrow_next(&it, &sample))
 | 
			
		||||
    {
 | 
			
		||||
      struct proxy_writer_info pwr_info;
 | 
			
		||||
      struct ddsi_writer_info wrinfo;
 | 
			
		||||
      struct ddsi_serdata *payload = sample.serdata;
 | 
			
		||||
      /* FIXME: whc has tk reference in its index nodes, which is what we really should be iterating over anyway, and so we don't really have to look them up anymore */
 | 
			
		||||
      struct ddsi_tkmap_instance *tk = ddsi_tkmap_lookup_instance_ref (tkmap, payload);
 | 
			
		||||
      make_proxy_writer_info (&pwr_info, &wr->e, wr->xqos);
 | 
			
		||||
      (void) rhc_store (rd->rhc, &pwr_info, payload, tk);
 | 
			
		||||
      ddsi_make_writer_info (&wrinfo, &wr->e, wr->xqos);
 | 
			
		||||
      (void) ddsi_rhc_store (rd->rhc, &wrinfo, payload, tk);
 | 
			
		||||
      ddsi_tkmap_instance_unref (tkmap, tk);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -2004,9 +2012,9 @@ static void proxy_reader_add_connection (struct proxy_reader *prd, struct writer
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static nn_entityid_t builtin_entityid_match (nn_entityid_t x)
 | 
			
		||||
static ddsi_entityid_t builtin_entityid_match (ddsi_entityid_t x)
 | 
			
		||||
{
 | 
			
		||||
  nn_entityid_t res;
 | 
			
		||||
  ddsi_entityid_t res;
 | 
			
		||||
  res.u = 0;
 | 
			
		||||
  switch (x.u)
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -2153,7 +2161,7 @@ static void connect_proxy_writer_with_reader (struct proxy_writer *pwr, struct r
 | 
			
		|||
  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 dds_qos *xqos1, const struct dds_qos *xqos2)
 | 
			
		||||
static bool ignore_local_p (const ddsi_guid_t *guid1, const ddsi_guid_t *guid2, const struct dds_qos *xqos1, const struct dds_qos *xqos2)
 | 
			
		||||
{
 | 
			
		||||
  assert (xqos1->present & QP_CYCLONE_IGNORELOCAL);
 | 
			
		||||
  assert (xqos2->present & QP_CYCLONE_IGNORELOCAL);
 | 
			
		||||
| 
						 | 
				
			
			@ -2372,7 +2380,7 @@ static void generic_do_match (struct entity_common *e, nn_mtime_t tnow)
 | 
			
		|||
  else
 | 
			
		||||
  {
 | 
			
		||||
    /* Built-ins have fixed QoS */
 | 
			
		||||
    nn_entityid_t tgt_ent = builtin_entityid_match (e->guid.entityid);
 | 
			
		||||
    ddsi_entityid_t tgt_ent = builtin_entityid_match (e->guid.entityid);
 | 
			
		||||
    enum entity_kind pkind = generic_do_match_isproxy (e) ? EK_PARTICIPANT : EK_PROXY_PARTICIPANT;
 | 
			
		||||
    EELOGDISC (e, "match_%s_with_%ss(%s "PGUIDFMT") scanning %sparticipants tgt=%"PRIx32"\n",
 | 
			
		||||
               generic_do_match_kindstr_us (e->kind), generic_do_match_kindstr_us (mkind),
 | 
			
		||||
| 
						 | 
				
			
			@ -2385,7 +2393,7 @@ static void generic_do_match (struct entity_common *e, nn_mtime_t tnow)
 | 
			
		|||
      ephash_enum_init (&est, guid_hash, pkind);
 | 
			
		||||
      while ((ep = ephash_enum_next (&est)) != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        nn_guid_t tgt_guid;
 | 
			
		||||
        ddsi_guid_t tgt_guid;
 | 
			
		||||
        tgt_guid.prefix = ep->guid.prefix;
 | 
			
		||||
        tgt_guid.entityid = tgt_ent;
 | 
			
		||||
        if ((em = ephash_lookup_guid (guid_hash, &tgt_guid, mkind)) != NULL)
 | 
			
		||||
| 
						 | 
				
			
			@ -2452,7 +2460,7 @@ static void match_proxy_reader_with_writers (struct proxy_reader *prd, nn_mtime_
 | 
			
		|||
 | 
			
		||||
/* ENDPOINT --------------------------------------------------------- */
 | 
			
		||||
 | 
			
		||||
static void new_reader_writer_common (const struct ddsrt_log_cfg *logcfg, const struct nn_guid *guid, const struct ddsi_sertopic *topic, const struct dds_qos *xqos)
 | 
			
		||||
static void new_reader_writer_common (const struct ddsrt_log_cfg *logcfg, const struct ddsi_guid *guid, const struct ddsi_sertopic *topic, const struct dds_qos *xqos)
 | 
			
		||||
{
 | 
			
		||||
  const char *partition = "(default)";
 | 
			
		||||
  const char *partition_suffix = "";
 | 
			
		||||
| 
						 | 
				
			
			@ -2478,7 +2486,7 @@ static void new_reader_writer_common (const struct ddsrt_log_cfg *logcfg, const
 | 
			
		|||
            topic ? topic->type_name : "(null)");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void endpoint_common_init (struct entity_common *e, struct endpoint_common *c, struct q_globals *gv, enum entity_kind kind, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, bool onlylocal)
 | 
			
		||||
static void endpoint_common_init (struct entity_common *e, struct endpoint_common *c, struct q_globals *gv, enum entity_kind kind, const struct ddsi_guid *guid, const struct ddsi_guid *group_guid, struct participant *pp, bool onlylocal)
 | 
			
		||||
{
 | 
			
		||||
  entity_common_init (e, gv, guid, NULL, kind, now (), NN_VENDORID_ECLIPSE, pp->e.onlylocal || onlylocal);
 | 
			
		||||
  c->pp = ref_participant (pp, &e->guid);
 | 
			
		||||
| 
						 | 
				
			
			@ -2867,7 +2875,7 @@ static void new_writer_guid_common_init (struct writer *wr, const struct ddsi_se
 | 
			
		|||
  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 dds_qos *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 ddsi_guid *guid, const struct ddsi_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;
 | 
			
		||||
  nn_mtime_t tnow = now_mt ();
 | 
			
		||||
| 
						 | 
				
			
			@ -2918,7 +2926,7 @@ static dds_return_t new_writer_guid (struct writer **wr_out, const struct nn_gui
 | 
			
		|||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dds_return_t new_writer (struct writer **wr_out, struct q_globals *gv, 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_writer (struct writer **wr_out, struct q_globals *gv, struct ddsi_guid *wrguid, const struct ddsi_guid *group_guid, const struct ddsi_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;
 | 
			
		||||
  dds_return_t rc;
 | 
			
		||||
| 
						 | 
				
			
			@ -2940,9 +2948,9 @@ dds_return_t new_writer (struct writer **wr_out, struct q_globals *gv, struct nn
 | 
			
		|||
  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 (struct q_globals *gv, nn_entityid_t entityid, struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct whc *whc)
 | 
			
		||||
struct local_orphan_writer *new_local_orphan_writer (struct q_globals *gv, ddsi_entityid_t entityid, struct ddsi_sertopic *topic, const struct dds_qos *xqos, struct whc *whc)
 | 
			
		||||
{
 | 
			
		||||
  nn_guid_t guid;
 | 
			
		||||
  ddsi_guid_t guid;
 | 
			
		||||
  struct local_orphan_writer *lowr;
 | 
			
		||||
  struct writer *wr;
 | 
			
		||||
  nn_mtime_t tnow = now_mt ();
 | 
			
		||||
| 
						 | 
				
			
			@ -3073,7 +3081,7 @@ dds_return_t delete_writer_nolinger_locked (struct writer *wr)
 | 
			
		|||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dds_return_t delete_writer_nolinger (struct q_globals *gv, const struct nn_guid *guid)
 | 
			
		||||
dds_return_t delete_writer_nolinger (struct q_globals *gv, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  struct writer *wr;
 | 
			
		||||
  /* We take no care to ensure application writers are not deleted
 | 
			
		||||
| 
						 | 
				
			
			@ -3102,7 +3110,7 @@ void delete_local_orphan_writer (struct local_orphan_writer *lowr)
 | 
			
		|||
  ddsrt_mutex_unlock (&lowr->wr.e.lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dds_return_t delete_writer (struct q_globals *gv, const struct nn_guid *guid)
 | 
			
		||||
dds_return_t delete_writer (struct q_globals *gv, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  struct writer *wr;
 | 
			
		||||
  struct whc_state whcst;
 | 
			
		||||
| 
						 | 
				
			
			@ -3250,12 +3258,12 @@ static void leave_mcast_helper (const nn_locator_t *n, void *varg)
 | 
			
		|||
static dds_return_t new_reader_guid
 | 
			
		||||
(
 | 
			
		||||
  struct reader **rd_out,
 | 
			
		||||
  const struct nn_guid *guid,
 | 
			
		||||
  const struct nn_guid *group_guid,
 | 
			
		||||
  const struct ddsi_guid *guid,
 | 
			
		||||
  const struct ddsi_guid *group_guid,
 | 
			
		||||
  struct participant *pp,
 | 
			
		||||
  const struct ddsi_sertopic *topic,
 | 
			
		||||
  const struct dds_qos *xqos,
 | 
			
		||||
  struct rhc *rhc,
 | 
			
		||||
  struct ddsi_rhc *rhc,
 | 
			
		||||
  status_cb_t status_cb,
 | 
			
		||||
  void * status_entity
 | 
			
		||||
)
 | 
			
		||||
| 
						 | 
				
			
			@ -3311,7 +3319,7 @@ static dds_return_t new_reader_guid
 | 
			
		|||
  /* set rhc qos for reader */
 | 
			
		||||
  if (rhc)
 | 
			
		||||
  {
 | 
			
		||||
    rhc_set_qos (rd->rhc, rd->xqos);
 | 
			
		||||
    ddsi_rhc_set_qos (rd->rhc, rd->xqos);
 | 
			
		||||
  }
 | 
			
		||||
  assert (rd->xqos->present & QP_LIVELINESS);
 | 
			
		||||
  if (rd->xqos->liveliness.kind != DDS_LIVELINESS_AUTOMATIC || rd->xqos->liveliness.lease_duration != T_NEVER)
 | 
			
		||||
| 
						 | 
				
			
			@ -3392,12 +3400,12 @@ dds_return_t new_reader
 | 
			
		|||
(
 | 
			
		||||
  struct reader **rd_out,
 | 
			
		||||
  struct q_globals *gv,
 | 
			
		||||
  struct nn_guid *rdguid,
 | 
			
		||||
  const struct nn_guid *group_guid,
 | 
			
		||||
  const struct nn_guid *ppguid,
 | 
			
		||||
  struct ddsi_guid *rdguid,
 | 
			
		||||
  const struct ddsi_guid *group_guid,
 | 
			
		||||
  const struct ddsi_guid *ppguid,
 | 
			
		||||
  const struct ddsi_sertopic *topic,
 | 
			
		||||
  const struct dds_qos *xqos,
 | 
			
		||||
  struct rhc * rhc,
 | 
			
		||||
  struct ddsi_rhc * rhc,
 | 
			
		||||
  status_cb_t status_cb,
 | 
			
		||||
  void * status_cbarg
 | 
			
		||||
)
 | 
			
		||||
| 
						 | 
				
			
			@ -3452,7 +3460,7 @@ static void gc_delete_reader (struct gcreq *gcreq)
 | 
			
		|||
#endif
 | 
			
		||||
  if (rd->rhc)
 | 
			
		||||
  {
 | 
			
		||||
    rhc_free (rd->rhc);
 | 
			
		||||
    ddsi_rhc_free (rd->rhc);
 | 
			
		||||
  }
 | 
			
		||||
  if (rd->status_cb)
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -3470,7 +3478,7 @@ static void gc_delete_reader (struct gcreq *gcreq)
 | 
			
		|||
  ddsrt_free (rd);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dds_return_t delete_reader (struct q_globals *gv, const struct nn_guid *guid)
 | 
			
		||||
dds_return_t delete_reader (struct q_globals *gv, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  struct reader *rd;
 | 
			
		||||
  assert (!is_writer_entityid (guid->entityid));
 | 
			
		||||
| 
						 | 
				
			
			@ -3533,10 +3541,10 @@ void proxy_participant_reassign_lease (struct proxy_participant *proxypp, struct
 | 
			
		|||
void new_proxy_participant
 | 
			
		||||
(
 | 
			
		||||
  struct q_globals *gv,
 | 
			
		||||
  const struct nn_guid *ppguid,
 | 
			
		||||
  const struct ddsi_guid *ppguid,
 | 
			
		||||
  unsigned bes,
 | 
			
		||||
  unsigned prismtech_bes,
 | 
			
		||||
  const struct nn_guid *privileged_pp_guid,
 | 
			
		||||
  const struct ddsi_guid *privileged_pp_guid,
 | 
			
		||||
  struct addrset *as_default,
 | 
			
		||||
  struct addrset *as_meta,
 | 
			
		||||
  const nn_plist_t *plist,
 | 
			
		||||
| 
						 | 
				
			
			@ -3685,7 +3693,7 @@ void new_proxy_participant
 | 
			
		|||
      const struct bestab *te = &bestab[i];
 | 
			
		||||
      if ((proxypp->bes & te->besflag) || (proxypp->prismtech_bes & te->prismtech_besflag))
 | 
			
		||||
      {
 | 
			
		||||
        nn_guid_t guid1;
 | 
			
		||||
        ddsi_guid_t guid1;
 | 
			
		||||
        guid1.prefix = proxypp->e.guid.prefix;
 | 
			
		||||
        guid1.entityid.u = te->entityid;
 | 
			
		||||
        assert (is_builtin_entityid (guid1.entityid, proxypp->vendor));
 | 
			
		||||
| 
						 | 
				
			
			@ -3948,7 +3956,7 @@ void purge_proxy_participants (struct q_globals *gv, const nn_locator_t *loc, bo
 | 
			
		|||
  thread_state_asleep (ts1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int delete_proxy_participant_by_guid (struct q_globals *gv, const struct nn_guid *guid, nn_wctime_t timestamp, int isimplicit)
 | 
			
		||||
int delete_proxy_participant_by_guid (struct q_globals *gv, const struct ddsi_guid *guid, nn_wctime_t timestamp, int isimplicit)
 | 
			
		||||
{
 | 
			
		||||
  struct proxy_participant *ppt;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -3971,7 +3979,7 @@ int delete_proxy_participant_by_guid (struct q_globals *gv, const struct nn_guid
 | 
			
		|||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint64_t get_entity_instance_id (const struct q_globals *gv, const struct nn_guid *guid)
 | 
			
		||||
uint64_t get_entity_instance_id (const struct q_globals *gv, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  struct thread_state1 *ts1 = lookup_thread_state ();
 | 
			
		||||
  struct entity_common *e;
 | 
			
		||||
| 
						 | 
				
			
			@ -3985,7 +3993,7 @@ uint64_t get_entity_instance_id (const struct q_globals *gv, const struct nn_gui
 | 
			
		|||
 | 
			
		||||
/* PROXY-ENDPOINT --------------------------------------------------- */
 | 
			
		||||
 | 
			
		||||
static void proxy_endpoint_common_init (struct entity_common *e, struct proxy_endpoint_common *c, enum entity_kind kind, const struct nn_guid *guid, nn_wctime_t tcreate, seqno_t seq, struct proxy_participant *proxypp, struct addrset *as, const nn_plist_t *plist)
 | 
			
		||||
static void proxy_endpoint_common_init (struct entity_common *e, struct proxy_endpoint_common *c, enum entity_kind kind, const struct ddsi_guid *guid, nn_wctime_t tcreate, seqno_t seq, struct proxy_participant *proxypp, struct addrset *as, const nn_plist_t *plist)
 | 
			
		||||
{
 | 
			
		||||
  const char *name;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -4020,7 +4028,7 @@ static void proxy_endpoint_common_fini (struct entity_common *e, struct proxy_en
 | 
			
		|||
 | 
			
		||||
/* PROXY-WRITER ----------------------------------------------------- */
 | 
			
		||||
 | 
			
		||||
int new_proxy_writer (struct q_globals *gv, const struct nn_guid *ppguid, const struct nn_guid *guid, struct addrset *as, const nn_plist_t *plist, struct nn_dqueue *dqueue, struct xeventq *evq, nn_wctime_t timestamp, seqno_t seq)
 | 
			
		||||
int new_proxy_writer (struct q_globals *gv, const struct ddsi_guid *ppguid, const struct ddsi_guid *guid, struct addrset *as, const nn_plist_t *plist, struct nn_dqueue *dqueue, struct xeventq *evq, nn_wctime_t timestamp, seqno_t seq)
 | 
			
		||||
{
 | 
			
		||||
  struct proxy_participant *proxypp;
 | 
			
		||||
  struct proxy_writer *pwr;
 | 
			
		||||
| 
						 | 
				
			
			@ -4153,7 +4161,7 @@ void update_proxy_writer (struct proxy_writer *pwr, seqno_t seq, struct addrset
 | 
			
		|||
void update_proxy_reader (struct proxy_reader *prd, seqno_t seq, struct addrset *as, const struct dds_qos *xqos, nn_wctime_t timestamp)
 | 
			
		||||
{
 | 
			
		||||
  struct prd_wr_match * m;
 | 
			
		||||
  nn_guid_t wrguid;
 | 
			
		||||
  ddsi_guid_t wrguid;
 | 
			
		||||
 | 
			
		||||
  memset (&wrguid, 0, sizeof (wrguid));
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -4174,7 +4182,7 @@ void update_proxy_reader (struct proxy_reader *prd, seqno_t seq, struct addrset
 | 
			
		|||
      while ((m = ddsrt_avl_lookup_succ_eq (&prd_writers_treedef, &prd->writers, &wrguid)) != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        struct prd_wr_match *next;
 | 
			
		||||
        nn_guid_t guid_next;
 | 
			
		||||
        ddsi_guid_t guid_next;
 | 
			
		||||
        struct writer * wr;
 | 
			
		||||
 | 
			
		||||
        wrguid = m->wr_guid;
 | 
			
		||||
| 
						 | 
				
			
			@ -4229,7 +4237,7 @@ static void gc_delete_proxy_writer (struct gcreq *gcreq)
 | 
			
		|||
  ddsrt_free (pwr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int delete_proxy_writer (struct q_globals *gv, const struct nn_guid *guid, nn_wctime_t timestamp, int isimplicit)
 | 
			
		||||
int delete_proxy_writer (struct q_globals *gv, const struct ddsi_guid *guid, nn_wctime_t timestamp, int isimplicit)
 | 
			
		||||
{
 | 
			
		||||
  struct proxy_writer *pwr;
 | 
			
		||||
  (void)isimplicit;
 | 
			
		||||
| 
						 | 
				
			
			@ -4256,7 +4264,7 @@ int delete_proxy_writer (struct q_globals *gv, const struct nn_guid *guid, nn_wc
 | 
			
		|||
 | 
			
		||||
/* PROXY-READER ----------------------------------------------------- */
 | 
			
		||||
 | 
			
		||||
int new_proxy_reader (struct q_globals *gv, const struct nn_guid *ppguid, const struct nn_guid *guid, struct addrset *as, const nn_plist_t *plist, nn_wctime_t timestamp, seqno_t seq
 | 
			
		||||
int new_proxy_reader (struct q_globals *gv, const struct ddsi_guid *ppguid, const struct ddsi_guid *guid, struct addrset *as, const nn_plist_t *plist, nn_wctime_t timestamp, seqno_t seq
 | 
			
		||||
#ifdef DDSI_INCLUDE_SSM
 | 
			
		||||
                      , int favours_ssm
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -4298,7 +4306,7 @@ int new_proxy_reader (struct q_globals *gv, const struct nn_guid *ppguid, const
 | 
			
		|||
 | 
			
		||||
static void proxy_reader_set_delete_and_ack_all_messages (struct proxy_reader *prd)
 | 
			
		||||
{
 | 
			
		||||
  nn_guid_t wrguid;
 | 
			
		||||
  ddsi_guid_t wrguid;
 | 
			
		||||
  struct writer *wr;
 | 
			
		||||
  struct prd_wr_match *m;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -4310,7 +4318,7 @@ static void proxy_reader_set_delete_and_ack_all_messages (struct proxy_reader *p
 | 
			
		|||
    /* have to be careful walking the tree -- pretty is different, but
 | 
			
		||||
       I want to check this before I write a lookup_succ function. */
 | 
			
		||||
    struct prd_wr_match *m_a_next;
 | 
			
		||||
    nn_guid_t wrguid_next;
 | 
			
		||||
    ddsi_guid_t wrguid_next;
 | 
			
		||||
    wrguid = m->wr_guid;
 | 
			
		||||
    if ((m_a_next = ddsrt_avl_find_succ (&prd_writers_treedef, &prd->writers, m)) != NULL)
 | 
			
		||||
      wrguid_next = m_a_next->wr_guid;
 | 
			
		||||
| 
						 | 
				
			
			@ -4362,7 +4370,7 @@ static void gc_delete_proxy_reader (struct gcreq *gcreq)
 | 
			
		|||
  ddsrt_free (prd);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int delete_proxy_reader (struct q_globals *gv, const struct nn_guid *guid, nn_wctime_t timestamp, int isimplicit)
 | 
			
		||||
int delete_proxy_reader (struct q_globals *gv, const struct ddsi_guid *guid, nn_wctime_t timestamp, int isimplicit)
 | 
			
		||||
{
 | 
			
		||||
  struct proxy_reader *prd;
 | 
			
		||||
  (void)isimplicit;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -113,7 +113,7 @@ static void ephash_guid_remove (struct ephash *gh, struct entity_common *e)
 | 
			
		|||
  assert (x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void *ephash_lookup_guid_untyped (const struct ephash *gh, const struct nn_guid *guid)
 | 
			
		||||
void *ephash_lookup_guid_untyped (const struct ephash *gh, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  /* FIXME: could (now) require guid to be first in entity_common; entity_common already is first in entity */
 | 
			
		||||
  struct entity_common e;
 | 
			
		||||
| 
						 | 
				
			
			@ -122,7 +122,7 @@ void *ephash_lookup_guid_untyped (const struct ephash *gh, const struct nn_guid
 | 
			
		|||
  return ddsrt_chh_lookup (gh->hash, &e);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void *ephash_lookup_guid_int (const struct ephash *gh, const struct nn_guid *guid, enum entity_kind kind)
 | 
			
		||||
static void *ephash_lookup_guid_int (const struct ephash *gh, const struct ddsi_guid *guid, enum entity_kind kind)
 | 
			
		||||
{
 | 
			
		||||
  struct entity_common *res;
 | 
			
		||||
  if ((res = ephash_lookup_guid_untyped (gh, guid)) != NULL && res->kind == kind)
 | 
			
		||||
| 
						 | 
				
			
			@ -131,7 +131,7 @@ static void *ephash_lookup_guid_int (const struct ephash *gh, const struct nn_gu
 | 
			
		|||
    return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void *ephash_lookup_guid (const struct ephash *gh, const struct nn_guid *guid, enum entity_kind kind)
 | 
			
		||||
void *ephash_lookup_guid (const struct ephash *gh, const struct ddsi_guid *guid, enum entity_kind kind)
 | 
			
		||||
{
 | 
			
		||||
  return ephash_lookup_guid_int (gh, guid, kind);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -196,42 +196,42 @@ void ephash_remove_proxy_reader_guid (struct ephash *gh, struct proxy_reader *pr
 | 
			
		|||
  ephash_guid_remove (gh, &prd->e);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct participant *ephash_lookup_participant_guid (const struct ephash *gh, const struct nn_guid *guid)
 | 
			
		||||
struct participant *ephash_lookup_participant_guid (const struct ephash *gh, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  assert (guid->entityid.u == NN_ENTITYID_PARTICIPANT);
 | 
			
		||||
  assert (offsetof (struct participant, e) == 0);
 | 
			
		||||
  return ephash_lookup_guid_int (gh, guid, EK_PARTICIPANT);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct proxy_participant *ephash_lookup_proxy_participant_guid (const struct ephash *gh, const struct nn_guid *guid)
 | 
			
		||||
struct proxy_participant *ephash_lookup_proxy_participant_guid (const struct ephash *gh, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  assert (guid->entityid.u == NN_ENTITYID_PARTICIPANT);
 | 
			
		||||
  assert (offsetof (struct proxy_participant, e) == 0);
 | 
			
		||||
  return ephash_lookup_guid_int (gh, guid, EK_PROXY_PARTICIPANT);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct writer *ephash_lookup_writer_guid (const struct ephash *gh, const struct nn_guid *guid)
 | 
			
		||||
struct writer *ephash_lookup_writer_guid (const struct ephash *gh, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  assert (is_writer_entityid (guid->entityid));
 | 
			
		||||
  assert (offsetof (struct writer, e) == 0);
 | 
			
		||||
  return ephash_lookup_guid_int (gh, guid, EK_WRITER);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct reader *ephash_lookup_reader_guid (const struct ephash *gh, const struct nn_guid *guid)
 | 
			
		||||
struct reader *ephash_lookup_reader_guid (const struct ephash *gh, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  assert (is_reader_entityid (guid->entityid));
 | 
			
		||||
  assert (offsetof (struct reader, e) == 0);
 | 
			
		||||
  return ephash_lookup_guid_int (gh, guid, EK_READER);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct proxy_writer *ephash_lookup_proxy_writer_guid (const struct ephash *gh, const struct nn_guid *guid)
 | 
			
		||||
struct proxy_writer *ephash_lookup_proxy_writer_guid (const struct ephash *gh, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  assert (is_writer_entityid (guid->entityid));
 | 
			
		||||
  assert (offsetof (struct proxy_writer, e) == 0);
 | 
			
		||||
  return ephash_lookup_guid_int (gh, guid, EK_PROXY_WRITER);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct proxy_reader *ephash_lookup_proxy_reader_guid (const struct ephash *gh, const struct nn_guid *guid)
 | 
			
		||||
struct proxy_reader *ephash_lookup_proxy_reader_guid (const struct ephash *gh, const struct ddsi_guid *guid)
 | 
			
		||||
{
 | 
			
		||||
  assert (is_reader_entityid (guid->entityid));
 | 
			
		||||
  assert (offsetof (struct proxy_reader, e) == 0);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -188,7 +188,7 @@ int64_t check_and_handle_lease_expiration (struct q_globals *gv, nn_etime_t tnow
 | 
			
		|||
  ddsrt_mutex_lock (&gv->leaseheap_lock);
 | 
			
		||||
  while ((l = ddsrt_fibheap_min (&lease_fhdef, &gv->leaseheap)) != NULL && l->tsched.v <= tnowE.v)
 | 
			
		||||
  {
 | 
			
		||||
    nn_guid_t g = l->entity->guid;
 | 
			
		||||
    ddsi_guid_t g = l->entity->guid;
 | 
			
		||||
    enum entity_kind k = l->entity->kind;
 | 
			
		||||
 | 
			
		||||
    assert (l->tsched.v != TSCHED_NOT_ON_HEAP);
 | 
			
		||||
| 
						 | 
				
			
			@ -303,7 +303,7 @@ void handle_PMD (const struct receiver_state *rst, nn_wctime_t timestamp, uint32
 | 
			
		|||
  const struct CDRHeader *data = vdata; /* built-ins not deserialized (yet) */
 | 
			
		||||
  const int bswap = (data->identifier == CDR_LE) ^ (DDSRT_ENDIAN == DDSRT_LITTLE_ENDIAN);
 | 
			
		||||
  struct proxy_participant *pp;
 | 
			
		||||
  nn_guid_t ppguid;
 | 
			
		||||
  ddsi_guid_t ppguid;
 | 
			
		||||
  RSTTRACE (" PMD ST%x", statusinfo);
 | 
			
		||||
  if (data->identifier != CDR_LE && data->identifier != CDR_BE)
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +318,7 @@ void handle_PMD (const struct receiver_state *rst, nn_wctime_t timestamp, uint32
 | 
			
		|||
      else
 | 
			
		||||
      {
 | 
			
		||||
        const ParticipantMessageData_t *pmd = (ParticipantMessageData_t *) (data + 1);
 | 
			
		||||
        nn_guid_prefix_t p = nn_ntoh_guid_prefix (pmd->participantGuidPrefix);
 | 
			
		||||
        ddsi_guid_prefix_t p = nn_ntoh_guid_prefix (pmd->participantGuidPrefix);
 | 
			
		||||
        uint32_t kind = ntohl (pmd->kind);
 | 
			
		||||
        uint32_t length = bswap ? bswap4u (pmd->length) : pmd->length;
 | 
			
		||||
        RSTTRACE (" pp %"PRIx32":%"PRIx32":%"PRIx32" kind %u data %u", p.u[0], p.u[1], p.u[2], kind, length);
 | 
			
		||||
| 
						 | 
				
			
			@ -346,11 +346,11 @@ void handle_PMD (const struct receiver_state *rst, nn_wctime_t timestamp, uint32
 | 
			
		|||
    case NN_STATUSINFO_DISPOSE | NN_STATUSINFO_UNREGISTER:
 | 
			
		||||
      /* Serialized key; BE or LE doesn't matter as both fields are
 | 
			
		||||
         defined as octets.  */
 | 
			
		||||
      if (len < sizeof (struct CDRHeader) + sizeof (nn_guid_prefix_t))
 | 
			
		||||
      if (len < sizeof (struct CDRHeader) + sizeof (ddsi_guid_prefix_t))
 | 
			
		||||
        debug_print_rawdata (rst->gv, " SHORT3", data, len);
 | 
			
		||||
      else
 | 
			
		||||
      {
 | 
			
		||||
        ppguid.prefix = nn_ntoh_guid_prefix (*((nn_guid_prefix_t *) (data + 1)));
 | 
			
		||||
        ppguid.prefix = nn_ntoh_guid_prefix (*((ddsi_guid_prefix_t *) (data + 1)));
 | 
			
		||||
        ppguid.entityid.u = NN_ENTITYID_PARTICIPANT;
 | 
			
		||||
        if (delete_proxy_participant_by_guid (rst->gv, &ppguid, timestamp, 0) < 0)
 | 
			
		||||
          RSTTRACE (" unknown");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -353,7 +353,7 @@ static void fini_generic_partial (void * __restrict dst, size_t * __restrict dst
 | 
			
		|||
      case Xo: case Xox2: SIMPLE (Xo, unsigned char); break;
 | 
			
		||||
      case Xb: case Xbx2: SIMPLE (Xb, unsigned char); break;
 | 
			
		||||
      case XbCOND: SIMPLE (XbCOND, unsigned char); break;
 | 
			
		||||
      case XG: SIMPLE (XG, nn_guid_t); break;
 | 
			
		||||
      case XG: SIMPLE (XG, ddsi_guid_t); break;
 | 
			
		||||
      case XK: SIMPLE (XK, nn_keyhash_t); break;
 | 
			
		||||
    }
 | 
			
		||||
    desc++;
 | 
			
		||||
| 
						 | 
				
			
			@ -492,7 +492,7 @@ static dds_return_t deser_generic (void * __restrict dst, size_t * __restrict ds
 | 
			
		|||
        break;
 | 
			
		||||
      }
 | 
			
		||||
      case XG: { /* GUID */
 | 
			
		||||
        nn_guid_t * const x = deser_generic_dst (dst, dstoff, alignof (nn_guid_t));
 | 
			
		||||
        ddsi_guid_t * const x = deser_generic_dst (dst, dstoff, alignof (ddsi_guid_t));
 | 
			
		||||
        if (dd->bufsz - *srcoff < sizeof (*x))
 | 
			
		||||
          goto fail;
 | 
			
		||||
        memcpy (x, dd->buf + *srcoff, sizeof (*x));
 | 
			
		||||
| 
						 | 
				
			
			@ -552,7 +552,7 @@ static size_t ser_generic_size (const void *src, size_t srcoff, const enum psero
 | 
			
		|||
      case Xo: case Xox2: SIMPLE1 (Xo, unsigned char); break;
 | 
			
		||||
      case Xb: case Xbx2: SIMPLE1 (Xb, unsigned char); break;
 | 
			
		||||
      case XbCOND: SIMPLE1 (XbCOND, unsigned char); break;
 | 
			
		||||
      case XG: SIMPLE1 (XG, nn_guid_t); break;
 | 
			
		||||
      case XG: SIMPLE1 (XG, ddsi_guid_t); break;
 | 
			
		||||
      case XK: SIMPLE1 (XK, nn_keyhash_t); break;
 | 
			
		||||
    }
 | 
			
		||||
    desc++;
 | 
			
		||||
| 
						 | 
				
			
			@ -679,8 +679,8 @@ static dds_return_t ser_generic (struct nn_xmsg *xmsg, nn_parameterid_t pid, con
 | 
			
		|||
        break;
 | 
			
		||||
      }
 | 
			
		||||
      case XG: { /* GUID */
 | 
			
		||||
        nn_guid_t const * const x = deser_generic_src (src, &srcoff, alignof (nn_guid_t));
 | 
			
		||||
        const nn_guid_t xn = nn_hton_guid (*x);
 | 
			
		||||
        ddsi_guid_t const * const x = deser_generic_src (src, &srcoff, alignof (ddsi_guid_t));
 | 
			
		||||
        const ddsi_guid_t xn = nn_hton_guid (*x);
 | 
			
		||||
        char * const p = data + dstoff;
 | 
			
		||||
        memcpy (p, &xn, sizeof (xn));
 | 
			
		||||
        dstoff += sizeof (xn);
 | 
			
		||||
| 
						 | 
				
			
			@ -730,7 +730,7 @@ static dds_return_t unalias_generic (void * __restrict dst, size_t * __restrict
 | 
			
		|||
      case Xo: case Xox2: SIMPLE (Xo, unsigned char); break;
 | 
			
		||||
      case Xb: case Xbx2: SIMPLE (Xb, unsigned char); break;
 | 
			
		||||
      case XbCOND: SIMPLE (XbCOND, unsigned char); break;
 | 
			
		||||
      case XG: SIMPLE (XG, nn_guid_t); break;
 | 
			
		||||
      case XG: SIMPLE (XG, ddsi_guid_t); break;
 | 
			
		||||
      case XK: SIMPLE (XK, nn_keyhash_t); break;
 | 
			
		||||
    }
 | 
			
		||||
    desc++;
 | 
			
		||||
| 
						 | 
				
			
			@ -798,7 +798,7 @@ static dds_return_t valid_generic (const void *src, size_t srcoff, const enum ps
 | 
			
		|||
      case Xo: case Xox2: TRIVIAL (Xo, unsigned char); break;
 | 
			
		||||
      case Xb: case Xbx2: SIMPLE (Xb, unsigned char, *x == 0 || *x == 1); break;
 | 
			
		||||
      case XbCOND: SIMPLE (XbCOND, unsigned char, *x == 0 || *x == 1); break;
 | 
			
		||||
      case XG: TRIVIAL (XG, nn_guid_t); break;
 | 
			
		||||
      case XG: TRIVIAL (XG, ddsi_guid_t); break;
 | 
			
		||||
      case XK: TRIVIAL (XK, nn_keyhash_t); break;
 | 
			
		||||
    }
 | 
			
		||||
    desc++;
 | 
			
		||||
| 
						 | 
				
			
			@ -857,7 +857,7 @@ static bool equal_generic (const void *srcx, const void *srcy, size_t srcoff, co
 | 
			
		|||
            return true;
 | 
			
		||||
        });
 | 
			
		||||
        break;
 | 
			
		||||
      case XG: SIMPLE (XG, nn_guid_t, memcmp (x, y, sizeof (*x))); break;
 | 
			
		||||
      case XG: SIMPLE (XG, ddsi_guid_t, memcmp (x, y, sizeof (*x))); break;
 | 
			
		||||
      case XK: SIMPLE (XK, nn_keyhash_t, memcmp (x, y, sizeof (*x))); break;
 | 
			
		||||
    }
 | 
			
		||||
    desc++;
 | 
			
		||||
| 
						 | 
				
			
			@ -904,7 +904,7 @@ static dds_return_t dvx_resource_limits (void * __restrict dst, const struct dd
 | 
			
		|||
 | 
			
		||||
static dds_return_t dvx_participant_guid (void * __restrict dst, const struct dd * __restrict dd)
 | 
			
		||||
{
 | 
			
		||||
  const nn_guid_t *g = dst;
 | 
			
		||||
  const ddsi_guid_t *g = dst;
 | 
			
		||||
  (void) dd;
 | 
			
		||||
  if (g->prefix.u[0] == 0 && g->prefix.u[1] == 0 && g->prefix.u[2] == 0)
 | 
			
		||||
    return (g->entityid.u == 0) ? 0 : DDS_RETCODE_BAD_PARAMETER;
 | 
			
		||||
| 
						 | 
				
			
			@ -914,7 +914,7 @@ static dds_return_t dvx_participant_guid (void * __restrict dst, const struct dd
 | 
			
		|||
 | 
			
		||||
static dds_return_t dvx_group_guid (void * __restrict dst, const struct dd * __restrict dd)
 | 
			
		||||
{
 | 
			
		||||
  const nn_guid_t *g = dst;
 | 
			
		||||
  const ddsi_guid_t *g = dst;
 | 
			
		||||
  (void) dd;
 | 
			
		||||
  if (g->prefix.u[0] == 0 && g->prefix.u[1] == 0 && g->prefix.u[2] == 0)
 | 
			
		||||
    return (g->entityid.u == 0) ? 0 : DDS_RETCODE_BAD_PARAMETER;
 | 
			
		||||
| 
						 | 
				
			
			@ -924,7 +924,7 @@ static dds_return_t dvx_group_guid (void * __restrict dst, const struct dd * __r
 | 
			
		|||
 | 
			
		||||
static dds_return_t dvx_endpoint_guid (void * __restrict dst, const struct dd * __restrict dd)
 | 
			
		||||
{
 | 
			
		||||
  nn_guid_t *g = dst;
 | 
			
		||||
  ddsi_guid_t *g = dst;
 | 
			
		||||
  if (g->prefix.u[0] == 0 && g->prefix.u[1] == 0 && g->prefix.u[2] == 0)
 | 
			
		||||
    return (g->entityid.u == 0) ? 0 : DDS_RETCODE_BAD_PARAMETER;
 | 
			
		||||
  switch (g->entityid.u & NN_ENTITYID_KIND_MASK)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2407,7 +2407,7 @@ struct nn_dqueue_bubble {
 | 
			
		|||
      void *arg;
 | 
			
		||||
    } cb;
 | 
			
		||||
    struct {
 | 
			
		||||
      nn_guid_t rdguid;
 | 
			
		||||
      ddsi_guid_t rdguid;
 | 
			
		||||
      uint32_t count;
 | 
			
		||||
    } rdguid;
 | 
			
		||||
  } u;
 | 
			
		||||
| 
						 | 
				
			
			@ -2429,7 +2429,7 @@ static uint32_t dqueue_thread (struct nn_dqueue *q)
 | 
			
		|||
  struct q_globals const * const gv = ddsrt_atomic_ldvoidp (&ts1->gv);
 | 
			
		||||
  nn_mtime_t next_thread_cputime = { 0 };
 | 
			
		||||
  int keepgoing = 1;
 | 
			
		||||
  nn_guid_t rdguid, *prdguid = NULL;
 | 
			
		||||
  ddsi_guid_t rdguid, *prdguid = NULL;
 | 
			
		||||
  uint32_t rdguid_count = 0;
 | 
			
		||||
 | 
			
		||||
  ddsrt_mutex_lock (&q->lock);
 | 
			
		||||
| 
						 | 
				
			
			@ -2631,7 +2631,7 @@ void nn_dqueue_enqueue_callback (struct nn_dqueue *q, nn_dqueue_callback_t cb, v
 | 
			
		|||
  nn_dqueue_enqueue_bubble (q, b);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void nn_dqueue_enqueue1 (struct nn_dqueue *q, const nn_guid_t *rdguid, struct nn_rsample_chain *sc, nn_reorder_result_t rres)
 | 
			
		||||
void nn_dqueue_enqueue1 (struct nn_dqueue *q, const ddsi_guid_t *rdguid, struct nn_rsample_chain *sc, nn_reorder_result_t rres)
 | 
			
		||||
{
 | 
			
		||||
  struct nn_dqueue_bubble *b;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,7 +44,7 @@
 | 
			
		|||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
#include "dds/ddsi/q_xmsg.h"
 | 
			
		||||
#include "dds/ddsi/q_receive.h"
 | 
			
		||||
#include "dds/ddsi/q_rhc.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_rhc.h"
 | 
			
		||||
 | 
			
		||||
#include "dds/ddsi/q_transmit.h"
 | 
			
		||||
#include "dds/ddsi/q_globals.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -74,7 +74,7 @@ Notes:
 | 
			
		|||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
static void deliver_user_data_synchronously (struct nn_rsample_chain *sc, const nn_guid_t *rdguid);
 | 
			
		||||
static void deliver_user_data_synchronously (struct nn_rsample_chain *sc, const ddsi_guid_t *rdguid);
 | 
			
		||||
 | 
			
		||||
static void maybe_set_reader_in_sync (struct proxy_writer *pwr, struct pwr_rd_match *wn, seqno_t last_deliv_seq)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -285,7 +285,7 @@ static int valid_NackFrag (NackFrag_t *msg, size_t size, int byteswap)
 | 
			
		|||
  return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void set_sampleinfo_proxy_writer (struct nn_rsample_info *sampleinfo, nn_guid_t *pwr_guid)
 | 
			
		||||
static void set_sampleinfo_proxy_writer (struct nn_rsample_info *sampleinfo, ddsi_guid_t *pwr_guid)
 | 
			
		||||
{
 | 
			
		||||
  struct proxy_writer * pwr = ephash_lookup_proxy_writer_guid (sampleinfo->rst->gv->guid_hash, pwr_guid);
 | 
			
		||||
  sampleinfo->pwr = pwr;
 | 
			
		||||
| 
						 | 
				
			
			@ -294,7 +294,7 @@ static void set_sampleinfo_proxy_writer (struct nn_rsample_info *sampleinfo, nn_
 | 
			
		|||
static int valid_Data (const struct receiver_state *rst, struct nn_rmsg *rmsg, Data_t *msg, size_t size, int byteswap, struct nn_rsample_info *sampleinfo, unsigned char **payloadp)
 | 
			
		||||
{
 | 
			
		||||
  /* on success: sampleinfo->{seq,rst,statusinfo,pt_wr_info_zoff,bswap,complex_qos} all set */
 | 
			
		||||
  nn_guid_t pwr_guid;
 | 
			
		||||
  ddsi_guid_t pwr_guid;
 | 
			
		||||
  unsigned char *ptr;
 | 
			
		||||
 | 
			
		||||
  if (size < sizeof (*msg))
 | 
			
		||||
| 
						 | 
				
			
			@ -405,7 +405,7 @@ static int valid_DataFrag (const struct receiver_state *rst, struct nn_rmsg *rms
 | 
			
		|||
{
 | 
			
		||||
  /* on success: sampleinfo->{rst,statusinfo,pt_wr_info_zoff,bswap,complex_qos} all set */
 | 
			
		||||
  uint32_t payloadsz;
 | 
			
		||||
  nn_guid_t pwr_guid;
 | 
			
		||||
  ddsi_guid_t pwr_guid;
 | 
			
		||||
  unsigned char *ptr;
 | 
			
		||||
 | 
			
		||||
  if (size < sizeof (*msg))
 | 
			
		||||
| 
						 | 
				
			
			@ -628,7 +628,7 @@ static int handle_AckNack (struct receiver_state *rst, nn_etime_t tnow, const Ac
 | 
			
		|||
  struct proxy_reader *prd;
 | 
			
		||||
  struct wr_prd_match *rn;
 | 
			
		||||
  struct writer *wr;
 | 
			
		||||
  nn_guid_t src, dst;
 | 
			
		||||
  ddsi_guid_t src, dst;
 | 
			
		||||
  seqno_t seqbase;
 | 
			
		||||
  seqno_t seq_xmit;
 | 
			
		||||
  nn_count_t *countp;
 | 
			
		||||
| 
						 | 
				
			
			@ -991,7 +991,7 @@ static int handle_AckNack (struct receiver_state *rst, nn_etime_t tnow, const Ac
 | 
			
		|||
  return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void handle_forall_destinations (const nn_guid_t *dst, struct proxy_writer *pwr, ddsrt_avl_walk_t fun, void *arg)
 | 
			
		||||
static void handle_forall_destinations (const ddsi_guid_t *dst, struct proxy_writer *pwr, ddsrt_avl_walk_t fun, void *arg)
 | 
			
		||||
{
 | 
			
		||||
  /* prefix:  id:   to:
 | 
			
		||||
     0        0     all matched readers
 | 
			
		||||
| 
						 | 
				
			
			@ -1023,7 +1023,7 @@ static void handle_forall_destinations (const nn_guid_t *dst, struct proxy_write
 | 
			
		|||
      break;
 | 
			
		||||
    case (1 << 1) | 0: /* all within one participant: walk a range of keyvalues */
 | 
			
		||||
      {
 | 
			
		||||
        nn_guid_t a, b;
 | 
			
		||||
        ddsi_guid_t a, b;
 | 
			
		||||
        a = *dst; a.entityid.u = 0;
 | 
			
		||||
        b = *dst; b.entityid.u = ~0u;
 | 
			
		||||
        ddsrt_avl_walk_range (&pwr_readers_treedef, &pwr->readers, &a, &b, fun, arg);
 | 
			
		||||
| 
						 | 
				
			
			@ -1124,7 +1124,7 @@ static int handle_Heartbeat (struct receiver_state *rst, nn_etime_t tnow, struct
 | 
			
		|||
  const seqno_t lastseq = fromSN (msg->lastSN);
 | 
			
		||||
  struct handle_Heartbeat_helper_arg arg;
 | 
			
		||||
  struct proxy_writer *pwr;
 | 
			
		||||
  nn_guid_t src, dst;
 | 
			
		||||
  ddsi_guid_t src, dst;
 | 
			
		||||
 | 
			
		||||
  src.prefix = rst->src_guid_prefix;
 | 
			
		||||
  src.entityid = msg->writerId;
 | 
			
		||||
| 
						 | 
				
			
			@ -1261,7 +1261,7 @@ static int handle_HeartbeatFrag (struct receiver_state *rst, UNUSED_ARG(nn_etime
 | 
			
		|||
{
 | 
			
		||||
  const seqno_t seq = fromSN (msg->writerSN);
 | 
			
		||||
  const nn_fragment_number_t fragnum = msg->lastFragmentNum - 1; /* we do 0-based */
 | 
			
		||||
  nn_guid_t src, dst;
 | 
			
		||||
  ddsi_guid_t src, dst;
 | 
			
		||||
  struct proxy_writer *pwr;
 | 
			
		||||
 | 
			
		||||
  src.prefix = rst->src_guid_prefix;
 | 
			
		||||
| 
						 | 
				
			
			@ -1374,7 +1374,7 @@ static int handle_NackFrag (struct receiver_state *rst, nn_etime_t tnow, const N
 | 
			
		|||
  struct wr_prd_match *rn;
 | 
			
		||||
  struct writer *wr;
 | 
			
		||||
  struct whc_borrowed_sample sample;
 | 
			
		||||
  nn_guid_t src, dst;
 | 
			
		||||
  ddsi_guid_t src, dst;
 | 
			
		||||
  nn_count_t *countp;
 | 
			
		||||
  seqno_t seq = fromSN (msg->writerSN);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1490,7 +1490,7 @@ static int handle_NackFrag (struct receiver_state *rst, nn_etime_t tnow, const N
 | 
			
		|||
  return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int handle_InfoDST (struct receiver_state *rst, const InfoDST_t *msg, const nn_guid_prefix_t *dst_prefix)
 | 
			
		||||
static int handle_InfoDST (struct receiver_state *rst, const InfoDST_t *msg, const ddsi_guid_prefix_t *dst_prefix)
 | 
			
		||||
{
 | 
			
		||||
  rst->dst_guid_prefix = nn_ntoh_guid_prefix (msg->guid_prefix);
 | 
			
		||||
  RSTTRACE ("INFODST(%"PRIx32":%"PRIx32":%"PRIx32")", PGUIDPREFIX (rst->dst_guid_prefix));
 | 
			
		||||
| 
						 | 
				
			
			@ -1502,7 +1502,7 @@ static int handle_InfoDST (struct receiver_state *rst, const InfoDST_t *msg, con
 | 
			
		|||
  }
 | 
			
		||||
  else
 | 
			
		||||
  {
 | 
			
		||||
    nn_guid_t dst;
 | 
			
		||||
    ddsi_guid_t dst;
 | 
			
		||||
    dst.prefix = rst->dst_guid_prefix;
 | 
			
		||||
    dst.entityid = to_entityid(NN_ENTITYID_PARTICIPANT);
 | 
			
		||||
    rst->forme = (ephash_lookup_participant_guid (rst->gv->guid_hash, &dst) != NULL ||
 | 
			
		||||
| 
						 | 
				
			
			@ -1623,7 +1623,7 @@ static int handle_Gap (struct receiver_state *rst, nn_etime_t tnow, struct nn_rm
 | 
			
		|||
 | 
			
		||||
  struct proxy_writer *pwr;
 | 
			
		||||
  struct pwr_rd_match *wn;
 | 
			
		||||
  nn_guid_t src, dst;
 | 
			
		||||
  ddsi_guid_t src, dst;
 | 
			
		||||
  seqno_t gapstart, listbase;
 | 
			
		||||
  int32_t last_included_rel;
 | 
			
		||||
  uint32_t listidx;
 | 
			
		||||
| 
						 | 
				
			
			@ -1750,7 +1750,7 @@ static struct ddsi_serdata *new_sample_from_data (struct ddsi_tkmap_instance **t
 | 
			
		|||
    if (!(data_smhdr_flags & DATA_FLAG_DATAFLAG) || sampleinfo->size == 0)
 | 
			
		||||
    {
 | 
			
		||||
      const struct proxy_writer *pwr = sampleinfo->pwr;
 | 
			
		||||
      nn_guid_t guid;
 | 
			
		||||
      ddsi_guid_t guid;
 | 
			
		||||
      /* pwr can't currently be null, but that might change some day, and this being
 | 
			
		||||
         an error path, it doesn't hurt to survive that */
 | 
			
		||||
      if (pwr) guid = pwr->e.guid; else memset (&guid, 0, sizeof (guid));
 | 
			
		||||
| 
						 | 
				
			
			@ -1802,7 +1802,7 @@ static struct ddsi_serdata *new_sample_from_data (struct ddsi_tkmap_instance **t
 | 
			
		|||
  {
 | 
			
		||||
    /* No message => error out */
 | 
			
		||||
    const struct proxy_writer *pwr = sampleinfo->pwr;
 | 
			
		||||
    nn_guid_t guid;
 | 
			
		||||
    ddsi_guid_t guid;
 | 
			
		||||
    if (pwr) guid = pwr->e.guid; else memset (&guid, 0, sizeof (guid));
 | 
			
		||||
    DDS_CWARNING (&gv->logconfig,
 | 
			
		||||
                  "data(application, vendor %u.%u): "PGUIDFMT" #%"PRId64": deserialization %s/%s failed (%s)\n",
 | 
			
		||||
| 
						 | 
				
			
			@ -1821,7 +1821,7 @@ static struct ddsi_serdata *new_sample_from_data (struct ddsi_tkmap_instance **t
 | 
			
		|||
    else if (gv->logconfig.c.mask & DDS_LC_TRACE)
 | 
			
		||||
    {
 | 
			
		||||
      const struct proxy_writer *pwr = sampleinfo->pwr;
 | 
			
		||||
      nn_guid_t guid;
 | 
			
		||||
      ddsi_guid_t guid;
 | 
			
		||||
      char tmp[1024];
 | 
			
		||||
      size_t res = 0;
 | 
			
		||||
      tmp[0] = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -1884,7 +1884,7 @@ static struct reader *proxy_writer_next_in_sync_reader (struct proxy_writer *pwr
 | 
			
		|||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int deliver_user_data (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, const nn_guid_t *rdguid, int pwr_locked)
 | 
			
		||||
static int deliver_user_data (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, const ddsi_guid_t *rdguid, int pwr_locked)
 | 
			
		||||
{
 | 
			
		||||
  struct receiver_state const * const rst = sampleinfo->rst;
 | 
			
		||||
  struct q_globals * const gv = rst->gv;
 | 
			
		||||
| 
						 | 
				
			
			@ -1956,8 +1956,8 @@ static int deliver_user_data (const struct nn_rsample_info *sampleinfo, const st
 | 
			
		|||
 | 
			
		||||
  /* FIXME: should it be 0, local wall clock time or INVALID? */
 | 
			
		||||
  const nn_wctime_t tstamp = (sampleinfo->timestamp.v != NN_WCTIME_INVALID.v) ? sampleinfo->timestamp : ((nn_wctime_t) {0});
 | 
			
		||||
  struct proxy_writer_info pwr_info;
 | 
			
		||||
  make_proxy_writer_info (&pwr_info, &pwr->e, pwr->c.xqos);
 | 
			
		||||
  struct ddsi_writer_info wrinfo;
 | 
			
		||||
  ddsi_make_writer_info (&wrinfo, &pwr->e, pwr->c.xqos);
 | 
			
		||||
 | 
			
		||||
  if (rdguid == NULL)
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -1978,7 +1978,7 @@ static int deliver_user_data (const struct nn_rsample_info *sampleinfo, const st
 | 
			
		|||
          ETRACE (pwr, " => EVERYONE\n");
 | 
			
		||||
          uint32_t i = 0;
 | 
			
		||||
          do {
 | 
			
		||||
            if (!rhc_store (rdary[i]->rhc, &pwr_info, payload, tk))
 | 
			
		||||
            if (!ddsi_rhc_store (rdary[i]->rhc, &wrinfo, payload, tk))
 | 
			
		||||
            {
 | 
			
		||||
              if (pwr_locked) ddsrt_mutex_unlock (&pwr->e.lock);
 | 
			
		||||
              ddsrt_mutex_unlock (&pwr->rdary.rdary_lock);
 | 
			
		||||
| 
						 | 
				
			
			@ -2020,7 +2020,7 @@ static int deliver_user_data (const struct nn_rsample_info *sampleinfo, const st
 | 
			
		|||
          ETRACE (pwr, " =>");
 | 
			
		||||
          do {
 | 
			
		||||
            ETRACE (pwr, " "PGUIDFMT, PGUID (rd->e.guid));
 | 
			
		||||
            (void) rhc_store (rd->rhc, &pwr_info, payload, tk);
 | 
			
		||||
            (void) ddsi_rhc_store (rd->rhc, &wrinfo, payload, tk);
 | 
			
		||||
            rd = proxy_writer_next_in_sync_reader (pwr, &it);
 | 
			
		||||
          } while (rd != NULL);
 | 
			
		||||
          free_sample_after_store (gv, payload, tk);
 | 
			
		||||
| 
						 | 
				
			
			@ -2045,7 +2045,7 @@ static int deliver_user_data (const struct nn_rsample_info *sampleinfo, const st
 | 
			
		|||
        /* FIXME: why look up rd,pwr again? Their states remains valid while the thread stays
 | 
			
		||||
           "awake" (although a delete can be initiated), and blocking like this is a stopgap
 | 
			
		||||
           anyway -- quite possibly to abort once either is deleted */
 | 
			
		||||
        while (!rhc_store (rd->rhc, &pwr_info, payload, tk))
 | 
			
		||||
        while (!ddsi_rhc_store (rd->rhc, &wrinfo, payload, tk))
 | 
			
		||||
        {
 | 
			
		||||
          if (pwr_locked) ddsrt_mutex_unlock (&pwr->e.lock);
 | 
			
		||||
          dds_sleepfor (DDS_MSECS (1));
 | 
			
		||||
| 
						 | 
				
			
			@ -2065,14 +2065,14 @@ static int deliver_user_data (const struct nn_rsample_info *sampleinfo, const st
 | 
			
		|||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int user_dqueue_handler (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, const nn_guid_t *rdguid, UNUSED_ARG (void *qarg))
 | 
			
		||||
int user_dqueue_handler (const struct nn_rsample_info *sampleinfo, const struct nn_rdata *fragchain, const ddsi_guid_t *rdguid, UNUSED_ARG (void *qarg))
 | 
			
		||||
{
 | 
			
		||||
  int res;
 | 
			
		||||
  res = deliver_user_data (sampleinfo, fragchain, rdguid, 0);
 | 
			
		||||
  return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void deliver_user_data_synchronously (struct nn_rsample_chain *sc, const nn_guid_t *rdguid)
 | 
			
		||||
static void deliver_user_data_synchronously (struct nn_rsample_chain *sc, const ddsi_guid_t *rdguid)
 | 
			
		||||
{
 | 
			
		||||
  while (sc->first)
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -2113,7 +2113,7 @@ static void handle_regular (struct receiver_state *rst, nn_etime_t tnow, struct
 | 
			
		|||
{
 | 
			
		||||
  struct proxy_writer *pwr;
 | 
			
		||||
  struct nn_rsample *rsample;
 | 
			
		||||
  nn_guid_t dst;
 | 
			
		||||
  ddsi_guid_t dst;
 | 
			
		||||
 | 
			
		||||
  dst.prefix = rst->dst_guid_prefix;
 | 
			
		||||
  dst.entityid = msg->readerId;
 | 
			
		||||
| 
						 | 
				
			
			@ -2121,7 +2121,7 @@ static void handle_regular (struct receiver_state *rst, nn_etime_t tnow, struct
 | 
			
		|||
  pwr = sampleinfo->pwr;
 | 
			
		||||
  if (pwr == NULL)
 | 
			
		||||
  {
 | 
			
		||||
    nn_guid_t src;
 | 
			
		||||
    ddsi_guid_t src;
 | 
			
		||||
    src.prefix = rst->src_guid_prefix;
 | 
			
		||||
    src.entityid = msg->writerId;
 | 
			
		||||
    RSTTRACE (" "PGUIDFMT"? -> "PGUIDFMT, PGUID (src), PGUID (dst));
 | 
			
		||||
| 
						 | 
				
			
			@ -2333,7 +2333,7 @@ static void drop_oversize (struct receiver_state *rst, struct nn_rmsg *rmsg, con
 | 
			
		|||
       effect seems a reasonable approach. */
 | 
			
		||||
    int refc_adjust = 0;
 | 
			
		||||
    struct nn_rdata *gap = nn_rdata_newgap (rmsg);
 | 
			
		||||
    nn_guid_t dst;
 | 
			
		||||
    ddsi_guid_t dst;
 | 
			
		||||
    struct pwr_rd_match *wn;
 | 
			
		||||
    int gap_was_valuable;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -2627,8 +2627,8 @@ static int handle_submsg_sequence
 | 
			
		|||
  const nn_locator_t *srcloc,
 | 
			
		||||
  nn_wctime_t tnowWC,
 | 
			
		||||
  nn_etime_t tnowE,
 | 
			
		||||
  const nn_guid_prefix_t * const src_prefix,
 | 
			
		||||
  const nn_guid_prefix_t * const dst_prefix,
 | 
			
		||||
  const ddsi_guid_prefix_t * const src_prefix,
 | 
			
		||||
  const ddsi_guid_prefix_t * const dst_prefix,
 | 
			
		||||
  unsigned char * const msg /* NOT const - we may byteswap it */,
 | 
			
		||||
  const size_t len,
 | 
			
		||||
  unsigned char * submsg /* aliases somewhere in msg */,
 | 
			
		||||
| 
						 | 
				
			
			@ -2937,7 +2937,7 @@ malformed_asleep:
 | 
			
		|||
  return -1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool do_packet (struct thread_state1 * const ts1, struct q_globals *gv, ddsi_tran_conn_t conn, const nn_guid_prefix_t *guidprefix, struct nn_rbufpool *rbpool)
 | 
			
		||||
static bool do_packet (struct thread_state1 * const ts1, struct q_globals *gv, ddsi_tran_conn_t conn, const ddsi_guid_prefix_t *guidprefix, struct nn_rbufpool *rbpool)
 | 
			
		||||
{
 | 
			
		||||
  /* UDP max packet size is 64kB */
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -3057,7 +3057,7 @@ static bool do_packet (struct thread_state1 * const ts1, struct q_globals *gv, d
 | 
			
		|||
struct local_participant_desc
 | 
			
		||||
{
 | 
			
		||||
  ddsi_tran_conn_t m_conn;
 | 
			
		||||
  nn_guid_prefix_t guid_prefix;
 | 
			
		||||
  ddsi_guid_prefix_t guid_prefix;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static int local_participant_cmp (const void *va, const void *vb)
 | 
			
		||||
| 
						 | 
				
			
			@ -3409,7 +3409,7 @@ uint32_t recv_thread (void *vrecv_thread_arg)
 | 
			
		|||
        ddsi_tran_conn_t conn;
 | 
			
		||||
        while ((idx = os_sockWaitsetNextEvent (ctx, &conn)) >= 0)
 | 
			
		||||
        {
 | 
			
		||||
          const nn_guid_prefix_t *guid_prefix;
 | 
			
		||||
          const ddsi_guid_prefix_t *guid_prefix;
 | 
			
		||||
          if (((unsigned)idx < num_fixed) || gv->config.many_sockets_mode != MSM_MANY_UNICAST)
 | 
			
		||||
            guid_prefix = NULL;
 | 
			
		||||
          else
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,28 +0,0 @@
 | 
			
		|||
/*
 | 
			
		||||
 * 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
 | 
			
		||||
 */
 | 
			
		||||
#include "dds/ddsi/q_rhc.h"
 | 
			
		||||
#include "dds/ddsi/q_xqos.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
 | 
			
		||||
extern inline void rhc_free (struct rhc *rhc);
 | 
			
		||||
extern inline bool rhc_store (struct rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info, struct ddsi_serdata * __restrict sample, struct ddsi_tkmap_instance * __restrict tk);
 | 
			
		||||
extern inline void rhc_unregister_wr (struct rhc * __restrict rhc, const struct proxy_writer_info * __restrict pwr_info);
 | 
			
		||||
extern inline void rhc_relinquish_ownership (struct rhc * __restrict rhc, const uint64_t wr_iid);
 | 
			
		||||
extern inline void rhc_set_qos (struct rhc *rhc, const struct dds_qos *qos);
 | 
			
		||||
 | 
			
		||||
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->ownership_strength = xqos->ownership_strength.value;
 | 
			
		||||
  pwr_info->auto_dispose = xqos->writer_data_lifecycle.autodispose_unregistered_instances;
 | 
			
		||||
  pwr_info->iid = e->iid;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -134,7 +134,7 @@ struct nn_xmsg *writer_hbcontrol_create_heartbeat (struct writer *wr, const stru
 | 
			
		|||
{
 | 
			
		||||
  struct q_globals const * const gv = wr->e.gv;
 | 
			
		||||
  struct nn_xmsg *msg;
 | 
			
		||||
  const nn_guid_t *prd_guid;
 | 
			
		||||
  const ddsi_guid_t *prd_guid;
 | 
			
		||||
 | 
			
		||||
  ASSERT_MUTEX_HELD (&wr->e.lock);
 | 
			
		||||
  assert (wr->reliable);
 | 
			
		||||
| 
						 | 
				
			
			@ -313,7 +313,7 @@ struct nn_xmsg *writer_hbcontrol_piggyback (struct writer *wr, const struct whc_
 | 
			
		|||
  return msg;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void add_Heartbeat (struct nn_xmsg *msg, struct writer *wr, const struct whc_state *whcst, int hbansreq, nn_entityid_t dst, int issync)
 | 
			
		||||
void add_Heartbeat (struct nn_xmsg *msg, struct writer *wr, const struct whc_state *whcst, int hbansreq, ddsi_entityid_t dst, int issync)
 | 
			
		||||
{
 | 
			
		||||
  struct q_globals const * const gv = wr->e.gv;
 | 
			
		||||
  struct nn_xmsg_marker sm_marker;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -68,26 +68,26 @@ struct xevent
 | 
			
		|||
  enum xeventkind kind;
 | 
			
		||||
  union {
 | 
			
		||||
    struct {
 | 
			
		||||
      nn_guid_t wr_guid;
 | 
			
		||||
      ddsi_guid_t wr_guid;
 | 
			
		||||
    } heartbeat;
 | 
			
		||||
    struct {
 | 
			
		||||
      nn_guid_t pwr_guid;
 | 
			
		||||
      nn_guid_t rd_guid;
 | 
			
		||||
      ddsi_guid_t pwr_guid;
 | 
			
		||||
      ddsi_guid_t rd_guid;
 | 
			
		||||
    } acknack;
 | 
			
		||||
    struct {
 | 
			
		||||
      nn_guid_t pp_guid;
 | 
			
		||||
      nn_guid_prefix_t dest_proxypp_guid_prefix; /* only if "directed" */
 | 
			
		||||
      ddsi_guid_t pp_guid;
 | 
			
		||||
      ddsi_guid_prefix_t dest_proxypp_guid_prefix; /* only if "directed" */
 | 
			
		||||
      int directed; /* if 0, undirected; if > 0, number of directed ones to send in reasonably short succession */
 | 
			
		||||
    } spdp;
 | 
			
		||||
    struct {
 | 
			
		||||
      nn_guid_t pp_guid;
 | 
			
		||||
      ddsi_guid_t pp_guid;
 | 
			
		||||
    } pmd_update;
 | 
			
		||||
#if 0
 | 
			
		||||
    struct {
 | 
			
		||||
    } info;
 | 
			
		||||
#endif
 | 
			
		||||
    struct {
 | 
			
		||||
      nn_guid_t guid;
 | 
			
		||||
      ddsi_guid_t guid;
 | 
			
		||||
    } delete_writer;
 | 
			
		||||
    struct {
 | 
			
		||||
      void (*cb) (struct xevent *ev, void *arg, nn_mtime_t tnow);
 | 
			
		||||
| 
						 | 
				
			
			@ -937,7 +937,7 @@ static void handle_xevk_acknack (UNUSED_ARG (struct nn_xpack *xp), struct xevent
 | 
			
		|||
  resched_xevent_if_earlier (ev, add_duration_to_mtime (tnow, 100 * T_MILLISECOND));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool resend_spdp_sample_by_guid_key (struct writer *wr, const nn_guid_t *guid, struct proxy_reader *prd)
 | 
			
		||||
static bool resend_spdp_sample_by_guid_key (struct writer *wr, const ddsi_guid_t *guid, struct proxy_reader *prd)
 | 
			
		||||
{
 | 
			
		||||
  /* Look up data in (transient-local) WHC by key value -- FIXME: clearly
 | 
			
		||||
   a slightly more efficient and elegant way of looking up the key value
 | 
			
		||||
| 
						 | 
				
			
			@ -1009,7 +1009,7 @@ static void handle_xevk_spdp (UNUSED_ARG (struct nn_xpack *xp), struct xevent *e
 | 
			
		|||
  }
 | 
			
		||||
  else
 | 
			
		||||
  {
 | 
			
		||||
    nn_guid_t guid;
 | 
			
		||||
    ddsi_guid_t guid;
 | 
			
		||||
    guid.prefix = ev->u.spdp.dest_proxypp_guid_prefix;
 | 
			
		||||
    guid.entityid.u = NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_READER;
 | 
			
		||||
    prd = ephash_lookup_proxy_reader_guid (gv->guid_hash, &guid);
 | 
			
		||||
| 
						 | 
				
			
			@ -1387,7 +1387,7 @@ void qxev_msg (struct xeventq *evq, struct nn_xmsg *msg)
 | 
			
		|||
  ddsrt_mutex_unlock (&evq->lock);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void qxev_prd_entityid (struct proxy_reader *prd, nn_guid_prefix_t *id)
 | 
			
		||||
void qxev_prd_entityid (struct proxy_reader *prd, ddsi_guid_prefix_t *id)
 | 
			
		||||
{
 | 
			
		||||
  struct q_globals * const gv = prd->e.gv;
 | 
			
		||||
  struct nn_xmsg *msg;
 | 
			
		||||
| 
						 | 
				
			
			@ -1415,7 +1415,7 @@ void qxev_prd_entityid (struct proxy_reader *prd, nn_guid_prefix_t *id)
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void qxev_pwr_entityid (struct proxy_writer *pwr, nn_guid_prefix_t *id)
 | 
			
		||||
void qxev_pwr_entityid (struct proxy_writer *pwr, ddsi_guid_prefix_t *id)
 | 
			
		||||
{
 | 
			
		||||
  struct q_globals * const gv = pwr->e.gv;
 | 
			
		||||
  struct nn_xmsg *msg;
 | 
			
		||||
| 
						 | 
				
			
			@ -1488,7 +1488,7 @@ int qxev_msg_rexmit_wrlock_held (struct xeventq *evq, struct nn_xmsg *msg, int f
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct xevent *qxev_heartbeat (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_t *wr_guid)
 | 
			
		||||
struct xevent *qxev_heartbeat (struct xeventq *evq, nn_mtime_t tsched, const ddsi_guid_t *wr_guid)
 | 
			
		||||
{
 | 
			
		||||
  /* Event _must_ be deleted before enough of the writer is freed to
 | 
			
		||||
     cause trouble.  Currently used exclusively for
 | 
			
		||||
| 
						 | 
				
			
			@ -1503,7 +1503,7 @@ struct xevent *qxev_heartbeat (struct xeventq *evq, nn_mtime_t tsched, const nn_
 | 
			
		|||
  return ev;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct xevent *qxev_acknack (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_t *pwr_guid, const nn_guid_t *rd_guid)
 | 
			
		||||
struct xevent *qxev_acknack (struct xeventq *evq, nn_mtime_t tsched, const ddsi_guid_t *pwr_guid, const ddsi_guid_t *rd_guid)
 | 
			
		||||
{
 | 
			
		||||
  struct xevent *ev;
 | 
			
		||||
  assert(evq);
 | 
			
		||||
| 
						 | 
				
			
			@ -1516,7 +1516,7 @@ struct xevent *qxev_acknack (struct xeventq *evq, nn_mtime_t tsched, const nn_gu
 | 
			
		|||
  return ev;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct xevent *qxev_spdp (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_t *pp_guid, const nn_guid_t *dest_proxypp_guid)
 | 
			
		||||
struct xevent *qxev_spdp (struct xeventq *evq, nn_mtime_t tsched, const ddsi_guid_t *pp_guid, const ddsi_guid_t *dest_proxypp_guid)
 | 
			
		||||
{
 | 
			
		||||
  struct xevent *ev;
 | 
			
		||||
  ddsrt_mutex_lock (&evq->lock);
 | 
			
		||||
| 
						 | 
				
			
			@ -1534,7 +1534,7 @@ struct xevent *qxev_spdp (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_
 | 
			
		|||
  return ev;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct xevent *qxev_pmd_update (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_t *pp_guid)
 | 
			
		||||
struct xevent *qxev_pmd_update (struct xeventq *evq, nn_mtime_t tsched, const ddsi_guid_t *pp_guid)
 | 
			
		||||
{
 | 
			
		||||
  struct xevent *ev;
 | 
			
		||||
  ddsrt_mutex_lock (&evq->lock);
 | 
			
		||||
| 
						 | 
				
			
			@ -1545,7 +1545,7 @@ struct xevent *qxev_pmd_update (struct xeventq *evq, nn_mtime_t tsched, const nn
 | 
			
		|||
  return ev;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct xevent *qxev_delete_writer (struct xeventq *evq, nn_mtime_t tsched, const nn_guid_t *guid)
 | 
			
		||||
struct xevent *qxev_delete_writer (struct xeventq *evq, nn_mtime_t tsched, const ddsi_guid_t *guid)
 | 
			
		||||
{
 | 
			
		||||
  struct xevent *ev;
 | 
			
		||||
  ddsrt_mutex_lock (&evq->lock);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -83,7 +83,7 @@ struct nn_xmsg {
 | 
			
		|||
  union {
 | 
			
		||||
    char control;
 | 
			
		||||
    struct {
 | 
			
		||||
      nn_guid_t wrguid;
 | 
			
		||||
      ddsi_guid_t wrguid;
 | 
			
		||||
      seqno_t wrseq;
 | 
			
		||||
      nn_fragment_number_t wrfragid;
 | 
			
		||||
      /* readerId encodes offset to destination readerId or 0 -- used
 | 
			
		||||
| 
						 | 
				
			
			@ -191,7 +191,7 @@ struct nn_xpack
 | 
			
		|||
  bool async_mode;
 | 
			
		||||
  Header_t hdr;
 | 
			
		||||
  MsgLen_t msg_len;
 | 
			
		||||
  nn_guid_prefix_t *last_src;
 | 
			
		||||
  ddsi_guid_prefix_t *last_src;
 | 
			
		||||
  InfoDST_t *last_dst;
 | 
			
		||||
  int64_t maxdelay;
 | 
			
		||||
  unsigned packetid;
 | 
			
		||||
| 
						 | 
				
			
			@ -329,7 +329,7 @@ static struct nn_xmsg *nn_xmsg_allocnew (struct nn_xmsgpool *pool, size_t expect
 | 
			
		|||
  return m;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct nn_xmsg *nn_xmsg_new (struct nn_xmsgpool *pool, const nn_guid_prefix_t *src_guid_prefix, size_t expected_size, enum nn_xmsg_kind kind)
 | 
			
		||||
struct nn_xmsg *nn_xmsg_new (struct nn_xmsgpool *pool, const ddsi_guid_prefix_t *src_guid_prefix, size_t expected_size, enum nn_xmsg_kind kind)
 | 
			
		||||
{
 | 
			
		||||
  struct nn_xmsg *m;
 | 
			
		||||
  if ((m = nn_freelist_pop (&pool->freelist)) != NULL)
 | 
			
		||||
| 
						 | 
				
			
			@ -460,7 +460,7 @@ enum nn_xmsg_kind nn_xmsg_kind (const struct nn_xmsg *m)
 | 
			
		|||
  return m->kind;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void nn_xmsg_guid_seq_fragid (const struct nn_xmsg *m, nn_guid_t *wrguid, seqno_t *wrseq, nn_fragment_number_t *wrfragid)
 | 
			
		||||
void nn_xmsg_guid_seq_fragid (const struct nn_xmsg *m, ddsi_guid_t *wrguid, seqno_t *wrseq, nn_fragment_number_t *wrfragid)
 | 
			
		||||
{
 | 
			
		||||
  assert (m->kind != NN_XMSG_KIND_CONTROL);
 | 
			
		||||
  *wrguid = m->kindspecific.data.wrguid;
 | 
			
		||||
| 
						 | 
				
			
			@ -577,7 +577,7 @@ void nn_xmsg_serdata (struct nn_xmsg *m, struct ddsi_serdata *serdata, size_t of
 | 
			
		|||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void nn_xmsg_setdst1 (struct nn_xmsg *m, const nn_guid_prefix_t *gp, const nn_locator_t *loc)
 | 
			
		||||
void nn_xmsg_setdst1 (struct nn_xmsg *m, const ddsi_guid_prefix_t *gp, const nn_locator_t *loc)
 | 
			
		||||
{
 | 
			
		||||
  assert (m->dstmode == NN_XMSG_DST_UNSET);
 | 
			
		||||
  m->dstmode = NN_XMSG_DST_ONE;
 | 
			
		||||
| 
						 | 
				
			
			@ -620,7 +620,7 @@ void nn_xmsg_setdstN (struct nn_xmsg *m, struct addrset *as, struct addrset *as_
 | 
			
		|||
  m->dstaddr.all.as_group = ref_addrset (as_group);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void nn_xmsg_set_data_readerId (struct nn_xmsg *m, nn_entityid_t *readerId)
 | 
			
		||||
void nn_xmsg_set_data_readerId (struct nn_xmsg *m, ddsi_entityid_t *readerId)
 | 
			
		||||
{
 | 
			
		||||
  assert (m->kind == NN_XMSG_KIND_DATA_REXMIT);
 | 
			
		||||
  assert (m->kindspecific.data.readerId_off == 0);
 | 
			
		||||
| 
						 | 
				
			
			@ -633,21 +633,21 @@ static void clear_readerId (struct nn_xmsg *m)
 | 
			
		|||
{
 | 
			
		||||
  assert (m->kind == NN_XMSG_KIND_DATA_REXMIT);
 | 
			
		||||
  assert (m->kindspecific.data.readerId_off != 0);
 | 
			
		||||
  *((nn_entityid_t *) (m->data->payload + m->kindspecific.data.readerId_off)) =
 | 
			
		||||
  *((ddsi_entityid_t *) (m->data->payload + m->kindspecific.data.readerId_off)) =
 | 
			
		||||
    nn_hton_entityid (to_entityid (NN_ENTITYID_UNKNOWN));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static nn_entityid_t load_readerId (const struct nn_xmsg *m)
 | 
			
		||||
static ddsi_entityid_t load_readerId (const struct nn_xmsg *m)
 | 
			
		||||
{
 | 
			
		||||
  assert (m->kind == NN_XMSG_KIND_DATA_REXMIT);
 | 
			
		||||
  assert (m->kindspecific.data.readerId_off != 0);
 | 
			
		||||
  return nn_ntoh_entityid (*((nn_entityid_t *) (m->data->payload + m->kindspecific.data.readerId_off)));
 | 
			
		||||
  return nn_ntoh_entityid (*((ddsi_entityid_t *) (m->data->payload + m->kindspecific.data.readerId_off)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int readerId_compatible (const struct nn_xmsg *m, const struct nn_xmsg *madd)
 | 
			
		||||
{
 | 
			
		||||
  nn_entityid_t e = load_readerId (m);
 | 
			
		||||
  nn_entityid_t eadd = load_readerId (madd);
 | 
			
		||||
  ddsi_entityid_t e = load_readerId (m);
 | 
			
		||||
  ddsi_entityid_t eadd = load_readerId (madd);
 | 
			
		||||
  return e.u == NN_ENTITYID_UNKNOWN || e.u == eadd.u;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -750,13 +750,13 @@ int nn_xmsg_setencoderid (struct nn_xmsg *msg, uint32_t encoderid)
 | 
			
		|||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void nn_xmsg_setwriterseq (struct nn_xmsg *msg, const nn_guid_t *wrguid, seqno_t wrseq)
 | 
			
		||||
void nn_xmsg_setwriterseq (struct nn_xmsg *msg, const ddsi_guid_t *wrguid, seqno_t wrseq)
 | 
			
		||||
{
 | 
			
		||||
  msg->kindspecific.data.wrguid = *wrguid;
 | 
			
		||||
  msg->kindspecific.data.wrseq = wrseq;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void nn_xmsg_setwriterseq_fragid (struct nn_xmsg *msg, const nn_guid_t *wrguid, seqno_t wrseq, nn_fragment_number_t wrfragid)
 | 
			
		||||
void nn_xmsg_setwriterseq_fragid (struct nn_xmsg *msg, const ddsi_guid_t *wrguid, seqno_t wrseq, nn_fragment_number_t wrfragid)
 | 
			
		||||
{
 | 
			
		||||
  nn_xmsg_setwriterseq (msg, wrguid, wrseq);
 | 
			
		||||
  msg->kindspecific.data.wrfragid = wrfragid;
 | 
			
		||||
| 
						 | 
				
			
			@ -838,7 +838,7 @@ int nn_xmsg_addpar_sentinel_ifparam (struct nn_xmsg * m)
 | 
			
		|||
 | 
			
		||||
static void nn_xmsg_chain_release (struct q_globals *gv, struct nn_xmsg_chain *chain)
 | 
			
		||||
{
 | 
			
		||||
  nn_guid_t wrguid;
 | 
			
		||||
  ddsi_guid_t wrguid;
 | 
			
		||||
  memset (&wrguid, 0, sizeof (wrguid));
 | 
			
		||||
 | 
			
		||||
  while (chain->latest)
 | 
			
		||||
| 
						 | 
				
			
			@ -1385,7 +1385,7 @@ static int nn_xpack_mayaddmsg (const struct nn_xpack *xp, const struct nn_xmsg *
 | 
			
		|||
  return addressing_info_eq_onesidederr (xp, m);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int guid_prefix_eq (const nn_guid_prefix_t *a, const nn_guid_prefix_t *b)
 | 
			
		||||
static int guid_prefix_eq (const ddsi_guid_prefix_t *a, const ddsi_guid_prefix_t *b)
 | 
			
		||||
{
 | 
			
		||||
  return a->u[0] == b->u[0] && a->u[1] == b->u[1] && a->u[2] == b->u[2];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1395,7 +1395,7 @@ int nn_xpack_addmsg (struct nn_xpack *xp, struct nn_xmsg *m, const uint32_t flag
 | 
			
		|||
  /* Returns > 0 if pack got sent out before adding m */
 | 
			
		||||
  struct q_globals const * const gv = xp->gv;
 | 
			
		||||
  static InfoDST_t static_zero_dst = {
 | 
			
		||||
    { SMID_INFO_DST, (DDSRT_ENDIAN == DDSRT_LITTLE_ENDIAN ? SMFLAG_ENDIANNESS : 0), sizeof (nn_guid_prefix_t) },
 | 
			
		||||
    { SMID_INFO_DST, (DDSRT_ENDIAN == DDSRT_LITTLE_ENDIAN ? SMFLAG_ENDIANNESS : 0), sizeof (ddsi_guid_prefix_t) },
 | 
			
		||||
    { { 0,0,0,0, 0,0,0,0, 0,0,0,0 } }
 | 
			
		||||
  };
 | 
			
		||||
  InfoDST_t *dst;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,7 @@
 | 
			
		|||
#include "dds/ddsi/q_gc.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_serdata.h"
 | 
			
		||||
#include "dds__topic.h"
 | 
			
		||||
#include "dds__rhc.h"
 | 
			
		||||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
#include "dds__rhc_default.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_iid.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -108,7 +108,7 @@ static uint64_t store (struct ddsi_tkmap *tkmap, struct dds_rhc *rhc, struct pro
 | 
			
		|||
{
 | 
			
		||||
  /* beware: unrefs sd */
 | 
			
		||||
  struct ddsi_tkmap_instance *tk;
 | 
			
		||||
  struct proxy_writer_info pwr_info;
 | 
			
		||||
  struct ddsi_writer_info pwr_info;
 | 
			
		||||
  /* single-domain application ... so domain won't change */
 | 
			
		||||
  thread_state_awake_domain_ok (lookup_thread_state ());
 | 
			
		||||
  tk = ddsi_tkmap_lookup_instance_ref (tkmap, sd);
 | 
			
		||||
| 
						 | 
				
			
			@ -782,7 +782,7 @@ static void test_conditions (dds_entity_t pp, dds_entity_t tp, const int count,
 | 
			
		|||
      }
 | 
			
		||||
      case 11: {
 | 
			
		||||
        thread_state_awake_domain_ok (lookup_thread_state ());
 | 
			
		||||
        struct proxy_writer_info wr_info;
 | 
			
		||||
        struct ddsi_writer_info wr_info;
 | 
			
		||||
        wr_info.auto_dispose = wr[which]->c.xqos->writer_data_lifecycle.autodispose_unregistered_instances;
 | 
			
		||||
        wr_info.guid = wr[which]->e.guid;
 | 
			
		||||
        wr_info.iid = wr[which]->e.iid;
 | 
			
		||||
| 
						 | 
				
			
			@ -890,7 +890,7 @@ int main (int argc, char **argv)
 | 
			
		|||
    };
 | 
			
		||||
    rdall (rhc, c1, print, states_seen);
 | 
			
		||||
    thread_state_awake_domain_ok (lookup_thread_state ());
 | 
			
		||||
    struct proxy_writer_info wr0_info;
 | 
			
		||||
    struct ddsi_writer_info wr0_info;
 | 
			
		||||
    wr0_info.auto_dispose = wr0->c.xqos->writer_data_lifecycle.autodispose_unregistered_instances;
 | 
			
		||||
    wr0_info.guid = wr0->e.guid;
 | 
			
		||||
    wr0_info.iid = wr0->e.iid;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue