Clean up return code types
* Remove dds_return_t / dds_retcode_t distinction (now there is only dds_return_t and all error codes are always negative) * Remove Q_ERR_... error codes and replace them by DDS_RETCODE_... ones so that there is only one set of error codes * Replace a whole bunch "int" return types that were used to return Q_ERR_... codes by "dds_return_t" return types Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
a652ecb78e
commit
19aec98b8a
126 changed files with 1565 additions and 1722 deletions
|
@ -86,7 +86,6 @@ PREPEND(hdrs_private_ddsi "${CMAKE_CURRENT_LIST_DIR}/include/dds/ddsi"
|
|||
q_debmon.h
|
||||
q_entity.h
|
||||
q_ephash.h
|
||||
q_error.h
|
||||
q_feature_check.h
|
||||
q_freelist.h
|
||||
q_gc.h
|
||||
|
|
|
@ -28,8 +28,8 @@ struct ddsi_ssl_plugins
|
|||
void (*fini) (void);
|
||||
void (*ssl_free) (SSL *ssl);
|
||||
void (*bio_vfree) (BIO *bio);
|
||||
ssize_t (*read) (SSL *ssl, void *buf, size_t len, dds_retcode_t *err);
|
||||
ssize_t (*write) (SSL *ssl, const void *msg, size_t len, dds_retcode_t *err);
|
||||
ssize_t (*read) (SSL *ssl, void *buf, size_t len, dds_return_t *err);
|
||||
ssize_t (*write) (SSL *ssl, const void *msg, size_t len, dds_return_t *err);
|
||||
SSL * (*connect) (ddsrt_socket_t sock);
|
||||
BIO * (*listen) (ddsrt_socket_t sock);
|
||||
SSL * (*accept) (BIO *bio, ddsrt_socket_t *sock);
|
||||
|
|
|
@ -19,7 +19,7 @@ extern "C" {
|
|||
struct ddsi_threadmon;
|
||||
|
||||
struct ddsi_threadmon *ddsi_threadmon_new (void);
|
||||
int ddsi_threadmon_start (struct ddsi_threadmon *sl);
|
||||
dds_return_t ddsi_threadmon_start (struct ddsi_threadmon *sl);
|
||||
void ddsi_threadmon_stop (struct ddsi_threadmon *sl);
|
||||
void ddsi_threadmon_free (struct ddsi_threadmon *sl);
|
||||
void ddsi_threadmon_statechange_barrier (struct ddsi_threadmon *sl);
|
||||
|
|
|
@ -400,9 +400,6 @@ int is_writer_entityid (nn_entityid_t id);
|
|||
int is_reader_entityid (nn_entityid_t id);
|
||||
nn_vendorid_t get_entity_vendorid (const struct entity_common *e);
|
||||
|
||||
int pp_allocate_entityid (nn_entityid_t *id, unsigned kind, struct participant *pp);
|
||||
void pp_release_entityid(struct participant *pp, nn_entityid_t id);
|
||||
|
||||
/* Interface for glue code between the OpenSplice kernel and the DDSI
|
||||
entities. These all return 0 iff successful. All GIDs supplied
|
||||
__MUST_BE_UNIQUE__. All hell may break loose if they aren't.
|
||||
|
@ -456,20 +453,93 @@ void pp_release_entityid(struct participant *pp, nn_entityid_t id);
|
|||
/* Set this flag to mark the participant as an local entity only. */
|
||||
#define RTPS_PF_ONLY_LOCAL 16u
|
||||
|
||||
/* To create a DDSI participant given a GUID. May return ERR_OUT_OF_IDS
|
||||
(a.o.) */
|
||||
int new_participant_guid (const nn_guid_t *ppguid, unsigned flags, const struct nn_plist *plist);
|
||||
/**
|
||||
* @brief Create a new participant with a given GUID in the domain.
|
||||
*
|
||||
* @param[in] ppguid
|
||||
* The GUID of the new participant.
|
||||
* @param[in] flags
|
||||
* Zero or more of:
|
||||
* - RTPS_PF_NO_BUILTIN_READERS do not create discovery readers in new ppant
|
||||
* - RTPS_PF_NO_BUILTIN_WRITERS do not create discvoery writers in new ppant
|
||||
* - RTPS_PF_PRIVILEGED_PP FIXME: figure out how to describe this ...
|
||||
* - RTPS_PF_IS_DDSI2_PP FIXME: OSPL holdover - there is no DDSI2E here
|
||||
* - RTPS_PF_ONLY_LOCAL FIXME: not used, it seems
|
||||
* @param[in] plist
|
||||
* Parameters/QoS for this participant
|
||||
* @param[out] dest
|
||||
* Filled with the recognized parameters in the input if successful, otherwise
|
||||
* initialized to an empty parameter list. Where possible, pointers alias the
|
||||
* input (indicated by the "aliased" bits in the plist/xqos structures), but
|
||||
* some things cannot be aliased (e.g., the array of pointers to strings for a
|
||||
* sequence of strings).
|
||||
* Generally, nn_plist_fini should be called when done with the parameter list,
|
||||
* even when nn_plist_unlias or nn_xqos_unlias hasn't been called.
|
||||
* @param[out] nextafterplist
|
||||
* If non-NULL, *nextafterplist is set to the first byte following the parameter
|
||||
* list sentinel on successful parse, or to NULL on failure
|
||||
*
|
||||
* @returns A dds_return_t indicating success or failure.
|
||||
*
|
||||
* @retval DDS_RETCODE_OK
|
||||
* All parameters valid (or ignored), dest and *nextafterplist have been set
|
||||
* accordingly.
|
||||
* @retval DDS_RETCODE_PRECONDITION_NOT_MET
|
||||
* A participant with GUID *ppguid already exists.
|
||||
* @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, unsigned flags, const struct nn_plist *plist);
|
||||
|
||||
int new_participant (struct nn_guid *ppguid, unsigned flags, const struct nn_plist *plist);
|
||||
/**
|
||||
* @brief Create a new participant in the domain. See also new_participant_guid.
|
||||
*
|
||||
* @param[out] ppguid
|
||||
* On successful return: the GUID of the new participant;
|
||||
* Undefined on error.
|
||||
* @param[in] flags
|
||||
* See new_participant_guid
|
||||
* @param[in] plist
|
||||
* See new_participant_guid
|
||||
*
|
||||
* @returns A dds_return_t indicating success or failure.
|
||||
*
|
||||
* @retval DDS_RETCODE_OK
|
||||
* Success, there is now a local participant with the GUID stored in
|
||||
* *ppguid
|
||||
* @retval DDS_RETCODE_OUT_OF_RESOURCES
|
||||
* Failed to allocate a new GUID (note: currently this will always
|
||||
* happen after 2**24-1 successful calls to new_participant ...).
|
||||
* @retval DDS_RETCODE_OUT_OF_RESOURCES
|
||||
* The configured maximum number of participants has been reached.
|
||||
*/
|
||||
dds_return_t new_participant (struct nn_guid *ppguid, unsigned flags, const struct nn_plist *plist);
|
||||
|
||||
/* To delete a DDSI participant: this only removes the participant
|
||||
from the hash tables and schedules the actual delete operation,
|
||||
which will start doing scary things once all but the DDSI built-in
|
||||
endpoints are gone. It is acceptable to call delete_participant()
|
||||
before all its readers and writers have been deleted (which also
|
||||
fits nicely with model where the glue calls merely schedules
|
||||
garbage-collection). */
|
||||
int delete_participant (const struct nn_guid *ppguid);
|
||||
/**
|
||||
* @brief Initiate the deletion of the participant:
|
||||
* - dispose/unregister built-in topic
|
||||
* - list it as one of the recently deleted participants
|
||||
* - remote it from the GUID hash tables
|
||||
* - schedule the scare stuff to really delete it via the GC
|
||||
*
|
||||
* It is ok to call delete_participant without deleting all DDSI-level
|
||||
* readers/writers: those will simply be deleted. (New ones can't be
|
||||
* created anymore because the participant can no longer be located via
|
||||
* the hash tables).
|
||||
*
|
||||
* @param[in] ppguid
|
||||
* GUID of the participant to be deleted.
|
||||
*
|
||||
* @returns A dds_return_t indicating success or failure.
|
||||
*
|
||||
* @retval DDS_RETCODE_OK
|
||||
* Success, it is no longer visible and GC events have
|
||||
* been scheduled for eventual deleting of all remaining
|
||||
* readers and writers and freeing of memory
|
||||
* @retval DDS_RETCODE_BAD_PARAMETER
|
||||
* ppguid lookup failed.
|
||||
*/
|
||||
dds_return_t delete_participant (const struct nn_guid *ppguid);
|
||||
|
||||
/* 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
|
||||
|
@ -480,9 +550,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_retcode_t new_writer (struct writer **wr_out, struct nn_guid *wrguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc * whc, status_cb_t status_cb, void *status_cb_arg);
|
||||
dds_return_t new_writer (struct writer **wr_out, struct nn_guid *wrguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc * whc, status_cb_t status_cb, void *status_cb_arg);
|
||||
|
||||
dds_retcode_t new_reader (struct reader **rd_out, struct nn_guid *rdguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct rhc * rhc, status_cb_t status_cb, void *status_cb_arg);
|
||||
dds_return_t new_reader (struct reader **rd_out, struct nn_guid *rdguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct rhc * rhc, status_cb_t status_cb, void *status_cb_arg);
|
||||
|
||||
struct whc_node;
|
||||
struct whc_state;
|
||||
|
|
|
@ -1,27 +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 NN_ERROR_H
|
||||
#define NN_ERROR_H
|
||||
|
||||
#define Q_ERR_UNSPECIFIED -1
|
||||
#define Q_ERR_INVALID -2
|
||||
#define Q_ERR_OUT_OF_MEMORY -3
|
||||
#define Q_ERR_ENTITY_EXISTS -4
|
||||
#define Q_ERR_UNKNOWN_ENTITY -5
|
||||
#define Q_ERR_OUT_OF_IDS -6
|
||||
#define Q_ERR_INVALID_DATA -7
|
||||
#define Q_ERR_BUSY -8
|
||||
#define Q_ERR_NO_ADDRESS -9
|
||||
#define Q_ERR_TIMEOUT -10
|
||||
#define Q_ERR_INCOMPATIBLE -11
|
||||
|
||||
#endif /* NN_ERROR_H */
|
|
@ -196,24 +196,68 @@ DDS_EXPORT void nn_plist_init_empty (nn_plist_t *dest);
|
|||
DDS_EXPORT void nn_plist_mergein_missing (nn_plist_t *a, const nn_plist_t *b);
|
||||
DDS_EXPORT void nn_plist_copy (nn_plist_t *dst, const nn_plist_t *src);
|
||||
DDS_EXPORT nn_plist_t *nn_plist_dup (const nn_plist_t *src);
|
||||
DDS_EXPORT int nn_plist_init_frommsg (nn_plist_t *dest, char **nextafterplist, uint64_t pwanted, uint64_t qwanted, const nn_plist_src_t *src);
|
||||
|
||||
/**
|
||||
* @brief Initialize an nn_plist_t from a PL_CDR_{LE,BE} paylaod.
|
||||
*
|
||||
* @param[in] pwanted
|
||||
* PP_... flags indicating which non-QoS parameters are of interest, treated as
|
||||
* a hint. Parameters in the input that are outside the mask may or may not be
|
||||
* ignored.
|
||||
* @param[in] qwanted
|
||||
* QP_... flags indicating which QoS settings are of interest, and is treated as
|
||||
* a hint. Parameters in the input that are outside the mask may or may not be
|
||||
* ignored.
|
||||
* @param[in] src
|
||||
* Serialized payload to be parsed, validated and copied into dest
|
||||
* - protocol_version is the version protocol version according to which the list
|
||||
* should be parsed
|
||||
* - vendorid is the vendor id code for the source of the parameter list (for
|
||||
* handling vendor-specific parameters and compatibility workarounds)
|
||||
* - encoding is PL_CDR_LE or PL_CDR_BE
|
||||
* - buf is a pointer to the first parameter header
|
||||
* - bufsz is the size in bytes of the input buffer
|
||||
* @param[out] dest
|
||||
* Filled with the recognized parameters in the input if successful, otherwise
|
||||
* initialized to an empty parameter list. Where possible, pointers alias the
|
||||
* input (indicated by the "aliased" bits in the plist/xqos structures), but
|
||||
* some things cannot be aliased (e.g., the array of pointers to strings for a
|
||||
* sequence of strings).
|
||||
* Generally, nn_plist_fini should be called when done with the parameter list,
|
||||
* even when nn_plist_unlias or nn_xqos_unlias hasn't been called.
|
||||
* @param[out] nextafterplist
|
||||
* If non-NULL, *nextafterplist is set to the first byte following the parameter
|
||||
* list sentinel on successful parse, or to NULL on failure
|
||||
*
|
||||
* @returns A dds_return_t indicating success or failure.
|
||||
*
|
||||
* @retval DDS_RETCODE_OK
|
||||
* All parameters valid (or ignored), dest and *nextafterplist have been set
|
||||
* accordingly.
|
||||
* @retval DDS_RETCODE_BAD_PARAMETER
|
||||
* Input contained invalid data; dest is cleared, *nextafterplist is NULL.
|
||||
* @retval DDS_RETCODE_UNSUPPORTED
|
||||
* Input contained an unrecognized parameter with the "incompatible-if-unknown"
|
||||
* flag set; dest is cleared, *nextafterplist is NULL.
|
||||
*/
|
||||
DDS_EXPORT dds_return_t nn_plist_init_frommsg (nn_plist_t *dest, char **nextafterplist, uint64_t pwanted, uint64_t qwanted, const nn_plist_src_t *src);
|
||||
DDS_EXPORT void nn_plist_fini (nn_plist_t *ps);
|
||||
DDS_EXPORT void nn_plist_addtomsg (struct nn_xmsg *m, const nn_plist_t *ps, uint64_t pwanted, uint64_t qwanted);
|
||||
DDS_EXPORT int nn_plist_init_default_participant (nn_plist_t *plist);
|
||||
DDS_EXPORT void nn_plist_init_default_participant (nn_plist_t *plist);
|
||||
|
||||
DDS_EXPORT int validate_history_qospolicy (const nn_history_qospolicy_t *q);
|
||||
DDS_EXPORT int validate_durability_qospolicy (const nn_durability_qospolicy_t *q);
|
||||
DDS_EXPORT int validate_resource_limits_qospolicy (const nn_resource_limits_qospolicy_t *q);
|
||||
DDS_EXPORT int validate_history_and_resource_limits (const nn_history_qospolicy_t *qh, const nn_resource_limits_qospolicy_t *qr);
|
||||
DDS_EXPORT int validate_durability_service_qospolicy (const nn_durability_service_qospolicy_t *q);
|
||||
DDS_EXPORT int validate_liveliness_qospolicy (const nn_liveliness_qospolicy_t *q);
|
||||
DDS_EXPORT int validate_destination_order_qospolicy (const nn_destination_order_qospolicy_t *q);
|
||||
DDS_EXPORT int validate_ownership_qospolicy (const nn_ownership_qospolicy_t *q);
|
||||
DDS_EXPORT int validate_ownership_strength_qospolicy (const nn_ownership_strength_qospolicy_t *q);
|
||||
DDS_EXPORT int validate_presentation_qospolicy (const nn_presentation_qospolicy_t *q);
|
||||
DDS_EXPORT int validate_transport_priority_qospolicy (const nn_transport_priority_qospolicy_t *q);
|
||||
DDS_EXPORT int validate_reader_data_lifecycle (const nn_reader_data_lifecycle_qospolicy_t *q);
|
||||
DDS_EXPORT int validate_duration (const nn_duration_t *d);
|
||||
DDS_EXPORT dds_return_t validate_history_qospolicy (const nn_history_qospolicy_t *q);
|
||||
DDS_EXPORT dds_return_t validate_durability_qospolicy (const nn_durability_qospolicy_t *q);
|
||||
DDS_EXPORT dds_return_t validate_resource_limits_qospolicy (const nn_resource_limits_qospolicy_t *q);
|
||||
DDS_EXPORT dds_return_t validate_history_and_resource_limits (const nn_history_qospolicy_t *qh, const nn_resource_limits_qospolicy_t *qr);
|
||||
DDS_EXPORT dds_return_t validate_durability_service_qospolicy (const nn_durability_service_qospolicy_t *q);
|
||||
DDS_EXPORT dds_return_t validate_liveliness_qospolicy (const nn_liveliness_qospolicy_t *q);
|
||||
DDS_EXPORT dds_return_t validate_destination_order_qospolicy (const nn_destination_order_qospolicy_t *q);
|
||||
DDS_EXPORT dds_return_t validate_ownership_qospolicy (const nn_ownership_qospolicy_t *q);
|
||||
DDS_EXPORT dds_return_t validate_ownership_strength_qospolicy (const nn_ownership_strength_qospolicy_t *q);
|
||||
DDS_EXPORT dds_return_t validate_presentation_qospolicy (const nn_presentation_qospolicy_t *q);
|
||||
DDS_EXPORT dds_return_t validate_transport_priority_qospolicy (const nn_transport_priority_qospolicy_t *q);
|
||||
DDS_EXPORT dds_return_t validate_reader_data_lifecycle (const nn_reader_data_lifecycle_qospolicy_t *q);
|
||||
DDS_EXPORT dds_return_t validate_duration (const nn_duration_t *d);
|
||||
|
||||
|
||||
struct nn_rmsg;
|
||||
|
|
|
@ -98,9 +98,9 @@ DDS_EXPORT void thread_states_fini (void);
|
|||
DDS_EXPORT void upgrade_main_thread (void);
|
||||
DDS_EXPORT void downgrade_main_thread (void);
|
||||
DDS_EXPORT const struct config_thread_properties_listelem *lookup_thread_properties (const char *name);
|
||||
DDS_EXPORT dds_retcode_t create_thread (struct thread_state1 **ts, const char *name, uint32_t (*f) (void *arg), void *arg);
|
||||
DDS_EXPORT dds_return_t create_thread (struct thread_state1 **ts, const char *name, uint32_t (*f) (void *arg), void *arg);
|
||||
DDS_EXPORT struct thread_state1 *lookup_thread_state_real (void);
|
||||
DDS_EXPORT int join_thread (struct thread_state1 *ts1);
|
||||
DDS_EXPORT dds_return_t join_thread (struct thread_state1 *ts1);
|
||||
DDS_EXPORT void log_stack_traces (void);
|
||||
DDS_EXPORT void reset_thread_state (struct thread_state1 *ts1);
|
||||
DDS_EXPORT int thread_exists (const char *name);
|
||||
|
|
|
@ -40,7 +40,7 @@ int write_sample_gc_notk (struct thread_state1 * const ts1, struct nn_xpack *xp,
|
|||
int write_sample_nogc_notk (struct thread_state1 * const ts1, struct nn_xpack *xp, struct writer *wr, struct ddsi_serdata *serdata);
|
||||
|
||||
/* When calling the following functions, wr->lock must be held */
|
||||
int 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);
|
||||
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);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ struct xeventq *xeventq_new
|
|||
/* xeventq_free calls callback handlers with t = T_NEVER, at which point they are required to free
|
||||
whatever memory is claimed for the argument and call delete_xevent. */
|
||||
DDS_EXPORT void xeventq_free (struct xeventq *evq);
|
||||
DDS_EXPORT int xeventq_start (struct xeventq *evq, const char *name); /* <0 => error, =0 => ok */
|
||||
DDS_EXPORT dds_return_t xeventq_start (struct xeventq *evq, const char *name); /* <0 => error, =0 => ok */
|
||||
DDS_EXPORT void xeventq_stop (struct xeventq *evq);
|
||||
|
||||
DDS_EXPORT void qxev_msg (struct xeventq *evq, struct nn_xmsg *msg);
|
||||
|
|
|
@ -64,8 +64,8 @@ void nn_xmsg_setdst1 (struct nn_xmsg *m, const nn_guid_prefix_t *gp, const nn_lo
|
|||
/* For sending to a particular proxy reader; this is a convenience
|
||||
routine that extracts a suitable address from the proxy reader's
|
||||
address sets and calls setdst1. */
|
||||
int nn_xmsg_setdstPRD (struct nn_xmsg *m, const struct proxy_reader *prd);
|
||||
int nn_xmsg_setdstPWR (struct nn_xmsg *m, const struct proxy_writer *pwr);
|
||||
dds_return_t nn_xmsg_setdstPRD (struct nn_xmsg *m, const struct proxy_reader *prd);
|
||||
dds_return_t nn_xmsg_setdstPWR (struct nn_xmsg *m, const struct proxy_writer *pwr);
|
||||
|
||||
/* For sending to all in the address set AS -- typically, the writer's
|
||||
address set to multicast to all matched readers */
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "dds/ddsi/q_nwif.h"
|
||||
#include "dds/ddsi/q_config.h"
|
||||
#include "dds/ddsi/q_log.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/q_pcap.h"
|
||||
#include "dds/ddsi/q_globals.h"
|
||||
#include "dds/ddsrt/atomics.h"
|
||||
|
@ -69,7 +68,7 @@ static char *ddsi_raweth_to_string (ddsi_tran_factory_t tran, char *dst, size_t
|
|||
|
||||
static ssize_t ddsi_raweth_conn_read (ddsi_tran_conn_t conn, unsigned char * buf, size_t len, bool allow_spurious, nn_locator_t *srcloc)
|
||||
{
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
ssize_t ret = 0;
|
||||
struct msghdr msghdr;
|
||||
struct sockaddr_ll src;
|
||||
|
@ -127,7 +126,7 @@ static ssize_t ddsi_raweth_conn_read (ddsi_tran_conn_t conn, unsigned char * buf
|
|||
static ssize_t ddsi_raweth_conn_write (ddsi_tran_conn_t conn, const nn_locator_t *dst, size_t niov, const ddsrt_iovec_t *iov, uint32_t flags)
|
||||
{
|
||||
ddsi_raweth_conn_t uc = (ddsi_raweth_conn_t) conn;
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
ssize_t ret;
|
||||
unsigned retry = 2;
|
||||
int sendflags = 0;
|
||||
|
@ -191,7 +190,7 @@ static int ddsi_raweth_conn_locator (ddsi_tran_base_t base, nn_locator_t *loc)
|
|||
static ddsi_tran_conn_t ddsi_raweth_create_conn (uint32_t port, ddsi_tran_qos_t qos)
|
||||
{
|
||||
ddsrt_socket_t sock;
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
ddsi_raweth_conn_t uc = NULL;
|
||||
struct sockaddr_ll addr;
|
||||
bool mcast = (bool) (qos ? qos->m_multicast : 0);
|
||||
|
|
|
@ -63,7 +63,7 @@ static int ddsi_ssl_verify (int ok, X509_STORE_CTX *store)
|
|||
return ok;
|
||||
}
|
||||
|
||||
static ssize_t ddsi_ssl_read (SSL *ssl, void *buf, size_t len, dds_retcode_t *rc)
|
||||
static ssize_t ddsi_ssl_read (SSL *ssl, void *buf, size_t len, dds_return_t *rc)
|
||||
{
|
||||
assert (len <= INT32_MAX);
|
||||
if (SSL_get_shutdown (ssl) != 0)
|
||||
|
@ -95,7 +95,7 @@ static ssize_t ddsi_ssl_read (SSL *ssl, void *buf, size_t len, dds_retcode_t *rc
|
|||
return rcvd;
|
||||
}
|
||||
|
||||
static ssize_t ddsi_ssl_write (SSL *ssl, const void *buf, size_t len, dds_retcode_t *rc)
|
||||
static ssize_t ddsi_ssl_write (SSL *ssl, const void *buf, size_t len, dds_return_t *rc)
|
||||
{
|
||||
assert(len <= INT32_MAX);
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ static unsigned short get_socket_port (ddsrt_socket_t socket)
|
|||
{
|
||||
struct sockaddr_storage addr;
|
||||
socklen_t addrlen = sizeof (addr);
|
||||
dds_retcode_t ret;
|
||||
dds_return_t ret;
|
||||
|
||||
ret = ddsrt_getsockname(socket, (struct sockaddr *)&addr, &addrlen);
|
||||
if (ret != DDS_RETCODE_OK) {
|
||||
|
@ -197,7 +197,7 @@ static void ddsi_tcp_conn_connect (ddsi_tcp_conn_t conn, const ddsrt_msghdr_t *
|
|||
{
|
||||
char buff[DDSI_LOCSTRLEN];
|
||||
ddsrt_socket_t sock;
|
||||
dds_retcode_t ret;
|
||||
dds_return_t ret;
|
||||
|
||||
ddsi_tcp_sock_new (&sock, 0);
|
||||
if (sock != DDSRT_INVALID_SOCKET)
|
||||
|
@ -341,7 +341,7 @@ static ddsi_tcp_conn_t ddsi_tcp_cache_find (const ddsrt_msghdr_t * msg)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t ddsi_tcp_conn_read_plain (ddsi_tcp_conn_t tcp, void * buf, size_t len, dds_retcode_t *rc)
|
||||
static ssize_t ddsi_tcp_conn_read_plain (ddsi_tcp_conn_t tcp, void * buf, size_t len, dds_return_t *rc)
|
||||
{
|
||||
ssize_t rcvd = -1;
|
||||
|
||||
|
@ -352,7 +352,7 @@ static ssize_t ddsi_tcp_conn_read_plain (ddsi_tcp_conn_t tcp, void * buf, size_t
|
|||
}
|
||||
|
||||
#ifdef DDSI_INCLUDE_SSL
|
||||
static ssize_t ddsi_tcp_conn_read_ssl (ddsi_tcp_conn_t tcp, void * buf, size_t len, dds_retcode_t *rc)
|
||||
static ssize_t ddsi_tcp_conn_read_ssl (ddsi_tcp_conn_t tcp, void * buf, size_t len, dds_return_t *rc)
|
||||
{
|
||||
return (ddsi_tcp_ssl_plugin.read) (tcp->m_ssl, buf, len, rc);
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ static ssize_t ddsi_tcp_conn_read_ssl (ddsi_tcp_conn_t tcp, void * buf, size_t l
|
|||
|
||||
static bool ddsi_tcp_select (ddsrt_socket_t sock, bool read, size_t pos)
|
||||
{
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
fd_set fds;
|
||||
fd_set * rdset = read ? &fds : NULL;
|
||||
fd_set * wrset = read ? NULL : &fds;
|
||||
|
@ -395,9 +395,9 @@ static bool ddsi_tcp_select (ddsrt_socket_t sock, bool read, size_t pos)
|
|||
|
||||
static ssize_t ddsi_tcp_conn_read (ddsi_tran_conn_t conn, unsigned char * buf, size_t len, bool allow_spurious, nn_locator_t *srcloc)
|
||||
{
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
ddsi_tcp_conn_t tcp = (ddsi_tcp_conn_t) conn;
|
||||
ssize_t (*rd) (ddsi_tcp_conn_t, void *, size_t, dds_retcode_t * err) = ddsi_tcp_conn_read_plain;
|
||||
ssize_t (*rd) (ddsi_tcp_conn_t, void *, size_t, dds_return_t * err) = ddsi_tcp_conn_read_plain;
|
||||
size_t pos = 0;
|
||||
ssize_t n;
|
||||
|
||||
|
@ -452,7 +452,7 @@ static ssize_t ddsi_tcp_conn_read (ddsi_tran_conn_t conn, unsigned char * buf, s
|
|||
return -1;
|
||||
}
|
||||
|
||||
static ssize_t ddsi_tcp_conn_write_plain (ddsi_tcp_conn_t conn, const void * buf, size_t len, dds_retcode_t *rc)
|
||||
static ssize_t ddsi_tcp_conn_write_plain (ddsi_tcp_conn_t conn, const void * buf, size_t len, dds_return_t *rc)
|
||||
{
|
||||
ssize_t sent = -1;
|
||||
int sendflags = 0;
|
||||
|
@ -466,7 +466,7 @@ static ssize_t ddsi_tcp_conn_write_plain (ddsi_tcp_conn_t conn, const void * buf
|
|||
}
|
||||
|
||||
#ifdef DDSI_INCLUDE_SSL
|
||||
static ssize_t ddsi_tcp_conn_write_ssl (ddsi_tcp_conn_t conn, const void * buf, size_t len, dds_retcode_t *rc)
|
||||
static ssize_t ddsi_tcp_conn_write_ssl (ddsi_tcp_conn_t conn, const void * buf, size_t len, dds_return_t *rc)
|
||||
{
|
||||
return (ddsi_tcp_ssl_plugin.write) (conn->m_ssl, buf, len, rc);
|
||||
}
|
||||
|
@ -474,7 +474,7 @@ static ssize_t ddsi_tcp_conn_write_ssl (ddsi_tcp_conn_t conn, const void * buf,
|
|||
|
||||
static ssize_t ddsi_tcp_block_write
|
||||
(
|
||||
ssize_t (*wr) (ddsi_tcp_conn_t, const void *, size_t, dds_retcode_t *),
|
||||
ssize_t (*wr) (ddsi_tcp_conn_t, const void *, size_t, dds_return_t *),
|
||||
ddsi_tcp_conn_t conn,
|
||||
const void * buf,
|
||||
size_t sz
|
||||
|
@ -482,7 +482,7 @@ static ssize_t ddsi_tcp_block_write
|
|||
{
|
||||
/* Write all bytes of buf even in the presence of signals,
|
||||
partial writes and blocking (typically write buffer full) */
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
size_t pos = 0;
|
||||
ssize_t n = -1;
|
||||
|
||||
|
@ -615,7 +615,7 @@ static ssize_t ddsi_tcp_conn_write (ddsi_tran_conn_t base, const nn_locator_t *d
|
|||
#endif
|
||||
{
|
||||
int sendflags = 0;
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
#ifdef MSG_NOSIGNAL
|
||||
sendflags |= MSG_NOSIGNAL;
|
||||
#endif
|
||||
|
@ -661,7 +661,7 @@ static ssize_t ddsi_tcp_conn_write (ddsi_tran_conn_t base, const nn_locator_t *d
|
|||
|
||||
if (piecewise)
|
||||
{
|
||||
ssize_t (*wr) (ddsi_tcp_conn_t, const void *, size_t, dds_retcode_t *) = ddsi_tcp_conn_write_plain;
|
||||
ssize_t (*wr) (ddsi_tcp_conn_t, const void *, size_t, dds_return_t *) = ddsi_tcp_conn_write_plain;
|
||||
int i = 0;
|
||||
#ifdef DDSI_INCLUDE_SSL
|
||||
if (ddsi_tcp_ssl_plugin.write)
|
||||
|
@ -749,7 +749,7 @@ static ddsi_tran_conn_t ddsi_tcp_accept (ddsi_tran_listener_t listener)
|
|||
struct sockaddr_storage addr;
|
||||
socklen_t addrlen = sizeof (addr);
|
||||
char buff[DDSI_LOCSTRLEN];
|
||||
dds_retcode_t rc = DDS_RETCODE_OK;
|
||||
dds_return_t rc = DDS_RETCODE_OK;
|
||||
#ifdef DDSI_INCLUDE_SSL
|
||||
SSL * ssl = NULL;
|
||||
#endif
|
||||
|
@ -875,7 +875,7 @@ static ddsi_tran_listener_t ddsi_tcp_create_listener (int port, ddsi_tran_qos_t
|
|||
|
||||
if (sock != DDSRT_INVALID_SOCKET)
|
||||
{
|
||||
dds_retcode_t ret;
|
||||
dds_return_t ret;
|
||||
tl = (ddsi_tcp_listener_t) ddsrt_malloc (sizeof (*tl));
|
||||
memset (tl, 0, sizeof (*tl));
|
||||
|
||||
|
@ -953,7 +953,7 @@ static void ddsi_tcp_unblock_listener (ddsi_tran_listener_t listener)
|
|||
{
|
||||
ddsi_tcp_listener_t tl = (ddsi_tcp_listener_t) listener;
|
||||
ddsrt_socket_t sock;
|
||||
dds_retcode_t ret;
|
||||
dds_return_t ret;
|
||||
|
||||
/* Connect to own listener socket to wake listener from blocking 'accept()' */
|
||||
ddsi_tcp_sock_new (&sock, 0);
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "dds/ddsi/q_thread.h"
|
||||
#include "dds/ddsi/q_time.h"
|
||||
#include "dds/ddsi/q_unused.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/q_globals.h" /* for mattr, cattr */
|
||||
#include "dds/ddsi/q_receive.h"
|
||||
|
||||
|
@ -166,7 +165,7 @@ struct ddsi_threadmon *ddsi_threadmon_new (void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int ddsi_threadmon_start (struct ddsi_threadmon *sl)
|
||||
dds_return_t ddsi_threadmon_start (struct ddsi_threadmon *sl)
|
||||
{
|
||||
ddsrt_mutex_lock (&sl->lock);
|
||||
assert (sl->keepgoing == -1);
|
||||
|
@ -179,7 +178,7 @@ int ddsi_threadmon_start (struct ddsi_threadmon *sl)
|
|||
|
||||
fail_thread:
|
||||
sl->keepgoing = -1;
|
||||
return Q_ERR_UNSPECIFIED;
|
||||
return DDS_RETCODE_ERROR;
|
||||
}
|
||||
|
||||
void ddsi_threadmon_statechange_barrier (struct ddsi_threadmon *sl)
|
||||
|
|
|
@ -54,7 +54,7 @@ static ddsrt_atomic_uint32_t ddsi_udp_init_g = DDSRT_ATOMIC_UINT32_INIT(0);
|
|||
|
||||
static ssize_t ddsi_udp_conn_read (ddsi_tran_conn_t conn, unsigned char * buf, size_t len, bool allow_spurious, nn_locator_t *srcloc)
|
||||
{
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
ssize_t ret = 0;
|
||||
ddsrt_msghdr_t msghdr;
|
||||
struct sockaddr_storage src;
|
||||
|
@ -117,7 +117,7 @@ static void set_msghdr_iov (ddsrt_msghdr_t *mhdr, ddsrt_iovec_t *iov, size_t iov
|
|||
|
||||
static ssize_t ddsi_udp_conn_write (ddsi_tran_conn_t conn, const nn_locator_t *dst, size_t niov, const ddsrt_iovec_t *iov, uint32_t flags)
|
||||
{
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
ssize_t ret = -1;
|
||||
unsigned retry = 2;
|
||||
int sendflags = 0;
|
||||
|
@ -214,7 +214,7 @@ static int ddsi_udp_conn_locator (ddsi_tran_base_t base, nn_locator_t *loc)
|
|||
|
||||
static unsigned short get_socket_port (ddsrt_socket_t socket)
|
||||
{
|
||||
dds_retcode_t ret;
|
||||
dds_return_t ret;
|
||||
struct sockaddr_storage addr;
|
||||
socklen_t addrlen = sizeof (addr);
|
||||
|
||||
|
@ -282,7 +282,7 @@ static ddsi_tran_conn_t ddsi_udp_create_conn
|
|||
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
||||
if ((uc->m_diffserv != 0) && (ddsi_udp_factory_g.m_kind == NN_LOCATOR_KIND_UDPv4))
|
||||
{
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
rc = ddsrt_setsockopt(sock, IPPROTO_IP, IP_TOS, (char *)&uc->m_diffserv, sizeof(uc->m_diffserv));
|
||||
if (rc != DDS_RETCODE_OK)
|
||||
DDS_ERROR("ddsi_udp_create_conn: set diffserv retcode %"PRId32"\n", rc);
|
||||
|
@ -307,7 +307,7 @@ static ddsi_tran_conn_t ddsi_udp_create_conn
|
|||
|
||||
static int joinleave_asm_mcgroup (ddsrt_socket_t socket, int join, const nn_locator_t *mcloc, const struct nn_interface *interf)
|
||||
{
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
struct sockaddr_storage mcip;
|
||||
ddsi_ipaddr_from_loc(&mcip, mcloc);
|
||||
#if DDSRT_HAVE_IPV6
|
||||
|
@ -336,7 +336,7 @@ static int joinleave_asm_mcgroup (ddsrt_socket_t socket, int join, const nn_loca
|
|||
#ifdef DDSI_INCLUDE_SSM
|
||||
static int joinleave_ssm_mcgroup (ddsrt_socket_t socket, int join, const nn_locator_t *srcloc, const nn_locator_t *mcloc, const struct nn_interface *interf)
|
||||
{
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
struct sockaddr_storage mcip, srcip;
|
||||
ddsi_ipaddr_from_loc(&mcip, mcloc);
|
||||
ddsi_ipaddr_from_loc(&srcip, srcloc);
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "dds/ddsi/q_misc.h"
|
||||
#include "dds/ddsi/q_addrset.h"
|
||||
#include "dds/ddsi/q_nwif.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
|
||||
#include "dds/ddsrt/xmlparser.h"
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "dds/ddsi/q_bswap.h"
|
||||
#include "dds/ddsi/q_transmit.h"
|
||||
#include "dds/ddsi/q_lease.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/ddsi_serdata_default.h"
|
||||
#include "dds/ddsi/q_feature_check.h"
|
||||
|
||||
|
@ -793,7 +792,7 @@ static void handle_SPDP (const struct receiver_state *rst, nn_wctime_t timestamp
|
|||
nn_plist_t decoded_data;
|
||||
nn_plist_src_t src;
|
||||
int interesting = 0;
|
||||
int plist_ret;
|
||||
dds_return_t plist_ret;
|
||||
src.protocol_version = rst->protocol_version;
|
||||
src.vendorid = rst->vendor;
|
||||
src.encoding = data->identifier;
|
||||
|
@ -801,7 +800,7 @@ static void handle_SPDP (const struct receiver_state *rst, nn_wctime_t timestamp
|
|||
src.bufsz = len - 4;
|
||||
if ((plist_ret = nn_plist_init_frommsg (&decoded_data, NULL, ~(uint64_t)0, ~(uint64_t)0, &src)) < 0)
|
||||
{
|
||||
if (plist_ret != Q_ERR_INCOMPATIBLE)
|
||||
if (plist_ret != DDS_RETCODE_UNSUPPORTED)
|
||||
DDS_WARNING("SPDP (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
return;
|
||||
}
|
||||
|
@ -1335,7 +1334,7 @@ static void handle_SEDP (const struct receiver_state *rst, nn_wctime_t timestamp
|
|||
{
|
||||
nn_plist_t decoded_data;
|
||||
nn_plist_src_t src;
|
||||
int plist_ret;
|
||||
dds_return_t plist_ret;
|
||||
src.protocol_version = rst->protocol_version;
|
||||
src.vendorid = rst->vendor;
|
||||
src.encoding = data->identifier;
|
||||
|
@ -1343,7 +1342,7 @@ static void handle_SEDP (const struct receiver_state *rst, nn_wctime_t timestamp
|
|||
src.bufsz = len - 4;
|
||||
if ((plist_ret = nn_plist_init_frommsg (&decoded_data, NULL, ~(uint64_t)0, ~(uint64_t)0, &src)) < 0)
|
||||
{
|
||||
if (plist_ret != Q_ERR_INCOMPATIBLE)
|
||||
if (plist_ret != DDS_RETCODE_UNSUPPORTED)
|
||||
DDS_WARNING("SEDP (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
return;
|
||||
}
|
||||
|
@ -1463,7 +1462,7 @@ static void handle_SEDP_CM (const struct receiver_state *rst, nn_entityid_t wr_e
|
|||
{
|
||||
nn_plist_t decoded_data;
|
||||
nn_plist_src_t src;
|
||||
int plist_ret;
|
||||
dds_return_t plist_ret;
|
||||
src.protocol_version = rst->protocol_version;
|
||||
src.vendorid = rst->vendor;
|
||||
src.encoding = data->identifier;
|
||||
|
@ -1471,7 +1470,7 @@ static void handle_SEDP_CM (const struct receiver_state *rst, nn_entityid_t wr_e
|
|||
src.bufsz = len - 4;
|
||||
if ((plist_ret = nn_plist_init_frommsg (&decoded_data, NULL, ~(uint64_t)0, ~(uint64_t)0, &src)) < 0)
|
||||
{
|
||||
if (plist_ret != Q_ERR_INCOMPATIBLE)
|
||||
if (plist_ret != DDS_RETCODE_UNSUPPORTED)
|
||||
DDS_WARNING("SEDP_CM (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
return;
|
||||
}
|
||||
|
@ -1625,7 +1624,7 @@ static void handle_SEDP_GROUP (const struct receiver_state *rst, nn_wctime_t tim
|
|||
{
|
||||
nn_plist_t decoded_data;
|
||||
nn_plist_src_t src;
|
||||
int plist_ret;
|
||||
dds_return_t plist_ret;
|
||||
src.protocol_version = rst->protocol_version;
|
||||
src.vendorid = rst->vendor;
|
||||
src.encoding = data->identifier;
|
||||
|
@ -1633,7 +1632,7 @@ static void handle_SEDP_GROUP (const struct receiver_state *rst, nn_wctime_t tim
|
|||
src.bufsz = len - 4;
|
||||
if ((plist_ret = nn_plist_init_frommsg (&decoded_data, NULL, ~(uint64_t)0, ~(uint64_t)0, &src)) < 0)
|
||||
{
|
||||
if (plist_ret != Q_ERR_INCOMPATIBLE)
|
||||
if (plist_ret != DDS_RETCODE_UNSUPPORTED)
|
||||
DDS_WARNING("SEDP_GROUP (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
return;
|
||||
}
|
||||
|
@ -1748,7 +1747,7 @@ int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const str
|
|||
{
|
||||
nn_plist_src_t src;
|
||||
size_t qos_offset = NN_RDATA_SUBMSG_OFF (fragchain) + offsetof (Data_DataFrag_common_t, octetsToInlineQos) + sizeof (msg->octetsToInlineQos) + msg->octetsToInlineQos;
|
||||
int plist_ret;
|
||||
dds_return_t plist_ret;
|
||||
src.protocol_version = sampleinfo->rst->protocol_version;
|
||||
src.vendorid = sampleinfo->rst->vendor;
|
||||
src.encoding = (msg->smhdr.flags & SMFLAG_ENDIANNESS) ? PL_CDR_LE : PL_CDR_BE;
|
||||
|
@ -1756,7 +1755,7 @@ int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const str
|
|||
src.bufsz = NN_RDATA_PAYLOAD_OFF (fragchain) - qos_offset;
|
||||
if ((plist_ret = nn_plist_init_frommsg (&qos, NULL, PP_STATUSINFO | PP_KEYHASH, 0, &src)) < 0)
|
||||
{
|
||||
if (plist_ret != Q_ERR_INCOMPATIBLE)
|
||||
if (plist_ret != DDS_RETCODE_UNSUPPORTED)
|
||||
DDS_WARNING("data(builtin, vendor %u.%u): "PGUIDFMT" #%"PRId64": invalid inline qos\n",
|
||||
src.vendorid.id[0], src.vendorid.id[1], PGUID (srcguid), sampleinfo->seq);
|
||||
goto done_upd_deliv;
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "dds/ddsi/q_ddsi_discovery.h"
|
||||
#include "dds/ddsi/q_protocol.h" /* NN_ENTITYID_... */
|
||||
#include "dds/ddsi/q_unused.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/q_debmon.h"
|
||||
#include "dds/ddsi/ddsi_serdata.h"
|
||||
#include "dds/ddsi/ddsi_tran.h"
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "dds/ddsi/q_radmin.h"
|
||||
#include "dds/ddsi/q_protocol.h" /* NN_ENTITYID_... */
|
||||
#include "dds/ddsi/q_unused.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/ddsi_serdata_default.h"
|
||||
#include "dds/ddsi/ddsi_mcgroup.h"
|
||||
#include "dds/ddsi/q_receive.h"
|
||||
|
@ -88,8 +87,8 @@ static const unsigned prismtech_builtin_writers_besmask =
|
|||
NN_DISC_BUILTIN_ENDPOINT_CM_PUBLISHER_WRITER |
|
||||
NN_DISC_BUILTIN_ENDPOINT_CM_SUBSCRIBER_WRITER;
|
||||
|
||||
static dds_retcode_t new_writer_guid (struct writer **wr_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc *whc, status_cb_t status_cb, void *status_cbarg);
|
||||
static dds_retcode_t new_reader_guid (struct reader **rd_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct rhc *rhc, status_cb_t status_cb, void *status_cbarg);
|
||||
static dds_return_t new_writer_guid (struct writer **wr_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc *whc, status_cb_t status_cb, void *status_cbarg);
|
||||
static dds_return_t new_reader_guid (struct reader **rd_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct rhc *rhc, status_cb_t status_cb, void *status_cbarg);
|
||||
static struct participant *ref_participant (struct participant *pp, const struct nn_guid *guid_of_refing_entity);
|
||||
static void unref_participant (struct participant *pp, const struct nn_guid *guid_of_refing_entity);
|
||||
static void delete_proxy_group_locked (struct proxy_group *pgroup, nn_wctime_t timestamp, int isimplicit);
|
||||
|
@ -376,7 +375,7 @@ static void remove_deleted_participant_guid (const struct nn_guid *guid, unsigne
|
|||
|
||||
/* PARTICIPANT ------------------------------------------------------ */
|
||||
|
||||
int pp_allocate_entityid(nn_entityid_t *id, unsigned kind, struct participant *pp)
|
||||
static dds_return_t pp_allocate_entityid(nn_entityid_t *id, unsigned kind, struct participant *pp)
|
||||
{
|
||||
uint32_t id1;
|
||||
int ret = 0;
|
||||
|
@ -389,20 +388,20 @@ int pp_allocate_entityid(nn_entityid_t *id, unsigned kind, struct participant *p
|
|||
else
|
||||
{
|
||||
DDS_ERROR("pp_allocate_entityid("PGUIDFMT"): all ids in use\n", PGUID(pp->e.guid));
|
||||
ret = Q_ERR_OUT_OF_IDS;
|
||||
ret = DDS_RETCODE_OUT_OF_RESOURCES;
|
||||
}
|
||||
ddsrt_mutex_unlock (&pp->e.lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void pp_release_entityid(struct participant *pp, nn_entityid_t id)
|
||||
static void pp_release_entityid(struct participant *pp, nn_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);
|
||||
}
|
||||
|
||||
int new_participant_guid (const nn_guid_t *ppguid, unsigned flags, const nn_plist_t *plist)
|
||||
dds_return_t new_participant_guid (const nn_guid_t *ppguid, unsigned flags, const nn_plist_t *plist)
|
||||
{
|
||||
struct participant *pp;
|
||||
nn_guid_t subguid, group_guid;
|
||||
|
@ -420,7 +419,7 @@ int new_participant_guid (const nn_guid_t *ppguid, unsigned flags, const nn_plis
|
|||
used to exist, but is currently being deleted and we're trying to
|
||||
recreate it. */
|
||||
if (ephash_lookup_participant_guid (ppguid) != NULL)
|
||||
return Q_ERR_ENTITY_EXISTS;
|
||||
return DDS_RETCODE_PRECONDITION_NOT_MET;
|
||||
|
||||
if (config.max_participants == 0)
|
||||
{
|
||||
|
@ -440,7 +439,7 @@ int new_participant_guid (const nn_guid_t *ppguid, unsigned flags, const nn_plis
|
|||
{
|
||||
ddsrt_mutex_unlock (&gv.participant_set_lock);
|
||||
DDS_ERROR("new_participant("PGUIDFMT", %x) failed: max participants reached\n", PGUID (*ppguid), flags);
|
||||
return Q_ERR_OUT_OF_IDS;
|
||||
return DDS_RETCODE_OUT_OF_RESOURCES;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -658,7 +657,7 @@ int new_participant_guid (const nn_guid_t *ppguid, unsigned flags, const nn_plis
|
|||
return 0;
|
||||
}
|
||||
|
||||
int new_participant (nn_guid_t *p_ppguid, unsigned flags, const nn_plist_t *plist)
|
||||
dds_return_t new_participant (nn_guid_t *p_ppguid, unsigned flags, const nn_plist_t *plist)
|
||||
{
|
||||
nn_guid_t ppguid;
|
||||
|
||||
|
@ -667,7 +666,7 @@ int new_participant (nn_guid_t *p_ppguid, unsigned flags, const nn_plist_t *plis
|
|||
if (gv.next_ppguid.prefix.u[2]++ == ~0u)
|
||||
{
|
||||
ddsrt_mutex_unlock (&gv.privileged_pp_lock);
|
||||
return Q_ERR_OUT_OF_IDS;
|
||||
return DDS_RETCODE_OUT_OF_RESOURCES;
|
||||
}
|
||||
ddsrt_mutex_unlock (&gv.privileged_pp_lock);
|
||||
*p_ppguid = ppguid;
|
||||
|
@ -858,11 +857,11 @@ static void gc_delete_participant (struct gcreq *gcreq)
|
|||
unref_participant (pp, NULL);
|
||||
}
|
||||
|
||||
int delete_participant (const struct nn_guid *ppguid)
|
||||
dds_return_t delete_participant (const struct nn_guid *ppguid)
|
||||
{
|
||||
struct participant *pp;
|
||||
if ((pp = ephash_lookup_participant_guid (ppguid)) == NULL)
|
||||
return Q_ERR_UNKNOWN_ENTITY;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
ddsi_plugin.builtintopic_write (&pp->e, now(), false);
|
||||
remember_deleted_participant_guid (&pp->e.guid);
|
||||
ephash_remove_participant_guid (pp);
|
||||
|
@ -2821,7 +2820,7 @@ static void new_writer_guid_common_init (struct writer *wr, const struct ddsi_se
|
|||
local_reader_ary_init (&wr->rdary);
|
||||
}
|
||||
|
||||
static dds_retcode_t new_writer_guid (struct writer **wr_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc *whc, status_cb_t status_cb, void *status_entity)
|
||||
static dds_return_t new_writer_guid (struct writer **wr_out, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc *whc, status_cb_t status_cb, void *status_entity)
|
||||
{
|
||||
struct writer *wr;
|
||||
nn_mtime_t tnow = now_mt ();
|
||||
|
@ -2868,24 +2867,25 @@ static dds_retcode_t new_writer_guid (struct writer **wr_out, const struct nn_gu
|
|||
resched_xevent_if_earlier (pp->pmd_update_xevent, tsched);
|
||||
}
|
||||
|
||||
return DDS_RETCODE_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
dds_retcode_t new_writer (struct writer **wr_out, struct nn_guid *wrguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc * whc, status_cb_t status_cb, void *status_cb_arg)
|
||||
dds_return_t new_writer (struct writer **wr_out, struct nn_guid *wrguid, const struct nn_guid *group_guid, const struct nn_guid *ppguid, const struct ddsi_sertopic *topic, const struct nn_xqos *xqos, struct whc * whc, status_cb_t status_cb, void *status_cb_arg)
|
||||
{
|
||||
struct participant *pp;
|
||||
dds_return_t rc;
|
||||
|
||||
if ((pp = ephash_lookup_participant_guid (ppguid)) == NULL)
|
||||
{
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "new_writer - participant "PGUIDFMT" not found\n", PGUID (*ppguid));
|
||||
return DDS_RETCODE_NOT_FOUND;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
/* participant can't be freed while we're mucking around cos we are
|
||||
awake and do not touch the thread's vtime (ephash_lookup already
|
||||
verifies we're awake) */
|
||||
wrguid->prefix = pp->e.guid.prefix;
|
||||
if (pp_allocate_entityid (&wrguid->entityid, NN_ENTITYID_KIND_WRITER_WITH_KEY, pp) < 0)
|
||||
return DDS_RETCODE_OUT_OF_RESOURCES;
|
||||
if ((rc = pp_allocate_entityid (&wrguid->entityid, NN_ENTITYID_KIND_WRITER_WITH_KEY, pp)) < 0)
|
||||
return rc;
|
||||
return new_writer_guid (wr_out, wrguid, group_guid, pp, topic, xqos, whc, status_cb, status_cb_arg);
|
||||
}
|
||||
|
||||
|
@ -3027,7 +3027,7 @@ int delete_writer_nolinger (const struct nn_guid *guid)
|
|||
if ((wr = ephash_lookup_writer_guid (guid)) == NULL)
|
||||
{
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_writer_nolinger(guid "PGUIDFMT") - unknown guid\n", PGUID (*guid));
|
||||
return Q_ERR_UNKNOWN_ENTITY;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_writer_nolinger(guid "PGUIDFMT") ...\n", PGUID (*guid));
|
||||
ddsrt_mutex_lock (&wr->e.lock);
|
||||
|
@ -3050,7 +3050,7 @@ int delete_writer (const struct nn_guid *guid)
|
|||
if ((wr = ephash_lookup_writer_guid (guid)) == NULL)
|
||||
{
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_writer(guid "PGUIDFMT") - unknown guid\n", PGUID (*guid));
|
||||
return Q_ERR_UNKNOWN_ENTITY;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_writer(guid "PGUIDFMT") ...\n", PGUID (*guid));
|
||||
ddsrt_mutex_lock (&wr->e.lock);
|
||||
|
@ -3196,7 +3196,7 @@ static void leave_mcast_helper (const nn_locator_t *n, void * varg)
|
|||
}
|
||||
#endif /* DDSI_INCLUDE_NETWORK_PARTITIONS */
|
||||
|
||||
static dds_retcode_t new_reader_guid
|
||||
static dds_return_t new_reader_guid
|
||||
(
|
||||
struct reader **rd_out,
|
||||
const struct nn_guid *guid,
|
||||
|
@ -3332,10 +3332,10 @@ static dds_retcode_t new_reader_guid
|
|||
match_reader_with_proxy_writers (rd, tnow);
|
||||
match_reader_with_local_writers (rd, tnow);
|
||||
sedp_write_reader (rd);
|
||||
return DDS_RETCODE_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
dds_retcode_t new_reader
|
||||
dds_return_t new_reader
|
||||
(
|
||||
struct reader **rd_out,
|
||||
struct nn_guid *rdguid,
|
||||
|
@ -3349,15 +3349,16 @@ dds_retcode_t new_reader
|
|||
)
|
||||
{
|
||||
struct participant * pp;
|
||||
dds_return_t rc;
|
||||
|
||||
if ((pp = ephash_lookup_participant_guid (ppguid)) == NULL)
|
||||
{
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "new_reader - participant "PGUIDFMT" not found\n", PGUID (*ppguid));
|
||||
return DDS_RETCODE_NOT_FOUND;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
rdguid->prefix = pp->e.guid.prefix;
|
||||
if (pp_allocate_entityid (&rdguid->entityid, NN_ENTITYID_KIND_READER_WITH_KEY, pp) < 0)
|
||||
return DDS_RETCODE_OUT_OF_RESOURCES;
|
||||
if ((rc = pp_allocate_entityid (&rdguid->entityid, NN_ENTITYID_KIND_READER_WITH_KEY, pp)) < 0)
|
||||
return rc;
|
||||
return new_reader_guid (rd_out, rdguid, group_guid, pp, topic, xqos, rhc, status_cb, status_cbarg);
|
||||
}
|
||||
|
||||
|
@ -3415,7 +3416,7 @@ int delete_reader (const struct nn_guid *guid)
|
|||
if ((rd = ephash_lookup_reader_guid (guid)) == NULL)
|
||||
{
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_reader_guid(guid "PGUIDFMT") - unknown guid\n", PGUID (*guid));
|
||||
return Q_ERR_UNKNOWN_ENTITY;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_reader_guid(guid "PGUIDFMT") ...\n", PGUID (*guid));
|
||||
ddsi_plugin.builtintopic_write (&rd->e, now(), false);
|
||||
|
@ -3918,7 +3919,7 @@ int delete_proxy_participant_by_guid (const struct nn_guid * guid, nn_wctime_t t
|
|||
{
|
||||
ddsrt_mutex_unlock (&gv.lock);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "- unknown\n");
|
||||
return Q_ERR_UNKNOWN_ENTITY;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "- deleting\n");
|
||||
ddsi_plugin.builtintopic_write (&ppt->e, timestamp, false);
|
||||
|
@ -3973,7 +3974,7 @@ int new_proxy_group (const struct nn_guid *guid, const char *name, const struct
|
|||
break;
|
||||
default:
|
||||
DDS_WARNING("new_proxy_group: unrecognised entityid: %"PRIx32"\n", guid->entityid.u);
|
||||
return Q_ERR_INVALID_DATA;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
ddsrt_mutex_lock (&proxypp->e.lock);
|
||||
if ((pgroup = ddsrt_avl_lookup_ipath (&proxypp_groups_treedef, &proxypp->groups, guid, &ipath)) != NULL)
|
||||
|
@ -4102,7 +4103,7 @@ int new_proxy_writer (const struct nn_guid *ppguid, const struct nn_guid *guid,
|
|||
if ((proxypp = ephash_lookup_proxy_participant_guid (ppguid)) == NULL)
|
||||
{
|
||||
DDS_WARNING("new_proxy_writer("PGUIDFMT"): proxy participant unknown\n", PGUID (*guid));
|
||||
return Q_ERR_UNKNOWN_ENTITY;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
pwr = ddsrt_malloc (sizeof (*pwr));
|
||||
|
@ -4301,7 +4302,7 @@ int delete_proxy_writer (const struct nn_guid *guid, nn_wctime_t timestamp, int
|
|||
{
|
||||
ddsrt_mutex_unlock (&gv.lock);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "- unknown\n");
|
||||
return Q_ERR_UNKNOWN_ENTITY;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
/* Set "deleting" flag in particular for Lite, to signal to the receive path it can't
|
||||
trust rdary[] anymore, which is because removing the proxy writer from the hash
|
||||
|
@ -4334,7 +4335,7 @@ int new_proxy_reader (const struct nn_guid *ppguid, const struct nn_guid *guid,
|
|||
if ((proxypp = ephash_lookup_proxy_participant_guid (ppguid)) == NULL)
|
||||
{
|
||||
DDS_WARNING("new_proxy_reader("PGUIDFMT"): proxy participant unknown\n", PGUID (*guid));
|
||||
return Q_ERR_UNKNOWN_ENTITY;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
prd = ddsrt_malloc (sizeof (*prd));
|
||||
|
@ -4437,7 +4438,7 @@ int delete_proxy_reader (const struct nn_guid *guid, nn_wctime_t timestamp, int
|
|||
{
|
||||
ddsrt_mutex_unlock (&gv.lock);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "- unknown\n");
|
||||
return Q_ERR_UNKNOWN_ENTITY;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
ddsi_plugin.builtintopic_write (&prd->e, timestamp, false);
|
||||
ephash_remove_proxy_reader_guid (prd);
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include "dds/ddsi/q_addrset.h"
|
||||
#include "dds/ddsi/q_ddsi_discovery.h"
|
||||
#include "dds/ddsi/q_radmin.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/q_thread.h"
|
||||
#include "dds/ddsi/q_ephash.h"
|
||||
#include "dds/ddsi/q_lease.h"
|
||||
|
|
|
@ -96,7 +96,7 @@ static int set_rcvbuf (ddsrt_socket_t socket)
|
|||
uint32_t ReceiveBufferSize;
|
||||
socklen_t optlen = (socklen_t) sizeof (ReceiveBufferSize);
|
||||
uint32_t socket_min_rcvbuf_size;
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
if (config.socket_min_rcvbuf_size.isdefault)
|
||||
socket_min_rcvbuf_size = 1048576;
|
||||
else
|
||||
|
@ -145,7 +145,7 @@ static int set_sndbuf (ddsrt_socket_t socket)
|
|||
{
|
||||
unsigned SendBufferSize;
|
||||
socklen_t optlen = (socklen_t) sizeof(SendBufferSize);
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
rc = ddsrt_getsockopt(
|
||||
socket, SOL_SOCKET, SO_SNDBUF,(char *)&SendBufferSize, &optlen);
|
||||
if (rc == DDS_RETCODE_BAD_PARAMETER) {
|
||||
|
@ -202,7 +202,7 @@ static int set_reuse_options (ddsrt_socket_t socket)
|
|||
/* Set REUSEADDR (if available on platform) for
|
||||
multicast sockets, leave unicast sockets alone. */
|
||||
int one = 1;
|
||||
dds_retcode_t rc = ddsrt_setsockopt (
|
||||
dds_return_t rc = ddsrt_setsockopt (
|
||||
socket, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof (one));
|
||||
if (rc == DDS_RETCODE_BAD_PARAMETER) {
|
||||
DDS_LOG(DDS_LC_CONFIG, "cannot enable address reuse on socket\n");
|
||||
|
@ -217,7 +217,7 @@ static int set_reuse_options (ddsrt_socket_t socket)
|
|||
|
||||
static int bind_socket (ddsrt_socket_t socket, unsigned short port)
|
||||
{
|
||||
dds_retcode_t rc = DDS_RETCODE_ERROR;
|
||||
dds_return_t rc = DDS_RETCODE_ERROR;
|
||||
|
||||
#if DDSRT_HAVE_IPV6
|
||||
if (config.transport_selector == TRANS_TCP6 || config.transport_selector == TRANS_UDP6)
|
||||
|
@ -279,7 +279,7 @@ static int set_mc_options_transmit_ipv4 (ddsrt_socket_t socket)
|
|||
{
|
||||
unsigned char ttl = (unsigned char) config.multicast_ttl;
|
||||
unsigned char loop;
|
||||
dds_retcode_t ret;
|
||||
dds_return_t ret;
|
||||
|
||||
#if (defined(__linux) || defined(__APPLE__)) && !LWIP_SOCKET
|
||||
if (config.use_multicast_if_mreqn)
|
||||
|
@ -348,7 +348,7 @@ int make_socket
|
|||
)
|
||||
{
|
||||
int rc = -2;
|
||||
dds_retcode_t ret;
|
||||
dds_return_t ret;
|
||||
|
||||
#if DDSRT_HAVE_IPV6
|
||||
if (config.transport_selector == TRANS_TCP6 || config.transport_selector == TRANS_UDP6)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -36,7 +36,6 @@
|
|||
#include "dds/ddsi/q_addrset.h"
|
||||
#include "dds/ddsi/q_ddsi_discovery.h"
|
||||
#include "dds/ddsi/q_radmin.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/q_thread.h"
|
||||
#include "dds/ddsi/q_ephash.h"
|
||||
#include "dds/ddsi/q_lease.h"
|
||||
|
@ -1953,7 +1952,7 @@ static int deliver_user_data (const struct nn_rsample_info *sampleinfo, const st
|
|||
{
|
||||
nn_plist_src_t src;
|
||||
size_t qos_offset = NN_RDATA_SUBMSG_OFF (fragchain) + offsetof (Data_DataFrag_common_t, octetsToInlineQos) + sizeof (msg->octetsToInlineQos) + msg->octetsToInlineQos;
|
||||
int plist_ret;
|
||||
dds_return_t plist_ret;
|
||||
src.protocol_version = rst->protocol_version;
|
||||
src.vendorid = rst->vendor;
|
||||
src.encoding = (msg->smhdr.flags & SMFLAG_ENDIANNESS) ? PL_CDR_LE : PL_CDR_BE;
|
||||
|
@ -1961,7 +1960,7 @@ static int deliver_user_data (const struct nn_rsample_info *sampleinfo, const st
|
|||
src.bufsz = NN_RDATA_PAYLOAD_OFF (fragchain) - qos_offset;
|
||||
if ((plist_ret = nn_plist_init_frommsg (&qos, NULL, PP_STATUSINFO | PP_KEYHASH | PP_COHERENT_SET | PP_PRISMTECH_EOTINFO, 0, &src)) < 0)
|
||||
{
|
||||
if (plist_ret != Q_ERR_INCOMPATIBLE)
|
||||
if (plist_ret != DDS_RETCODE_UNSUPPORTED)
|
||||
DDS_WARNING ("data(application, vendor %u.%u): "PGUIDFMT" #%"PRId64": invalid inline qos\n",
|
||||
src.vendorid.id[0], src.vendorid.id[1], PGUID (pwr->e.guid), sampleinfo->seq);
|
||||
return 0;
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "dds/ddsi/q_security.h"
|
||||
#include "dds/ddsi/q_config.h"
|
||||
#include "dds/ddsi/q_log.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "os/os_stdlib.h"
|
||||
#include "os/os_process.h"
|
||||
#include "os/os_thread.h"
|
||||
|
@ -1657,7 +1656,7 @@ static os_ssize_t q_security_sendmsg
|
|||
char stbuf[2048], *buf;
|
||||
size_t sz, data_size;
|
||||
uint32_t sz32, data_size32;
|
||||
ssize_t ret = Q_ERR_UNSPECIFIED;
|
||||
ssize_t ret = DDS_RETCODE_ERROR;
|
||||
PT_InfoContainer_t * securityHeader;
|
||||
unsigned i;
|
||||
|
||||
|
|
|
@ -893,7 +893,7 @@ os_sockWaitsetCtx os_sockWaitsetWait (os_sockWaitset ws)
|
|||
|
||||
do
|
||||
{
|
||||
dds_retcode_t rc = ddsrt_select (fdmax, rdset, NULL, NULL, DDS_INFINITY, &n);
|
||||
dds_return_t rc = ddsrt_select (fdmax, rdset, NULL, NULL, DDS_INFINITY, &n);
|
||||
if (rc != DDS_RETCODE_OK && rc != DDS_RETCODE_INTERRUPTED && rc != DDS_RETCODE_TRY_AGAIN)
|
||||
{
|
||||
DDS_WARNING("os_sockWaitsetWait: select failed, retcode = %"PRId32, rc);
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
#include "dds/ddsi/q_thread.h"
|
||||
#include "dds/ddsi/ddsi_threadmon.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/q_log.h"
|
||||
#include "dds/ddsi/q_config.h"
|
||||
#include "dds/ddsi/q_globals.h"
|
||||
|
@ -245,7 +244,7 @@ static struct thread_state1 *init_thread_state (const char *tname, enum thread_s
|
|||
return ts;
|
||||
}
|
||||
|
||||
dds_retcode_t create_thread (struct thread_state1 **ts1, const char *name, uint32_t (*f) (void *arg), void *arg)
|
||||
dds_return_t create_thread (struct thread_state1 **ts1, const char *name, uint32_t (*f) (void *arg), void *arg)
|
||||
{
|
||||
struct config_thread_properties_listelem const * const tprops = lookup_thread_properties (name);
|
||||
ddsrt_threadattr_t tattr;
|
||||
|
@ -300,14 +299,11 @@ static void reap_thread_state (struct thread_state1 *ts1, int sync_with_servicel
|
|||
ddsrt_mutex_unlock (&thread_states.lock);
|
||||
}
|
||||
|
||||
int join_thread (struct thread_state1 *ts1)
|
||||
dds_return_t join_thread (struct thread_state1 *ts1)
|
||||
{
|
||||
int ret;
|
||||
dds_return_t ret;
|
||||
assert (ts1->state == THREAD_STATE_ALIVE);
|
||||
if (ddsrt_thread_join (ts1->extTid, NULL) == DDS_RETCODE_OK)
|
||||
ret = 0;
|
||||
else
|
||||
ret = Q_ERR_UNSPECIFIED;
|
||||
ret = ddsrt_thread_join (ts1->extTid, NULL);
|
||||
assert (vtime_asleep_p (ts1->vtime));
|
||||
reap_thread_state (ts1, 1);
|
||||
return ret;
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "dds/ddsi/q_time.h"
|
||||
#include "dds/ddsi/q_config.h"
|
||||
#include "dds/ddsi/q_globals.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/q_transmit.h"
|
||||
#include "dds/ddsi/q_entity.h"
|
||||
#include "dds/ddsi/q_unused.h"
|
||||
|
@ -387,7 +386,7 @@ void add_Heartbeat (struct nn_xmsg *msg, struct writer *wr, const struct whc_sta
|
|||
nn_xmsg_submsg_setnext (msg, sm_marker);
|
||||
}
|
||||
|
||||
static int create_fragment_message_simple (struct writer *wr, seqno_t seq, struct ddsi_serdata *serdata, struct nn_xmsg **pmsg)
|
||||
static dds_return_t create_fragment_message_simple (struct writer *wr, seqno_t seq, struct ddsi_serdata *serdata, struct nn_xmsg **pmsg)
|
||||
{
|
||||
#define TEST_KEYHASH 0
|
||||
/* actual expected_inline_qos_size is typically 0, but always claiming 32 bytes won't make
|
||||
|
@ -417,7 +416,7 @@ static int create_fragment_message_simple (struct writer *wr, seqno_t seq, struc
|
|||
|
||||
/* INFO_TS: 12 bytes, Data_t: 24 bytes, expected inline QoS: 32 => should be single chunk */
|
||||
if ((*pmsg = nn_xmsg_new (gv.xmsgpool, &wr->e.guid.prefix, sizeof (InfoTimestamp_t) + sizeof (Data_t) + expected_inline_qos_size, NN_XMSG_KIND_DATA)) == NULL)
|
||||
return Q_ERR_OUT_OF_MEMORY;
|
||||
return DDS_RETCODE_OUT_OF_RESOURCES;
|
||||
|
||||
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
|
||||
/* use the partition_id from the writer to select the proper encoder */
|
||||
|
@ -461,7 +460,7 @@ static int create_fragment_message_simple (struct writer *wr, seqno_t seq, struc
|
|||
return 0;
|
||||
}
|
||||
|
||||
int 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 **pmsg, int isnew)
|
||||
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 **pmsg, int isnew)
|
||||
{
|
||||
/* We always fragment into FRAGMENT_SIZEd fragments, which are near
|
||||
the smallest allowed fragment size & can't be bothered (yet) to
|
||||
|
@ -484,7 +483,7 @@ int create_fragment_message (struct writer *wr, seqno_t seq, const struct nn_pli
|
|||
uint32_t fragstart, fraglen;
|
||||
enum nn_xmsg_kind xmsg_kind = isnew ? NN_XMSG_KIND_DATA : NN_XMSG_KIND_DATA_REXMIT;
|
||||
const uint32_t size = ddsi_serdata_size (serdata);
|
||||
int ret = 0;
|
||||
dds_return_t ret = 0;
|
||||
(void)plist;
|
||||
|
||||
ASSERT_MUTEX_HELD (&wr->e.lock);
|
||||
|
@ -495,14 +494,14 @@ int create_fragment_message (struct writer *wr, seqno_t seq, const struct nn_pli
|
|||
an non-existent fragment, which a malicious (or buggy) remote
|
||||
reader can trigger. So we return an error instead of asserting
|
||||
as we used to. */
|
||||
return Q_ERR_INVALID;
|
||||
return DDS_RETCODE_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
fragging = (config.fragment_size < size);
|
||||
|
||||
/* INFO_TS: 12 bytes, DataFrag_t: 36 bytes, expected inline QoS: 32 => should be single chunk */
|
||||
if ((*pmsg = nn_xmsg_new (gv.xmsgpool, &wr->e.guid.prefix, sizeof (InfoTimestamp_t) + sizeof (DataFrag_t) + expected_inline_qos_size, xmsg_kind)) == NULL)
|
||||
return Q_ERR_OUT_OF_MEMORY;
|
||||
return DDS_RETCODE_OUT_OF_RESOURCES;
|
||||
|
||||
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
|
||||
/* use the partition_id from the writer to select the proper encoder */
|
||||
|
@ -515,7 +514,7 @@ int create_fragment_message (struct writer *wr, seqno_t seq, const struct nn_pli
|
|||
{
|
||||
nn_xmsg_free (*pmsg);
|
||||
*pmsg = NULL;
|
||||
return Q_ERR_NO_ADDRESS;
|
||||
return DDS_RETCODE_PRECONDITION_NOT_MET;
|
||||
}
|
||||
/* retransmits: latency budget doesn't apply */
|
||||
}
|
||||
|
@ -901,7 +900,7 @@ static int writer_may_continue (const struct writer *wr, const struct whc_state
|
|||
}
|
||||
|
||||
|
||||
static dds_retcode_t throttle_writer (struct thread_state1 * const ts1, struct nn_xpack *xp, struct writer *wr)
|
||||
static dds_return_t throttle_writer (struct thread_state1 * const ts1, struct nn_xpack *xp, struct writer *wr)
|
||||
{
|
||||
/* Sleep (cond_wait) without updating the thread's vtime: the
|
||||
garbage collector won't free the writer while we leave it
|
||||
|
@ -937,7 +936,7 @@ static dds_retcode_t throttle_writer (struct thread_state1 * const ts1, struct n
|
|||
reader. This implicitly clears the whc and unblocks the
|
||||
writer. */
|
||||
|
||||
dds_retcode_t result = DDS_RETCODE_OK;
|
||||
dds_return_t result = DDS_RETCODE_OK;
|
||||
nn_mtime_t tnow = now_mt ();
|
||||
const nn_mtime_t abstimeout = add_duration_to_mtime (tnow, nn_from_ddsi_duration (wr->xqos->reliability.max_blocking_time));
|
||||
struct whc_state whcst;
|
||||
|
@ -1040,7 +1039,7 @@ static int write_sample_eot (struct thread_state1 * const ts1, struct nn_xpack *
|
|||
ddsi_serdata_size (serdata), config.max_sample_size,
|
||||
PGUID (wr->e.guid), tname, ttname, ppbuf,
|
||||
tmp < (int) sizeof (ppbuf) ? "" : " (trunc)");
|
||||
r = Q_ERR_INVALID_DATA;
|
||||
r = DDS_RETCODE_BAD_PARAMETER;
|
||||
goto drop;
|
||||
}
|
||||
|
||||
|
@ -1057,7 +1056,7 @@ static int write_sample_eot (struct thread_state1 * const ts1, struct nn_xpack *
|
|||
whc_get_state(wr->whc, &whcst);
|
||||
if (whcst.unacked_bytes > wr->whc_high)
|
||||
{
|
||||
dds_retcode_t ores;
|
||||
dds_return_t ores;
|
||||
assert(gc_allowed); /* also see beginning of the function */
|
||||
if (config.prioritize_retransmit && wr->retransmitting)
|
||||
ores = throttle_writer (ts1, xp, wr);
|
||||
|
@ -1072,7 +1071,7 @@ static int write_sample_eot (struct thread_state1 * const ts1, struct nn_xpack *
|
|||
if (ores == DDS_RETCODE_TIMEOUT)
|
||||
{
|
||||
ddsrt_mutex_unlock (&wr->e.lock);
|
||||
r = Q_ERR_TIMEOUT;
|
||||
r = DDS_RETCODE_TIMEOUT;
|
||||
goto drop;
|
||||
}
|
||||
}
|
||||
|
@ -1189,4 +1188,3 @@ int write_sample_nogc_notk (struct thread_state1 * const ts1, struct nn_xpack *x
|
|||
ddsi_tkmap_instance_unref (tk);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "dds/ddsi/q_globals.h"
|
||||
#include "dds/ddsi/q_ephash.h"
|
||||
#include "dds/ddsi/q_transmit.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/q_bswap.h"
|
||||
#include "dds/ddsi/q_entity.h"
|
||||
#include "dds/ddsi/q_misc.h"
|
||||
|
@ -477,9 +476,9 @@ struct xeventq * xeventq_new
|
|||
return evq;
|
||||
}
|
||||
|
||||
int xeventq_start (struct xeventq *evq, const char *name)
|
||||
dds_return_t xeventq_start (struct xeventq *evq, const char *name)
|
||||
{
|
||||
dds_retcode_t rc;
|
||||
dds_return_t rc;
|
||||
char * evqname = "tev";
|
||||
assert (evq->ts == NULL);
|
||||
|
||||
|
@ -497,7 +496,7 @@ int xeventq_start (struct xeventq *evq, const char *name)
|
|||
{
|
||||
ddsrt_free (evqname);
|
||||
}
|
||||
return (rc != DDS_RETCODE_OK) ? Q_ERR_UNSPECIFIED : 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
void xeventq_stop (struct xeventq *evq)
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "dds/ddsi/q_bswap.h"
|
||||
#include "dds/ddsi/q_rtps.h"
|
||||
#include "dds/ddsi/q_addrset.h"
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/q_misc.h"
|
||||
#include "dds/ddsi/q_log.h"
|
||||
#include "dds/ddsi/q_unused.h"
|
||||
|
@ -148,7 +147,7 @@ typedef struct {
|
|||
ddsrt_cond_t cv;
|
||||
} ddsi_sem_t;
|
||||
|
||||
dds_retcode_t
|
||||
dds_return_t
|
||||
ddsi_sem_init (ddsi_sem_t *sem, uint32_t value)
|
||||
{
|
||||
sem->value = value;
|
||||
|
@ -157,7 +156,7 @@ ddsi_sem_init (ddsi_sem_t *sem, uint32_t value)
|
|||
return DDS_RETCODE_OK;
|
||||
}
|
||||
|
||||
dds_retcode_t
|
||||
dds_return_t
|
||||
ddsi_sem_destroy (ddsi_sem_t *sem)
|
||||
{
|
||||
ddsrt_cond_destroy (&sem->cv);
|
||||
|
@ -165,7 +164,7 @@ ddsi_sem_destroy (ddsi_sem_t *sem)
|
|||
return DDS_RETCODE_OK;
|
||||
}
|
||||
|
||||
dds_retcode_t
|
||||
dds_return_t
|
||||
ddsi_sem_post (ddsi_sem_t *sem)
|
||||
{
|
||||
ddsrt_mutex_lock (&sem->mtx);
|
||||
|
@ -175,7 +174,7 @@ ddsi_sem_post (ddsi_sem_t *sem)
|
|||
return DDS_RETCODE_OK;
|
||||
}
|
||||
|
||||
dds_retcode_t
|
||||
dds_return_t
|
||||
ddsi_sem_wait (ddsi_sem_t *sem)
|
||||
{
|
||||
ddsrt_mutex_lock (&sem->mtx);
|
||||
|
@ -586,7 +585,7 @@ void nn_xmsg_setdst1 (struct nn_xmsg *m, const nn_guid_prefix_t *gp, const nn_lo
|
|||
m->data->dst.guid_prefix = nn_hton_guid_prefix (*gp);
|
||||
}
|
||||
|
||||
int nn_xmsg_setdstPRD (struct nn_xmsg *m, const struct proxy_reader *prd)
|
||||
dds_return_t nn_xmsg_setdstPRD (struct nn_xmsg *m, const struct proxy_reader *prd)
|
||||
{
|
||||
nn_locator_t loc;
|
||||
if (addrset_any_uc (prd->c.as, &loc) || addrset_any_mc (prd->c.as, &loc))
|
||||
|
@ -597,11 +596,11 @@ int nn_xmsg_setdstPRD (struct nn_xmsg *m, const struct proxy_reader *prd)
|
|||
else
|
||||
{
|
||||
DDS_WARNING("nn_xmsg_setdstPRD: no address for "PGUIDFMT"", PGUID (prd->e.guid));
|
||||
return Q_ERR_NO_ADDRESS;
|
||||
return DDS_RETCODE_PRECONDITION_NOT_MET;
|
||||
}
|
||||
}
|
||||
|
||||
int nn_xmsg_setdstPWR (struct nn_xmsg *m, const struct proxy_writer *pwr)
|
||||
dds_return_t nn_xmsg_setdstPWR (struct nn_xmsg *m, const struct proxy_writer *pwr)
|
||||
{
|
||||
nn_locator_t loc;
|
||||
if (addrset_any_uc (pwr->c.as, &loc) || addrset_any_mc (pwr->c.as, &loc))
|
||||
|
@ -610,7 +609,7 @@ int nn_xmsg_setdstPWR (struct nn_xmsg *m, const struct proxy_writer *pwr)
|
|||
return 0;
|
||||
}
|
||||
DDS_WARNING("nn_xmsg_setdstPRD: no address for "PGUIDFMT, PGUID (pwr->e.guid));
|
||||
return Q_ERR_NO_ADDRESS;
|
||||
return DDS_RETCODE_PRECONDITION_NOT_MET;
|
||||
}
|
||||
|
||||
void nn_xmsg_setdstN (struct nn_xmsg *m, struct addrset *as, struct addrset *as_group)
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "dds/ddsrt/atomics.h"
|
||||
#include "dds/ddsrt/misc.h"
|
||||
|
||||
#include "dds/ddsi/q_error.h"
|
||||
#include "dds/ddsi/q_log.h"
|
||||
#include "dds/ddsi/q_config.h"
|
||||
#include "dds/ddsi/sysdeps.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue