Пример #1
0
DDS_ReturnCode_t DDS_DataWriter_get_matched_subscription_data (
				DDS_DataWriter                   wp,
				DDS_SubscriptionBuiltinTopicData *data,
				DDS_InstanceHandle_t             handle)
{
	Entity_t		*ep;
	DDS_ReturnCode_t	ret;

	ctrc_begind (DCPS_ID, DCPS_DW_G_SUBS_D, &wp, sizeof (wp));
	ctrc_contd (&data, sizeof (data));
	ctrc_contd (&handle, sizeof (handle));
	ctrc_endd ();

	if (!data || !handle)
		return (DDS_RETCODE_BAD_PARAMETER);

	if (!writer_ptr (wp, 1, &ret))
		return (ret);

	ep = entity_ptr (handle);
	if (!ep ||
	     ep->type != ET_READER ||
	     entity_ignored (ep->flags)) {
		ret = DDS_RETCODE_BAD_PARAMETER;
		goto done;
	}
	if (entity_discovered (ep->flags))
		ret = dcps_get_builtin_subscription_data (data, (DiscoveredReader_t *) ep);
	else
		ret = dcps_get_local_subscription_data (data, (Reader_t *) ep);

    done:
	lock_release (wp->w_lock);
	return (ret);
}
Пример #2
0
DDS_ReturnCode_t DDS_DomainParticipant_ignore_publication (DDS_DomainParticipant dp,
						           DDS_InstanceHandle_t handle)
{
	Entity_t		*ep;
	DDS_ReturnCode_t	ret;

	ctrc_begind (DCPS_ID, DCPS_DP_IGN_PUB, &dp, sizeof (dp));
	ctrc_contd (&handle, sizeof (handle));
	ctrc_endd ();

	if (!domain_ptr (dp, 1, &ret))
		return (ret);

	if ((dp->participant.p_flags & EF_ENABLED) == 0) {
		lock_release (dp->lock);
		return (DDS_RETCODE_NOT_ENABLED);
	}
	ep = entity_ptr (handle);
	if (!ep ||
	    ep->type != ET_WRITER ||
	    !entity_discovered (ep->flags)) {
		ret = DDS_RETCODE_ALREADY_DELETED;
		goto done;
	}
	ret = disc_ignore_writer ((DiscoveredWriter_t *) ep);

    done:
	lock_release (dp->lock);
	return (ret);
}
Пример #3
0
static int topic_add_handle (Skiplist_t *list, void *node, void *arg)
{
	const Topic_t		*tp, **tpp = (const Topic_t **) node;
	DDS_InstanceHandleSeq	*handles = (DDS_InstanceHandleSeq *) arg;
	DDS_InstanceHandle_t	h;

	ARG_NOT_USED (list)

	tp = *tpp;
	if (!entity_discovered (tp->entity.flags) ||
	    entity_ignored (tp->entity.flags))
		return (1);

	h = tp->entity.handle;
	return (dds_seq_append (handles, &h) == 0);
}
Пример #4
0
DDS_ReturnCode_t DDS_DomainParticipant_get_discovered_topic_data (
					DDS_DomainParticipant     dp,
					DDS_TopicBuiltinTopicData *data,
					DDS_InstanceHandle_t      handle)
{
	Entity_t		*ep;
	DDS_ReturnCode_t	ret;

	ctrc_begind (DCPS_ID, DCPS_DP_G_DISC_T, &dp, sizeof (dp));
	ctrc_contd (&data, sizeof (data));
	ctrc_contd (&handle, sizeof (handle));
	ctrc_endd ();

	if (!data || !handle)
		return (DDS_RETCODE_BAD_PARAMETER);

	if (!domain_ptr (dp, 1, &ret))
		return (ret);

	if ((dp->participant.p_flags & EF_ENABLED) == 0) {
		lock_release (dp->lock);
		return (DDS_RETCODE_NOT_ENABLED);
	}
	ep = entity_ptr (handle);
	if (!ep ||
	     ep->type != ET_TOPIC ||
	     !entity_discovered (ep->flags) ||
	     entity_ignored (ep->flags)) {
		ret = DDS_RETCODE_BAD_PARAMETER;
		goto done;
	}
	if (dcps_get_builtin_topic_data (data, (Topic_t *) ep, 0)) {
		ret = DDS_RETCODE_OUT_OF_RESOURCES;
		goto done;
	}

    done:
	lock_release (dp->lock);
	return (ret);
}
Пример #5
0
static void topic_type_promote_tc_eps (Endpoint_t *ep, TPTC_t *tp, int dwriter)
{
	unsigned char	**tcp;

	for (; ep; ep = ep->next) {
		if (!entity_discovered (ep->entity.flags))
			continue;

		if (dwriter)
			tcp = &((DiscoveredWriter_t *) ep)->dw_tc;
		else
			tcp = &((DiscoveredReader_t *) ep)->dr_tc;
		if (!*tcp || *tcp == (unsigned char *) ~0UL)
			continue;

		if ((tp->eq_tc && 
		     (*tcp == tp->eq_tc || vtc_equal (tp->eq_tc, *tcp))) ||
		    vtc_identical (tp->ts, *tcp)) {
			vtc_free (*tcp);
			*tcp = (unsigned char *) ~0UL;
		}
	}
}