Simplify logging and remove unwanted functions from abstraction layer
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
This commit is contained in:
parent
ac020f62f7
commit
1cf03332ca
97 changed files with 2819 additions and 5361 deletions
|
@ -17,7 +17,6 @@
|
|||
16 src/q_init.c
|
||||
17 src/q_lat_estim.c
|
||||
18 src/q_lease.c
|
||||
19 src/q_log.c
|
||||
20 src/q_md5.c
|
||||
21 src/q_misc.c
|
||||
22 src/q_nwif.c
|
||||
|
|
|
@ -37,7 +37,6 @@ PREPEND(srcs_ddsi "${CMAKE_CURRENT_LIST_DIR}/src"
|
|||
q_init.c
|
||||
q_lat_estim.c
|
||||
q_lease.c
|
||||
q_log.c
|
||||
q_md5.c
|
||||
q_misc.c
|
||||
q_nwif.c
|
||||
|
|
|
@ -64,7 +64,7 @@ int addrset_any_mc (const struct addrset *as, nn_locator_t *dst);
|
|||
int addrset_forone (struct addrset *as, addrset_forone_fun_t f, void *arg);
|
||||
void addrset_forall (struct addrset *as, addrset_forall_fun_t f, void *arg);
|
||||
size_t addrset_forall_count (struct addrset *as, addrset_forall_fun_t f, void *arg);
|
||||
void nn_log_addrset (logcat_t tf, const char *prefix, const struct addrset *as);
|
||||
void nn_log_addrset (uint32_t tf, const char *prefix, const struct addrset *as);
|
||||
|
||||
/* Tries to lock A then B for a decent check, returning false if
|
||||
trylock B fails */
|
||||
|
|
|
@ -216,7 +216,7 @@ enum many_sockets_mode {
|
|||
struct config
|
||||
{
|
||||
int valid;
|
||||
logcat_t enabled_logcats;
|
||||
uint32_t enabled_logcats;
|
||||
char *servicename;
|
||||
char *pcap_file;
|
||||
|
||||
|
|
|
@ -308,13 +308,6 @@ struct q_globals {
|
|||
os_timePowerEvents powerEvents;
|
||||
|
||||
struct nn_group_membership *mship;
|
||||
|
||||
/* Static log buffer, for those rare cases a thread calls nn_vlogb
|
||||
without having its own log buffer (happens during config file
|
||||
processing and for listeners, &c. */
|
||||
int static_logbuf_lock_inited;
|
||||
os_mutex static_logbuf_lock;
|
||||
struct logbuf static_logbuf;
|
||||
};
|
||||
|
||||
extern struct q_globals OSAPI_EXPORT gv;
|
||||
|
|
|
@ -35,7 +35,7 @@ void nn_lat_estim_init (struct nn_lat_estim *le);
|
|||
void nn_lat_estim_fini (struct nn_lat_estim *le);
|
||||
void nn_lat_estim_update (struct nn_lat_estim *le, int64_t est);
|
||||
double nn_lat_estim_current (const struct nn_lat_estim *le);
|
||||
int nn_lat_estim_log (logcat_t logcat, const char *tag, const struct nn_lat_estim *le);
|
||||
int nn_lat_estim_log (uint32_t logcat, const char *tag, const struct nn_lat_estim *le);
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
|
|
|
@ -21,62 +21,21 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define LC_FATAL 1u
|
||||
#define LC_ERROR 2u
|
||||
#define LC_WARNING 4u
|
||||
#define LC_CONFIG 8u
|
||||
#define LC_INFO 16u
|
||||
#define LC_DISCOVERY 32u
|
||||
#define LC_DATA 64u
|
||||
#define LC_TRACE 128u
|
||||
#define LC_RADMIN 256u
|
||||
#define LC_TIMING 512u
|
||||
#define LC_TRAFFIC 1024u
|
||||
#define LC_TOPIC 2048u
|
||||
#define LC_TCP 4096u
|
||||
#define LC_PLIST 8192u
|
||||
#define LC_WHC 16384u
|
||||
#define LC_THROTTLE 32768u
|
||||
#define LC_ALLCATS (LC_FATAL | LC_ERROR | LC_WARNING | LC_CONFIG | LC_INFO | LC_DISCOVERY | LC_DATA | LC_TRACE | LC_TIMING | LC_TRAFFIC | LC_TCP | LC_THROTTLE)
|
||||
|
||||
typedef unsigned logcat_t;
|
||||
|
||||
typedef struct logbuf {
|
||||
char buf[2048];
|
||||
size_t bufsz;
|
||||
size_t pos;
|
||||
nn_wctime_t tstamp;
|
||||
} *logbuf_t;
|
||||
|
||||
logbuf_t logbuf_new (void);
|
||||
void logbuf_init (logbuf_t lb);
|
||||
void logbuf_free (logbuf_t lb);
|
||||
|
||||
int nn_vlog (logcat_t cat, const char *fmt, va_list ap);
|
||||
OSAPI_EXPORT int nn_log (_In_ logcat_t cat, _In_z_ _Printf_format_string_ const char *fmt, ...) __attribute_format__((printf,2,3));
|
||||
OSAPI_EXPORT int nn_trace (_In_z_ _Printf_format_string_ const char *fmt, ...) __attribute_format__((printf,1,2));
|
||||
void nn_log_set_tstamp (nn_wctime_t tnow);
|
||||
|
||||
#define TRACE(args) ((config.enabled_logcats & LC_TRACE) ? (nn_trace args) : 0)
|
||||
|
||||
#define LOG_THREAD_CPUTIME(guard) do { \
|
||||
if (config.enabled_logcats & LC_TIMING) \
|
||||
{ \
|
||||
nn_mtime_t tnowlt = now_mt (); \
|
||||
if (tnowlt.v >= (guard).v) \
|
||||
{ \
|
||||
int64_t ts = get_thread_cputime (); \
|
||||
nn_log (LC_TIMING, "thread_cputime %d.%09d\n", \
|
||||
(int) (ts / T_SECOND), (int) (ts % T_SECOND)); \
|
||||
(guard).v = tnowlt.v + T_SECOND; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define NN_WARNING(fmt,...) nn_log (LC_WARNING, ("<Warning> " fmt),##__VA_ARGS__)
|
||||
#define NN_ERROR(fmt,...) nn_log (LC_ERROR, ("<Error> " fmt),##__VA_ARGS__)
|
||||
#define NN_FATAL(fmt,...) nn_log (LC_FATAL, ("<Fatal> " fmt),##__VA_ARGS__)
|
||||
/* LOG_THREAD_CPUTIME must be considered private. */
|
||||
#define LOG_THREAD_CPUTIME(guard) \
|
||||
do { \
|
||||
if (dds_get_log_mask() & DDS_LC_TIMING) { \
|
||||
nn_mtime_t tnowlt = now_mt(); \
|
||||
if (tnowlt.v >= (guard).v) { \
|
||||
const char fmt[] = "thread_cputime %d.%09d\n"; \
|
||||
int64_t ts = get_thread_cputime (); \
|
||||
dds_log( \
|
||||
DDS_LC_TIMING, __FILE__, __LINE__, OS_FUNCTION, \
|
||||
fmt, (int)(ts / T_SECOND), (int)(ts % T_SECOND)); \
|
||||
(guard).v = tnowlt.v + T_SECOND; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
|
|
|
@ -61,7 +61,6 @@ struct logbuf;
|
|||
os_threadId tid; \
|
||||
os_threadId extTid; \
|
||||
enum thread_state state; \
|
||||
struct logbuf *lb; \
|
||||
char *name /* note: no semicolon! */
|
||||
|
||||
struct thread_state_base {
|
||||
|
|
|
@ -339,7 +339,7 @@ void nn_xqos_fini (nn_xqos_t *xqos);
|
|||
void nn_xqos_mergein_missing (nn_xqos_t *a, const nn_xqos_t *b);
|
||||
uint64_t nn_xqos_delta (const nn_xqos_t *a, const nn_xqos_t *b, uint64_t mask);
|
||||
void nn_xqos_addtomsg (struct nn_xmsg *m, const nn_xqos_t *xqos, uint64_t wanted);
|
||||
void nn_log_xqos (logcat_t cat, const nn_xqos_t *xqos);
|
||||
void nn_log_xqos (uint32_t cat, const nn_xqos_t *xqos);
|
||||
nn_xqos_t *nn_xqos_dup (const nn_xqos_t *src);
|
||||
|
||||
#if defined (__cplusplus)
|
||||
|
|
|
@ -171,7 +171,7 @@ void ddsi_ipaddr_to_loc (nn_locator_t *dst, const os_sockaddr *src, int32_t kind
|
|||
}
|
||||
#endif
|
||||
default:
|
||||
NN_FATAL ("nn_address_to_loc: family %d unsupported\n", (int) src->sa_family);
|
||||
DDS_FATAL("nn_address_to_loc: family %d unsupported\n", (int) src->sa_family);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -154,13 +154,13 @@ static int joinleave_mcgroup (ddsi_tran_conn_t conn, int join, const nn_locator_
|
|||
{
|
||||
char buf[256];
|
||||
int err;
|
||||
TRACE (("%s\n", make_joinleave_msg (buf, sizeof(buf), conn, join, srcloc, mcloc, interf, 0)));
|
||||
DDS_TRACE("%s\n", make_joinleave_msg (buf, sizeof(buf), conn, join, srcloc, mcloc, interf, 0));
|
||||
if (join)
|
||||
err = ddsi_conn_join_mc(conn, srcloc, mcloc, interf);
|
||||
else
|
||||
err = ddsi_conn_leave_mc(conn, srcloc, mcloc, interf);
|
||||
if (err)
|
||||
NN_WARNING ("%s\n", make_joinleave_msg (buf, sizeof(buf), conn, join, srcloc, mcloc, interf, err));
|
||||
DDS_WARNING("%s\n", make_joinleave_msg (buf, sizeof(buf), conn, join, srcloc, mcloc, interf, err));
|
||||
return err ? -1 : 0;
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ static int joinleave_mcgroups (ddsi_tran_conn_t conn, int join, const nn_locator
|
|||
if (fails > 0)
|
||||
{
|
||||
if (oks > 0)
|
||||
TRACE (("multicast join failed for some but not all interfaces, proceeding\n"));
|
||||
DDS_TRACE("multicast join failed for some but not all interfaces, proceeding\n");
|
||||
else
|
||||
return -2;
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ int ddsi_join_mc (ddsi_tran_conn_t conn, const nn_locator_t *srcloc, const nn_lo
|
|||
if (!reg_group_membership (gv.mship, conn, srcloc, mcloc))
|
||||
{
|
||||
char buf[256];
|
||||
TRACE (("%s: already joined\n", make_joinleave_msg (buf, sizeof(buf), conn, 1, srcloc, mcloc, NULL, 0)));
|
||||
DDS_TRACE("%s: already joined\n", make_joinleave_msg (buf, sizeof(buf), conn, 1, srcloc, mcloc, NULL, 0));
|
||||
ret = 0;
|
||||
}
|
||||
else
|
||||
|
@ -246,7 +246,7 @@ int ddsi_leave_mc (ddsi_tran_conn_t conn, const nn_locator_t *srcloc, const nn_l
|
|||
if (!unreg_group_membership (gv.mship, conn, srcloc, mcloc))
|
||||
{
|
||||
char buf[256];
|
||||
TRACE (("%s: not leaving yet\n", make_joinleave_msg (buf, sizeof(buf), conn, 0, srcloc, mcloc, NULL, 0)));
|
||||
DDS_TRACE("%s: not leaving yet\n", make_joinleave_msg (buf, sizeof(buf), conn, 0, srcloc, mcloc, NULL, 0));
|
||||
ret = 0;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -108,12 +108,12 @@ static ssize_t ddsi_raweth_conn_read (ddsi_tran_conn_t conn, unsigned char * buf
|
|||
snprintf(addrbuf, sizeof(addrbuf), "[%02x:%02x:%02x:%02x:%02x:%02x]:%u",
|
||||
src.sll_addr[0], src.sll_addr[1], src.sll_addr[2],
|
||||
src.sll_addr[3], src.sll_addr[4], src.sll_addr[5], ntohs(src.sll_protocol));
|
||||
NN_WARNING ("%s => %d truncated to %d\n", addrbuf, (int)ret, (int)len);
|
||||
DDS_WARNING("%s => %d truncated to %d\n", addrbuf, (int)ret, (int)len);
|
||||
}
|
||||
}
|
||||
else if (err != os_sockENOTSOCK && err != os_sockECONNRESET)
|
||||
{
|
||||
NN_ERROR ("UDP recvmsg sock %d: ret %d errno %d\n", (int) ((ddsi_raweth_conn_t) conn)->m_sock, (int) ret, err);
|
||||
DDS_ERROR("UDP recvmsg sock %d: ret %d errno %d\n", (int) ((ddsi_raweth_conn_t) conn)->m_sock, (int) ret, err);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ static ssize_t ddsi_raweth_conn_write (ddsi_tran_conn_t conn, const nn_locator_t
|
|||
#endif
|
||||
break;
|
||||
default:
|
||||
NN_ERROR("ddsi_raweth_conn_write failed with error code %d", err);
|
||||
DDS_ERROR("ddsi_raweth_conn_write failed with error code %d", err);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
@ -204,14 +204,14 @@ static ddsi_tran_conn_t ddsi_raweth_create_conn (uint32_t port, ddsi_tran_qos_t
|
|||
|
||||
if (port == 0 || port > 65535)
|
||||
{
|
||||
NN_ERROR("ddsi_raweth_create_conn %s port %u - using port number as ethernet type, %u won't do\n", mcast ? "multicast" : "unicast", port, port);
|
||||
DDS_ERROR("ddsi_raweth_create_conn %s port %u - using port number as ethernet type, %u won't do\n", mcast ? "multicast" : "unicast", port, port);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((sock = socket(PF_PACKET, SOCK_DGRAM, htons((uint16_t)port))) == -1)
|
||||
{
|
||||
rc = os_getErrno();
|
||||
NN_ERROR("ddsi_raweth_create_conn %s port %u failed ... errno = %d\n", mcast ? "multicast" : "unicast", port, rc);
|
||||
DDS_ERROR("ddsi_raweth_create_conn %s port %u failed ... errno = %d\n", mcast ? "multicast" : "unicast", port, rc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ static ddsi_tran_conn_t ddsi_raweth_create_conn (uint32_t port, ddsi_tran_qos_t
|
|||
{
|
||||
rc = os_getErrno();
|
||||
close(sock);
|
||||
NN_ERROR("ddsi_raweth_create_conn %s bind port %u failed ... errno = %d\n", mcast ? "multicast" : "unicast", port, rc);
|
||||
DDS_ERROR("ddsi_raweth_create_conn %s bind port %u failed ... errno = %d\n", mcast ? "multicast" : "unicast", port, rc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ static ddsi_tran_conn_t ddsi_raweth_create_conn (uint32_t port, ddsi_tran_qos_t
|
|||
uc->m_base.m_write_fn = ddsi_raweth_conn_write;
|
||||
uc->m_base.m_disable_multiplexing_fn = 0;
|
||||
|
||||
nn_log(LC_INFO, "ddsi_raweth_create_conn %s socket %d port %u\n", mcast ? "multicast" : "unicast", uc->m_sock, uc->m_base.m_base.m_port);
|
||||
DDS_INFO("ddsi_raweth_create_conn %s socket %d port %u\n", mcast ? "multicast" : "unicast", uc->m_sock, uc->m_base.m_base.m_port);
|
||||
return uc ? &uc->m_base : NULL;
|
||||
}
|
||||
|
||||
|
@ -294,9 +294,8 @@ static int ddsi_raweth_leave_mc (ddsi_tran_conn_t conn, const nn_locator_t *srcl
|
|||
static void ddsi_raweth_release_conn (ddsi_tran_conn_t conn)
|
||||
{
|
||||
ddsi_raweth_conn_t uc = (ddsi_raweth_conn_t) conn;
|
||||
nn_log
|
||||
DDS_INFO
|
||||
(
|
||||
LC_INFO,
|
||||
"ddsi_raweth_release_conn %s socket %d port %d\n",
|
||||
conn->m_base.m_multicast ? "multicast" : "unicast",
|
||||
uc->m_sock,
|
||||
|
@ -344,7 +343,7 @@ static void ddsi_raweth_deinit(void)
|
|||
if (os_atomic_dec32_nv(&init_g) == 0) {
|
||||
if (ddsi_raweth_config_g.mship)
|
||||
free_group_membership(ddsi_raweth_config_g.mship);
|
||||
nn_log (LC_INFO | LC_CONFIG, "raweth de-initialized\n");
|
||||
DDS_LOG(DDS_LC_INFO | DDS_LC_CONFIG, "raweth de-initialized\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -380,7 +379,7 @@ int ddsi_raweth_init (void)
|
|||
|
||||
ddsi_raweth_config_g.mship = new_group_membership();
|
||||
|
||||
nn_log (LC_INFO | LC_CONFIG, "raweth initialized\n");
|
||||
DDS_LOG(DDS_LC_INFO | DDS_LC_CONFIG, "raweth initialized\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ static void serdata_free_wrap (void *elem)
|
|||
|
||||
void ddsi_serdatapool_free (struct serdatapool * pool)
|
||||
{
|
||||
TRACE (("ddsi_serdatapool_free(%p)\n", pool));
|
||||
DDS_TRACE("ddsi_serdatapool_free(%p)\n", pool);
|
||||
nn_freelist_fini (&pool->freelist, serdata_free_wrap);
|
||||
os_free (pool);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ static void ddsi_ssl_error (SSL * ssl, const char * str, int err)
|
|||
{
|
||||
char buff [128];
|
||||
ERR_error_string ((unsigned) SSL_get_error (ssl, err), buff);
|
||||
nn_log (LC_ERROR, "tcp/ssl %s %s %d\n", str, buff, err);
|
||||
DDS_ERROR("tcp/ssl %s %s %d\n", str, buff, err);
|
||||
}
|
||||
|
||||
static int ddsi_ssl_verify (int ok, X509_STORE_CTX * store)
|
||||
|
@ -56,9 +56,8 @@ static int ddsi_ssl_verify (int ok, X509_STORE_CTX * store)
|
|||
else
|
||||
{
|
||||
X509_NAME_oneline (X509_get_issuer_name (cert), issuer, sizeof (issuer));
|
||||
nn_log
|
||||
DDS_ERROR
|
||||
(
|
||||
LC_ERROR,
|
||||
"tcp/ssl failed to verify certificate from %s : %s\n",
|
||||
issuer,
|
||||
X509_verify_cert_error_string (err)
|
||||
|
@ -227,9 +226,9 @@ static SSL_CTX * ddsi_ssl_ctx_init (void)
|
|||
|
||||
if (! SSL_CTX_use_certificate_file (ctx, config.ssl_keystore, SSL_FILETYPE_PEM))
|
||||
{
|
||||
nn_log
|
||||
DDS_LOG
|
||||
(
|
||||
LC_ERROR | LC_CONFIG,
|
||||
DDS_LC_ERROR | DDS_LC_CONFIG,
|
||||
"tcp/ssl failed to load certificate from file: %s\n",
|
||||
config.ssl_keystore
|
||||
);
|
||||
|
@ -244,9 +243,9 @@ static SSL_CTX * ddsi_ssl_ctx_init (void)
|
|||
|
||||
if (! SSL_CTX_use_PrivateKey_file (ctx, config.ssl_keystore, SSL_FILETYPE_PEM))
|
||||
{
|
||||
nn_log
|
||||
DDS_LOG
|
||||
(
|
||||
LC_ERROR | LC_CONFIG,
|
||||
DDS_LC_ERROR | DDS_LC_CONFIG,
|
||||
"tcp/ssl failed to load private key from file: %s\n",
|
||||
config.ssl_keystore
|
||||
);
|
||||
|
@ -257,9 +256,9 @@ static SSL_CTX * ddsi_ssl_ctx_init (void)
|
|||
|
||||
if (! SSL_CTX_load_verify_locations (ctx, config.ssl_keystore, 0))
|
||||
{
|
||||
nn_log
|
||||
DDS_LOG
|
||||
(
|
||||
LC_ERROR | LC_CONFIG,
|
||||
DDS_LC_ERROR | DDS_LC_CONFIG,
|
||||
"tcp/ssl failed to load CA from file: %s\n",
|
||||
config.ssl_keystore
|
||||
);
|
||||
|
@ -270,9 +269,9 @@ static SSL_CTX * ddsi_ssl_ctx_init (void)
|
|||
|
||||
if (! SSL_CTX_set_cipher_list (ctx, config.ssl_ciphers))
|
||||
{
|
||||
nn_log
|
||||
DDS_LOG
|
||||
(
|
||||
LC_ERROR | LC_CONFIG,
|
||||
DDS_LC_ERROR | DDS_LC_CONFIG,
|
||||
"tcp/ssl failed to set ciphers: %s\n",
|
||||
config.ssl_ciphers
|
||||
);
|
||||
|
@ -285,9 +284,9 @@ static SSL_CTX * ddsi_ssl_ctx_init (void)
|
|||
{
|
||||
if (! RAND_load_file (config.ssl_rand_file, 4096))
|
||||
{
|
||||
nn_log
|
||||
DDS_LOG
|
||||
(
|
||||
LC_ERROR | LC_CONFIG,
|
||||
DDS_LC_ERROR | DDS_LC_CONFIG,
|
||||
"tcp/ssl failed to load random seed from file: %s\n",
|
||||
config.ssl_rand_file
|
||||
);
|
||||
|
|
|
@ -73,16 +73,6 @@ typedef struct ddsi_tcp_listener
|
|||
}
|
||||
* ddsi_tcp_listener_t;
|
||||
|
||||
static void nn_trace_tcp (const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, fmt);
|
||||
nn_vlog (LC_TCP, fmt, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
#define TRACE_TCP(args) ((config.enabled_logcats & LC_TCP) ? (nn_trace_tcp args) : (void) 0)
|
||||
|
||||
static int ddsi_tcp_cmp_conn (const ddsi_tcp_conn_t c1, const ddsi_tcp_conn_t c2)
|
||||
{
|
||||
const os_sockaddr *a1s = (os_sockaddr *)&c1->m_peer_addr;
|
||||
|
@ -136,9 +126,9 @@ static void ddsi_tcp_cache_dump (void)
|
|||
while (n)
|
||||
{
|
||||
os_sockaddrAddressPortToString ((const os_sockaddr *) &n->m_conn->m_peer_addr, buff, sizeof (buff));
|
||||
nn_log
|
||||
DDS_LOG
|
||||
(
|
||||
LC_INFO,
|
||||
DDS_LC_INFO,
|
||||
"%s cache #%d: %s sock %d port %u peer %s\n",
|
||||
ddsi_name, i++, n->m_conn->m_base.m_server ? "server" : "client",
|
||||
n->m_conn->m_sock, n->m_conn->m_base.m_base.m_port, buff
|
||||
|
@ -155,7 +145,7 @@ static unsigned short get_socket_port (os_socket socket)
|
|||
if (getsockname (socket, (os_sockaddr *) &addr, &addrlen) < 0)
|
||||
{
|
||||
int err = os_getErrno();
|
||||
NN_ERROR ("ddsi_tcp_get_socket_port: getsockname errno %d\n", err);
|
||||
DDS_ERROR("ddsi_tcp_get_socket_port: getsockname errno %d\n", err);
|
||||
return 0;
|
||||
}
|
||||
return os_sockaddr_get_port((os_sockaddr *)&addr);
|
||||
|
@ -173,7 +163,7 @@ static void ddsi_tcp_sock_free (os_socket sock, const char * msg)
|
|||
{
|
||||
if (msg)
|
||||
{
|
||||
nn_log (LC_INFO, "%s %s free socket %"PRIsock"\n", ddsi_name, msg, sock);
|
||||
DDS_INFO("%s %s free socket %"PRIsock"\n", ddsi_name, msg, sock);
|
||||
}
|
||||
os_sockFree (sock);
|
||||
}
|
||||
|
@ -231,7 +221,7 @@ static void ddsi_tcp_conn_connect (ddsi_tcp_conn_t conn, const struct msghdr * m
|
|||
#endif
|
||||
|
||||
sockaddr_to_string_with_port(buff, sizeof(buff), (os_sockaddr *) msg->msg_name);
|
||||
nn_log (LC_INFO, "%s connect socket %"PRIsock" port %u to %s\n", ddsi_name, sock, get_socket_port (sock), buff);
|
||||
DDS_INFO("%s connect socket %"PRIsock" port %u to %s\n", ddsi_name, sock, get_socket_port (sock), buff);
|
||||
|
||||
/* Also may need to receive on connection so add to waitset */
|
||||
|
||||
|
@ -279,7 +269,7 @@ static void ddsi_tcp_cache_add (ddsi_tcp_conn_t conn, ut_avlIPath_t * path)
|
|||
}
|
||||
|
||||
sockaddr_to_string_with_port(buff, sizeof(buff), (os_sockaddr *)&conn->m_peer_addr);
|
||||
nn_log (LC_INFO, "%s cache %s %s socket %"PRIsock" to %s\n", ddsi_name, action, conn->m_base.m_server ? "server" : "client", conn->m_sock, buff);
|
||||
DDS_INFO("%s cache %s %s socket %"PRIsock" to %s\n", ddsi_name, action, conn->m_base.m_server ? "server" : "client", conn->m_sock, buff);
|
||||
}
|
||||
|
||||
static void ddsi_tcp_cache_remove (ddsi_tcp_conn_t conn)
|
||||
|
@ -293,7 +283,7 @@ static void ddsi_tcp_cache_remove (ddsi_tcp_conn_t conn)
|
|||
if (node)
|
||||
{
|
||||
sockaddr_to_string_with_port(buff, sizeof(buff), (os_sockaddr *)&conn->m_peer_addr);
|
||||
nn_log (LC_INFO, "%s cache removed socket %"PRIsock" to %s\n", ddsi_name, conn->m_sock, buff);
|
||||
DDS_INFO("%s cache removed socket %"PRIsock" to %s\n", ddsi_name, conn->m_sock, buff);
|
||||
ut_avlDeleteDPath (&ddsi_tcp_treedef, &ddsi_tcp_cache_g, node, &path);
|
||||
ddsi_tcp_node_free (node);
|
||||
}
|
||||
|
@ -372,7 +362,7 @@ static bool ddsi_tcp_select (os_socket sock, bool read, size_t pos)
|
|||
timeout.tv_sec = (int) (tval / T_SECOND);
|
||||
timeout.tv_nsec = (int) (tval % T_SECOND);
|
||||
|
||||
TRACE_TCP (("%s blocked %s: sock %d\n", ddsi_name, read ? "read" : "write", (int) sock));
|
||||
DDS_LOG(DDS_LC_TCP, "%s blocked %s: sock %d\n", ddsi_name, read ? "read" : "write", (int) sock);
|
||||
do
|
||||
{
|
||||
ret = os_sockSelect ((int32_t)sock + 1, rdset, wrset, NULL, &timeout); /* The variable "sock" with os_socket type causes the possible loss of data. So type casting done */
|
||||
|
@ -381,9 +371,9 @@ static bool ddsi_tcp_select (os_socket sock, bool read, size_t pos)
|
|||
|
||||
if (ret <= 0)
|
||||
{
|
||||
nn_log
|
||||
DDS_WARNING
|
||||
(
|
||||
LC_WARNING, "%s abandoning %s on blocking socket %d after %"PRIuSIZE" bytes\n",
|
||||
"%s abandoning %s on blocking socket %d after %"PRIuSIZE" bytes\n",
|
||||
ddsi_name, read ? "read" : "write", (int) sock, pos
|
||||
);
|
||||
}
|
||||
|
@ -432,7 +422,7 @@ static ssize_t ddsi_tcp_conn_read (ddsi_tran_conn_t conn, unsigned char * buf, s
|
|||
}
|
||||
else if (n == 0)
|
||||
{
|
||||
TRACE_TCP (("%s read: sock %"PRIsock" closed-by-peer\n", ddsi_name, tcp->m_sock));
|
||||
DDS_LOG(DDS_LC_TCP, "%s read: sock %"PRIsock" closed-by-peer\n", ddsi_name, tcp->m_sock);
|
||||
break;
|
||||
}
|
||||
else
|
||||
|
@ -448,7 +438,7 @@ static ssize_t ddsi_tcp_conn_read (ddsi_tran_conn_t conn, unsigned char * buf, s
|
|||
}
|
||||
else
|
||||
{
|
||||
TRACE_TCP (("%s read: sock %"PRIsock" error %d\n", ddsi_name, tcp->m_sock, err));
|
||||
DDS_LOG(DDS_LC_TCP, "%s read: sock %"PRIsock" error %d\n", ddsi_name, tcp->m_sock, err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -516,7 +506,7 @@ static ssize_t ddsi_tcp_block_write
|
|||
}
|
||||
else
|
||||
{
|
||||
TRACE_TCP (("%s write: sock %"PRIsock" error %d\n", ddsi_name, conn->m_sock, err));
|
||||
DDS_LOG(DDS_LC_TCP, "%s write: sock %"PRIsock" error %d\n", ddsi_name, conn->m_sock, err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -591,7 +581,7 @@ static ssize_t ddsi_tcp_conn_write (ddsi_tran_conn_t base, const nn_locator_t *d
|
|||
|
||||
if (!connect && ((flags & DDSI_TRAN_ON_CONNECT) != 0))
|
||||
{
|
||||
TRACE_TCP (("%s write: sock %"PRIsock" message filtered\n", ddsi_name, conn->m_sock));
|
||||
DDS_LOG(DDS_LC_TCP, "%s write: sock %"PRIsock" message filtered\n", ddsi_name, conn->m_sock);
|
||||
os_mutexUnlock (&conn->m_mutex);
|
||||
return (ssize_t) len;
|
||||
}
|
||||
|
@ -651,16 +641,16 @@ static ssize_t ddsi_tcp_conn_write (ddsi_tran_conn_t base, const nn_locator_t *d
|
|||
{
|
||||
if (! conn->m_base.m_closed && (conn->m_sock != Q_INVALID_SOCKET))
|
||||
{
|
||||
nn_log
|
||||
DDS_WARNING
|
||||
(
|
||||
LC_WARNING, "%s write failed on socket %"PRIsock" with errno %d\n",
|
||||
"%s write failed on socket %"PRIsock" with errno %d\n",
|
||||
ddsi_name, conn->m_sock, err
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE_TCP (("%s write: sock %"PRIsock" ECONNRESET\n", ddsi_name, conn->m_sock));
|
||||
DDS_LOG(DDS_LC_TCP, "%s write: sock %"PRIsock" ECONNRESET\n", ddsi_name, conn->m_sock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -668,7 +658,7 @@ static ssize_t ddsi_tcp_conn_write (ddsi_tran_conn_t base, const nn_locator_t *d
|
|||
{
|
||||
if (ret == 0)
|
||||
{
|
||||
TRACE_TCP (("%s write: sock %"PRIsock" eof\n", ddsi_name, conn->m_sock));
|
||||
DDS_LOG(DDS_LC_TCP, "%s write: sock %"PRIsock" eof\n", ddsi_name, conn->m_sock);
|
||||
}
|
||||
piecewise = (ret > 0 && (size_t) ret < len);
|
||||
}
|
||||
|
@ -796,17 +786,17 @@ static ddsi_tran_conn_t ddsi_tcp_accept (ddsi_tran_listener_t listener)
|
|||
{
|
||||
getsockname (tl->m_sock, (struct sockaddr *) &addr, &addrlen);
|
||||
sockaddr_to_string_with_port(buff, sizeof(buff), (os_sockaddr *)&addr);
|
||||
nn_log ((err == 0) ? LC_ERROR : LC_FATAL, "%s accept failed on socket %"PRIsock" at %s errno %d\n", ddsi_name, tl->m_sock, buff, err);
|
||||
DDS_LOG((err == 0) ? DDS_LC_ERROR : DDS_LC_FATAL, "%s accept failed on socket %"PRIsock" at %s errno %d\n", ddsi_name, tl->m_sock, buff, err);
|
||||
}
|
||||
else if (getpeername (sock, (struct sockaddr *) &addr, &addrlen) == -1)
|
||||
{
|
||||
nn_log (LC_WARNING, "%s accepted new socket %"PRIsock" on socket %"PRIsock" but no peer address, errno %d\n", ddsi_name, sock, tl->m_sock, os_getErrno());
|
||||
DDS_WARNING("%s accepted new socket %"PRIsock" on socket %"PRIsock" but no peer address, errno %d\n", ddsi_name, sock, tl->m_sock, os_getErrno());
|
||||
os_sockFree (sock);
|
||||
}
|
||||
else
|
||||
{
|
||||
sockaddr_to_string_with_port(buff, sizeof(buff), (os_sockaddr *)&addr);
|
||||
nn_log (LC_INFO, "%s accept new socket %"PRIsock" on socket %"PRIsock" from %s\n", ddsi_name, sock, tl->m_sock, buff);
|
||||
DDS_INFO("%s accept new socket %"PRIsock" on socket %"PRIsock" from %s\n", ddsi_name, sock, tl->m_sock, buff);
|
||||
|
||||
os_sockSetNonBlocking (sock, true);
|
||||
tcp = ddsi_tcp_new_conn (sock, true, (os_sockaddr *)&addr);
|
||||
|
@ -844,7 +834,7 @@ static void ddsi_tcp_conn_peer_locator (ddsi_tran_conn_t conn, nn_locator_t * lo
|
|||
assert (tc->m_sock != Q_INVALID_SOCKET);
|
||||
ddsi_ipaddr_to_loc (loc, (os_sockaddr *)&tc->m_peer_addr, tc->m_peer_addr.ss_family == AF_INET ? NN_LOCATOR_KIND_TCPv4 : NN_LOCATOR_KIND_TCPv6);
|
||||
ddsi_locator_to_string(buff, sizeof(buff), loc);
|
||||
TRACE (("(%s EP:%s)", ddsi_name, buff));
|
||||
DDS_LOG(DDS_LC_TCP, "(%s EP:%s)", ddsi_name, buff);
|
||||
}
|
||||
|
||||
static void ddsi_tcp_base_init (struct ddsi_tran_conn * base)
|
||||
|
@ -907,14 +897,14 @@ static ddsi_tran_listener_t ddsi_tcp_create_listener (int port, ddsi_tran_qos_t
|
|||
if (getsockname (sock, (os_sockaddr *) &addr, &addrlen) == -1)
|
||||
{
|
||||
int err = os_getErrno ();
|
||||
NN_ERROR ("ddsi_tcp_create_listener: getsockname errno %d\n", err);
|
||||
DDS_ERROR("ddsi_tcp_create_listener: getsockname errno %d\n", err);
|
||||
ddsi_tcp_sock_free (sock, NULL);
|
||||
os_free (tl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sockaddr_to_string_with_port(buff, sizeof(buff), (os_sockaddr *)&addr);
|
||||
nn_log (LC_INFO, "%s create listener socket %"PRIsock" on %s\n", ddsi_name, sock, buff);
|
||||
DDS_INFO("%s create listener socket %"PRIsock" on %s\n", ddsi_name, sock, buff);
|
||||
}
|
||||
|
||||
return tl ? &tl->m_base : NULL;
|
||||
|
@ -924,7 +914,7 @@ static void ddsi_tcp_conn_delete (ddsi_tcp_conn_t conn)
|
|||
{
|
||||
char buff[DDSI_LOCSTRLEN];
|
||||
sockaddr_to_string_with_port(buff, sizeof(buff), (os_sockaddr *)&conn->m_peer_addr);
|
||||
nn_log (LC_INFO, "%s free %s connnection on socket %"PRIsock" to %s\n", ddsi_name, conn->m_base.m_server ? "server" : "client", conn->m_sock, buff);
|
||||
DDS_INFO("%s free %s connnection on socket %"PRIsock" to %s\n", ddsi_name, conn->m_base.m_server ? "server" : "client", conn->m_sock, buff);
|
||||
|
||||
#ifdef DDSI_INCLUDE_SSL
|
||||
if (ddsi_tcp_ssl_plugin.ssl_free)
|
||||
|
@ -948,7 +938,7 @@ static void ddsi_tcp_close_conn (ddsi_tran_conn_t tc)
|
|||
nn_locator_t loc;
|
||||
ddsi_tcp_conn_t conn = (ddsi_tcp_conn_t) tc;
|
||||
sockaddr_to_string_with_port(buff, sizeof(buff), (os_sockaddr *)&conn->m_peer_addr);
|
||||
nn_log (LC_INFO, "%s close %s connnection on socket %"PRIsock" to %s\n", ddsi_name, conn->m_base.m_server ? "server" : "client", conn->m_sock, buff);
|
||||
DDS_INFO("%s close %s connnection on socket %"PRIsock" to %s\n", ddsi_name, conn->m_base.m_server ? "server" : "client", conn->m_sock, buff);
|
||||
(void) shutdown (conn->m_sock, 2);
|
||||
ddsi_ipaddr_to_loc(&loc, (os_sockaddr *)&conn->m_peer_addr, conn->m_peer_addr.ss_family == AF_INET ? NN_LOCATOR_KIND_TCPv4 : NN_LOCATOR_KIND_TCPv6);
|
||||
loc.port = conn->m_peer_port;
|
||||
|
@ -984,7 +974,7 @@ static void ddsi_tcp_unblock_listener (ddsi_tran_listener_t listener)
|
|||
os_sockaddr_storage addr;
|
||||
socklen_t addrlen = sizeof (addr);
|
||||
if (getsockname (tl->m_sock, (os_sockaddr *) &addr, &addrlen) == -1)
|
||||
nn_log (LC_WARNING, "%s failed to get listener address error %d\n", ddsi_name, os_getErrno());
|
||||
DDS_WARNING("%s failed to get listener address error %d\n", ddsi_name, os_getErrno());
|
||||
else
|
||||
{
|
||||
switch (addr.ss_family) {
|
||||
|
@ -1016,7 +1006,7 @@ static void ddsi_tcp_unblock_listener (ddsi_tran_listener_t listener)
|
|||
{
|
||||
char buff[DDSI_LOCSTRLEN];
|
||||
sockaddr_to_string_with_port(buff, sizeof(buff), (os_sockaddr *)&addr);
|
||||
nn_log (LC_WARNING, "%s failed to connect to own listener (%s) error %d\n", ddsi_name, buff, os_getErrno());
|
||||
DDS_WARNING("%s failed to connect to own listener (%s) error %d\n", ddsi_name, buff, os_getErrno());
|
||||
}
|
||||
}
|
||||
ddsi_tcp_sock_free (sock, NULL);
|
||||
|
@ -1091,7 +1081,7 @@ int ddsi_tcp_init (void)
|
|||
ddsi_name = "tcp/ssl";
|
||||
if (! (ddsi_tcp_ssl_plugin.init) ())
|
||||
{
|
||||
NN_ERROR ("Failed to initialize OpenSSL\n");
|
||||
DDS_ERROR("Failed to initialize OpenSSL\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -1100,7 +1090,7 @@ int ddsi_tcp_init (void)
|
|||
ut_avlInit (&ddsi_tcp_treedef, &ddsi_tcp_cache_g);
|
||||
os_mutexInit (&ddsi_tcp_cache_lock_g);
|
||||
|
||||
nn_log (LC_INFO | LC_CONFIG, "%s initialized\n", ddsi_name);
|
||||
DDS_LOG(DDS_LC_CONFIG, "%s initialized\n", ddsi_name);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -93,12 +93,12 @@ static ssize_t ddsi_udp_conn_read (ddsi_tran_conn_t conn, unsigned char * buf, s
|
|||
nn_locator_t tmp;
|
||||
ddsi_ipaddr_to_loc(&tmp, (os_sockaddr *)&src, src.ss_family == AF_INET ? NN_LOCATOR_KIND_UDPv4 : NN_LOCATOR_KIND_UDPv6);
|
||||
ddsi_locator_to_string(addrbuf, sizeof(addrbuf), &tmp);
|
||||
NN_WARNING ("%s => %d truncated to %d\n", addrbuf, (int)ret, (int)len);
|
||||
DDS_WARNING("%s => %d truncated to %d\n", addrbuf, (int)ret, (int)len);
|
||||
}
|
||||
}
|
||||
else if (err != os_sockENOTSOCK && err != os_sockECONNRESET)
|
||||
{
|
||||
NN_ERROR ("UDP recvmsg sock %d: ret %d errno %d\n", (int) ((ddsi_udp_conn_t) conn)->m_sock, (int) ret, err);
|
||||
DDS_ERROR("UDP recvmsg sock %d: ret %d errno %d\n", (int) ((ddsi_udp_conn_t) conn)->m_sock, (int) ret, err);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ static ssize_t ddsi_udp_conn_write (ddsi_tran_conn_t conn, const nn_locator_t *d
|
|||
#endif
|
||||
break;
|
||||
default:
|
||||
NN_ERROR("ddsi_udp_conn_write failed with error code %d", err);
|
||||
DDS_ERROR("ddsi_udp_conn_write failed with error code %d", err);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
@ -220,7 +220,7 @@ static unsigned short get_socket_port (os_socket socket)
|
|||
if (getsockname (socket, (os_sockaddr *) &addr, &addrlen) < 0)
|
||||
{
|
||||
int err = os_getErrno();
|
||||
NN_ERROR ("ddsi_udp_get_socket_port: getsockname errno %d\n", err);
|
||||
DDS_ERROR("ddsi_udp_get_socket_port: getsockname errno %d\n", err);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -271,9 +271,8 @@ static ddsi_tran_conn_t ddsi_udp_create_conn
|
|||
uc->m_base.m_write_fn = ddsi_udp_conn_write;
|
||||
uc->m_base.m_disable_multiplexing_fn = ddsi_udp_disable_multiplexing;
|
||||
|
||||
nn_log
|
||||
DDS_INFO
|
||||
(
|
||||
LC_INFO,
|
||||
"ddsi_udp_create_conn %s socket %"PRIsock" port %u\n",
|
||||
mcast ? "multicast" : "unicast",
|
||||
uc->m_sock,
|
||||
|
@ -285,7 +284,7 @@ static ddsi_tran_conn_t ddsi_udp_create_conn
|
|||
if (os_sockSetsockopt (sock, IPPROTO_IP, IP_TOS, (char*) &uc->m_diffserv, sizeof (uc->m_diffserv)) != os_resultSuccess)
|
||||
{
|
||||
int err = os_getErrno();
|
||||
NN_ERROR("ddsi_udp_create_conn: set diffserv error %d\n", err);
|
||||
DDS_ERROR("ddsi_udp_create_conn: set diffserv error %d\n", err);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -294,7 +293,7 @@ static ddsi_tran_conn_t ddsi_udp_create_conn
|
|||
{
|
||||
if (config.participantIndex != PARTICIPANT_INDEX_AUTO)
|
||||
{
|
||||
NN_ERROR
|
||||
DDS_ERROR
|
||||
(
|
||||
"UDP make_socket failed for %s port %u\n",
|
||||
mcast ? "multicast" : "unicast",
|
||||
|
@ -395,9 +394,8 @@ static int ddsi_udp_leave_mc (ddsi_tran_conn_t conn, const nn_locator_t *srcloc,
|
|||
static void ddsi_udp_release_conn (ddsi_tran_conn_t conn)
|
||||
{
|
||||
ddsi_udp_conn_t uc = (ddsi_udp_conn_t) conn;
|
||||
nn_log
|
||||
DDS_INFO
|
||||
(
|
||||
LC_INFO,
|
||||
"ddsi_udp_release_conn %s socket %"PRIsock" port %u\n",
|
||||
conn->m_base.m_multicast ? "multicast" : "unicast",
|
||||
uc->m_sock,
|
||||
|
@ -415,7 +413,7 @@ void ddsi_udp_fini (void)
|
|||
if(os_atomic_dec32_nv (&ddsi_udp_init_g) == 0) {
|
||||
free_group_membership(ddsi_udp_config_g.mship);
|
||||
memset (&ddsi_udp_factory_g, 0, sizeof (ddsi_udp_factory_g));
|
||||
nn_log (LC_INFO | LC_CONFIG, "udp finalized\n");
|
||||
DDS_LOG(DDS_LC_INFO | DDS_LC_CONFIG, "udp finalized\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -505,7 +503,7 @@ static void ddsi_udp_deinit(void)
|
|||
if (os_atomic_dec32_nv(&ddsi_udp_init_g) == 0) {
|
||||
if (ddsi_udp_config_g.mship)
|
||||
free_group_membership(ddsi_udp_config_g.mship);
|
||||
nn_log (LC_INFO | LC_CONFIG, "udp de-initialized\n");
|
||||
DDS_LOG(DDS_LC_INFO | DDS_LC_CONFIG, "udp de-initialized\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -550,7 +548,7 @@ int ddsi_udp_init (void)
|
|||
|
||||
ddsi_factory_add (&ddsi_udp_factory_g);
|
||||
|
||||
nn_log (LC_INFO | LC_CONFIG, "udp initialized\n");
|
||||
DDS_LOG(DDS_LC_INFO | DDS_LC_CONFIG, "udp initialized\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -50,19 +50,19 @@ static int add_addresses_to_addrset_1 (struct addrset *as, const char *ip, int p
|
|||
case AFSR_OK:
|
||||
break;
|
||||
case AFSR_INVALID:
|
||||
NN_ERROR ("%s: %s: not a valid address\n", msgtag, ip);
|
||||
DDS_ERROR("%s: %s: not a valid address\n", msgtag, ip);
|
||||
return -1;
|
||||
case AFSR_UNKNOWN:
|
||||
NN_ERROR ("%s: %s: unknown address\n", msgtag, ip);
|
||||
DDS_ERROR("%s: %s: unknown address\n", msgtag, ip);
|
||||
return -1;
|
||||
case AFSR_MISMATCH:
|
||||
NN_ERROR ("%s: %s: address family mismatch\n", msgtag, ip);
|
||||
DDS_ERROR("%s: %s: address family mismatch\n", msgtag, ip);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (req_mc && !ddsi_is_mcaddr (&loc))
|
||||
{
|
||||
NN_ERROR ("%s: %s: not a multicast address\n", msgtag, ip);
|
||||
DDS_ERROR ("%s: %s: not a multicast address\n", msgtag, ip);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -82,20 +82,20 @@ static int add_addresses_to_addrset_1 (struct addrset *as, const char *ip, int p
|
|||
}
|
||||
else
|
||||
{
|
||||
NN_ERROR ("%s: %s,%d,%d,%d: IPv4 multicast address generator invalid or out of place\n",
|
||||
msgtag, ip, mcgen_base, mcgen_count, mcgen_idx);
|
||||
DDS_ERROR("%s: %s,%d,%d,%d: IPv4 multicast address generator invalid or out of place\n",
|
||||
msgtag, ip, mcgen_base, mcgen_count, mcgen_idx);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (port_mode >= 0)
|
||||
{
|
||||
loc.port = (unsigned) port_mode;
|
||||
nn_log (LC_CONFIG, "%s: add %s", msgtag, ddsi_locator_to_string(buf, sizeof(buf), &loc));
|
||||
DDS_LOG(DDS_LC_CONFIG, "%s: add %s", msgtag, ddsi_locator_to_string(buf, sizeof(buf), &loc));
|
||||
add_to_addrset (as, &loc);
|
||||
}
|
||||
else
|
||||
{
|
||||
nn_log (LC_CONFIG, "%s: add ", msgtag);
|
||||
DDS_LOG(DDS_LC_CONFIG, "%s: add ", msgtag);
|
||||
if (!ddsi_is_mcaddr (&loc))
|
||||
{
|
||||
int i;
|
||||
|
@ -104,9 +104,9 @@ static int add_addresses_to_addrset_1 (struct addrset *as, const char *ip, int p
|
|||
int port = config.port_base + config.port_dg * config.domainId.value + i * config.port_pg + config.port_d1;
|
||||
loc.port = (unsigned) port;
|
||||
if (i == 0)
|
||||
nn_log (LC_CONFIG, "%s", ddsi_locator_to_string(buf, sizeof(buf), &loc));
|
||||
DDS_LOG(DDS_LC_CONFIG, "%s", ddsi_locator_to_string(buf, sizeof(buf), &loc));
|
||||
else
|
||||
nn_log (LC_CONFIG, ", :%d", port);
|
||||
DDS_LOG(DDS_LC_CONFIG, ", :%d", port);
|
||||
add_to_addrset (as, &loc);
|
||||
}
|
||||
}
|
||||
|
@ -116,12 +116,12 @@ static int add_addresses_to_addrset_1 (struct addrset *as, const char *ip, int p
|
|||
if (port == -1)
|
||||
port = config.port_base + config.port_dg * config.domainId.value + config.port_d0;
|
||||
loc.port = (unsigned) port;
|
||||
nn_log (LC_CONFIG, "%s", ddsi_locator_to_string(buf, sizeof(buf), &loc));
|
||||
DDS_LOG(DDS_LC_CONFIG, "%s", ddsi_locator_to_string(buf, sizeof(buf), &loc));
|
||||
add_to_addrset (as, &loc);
|
||||
}
|
||||
}
|
||||
|
||||
nn_log (LC_CONFIG, "\n");
|
||||
DDS_LOG(DDS_LC_CONFIG, "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ int add_addresses_to_addrset (struct addrset *as, const char *addrs, int port_mo
|
|||
if (add_addresses_to_addrset_1 (as, ip, port, msgtag, req_mc, mcgen_base, mcgen_count, mcgen_idx) < 0)
|
||||
goto error;
|
||||
} else {
|
||||
NN_ERROR ("%s: %s: port %d invalid\n", msgtag, a, port);
|
||||
DDS_ERROR("%s: %s: port %d invalid\n", msgtag, a, port);
|
||||
}
|
||||
}
|
||||
retval = 0;
|
||||
|
@ -562,24 +562,24 @@ int addrset_forone (struct addrset *as, addrset_forone_fun_t f, void *arg)
|
|||
|
||||
struct log_addrset_helper_arg
|
||||
{
|
||||
logcat_t tf;
|
||||
uint32_t tf;
|
||||
};
|
||||
|
||||
static void log_addrset_helper (const nn_locator_t *n, void *varg)
|
||||
{
|
||||
const struct log_addrset_helper_arg *arg = varg;
|
||||
char buf[DDSI_LOCSTRLEN];
|
||||
if (config.enabled_logcats & arg->tf)
|
||||
nn_log (arg->tf, " %s", ddsi_locator_to_string(buf, sizeof(buf), n));
|
||||
if (dds_get_log_mask() & arg->tf)
|
||||
DDS_LOG(arg->tf, " %s", ddsi_locator_to_string(buf, sizeof(buf), n));
|
||||
}
|
||||
|
||||
void nn_log_addrset (logcat_t tf, const char *prefix, const struct addrset *as)
|
||||
void nn_log_addrset (uint32_t tf, const char *prefix, const struct addrset *as)
|
||||
{
|
||||
if (config.enabled_logcats & tf)
|
||||
if (dds_get_log_mask() & tf)
|
||||
{
|
||||
struct log_addrset_helper_arg arg;
|
||||
arg.tf = tf;
|
||||
nn_log (tf, "%s", prefix);
|
||||
DDS_LOG(tf, "%s", prefix);
|
||||
addrset_forall ((struct addrset *) as, log_addrset_helper, &arg); /* drop const, we know it is */
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,10 +98,10 @@ struct cfgst {
|
|||
|
||||
/* "trace" is special: it enables (nearly) everything */
|
||||
static const char *logcat_names[] = {
|
||||
"fatal", "error", "warning", "config", "info", "discovery", "data", "radmin", "timing", "traffic", "topic", "tcp", "plist", "whc", "throttle", "trace", NULL
|
||||
"fatal", "error", "warning", "info", "config", "discovery", "data", "radmin", "timing", "traffic", "topic", "tcp", "plist", "whc", "throttle", "trace", NULL
|
||||
};
|
||||
static const logcat_t logcat_codes[] = {
|
||||
LC_FATAL, LC_ERROR, LC_WARNING, LC_CONFIG, LC_INFO, LC_DISCOVERY, LC_DATA, LC_RADMIN, LC_TIMING, LC_TRAFFIC, LC_TOPIC, LC_TCP, LC_PLIST, LC_WHC, LC_THROTTLE, LC_ALLCATS
|
||||
static const uint32_t logcat_codes[] = {
|
||||
DDS_LC_FATAL, DDS_LC_ERROR, DDS_LC_WARNING, DDS_LC_INFO, DDS_LC_CONFIG, DDS_LC_DISCOVERY, DDS_LC_DATA, DDS_LC_RADMIN, DDS_LC_TIMING, DDS_LC_TRAFFIC, DDS_LC_TOPIC, DDS_LC_TCP, DDS_LC_PLIST, DDS_LC_WHC, DDS_LC_THROTTLE, DDS_LC_ALL
|
||||
};
|
||||
|
||||
/* We want the tracing/verbosity settings to be fixed while parsing
|
||||
|
@ -785,7 +785,7 @@ static const struct cfgelem tracing_cfgelems[] = {
|
|||
<li><i>finest</i>: <i>finer</i> + trace</li></ul>\n\
|
||||
<p>While <i>none</i> prevents any message from being written to a DDSI2 log file.</p>\n\
|
||||
<p>The categorisation of tracing output is incomplete and hence most of the verbosity levels and categories are not of much use in the current release. This is an ongoing process and here we describe the target situation rather than the current situation. Currently, the most useful verbosity levels are <i>config</i>, <i>fine</i> and <i>finest</i>.</p>" },
|
||||
{ LEAF("OutputFile"), 1, DDSC_PROJECT_NAME_NOSPACE_SMALL"-trace.log", ABSOFF(tracingOutputFileName), 0, uf_tracingOutputFileName, ff_free, pf_string,
|
||||
{ LEAF("OutputFile"), 1, DDSC_PROJECT_NAME_NOSPACE_SMALL".log", ABSOFF(tracingOutputFileName), 0, uf_tracingOutputFileName, ff_free, pf_string,
|
||||
"<p>This option specifies where the logging is printed to. Note that <i>stdout</i> and <i>stderr</i> are treated as special values, representing \"standard out\" and \"standard error\" respectively. No file is created unless logging categories are enabled using the Tracing/Verbosity or Tracing/EnabledCategory settings.</p>" },
|
||||
{ LEAF_W_ATTRS("Timestamps", timestamp_cfgattrs), 1, "true", ABSOFF(tracingTimestamps), 0, uf_boolean, 0, pf_boolean,
|
||||
"<p>This option has no effect.</p>" },
|
||||
|
@ -1015,7 +1015,7 @@ static size_t cfg_note_vsnprintf(struct cfg_note_buf *bb, const char *fmt, va_li
|
|||
return nbufsize;
|
||||
}
|
||||
if ( x < 0 )
|
||||
NN_FATAL("cfg_note_vsnprintf: os_vsnprintf failed\n");
|
||||
DDS_FATAL("cfg_note_vsnprintf: os_vsnprintf failed\n");
|
||||
else
|
||||
bb->bufpos += (size_t) x;
|
||||
return 0;
|
||||
|
@ -1036,13 +1036,13 @@ static void cfg_note_snprintf(struct cfg_note_buf *bb, const char *fmt, ...)
|
|||
va_start(ap, fmt);
|
||||
s = os_vsnprintf(bb->buf + bb->bufpos, bb->bufsize - bb->bufpos, fmt, ap);
|
||||
if ( s < 0 || (size_t) s >= bb->bufsize - bb->bufpos )
|
||||
NN_FATAL("cfg_note_snprintf: os_vsnprintf failed\n");
|
||||
DDS_FATAL("cfg_note_snprintf: os_vsnprintf failed\n");
|
||||
va_end(ap);
|
||||
bb->bufpos += (size_t) s;
|
||||
}
|
||||
}
|
||||
|
||||
static size_t cfg_note(struct cfgst *cfgst, logcat_t cat, size_t bsz, const char *fmt, va_list ap)
|
||||
static size_t cfg_note(struct cfgst *cfgst, uint32_t cat, size_t bsz, const char *fmt, va_list ap)
|
||||
{
|
||||
/* Have to snprintf our way to a single string so we can OS_REPORT
|
||||
as well as nn_log. Otherwise configuration errors will be lost
|
||||
|
@ -1053,14 +1053,14 @@ static size_t cfg_note(struct cfgst *cfgst, logcat_t cat, size_t bsz, const char
|
|||
int i, sidx;
|
||||
size_t r;
|
||||
|
||||
if (cat & LC_ERROR) {
|
||||
if (cat & DDS_LC_ERROR) {
|
||||
cfgst->error = 1;
|
||||
}
|
||||
|
||||
bb.bufpos = 0;
|
||||
bb.bufsize = (bsz == 0) ? 1024 : bsz;
|
||||
if ( (bb.buf = os_malloc(bb.bufsize)) == NULL )
|
||||
NN_FATAL("cfg_note: out of memory\n");
|
||||
DDS_FATAL("cfg_note: out of memory\n");
|
||||
|
||||
cfg_note_snprintf(&bb, "config: ");
|
||||
|
||||
|
@ -1093,17 +1093,17 @@ static size_t cfg_note(struct cfgst *cfgst, logcat_t cat, size_t bsz, const char
|
|||
}
|
||||
|
||||
switch ( cat ) {
|
||||
case LC_CONFIG:
|
||||
nn_log(cat, "%s\n", bb.buf);
|
||||
case DDS_LC_CONFIG:
|
||||
DDS_LOG(cat, "%s\n", bb.buf);
|
||||
break;
|
||||
case LC_WARNING:
|
||||
NN_WARNING("%s\n", bb.buf);
|
||||
case DDS_LC_WARNING:
|
||||
DDS_WARNING("%s\n", bb.buf);
|
||||
break;
|
||||
case LC_ERROR:
|
||||
NN_ERROR("%s\n", bb.buf);
|
||||
case DDS_LC_ERROR:
|
||||
DDS_ERROR("%s\n", bb.buf);
|
||||
break;
|
||||
default:
|
||||
NN_FATAL("cfg_note unhandled category %u for message %s\n", (unsigned) cat, bb.buf);
|
||||
DDS_FATAL("cfg_note unhandled category %u for message %s\n", (unsigned) cat, bb.buf);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1118,7 +1118,7 @@ static void cfg_warning(struct cfgst *cfgst, const char *fmt, ...)
|
|||
size_t bsz = 0;
|
||||
do {
|
||||
va_start(ap, fmt);
|
||||
bsz = cfg_note(cfgst, LC_WARNING, bsz, fmt, ap);
|
||||
bsz = cfg_note(cfgst, DDS_LC_WARNING, bsz, fmt, ap);
|
||||
va_end(ap);
|
||||
} while ( bsz > 0 );
|
||||
}
|
||||
|
@ -1130,7 +1130,7 @@ static int cfg_error(struct cfgst *cfgst, const char *fmt, ...)
|
|||
size_t bsz = 0;
|
||||
do {
|
||||
va_start(ap, fmt);
|
||||
bsz = cfg_note(cfgst, LC_ERROR, bsz, fmt, ap);
|
||||
bsz = cfg_note(cfgst, DDS_LC_ERROR, bsz, fmt, ap);
|
||||
va_end(ap);
|
||||
} while ( bsz > 0 );
|
||||
return 0;
|
||||
|
@ -1142,7 +1142,7 @@ static int cfg_log(struct cfgst *cfgst, const char *fmt, ...)
|
|||
size_t bsz = 0;
|
||||
do {
|
||||
va_start(ap, fmt);
|
||||
bsz = cfg_note(cfgst, LC_CONFIG, bsz, fmt, ap);
|
||||
bsz = cfg_note(cfgst, DDS_LC_CONFIG, bsz, fmt, ap);
|
||||
va_end(ap);
|
||||
} while ( bsz > 0 );
|
||||
return 0;
|
||||
|
@ -1345,7 +1345,7 @@ static void pf_boolean_default (struct cfgst *cfgst, void *parent, struct cfgele
|
|||
static int uf_logcat(struct cfgst *cfgst, UNUSED_ARG(void *parent), UNUSED_ARG(struct cfgelem const * const cfgelem), UNUSED_ARG(int first), const char *value)
|
||||
{
|
||||
static const char **vs = logcat_names;
|
||||
static const logcat_t *lc = logcat_codes;
|
||||
static const uint32_t *lc = logcat_codes;
|
||||
char *copy = os_strdup(value), *cursor = copy, *tok;
|
||||
while ( (tok = os_strsep(&cursor, ",")) != NULL ) {
|
||||
int idx = list_index(vs, tok);
|
||||
|
@ -1365,8 +1365,8 @@ static int uf_verbosity(struct cfgst *cfgst, UNUSED_ARG(void *parent), UNUSED_AR
|
|||
static const char *vs[] = {
|
||||
"finest", "finer", "fine", "config", "info", "warning", "severe", "none", NULL
|
||||
};
|
||||
static const logcat_t lc[] = {
|
||||
LC_ALLCATS, LC_TRAFFIC | LC_TIMING, LC_DISCOVERY | LC_THROTTLE, LC_CONFIG, LC_INFO, LC_WARNING, LC_ERROR | LC_FATAL, 0, 0
|
||||
static const uint32_t lc[] = {
|
||||
DDS_LC_ALL, DDS_LC_TRAFFIC | DDS_LC_TIMING, DDS_LC_DISCOVERY | DDS_LC_THROTTLE, DDS_LC_CONFIG, DDS_LC_INFO, DDS_LC_WARNING, DDS_LC_ERROR | DDS_LC_FATAL, 0, 0
|
||||
};
|
||||
int idx = list_index(vs, value);
|
||||
assert(sizeof(vs) / sizeof(*vs) == sizeof(lc) / sizeof(*lc));
|
||||
|
@ -2270,7 +2270,7 @@ static int uf_standards_conformance(struct cfgst *cfgst, void *parent, struct cf
|
|||
static const char *vs[] = {
|
||||
"pedantic", "strict", "lax", NULL
|
||||
};
|
||||
static const logcat_t lc[] = {
|
||||
static const uint32_t lc[] = {
|
||||
NN_SC_PEDANTIC, NN_SC_STRICT, NN_SC_LAX, 0
|
||||
};
|
||||
enum nn_standards_conformance *elem = cfg_address(cfgst, parent, cfgelem);
|
||||
|
@ -2298,7 +2298,7 @@ static void pf_standards_conformance(struct cfgst *cfgst, void *parent, struct c
|
|||
|
||||
static void pf_logcat(struct cfgst *cfgst, UNUSED_ARG(void *parent), UNUSED_ARG(struct cfgelem const * const cfgelem), UNUSED_ARG(int is_default))
|
||||
{
|
||||
logcat_t remaining = config.enabled_logcats;
|
||||
uint32_t remaining = config.enabled_logcats;
|
||||
char res[256] = "", *resp = res;
|
||||
const char *prefix = "";
|
||||
size_t i;
|
||||
|
@ -2313,9 +2313,9 @@ static void pf_logcat(struct cfgst *cfgst, UNUSED_ARG(void *parent), UNUSED_ARG(
|
|||
}
|
||||
#endif
|
||||
/* TRACE enables ALLCATS, all the others just one */
|
||||
if ( (remaining & LC_ALLCATS) == LC_ALLCATS ) {
|
||||
if ( (remaining & DDS_LC_ALL) == DDS_LC_ALL ) {
|
||||
resp += snprintf(resp, 256, "%strace", prefix);
|
||||
remaining &= ~LC_ALLCATS;
|
||||
remaining &= ~DDS_LC_ALL;
|
||||
prefix = ",";
|
||||
}
|
||||
for ( i = 0; i < sizeof(logcat_codes) / sizeof(*logcat_codes); i++ ) {
|
||||
|
@ -2692,7 +2692,7 @@ static int sort_channels_check_nodups(struct config *cfg)
|
|||
result = 0;
|
||||
for ( i = 0; i < n - 1; i++ ) {
|
||||
if ( ary[i]->priority == ary[i + 1]->priority ) {
|
||||
NN_ERROR("config: duplicate channel definition for priority %u: channels %s and %s\n",
|
||||
DDS_ERROR("config: duplicate channel definition for priority %u: channels %s and %s\n",
|
||||
ary[i]->priority, ary[i]->name, ary[i + 1]->name);
|
||||
result = ERR_ENTITY_EXISTS;
|
||||
}
|
||||
|
@ -2722,7 +2722,7 @@ struct cfgst * config_init
|
|||
memset(&config, 0, sizeof(config));
|
||||
|
||||
config.tracingOutputFile = stderr;
|
||||
config.enabled_logcats = LC_ERROR | LC_WARNING;
|
||||
config.enabled_logcats = DDS_LC_ERROR | DDS_LC_WARNING;
|
||||
|
||||
/* eventually, we domainId.value will be the real domain id selected, even if it was configured
|
||||
to the default of "any" and has "isdefault" set; initializing it to the default-default
|
||||
|
@ -2747,7 +2747,7 @@ struct cfgst * config_init
|
|||
|
||||
if ( (fp = fopen(tok, "r")) == NULL ) {
|
||||
if ( strncmp(tok, "file://", 7) != 0 || (fp = fopen(tok + 7, "r")) == NULL ) {
|
||||
NN_ERROR("can't open configuration file %s\n", tok);
|
||||
DDS_ERROR("can't open configuration file %s\n", tok);
|
||||
os_free(copy);
|
||||
os_free(cfgst);
|
||||
return NULL;
|
||||
|
@ -2816,7 +2816,7 @@ struct cfgst * config_init
|
|||
break;
|
||||
}
|
||||
if (!ok1)
|
||||
NN_ERROR ("config: invalid combination of Transport, IPv6, TCP\n");
|
||||
DDS_ERROR("config: invalid combination of Transport, IPv6, TCP\n");
|
||||
ok = ok && ok1;
|
||||
cfgst->cfg->compat_use_ipv6 = (cfgst->cfg->transport_selector == TRANS_UDP6 || cfgst->cfg->transport_selector == TRANS_TCP6) ? BOOLDEF_TRUE : BOOLDEF_FALSE;
|
||||
cfgst->cfg->compat_tcp_enable = (cfgst->cfg->transport_selector == TRANS_TCP || cfgst->cfg->transport_selector == TRANS_TCP6) ? BOOLDEF_TRUE : BOOLDEF_FALSE;
|
||||
|
@ -2844,17 +2844,17 @@ struct cfgst * config_init
|
|||
case Q_CIPHER_NULL:
|
||||
/* nop */
|
||||
if ( s->key && strlen(s->key) > 0 ) {
|
||||
NN_ERROR("config: DDSI2Service/Security/SecurityProfile[@cipherkey]: %s: cipher key not required\n", s->key);
|
||||
DDS_ERROR("config: DDSI2Service/Security/SecurityProfile[@cipherkey]: %s: cipher key not required\n", s->key);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* read the cipherkey if present */
|
||||
if ( !s->key || strlen(s->key) == 0 ) {
|
||||
NN_ERROR("config: DDSI2Service/Security/SecurityProfile[@cipherkey]: cipher key missing\n");
|
||||
DDS_ERROR("config: DDSI2Service/Security/SecurityProfile[@cipherkey]: cipher key missing\n");
|
||||
ok = 0;
|
||||
} else if ( q_security_plugin.valid_uri && !(q_security_plugin.valid_uri) (s->cipher, s->key) ) {
|
||||
NN_ERROR("config: DDSI2Service/Security/SecurityProfile[@cipherkey]: %s : incorrect key\n", s->key);
|
||||
DDS_ERROR("config: DDSI2Service/Security/SecurityProfile[@cipherkey]: %s : incorrect key\n", s->key);
|
||||
ok = 0;
|
||||
}
|
||||
}
|
||||
|
@ -2883,7 +2883,7 @@ struct cfgst * config_init
|
|||
if ( s )
|
||||
p->securityProfile = s;
|
||||
else {
|
||||
NN_ERROR("config: DDSI2Service/Partitioning/NetworkPartitions/NetworkPartition[@securityprofile]: %s: unknown securityprofile\n", p->profileName);
|
||||
DDS_ERROR("config: DDSI2Service/Partitioning/NetworkPartitions/NetworkPartition[@securityprofile]: %s: unknown securityprofile\n", p->profileName);
|
||||
ok = 0;
|
||||
}
|
||||
}
|
||||
|
@ -2911,7 +2911,7 @@ struct cfgst * config_init
|
|||
if ( p ) {
|
||||
m->partition = p;
|
||||
} else {
|
||||
NN_ERROR("config: DDSI2Service/Partitioning/PartitionMappings/PartitionMapping[@networkpartition]: %s: unknown partition\n", m->networkPartition);
|
||||
DDS_ERROR("config: DDSI2Service/Partitioning/PartitionMappings/PartitionMapping[@networkpartition]: %s: unknown partition\n", m->networkPartition);
|
||||
ok = 0;
|
||||
}
|
||||
m = m->next;
|
||||
|
@ -2950,7 +2950,9 @@ void config_fini(_In_ struct cfgst *cfgst)
|
|||
assert(config.valid);
|
||||
|
||||
free_all_elements(cfgst, cfgst->cfg, root_cfgelems);
|
||||
if ( config.tracingOutputFile && config.tracingOutputFile != stdout && config.tracingOutputFile != stderr) {
|
||||
dds_set_log_file(stderr);
|
||||
dds_set_trace_file(stderr);
|
||||
if (config.tracingOutputFile && config.tracingOutputFile != stdout && config.tracingOutputFile != stderr) {
|
||||
fclose(config.tracingOutputFile);
|
||||
}
|
||||
memset(&config, 0, sizeof(config));
|
||||
|
|
|
@ -202,11 +202,11 @@ int spdp_write (struct participant *pp)
|
|||
|
||||
propagate_builtin_topic_participant(&(pp->e), pp->plist, now(), true);
|
||||
|
||||
TRACE (("spdp_write(%x:%x:%x:%x)\n", PGUID (pp->e.guid)));
|
||||
DDS_TRACE("spdp_write(%x:%x:%x:%x)\n", PGUID (pp->e.guid));
|
||||
|
||||
if ((wr = get_builtin_writer (pp, NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER)) == NULL)
|
||||
{
|
||||
TRACE (("spdp_write(%x:%x:%x:%x) - builtin participant writer not found\n", PGUID (pp->e.guid)));
|
||||
DDS_TRACE("spdp_write(%x:%x:%x:%x) - builtin participant writer not found\n", PGUID (pp->e.guid));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ int spdp_write (struct participant *pp)
|
|||
size = strlen(node) + strlen(OSPL_VERSION_STR) + strlen(OSPL_HOST_STR) + strlen(OSPL_TARGET_STR) + 4; /* + ///'\0' */
|
||||
ps.prismtech_participant_version_info.internals = os_malloc(size);
|
||||
(void) snprintf(ps.prismtech_participant_version_info.internals, size, "%s/%s/%s/%s", node, OSPL_VERSION_STR, OSPL_HOST_STR, OSPL_TARGET_STR);
|
||||
TRACE (("spdp_write(%x:%x:%x:%x) - internals: %s\n", PGUID (pp->e.guid), ps.prismtech_participant_version_info.internals));
|
||||
DDS_TRACE("spdp_write(%x:%x:%x:%x) - internals: %s\n", PGUID (pp->e.guid), ps.prismtech_participant_version_info.internals);
|
||||
}
|
||||
|
||||
/* Participant QoS's insofar as they are set, different from the default, and mapped to the SPDP data, rather than to the PrismTech-specific CMParticipant endpoint. Currently, that means just USER_DATA. */
|
||||
|
@ -339,7 +339,7 @@ int spdp_dispose_unregister (struct participant *pp)
|
|||
|
||||
if ((wr = get_builtin_writer (pp, NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER)) == NULL)
|
||||
{
|
||||
TRACE (("spdp_dispose_unregister(%x:%x:%x:%x) - builtin participant writer not found\n", PGUID (pp->e.guid)));
|
||||
DDS_TRACE("spdp_dispose_unregister(%x:%x:%x:%x) - builtin participant writer not found\n", PGUID (pp->e.guid));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -400,7 +400,7 @@ static void respond_to_spdp (const nn_guid_t *dest_proxypp_guid)
|
|||
int64_t delay_max_ms = config.spdp_response_delay_max / 1000000;
|
||||
int64_t delay = (int64_t) delay_norm * delay_max_ms / 1000;
|
||||
nn_mtime_t tsched = add_duration_to_mtime (tnow, delay);
|
||||
TRACE ((" %"PRId64, delay));
|
||||
DDS_TRACE(" %"PRId64, delay);
|
||||
if (!config.unicast_response_to_spdp_messages)
|
||||
/* pp can't reach gc_delete_participant => can safely reschedule */
|
||||
resched_xevent_if_earlier (pp->spdp_xevent, tsched);
|
||||
|
@ -414,26 +414,26 @@ static int handle_SPDP_dead (const struct receiver_state *rst, nn_wctime_t times
|
|||
{
|
||||
nn_guid_t guid;
|
||||
|
||||
if (!(config.enabled_logcats & LC_TRACE))
|
||||
nn_log (LC_DISCOVERY, "SPDP ST%x", statusinfo);
|
||||
if (!(dds_get_log_mask() & DDS_LC_DISCOVERY))
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "SPDP ST%x", statusinfo);
|
||||
|
||||
if (datap->present & PP_PARTICIPANT_GUID)
|
||||
{
|
||||
guid = datap->participant_guid;
|
||||
nn_log (LC_DISCOVERY, " %x:%x:%x:%x", PGUID (guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " %x:%x:%x:%x", PGUID (guid));
|
||||
assert (guid.entityid.u == NN_ENTITYID_PARTICIPANT);
|
||||
if (delete_proxy_participant_by_guid (&guid, timestamp, 0) < 0)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " unknown");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " unknown");
|
||||
}
|
||||
else
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " delete");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " delete");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NN_WARNING ("data (SPDP, vendor %u.%u): no/invalid payload\n", rst->vendor.id[0], rst->vendor.id[1]);
|
||||
DDS_WARNING("data (SPDP, vendor %u.%u): no/invalid payload\n", rst->vendor.id[0], rst->vendor.id[1]);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -485,12 +485,12 @@ static void make_participants_dependent_on_ddsi2 (const nn_guid_t *ddsi2guid, nn
|
|||
{
|
||||
if (vendor_is_opensplice (pp->vendor) && pp->e.guid.prefix.u[0] == ddsi2guid->prefix.u[0] && !pp->is_ddsi2_pp)
|
||||
{
|
||||
TRACE (("proxy participant %x:%x:%x:%x depends on ddsi2 %x:%x:%x:%x", PGUID (pp->e.guid), PGUID (*ddsi2guid)));
|
||||
DDS_TRACE("proxy participant %x:%x:%x:%x depends on ddsi2 %x:%x:%x:%x", PGUID (pp->e.guid), PGUID (*ddsi2guid));
|
||||
os_mutexLock (&pp->e.lock);
|
||||
pp->privileged_pp_guid = *ddsi2guid;
|
||||
os_mutexUnlock (&pp->e.lock);
|
||||
proxy_participant_reassign_lease (pp, d2pp_lease);
|
||||
TRACE (("\n"));
|
||||
DDS_TRACE("\n");
|
||||
|
||||
if (ephash_lookup_proxy_participant_guid (ddsi2guid) == NULL)
|
||||
{
|
||||
|
@ -505,7 +505,7 @@ static void make_participants_dependent_on_ddsi2 (const nn_guid_t *ddsi2guid, nn
|
|||
|
||||
if (pp != NULL)
|
||||
{
|
||||
TRACE (("make_participants_dependent_on_ddsi2: ddsi2 %x:%x:%x:%x is no more, delete %x:%x:%x:%x\n", PGUID (*ddsi2guid), PGUID (pp->e.guid)));
|
||||
DDS_TRACE("make_participants_dependent_on_ddsi2: ddsi2 %x:%x:%x:%x is no more, delete %x:%x:%x:%x\n", PGUID (*ddsi2guid), PGUID (pp->e.guid));
|
||||
delete_proxy_participant_by_guid (&pp->e.guid, timestamp, 1);
|
||||
}
|
||||
}
|
||||
|
@ -523,12 +523,12 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
nn_duration_t lease_duration;
|
||||
unsigned custom_flags = 0;
|
||||
|
||||
if (!(config.enabled_logcats & LC_TRACE))
|
||||
nn_log (LC_DISCOVERY, "SPDP ST0");
|
||||
if (!(dds_get_log_mask() & DDS_LC_DISCOVERY))
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "SPDP ST0");
|
||||
|
||||
if (!(datap->present & PP_PARTICIPANT_GUID) || !(datap->present & PP_BUILTIN_ENDPOINT_SET))
|
||||
{
|
||||
NN_WARNING ("data (SPDP, vendor %u.%u): no/invalid payload\n", rst->vendor.id[0], rst->vendor.id[1]);
|
||||
DDS_WARNING("data (SPDP, vendor %u.%u): no/invalid payload\n", rst->vendor.id[0], rst->vendor.id[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -546,7 +546,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
NN_BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER)) &&
|
||||
config.assume_rti_has_pmd_endpoints)
|
||||
{
|
||||
NN_WARNING ("data (SPDP, vendor %u.%u): assuming unadvertised PMD endpoints do exist\n",
|
||||
DDS_WARNING("data (SPDP, vendor %u.%u): assuming unadvertised PMD endpoints do exist\n",
|
||||
rst->vendor.id[0], rst->vendor.id[1]);
|
||||
builtin_endpoint_set |=
|
||||
NN_BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER |
|
||||
|
@ -561,14 +561,14 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
but it would cause problems with cases where we would be happy with only
|
||||
(say) CM participant. Have to do a backwards-compatible fix because it has
|
||||
already been released with the flags all aliased to bits 0 and 1 ... */
|
||||
nn_log (LC_DISCOVERY, " (ptbes_fixed_0 %x)", prismtech_builtin_endpoint_set);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (ptbes_fixed_0 %x)", prismtech_builtin_endpoint_set);
|
||||
if (prismtech_builtin_endpoint_set & NN_DISC_BUILTIN_ENDPOINT_CM_PARTICIPANT_READER)
|
||||
prismtech_builtin_endpoint_set |= NN_DISC_BUILTIN_ENDPOINT_CM_PUBLISHER_READER | NN_DISC_BUILTIN_ENDPOINT_CM_SUBSCRIBER_READER;
|
||||
if (prismtech_builtin_endpoint_set & NN_DISC_BUILTIN_ENDPOINT_CM_PARTICIPANT_WRITER)
|
||||
prismtech_builtin_endpoint_set |= NN_DISC_BUILTIN_ENDPOINT_CM_PUBLISHER_WRITER | NN_DISC_BUILTIN_ENDPOINT_CM_SUBSCRIBER_WRITER;
|
||||
}
|
||||
|
||||
nn_log (LC_DISCOVERY, " %x:%x:%x:%x", PGUID (datap->participant_guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " %x:%x:%x:%x", PGUID (datap->participant_guid));
|
||||
|
||||
/* Local SPDP packets may be looped back, and that may include ones
|
||||
currently being deleted. The first thing that happens when
|
||||
|
@ -578,7 +578,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
|
||||
if (is_deleted_participant_guid (&datap->participant_guid, DPG_REMOTE))
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " (recently deleted)");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (recently deleted)");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -588,7 +588,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
islocal = 1;
|
||||
if (islocal)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " (local %d)", islocal);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (local %d)", islocal);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -599,12 +599,12 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
are even skipping the automatic lease renewal. Therefore do it
|
||||
regardless of
|
||||
config.arrival_of_data_asserts_pp_and_ep_liveliness. */
|
||||
nn_log (LC_DISCOVERY, " (known)");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (known)");
|
||||
lease_renew (os_atomic_ldvoidp (&proxypp->lease), now_et ());
|
||||
os_mutexLock (&proxypp->e.lock);
|
||||
if (proxypp->implicitly_created)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " (NEW was-implicitly-created)");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (NEW was-implicitly-created)");
|
||||
proxypp->implicitly_created = 0;
|
||||
update_proxy_participant_plist_locked (proxypp, datap, UPD_PROXYPP_SPDP, timestamp);
|
||||
}
|
||||
|
@ -612,7 +612,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
return 0;
|
||||
}
|
||||
|
||||
nn_log (LC_DISCOVERY, " bes %x ptbes %x NEW", builtin_endpoint_set, prismtech_builtin_endpoint_set);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " bes %x ptbes %x NEW", builtin_endpoint_set, prismtech_builtin_endpoint_set);
|
||||
|
||||
if (datap->present & PP_PARTICIPANT_LEASE_DURATION)
|
||||
{
|
||||
|
@ -620,7 +620,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
}
|
||||
else
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " (PARTICIPANT_LEASE_DURATION defaulting to 100s)");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (PARTICIPANT_LEASE_DURATION defaulting to 100s)");
|
||||
lease_duration = nn_to_ddsi_duration (100 * T_SECOND);
|
||||
}
|
||||
|
||||
|
@ -632,7 +632,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
(datap->prismtech_participant_version_info.flags & NN_PRISMTECH_FL_PARTICIPANT_IS_DDSI2))
|
||||
custom_flags |= CF_PARTICIPANT_IS_DDSI2;
|
||||
|
||||
nn_log (LC_DISCOVERY, " (0x%08x-0x%08x-0x%08x-0x%08x-0x%08x %s)",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (0x%08x-0x%08x-0x%08x-0x%08x-0x%08x %s)",
|
||||
datap->prismtech_participant_version_info.version,
|
||||
datap->prismtech_participant_version_info.flags,
|
||||
datap->prismtech_participant_version_info.unused[0],
|
||||
|
@ -652,7 +652,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
if ((builtin_endpoint_set & bes_sedp_announcer_mask) != bes_sedp_announcer_mask &&
|
||||
memcmp (&privileged_pp_guid, &datap->participant_guid, sizeof (nn_guid_t)) != 0)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " (depends on %x:%x:%x:%x)", PGUID (privileged_pp_guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (depends on %x:%x:%x:%x)", PGUID (privileged_pp_guid));
|
||||
/* never expire lease for this proxy: it won't actually expire
|
||||
until the "privileged" one expires anyway */
|
||||
lease_duration = nn_to_ddsi_duration (T_NEVER);
|
||||
|
@ -668,7 +668,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
{
|
||||
privileged_pp_guid.prefix = ddsi2->e.guid.prefix;
|
||||
lease_duration = nn_to_ddsi_duration (T_NEVER);
|
||||
nn_log (LC_DISCOVERY, " (depends on %x:%x:%x:%x)", PGUID (privileged_pp_guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (depends on %x:%x:%x:%x)", PGUID (privileged_pp_guid));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -699,40 +699,40 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
else
|
||||
{
|
||||
uc_same_subnet = 1;
|
||||
nn_log (LC_DISCOVERY, " subnet-filter");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " subnet-filter");
|
||||
}
|
||||
|
||||
/* If unicast locators not present, then try to obtain from connection */
|
||||
if (!config.tcp_use_peeraddr_for_unicast && (datap->present & PP_DEFAULT_UNICAST_LOCATOR) && (get_locator (&loc, &datap->default_unicast_locators, uc_same_subnet)))
|
||||
add_to_addrset (as_default, &loc);
|
||||
else {
|
||||
nn_log (LC_DISCOVERY, " (srclocD)");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (srclocD)");
|
||||
add_to_addrset (as_default, &rst->srcloc);
|
||||
}
|
||||
|
||||
if (!config.tcp_use_peeraddr_for_unicast && (datap->present & PP_METATRAFFIC_UNICAST_LOCATOR) && (get_locator (&loc, &datap->metatraffic_unicast_locators, uc_same_subnet)))
|
||||
add_to_addrset (as_meta, &loc);
|
||||
else {
|
||||
nn_log (LC_DISCOVERY, " (srclocM)");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (srclocM)");
|
||||
add_to_addrset (as_meta, &rst->srcloc);
|
||||
}
|
||||
|
||||
nn_log_addrset (LC_DISCOVERY, " (data", as_default);
|
||||
nn_log_addrset (LC_DISCOVERY, " meta", as_meta);
|
||||
nn_log (LC_DISCOVERY, ")");
|
||||
nn_log_addrset(DDS_LC_DISCOVERY, " (data", as_default);
|
||||
nn_log_addrset(DDS_LC_DISCOVERY, " meta", as_meta);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, ")");
|
||||
}
|
||||
|
||||
if (addrset_empty_uc (as_default) || addrset_empty_uc (as_meta))
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " (no unicast address");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (no unicast address");
|
||||
unref_addrset (as_default);
|
||||
unref_addrset (as_meta);
|
||||
return 1;
|
||||
}
|
||||
|
||||
nn_log (LC_DISCOVERY, " QOS={");
|
||||
nn_log_xqos (LC_DISCOVERY, &datap->qos);
|
||||
nn_log (LC_DISCOVERY, "}\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " QOS={");
|
||||
nn_log_xqos(DDS_LC_DISCOVERY, &datap->qos);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "}\n");
|
||||
|
||||
maybe_add_pp_as_meta_to_as_disc (as_meta);
|
||||
|
||||
|
@ -759,12 +759,12 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
(rst->dst_guid_prefix.u[0] != 0 || rst->dst_guid_prefix.u[1] != 0 || rst->dst_guid_prefix.u[2] != 0);
|
||||
if (!have_dst)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "broadcasted SPDP packet -> answering");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "broadcasted SPDP packet -> answering");
|
||||
respond_to_spdp (&datap->participant_guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "directed SPDP packet -> not responding\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "directed SPDP packet -> not responding\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -781,7 +781,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
of DDSI2. */
|
||||
if (ephash_lookup_proxy_participant_guid (&privileged_pp_guid) == NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "make_participants_dependent_on_ddsi2: ddsi2 %x:%x:%x:%x is no more, delete %x:%x:%x:%x\n", PGUID (privileged_pp_guid), PGUID (datap->participant_guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "make_participants_dependent_on_ddsi2: ddsi2 %x:%x:%x:%x is no more, delete %x:%x:%x:%x\n", PGUID (privileged_pp_guid), PGUID (datap->participant_guid));
|
||||
delete_proxy_participant_by_guid (&datap->participant_guid, timestamp, 1);
|
||||
}
|
||||
}
|
||||
|
@ -791,10 +791,10 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
|
|||
static void handle_SPDP (const struct receiver_state *rst, nn_wctime_t timestamp, unsigned statusinfo, const void *vdata, unsigned len)
|
||||
{
|
||||
const struct CDRHeader *data = vdata; /* built-ins not deserialized (yet) */
|
||||
TRACE (("SPDP ST%x", statusinfo));
|
||||
DDS_TRACE("SPDP ST%x", statusinfo);
|
||||
if (data == NULL)
|
||||
{
|
||||
TRACE ((" no payload?\n"));
|
||||
DDS_TRACE(" no payload?\n");
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -809,7 +809,7 @@ static void handle_SPDP (const struct receiver_state *rst, nn_wctime_t timestamp
|
|||
src.bufsz = len - 4;
|
||||
if (nn_plist_init_frommsg (&decoded_data, NULL, ~(uint64_t)0, ~(uint64_t)0, &src) < 0)
|
||||
{
|
||||
NN_WARNING ("SPDP (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
DDS_WARNING("SPDP (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -827,7 +827,7 @@ static void handle_SPDP (const struct receiver_state *rst, nn_wctime_t timestamp
|
|||
}
|
||||
|
||||
nn_plist_fini (&decoded_data);
|
||||
nn_log (interesting ? LC_DISCOVERY : LC_TRACE, "\n");
|
||||
DDS_LOG(interesting ? DDS_LC_DISCOVERY : DDS_LC_TRACE, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -951,7 +951,7 @@ static int sedp_write_endpoint
|
|||
nn_xmsg_addpar_sentinel (mpayload);
|
||||
nn_plist_fini (&ps);
|
||||
|
||||
TRACE (("sedp: write for %x:%x:%x:%x via %x:%x:%x:%x\n", PGUID (*epguid), PGUID (wr->e.guid)));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "sedp: write for %x:%x:%x:%x via %x:%x:%x:%x\n", PGUID (*epguid), PGUID (wr->e.guid));
|
||||
ret = write_mpayload (wr, alive, PID_ENDPOINT_GUID, mpayload);
|
||||
nn_xmsg_free (mpayload);
|
||||
return ret;
|
||||
|
@ -961,7 +961,7 @@ static struct writer *get_sedp_writer (const struct participant *pp, unsigned en
|
|||
{
|
||||
struct writer *sedp_wr = get_builtin_writer (pp, entityid);
|
||||
if (sedp_wr == NULL)
|
||||
NN_FATAL ("sedp_write_writer: no SEDP builtin writer %x for %x:%x:%x:%x\n", entityid, PGUID (pp->e.guid));
|
||||
DDS_FATAL("sedp_write_writer: no SEDP builtin writer %x for %x:%x:%x:%x\n", entityid, PGUID (pp->e.guid));
|
||||
return sedp_wr;
|
||||
}
|
||||
|
||||
|
@ -1044,14 +1044,14 @@ static struct proxy_participant *implicitly_create_proxypp (const nn_guid_t *ppg
|
|||
{
|
||||
nn_vendorid_t actual_vendorid;
|
||||
/* Some endpoint that we discovered through the DS, but then it must have at least some locators */
|
||||
TRACE ((" from-DS %x:%x:%x:%x", PGUID (privguid)));
|
||||
DDS_TRACE(" from-DS %x:%x:%x:%x", PGUID (privguid));
|
||||
/* avoid "no address" case, so we never create the proxy participant for nothing (FIXME: rework some of this) */
|
||||
if (!(datap->present & (PP_UNICAST_LOCATOR | PP_MULTICAST_LOCATOR)))
|
||||
{
|
||||
TRACE ((" data locator absent\n"));
|
||||
DDS_TRACE(" data locator absent\n");
|
||||
goto err;
|
||||
}
|
||||
nn_log (LC_DISCOVERY, " new-proxypp %x:%x:%x:%x\n", PGUID (*ppguid));
|
||||
DDS_TRACE(" new-proxypp %x:%x:%x:%x\n", PGUID (*ppguid));
|
||||
/* We need to handle any source of entities, but we really want to try to keep the GIDs (and
|
||||
certainly the systemId component) unchanged for OSPL. The new proxy participant will take
|
||||
the GID from the GUID if it is from a "modern" OSPL that advertises it includes all GIDs in
|
||||
|
@ -1073,18 +1073,18 @@ static struct proxy_participant *implicitly_create_proxypp (const nn_guid_t *ppg
|
|||
with a minimal built-in endpoint set */
|
||||
struct proxy_participant *privpp;
|
||||
if ((privpp = ephash_lookup_proxy_participant_guid (&privguid)) == NULL) {
|
||||
TRACE ((" unknown-src-proxypp?\n"));
|
||||
DDS_TRACE(" unknown-src-proxypp?\n");
|
||||
goto err;
|
||||
} else if (!privpp->is_ddsi2_pp) {
|
||||
TRACE ((" src-proxypp-not-ddsi2?\n"));
|
||||
DDS_TRACE(" src-proxypp-not-ddsi2?\n");
|
||||
goto err;
|
||||
} else if (!privpp->minimal_bes_mode) {
|
||||
TRACE ((" src-ddsi2-not-minimal-bes-mode?\n"));
|
||||
DDS_TRACE(" src-ddsi2-not-minimal-bes-mode?\n");
|
||||
goto err;
|
||||
} else {
|
||||
struct addrset *as_default, *as_meta;
|
||||
nn_plist_t tmp_plist;
|
||||
TRACE ((" from-ddsi2 %x:%x:%x:%x", PGUID (privguid)));
|
||||
DDS_TRACE(" from-ddsi2 %x:%x:%x:%x", PGUID (privguid));
|
||||
nn_plist_init_empty (&pp_plist);
|
||||
|
||||
os_mutexLock (&privpp->e.lock);
|
||||
|
@ -1109,7 +1109,7 @@ static struct proxy_participant *implicitly_create_proxypp (const nn_guid_t *ppg
|
|||
|
||||
static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *datap /* note: potentially modifies datap */, const nn_guid_prefix_t *src_guid_prefix, nn_vendorid_t vendorid, nn_wctime_t timestamp)
|
||||
{
|
||||
#define E(msg, lbl) do { nn_log (LC_DISCOVERY, (msg)); goto lbl; } while (0)
|
||||
#define E(msg, lbl) do { DDS_LOG(DDS_LC_DISCOVERY, msg); goto lbl; } while (0)
|
||||
struct proxy_participant *pp;
|
||||
struct proxy_writer * pwr = NULL;
|
||||
struct proxy_reader * prd = NULL;
|
||||
|
@ -1126,7 +1126,7 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat
|
|||
|
||||
if (!(datap->present & PP_ENDPOINT_GUID))
|
||||
E (" no guid?\n", err);
|
||||
nn_log (LC_DISCOVERY, " %x:%x:%x:%x", PGUID (datap->endpoint_guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " %x:%x:%x:%x", PGUID (datap->endpoint_guid));
|
||||
|
||||
ppguid.prefix = datap->endpoint_guid.prefix;
|
||||
ppguid.entityid.u = NN_ENTITYID_PARTICIPANT;
|
||||
|
@ -1145,11 +1145,11 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat
|
|||
|
||||
if ((pp = ephash_lookup_proxy_participant_guid (&ppguid)) == NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " unknown-proxypp");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " unknown-proxypp");
|
||||
if ((pp = implicitly_create_proxypp (&ppguid, datap, src_guid_prefix, vendorid, timestamp)) == NULL)
|
||||
E ("?\n", err);
|
||||
/* Repeat regular SEDP trace for convenience */
|
||||
nn_log (LC_DISCOVERY, "SEDP ST0 %x:%x:%x:%x (cont)", PGUID (datap->endpoint_guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "SEDP ST0 %x:%x:%x:%x (cont)", PGUID (datap->endpoint_guid));
|
||||
}
|
||||
|
||||
xqos = &datap->qos;
|
||||
|
@ -1169,7 +1169,7 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat
|
|||
assert (xqos->present & QP_DURABILITY);
|
||||
reliable = (xqos->reliability.kind == NN_RELIABLE_RELIABILITY_QOS);
|
||||
|
||||
nn_log (LC_DISCOVERY, " %s %s %s: %s%s.%s/%s",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " %s %s %s: %s%s.%s/%s",
|
||||
reliable ? "reliable" : "best-effort",
|
||||
durability_to_string (xqos->durability.kind),
|
||||
is_writer ? "writer" : "reader",
|
||||
|
@ -1197,28 +1197,28 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat
|
|||
|
||||
if (! vendor_is_cloud (vendorid))
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " known\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " known\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Re-bind the proxy participant to the discovery service - and do this if it is currently
|
||||
bound to another DS instance, because that other DS instance may have already failed and
|
||||
with a new one taking over, without our noticing it. */
|
||||
nn_log (LC_DISCOVERY, " known-DS");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " known-DS");
|
||||
if (vendor_is_cloud (vendorid) && pp->implicitly_created && memcmp(&pp->privileged_pp_guid.prefix, src_guid_prefix, sizeof(pp->privileged_pp_guid.prefix)) != 0)
|
||||
{
|
||||
nn_etime_t never = { T_NEVER };
|
||||
nn_log (LC_DISCOVERY, " %x:%x:%x:%x attach-to-DS %x:%x:%x:%x", PGUID(pp->e.guid), PGUIDPREFIX(*src_guid_prefix), pp->privileged_pp_guid.entityid.u);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " %x:%x:%x:%x attach-to-DS %x:%x:%x:%x", PGUID(pp->e.guid), PGUIDPREFIX(*src_guid_prefix), pp->privileged_pp_guid.entityid.u);
|
||||
os_mutexLock (&pp->e.lock);
|
||||
pp->privileged_pp_guid.prefix = *src_guid_prefix;
|
||||
lease_set_expiry(os_atomic_ldvoidp(&pp->lease), never);
|
||||
os_mutexUnlock (&pp->e.lock);
|
||||
}
|
||||
nn_log (LC_DISCOVERY, "\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " NEW");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " NEW");
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -1228,7 +1228,7 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat
|
|||
add_to_addrset (as, &loc);
|
||||
else if (config.tcp_use_peeraddr_for_unicast)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " (srcloc)");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " (srcloc)");
|
||||
add_to_addrset (as, &rst->srcloc);
|
||||
}
|
||||
else
|
||||
|
@ -1246,22 +1246,22 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat
|
|||
E (" no address", err);
|
||||
}
|
||||
|
||||
nn_log_addrset (LC_DISCOVERY, " (as", as);
|
||||
nn_log_addrset(DDS_LC_DISCOVERY, " (as", as);
|
||||
#ifdef DDSI_INCLUDE_SSM
|
||||
ssm = 0;
|
||||
if (is_writer)
|
||||
ssm = addrset_contains_ssm (as);
|
||||
else if (datap->present & PP_READER_FAVOURS_SSM)
|
||||
ssm = (datap->reader_favours_ssm.state != 0);
|
||||
nn_log (LC_DISCOVERY, " ssm=%u", ssm);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " ssm=%u", ssm);
|
||||
#endif
|
||||
nn_log (LC_DISCOVERY, ") QOS={");
|
||||
nn_log_xqos (LC_DISCOVERY, xqos);
|
||||
nn_log (LC_DISCOVERY, "}\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, ") QOS={");
|
||||
nn_log_xqos(DDS_LC_DISCOVERY, xqos);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "}\n");
|
||||
|
||||
if ((datap->endpoint_guid.entityid.u & NN_ENTITYID_SOURCE_MASK) == NN_ENTITYID_SOURCE_VENDOR && !vendor_is_prismtech (vendorid))
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "ignoring vendor-specific endpoint %x:%x:%x:%x\n", PGUID (datap->endpoint_guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "ignoring vendor-specific endpoint %x:%x:%x:%x\n", PGUID (datap->endpoint_guid));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1315,10 +1315,10 @@ static void handle_SEDP_dead (nn_plist_t *datap, nn_wctime_t timestamp)
|
|||
int res;
|
||||
if (!(datap->present & PP_ENDPOINT_GUID))
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " no guid?\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " no guid?\n");
|
||||
return;
|
||||
}
|
||||
nn_log (LC_DISCOVERY, " %x:%x:%x:%x", PGUID (datap->endpoint_guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " %x:%x:%x:%x", PGUID (datap->endpoint_guid));
|
||||
if (is_writer_entityid (datap->endpoint_guid.entityid))
|
||||
{
|
||||
res = delete_proxy_writer (&datap->endpoint_guid, timestamp, 0);
|
||||
|
@ -1327,16 +1327,16 @@ static void handle_SEDP_dead (nn_plist_t *datap, nn_wctime_t timestamp)
|
|||
{
|
||||
res = delete_proxy_reader (&datap->endpoint_guid, timestamp, 0);
|
||||
}
|
||||
nn_log (LC_DISCOVERY, " %s\n", (res < 0) ? " unknown" : " delete");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " %s\n", (res < 0) ? " unknown" : " delete");
|
||||
}
|
||||
|
||||
static void handle_SEDP (const struct receiver_state *rst, nn_wctime_t timestamp, unsigned statusinfo, const void *vdata, unsigned len)
|
||||
{
|
||||
const struct CDRHeader *data = vdata; /* built-ins not deserialized (yet) */
|
||||
nn_log (LC_DISCOVERY, "SEDP ST%x", statusinfo);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "SEDP ST%x", statusinfo);
|
||||
if (data == NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " no payload?\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " no payload?\n");
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -1350,7 +1350,7 @@ static void handle_SEDP (const struct receiver_state *rst, nn_wctime_t timestamp
|
|||
src.bufsz = len - 4;
|
||||
if (nn_plist_init_frommsg (&decoded_data, NULL, ~(uint64_t)0, ~(uint64_t)0, &src) < 0)
|
||||
{
|
||||
NN_WARNING ("SEDP (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
DDS_WARNING("SEDP (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1400,7 +1400,7 @@ int sedp_write_topic (struct participant *pp, const struct nn_plist *datap)
|
|||
nn_plist_addtomsg (mpayload, datap, ~(uint64_t)0, delta);
|
||||
nn_xmsg_addpar_sentinel (mpayload);
|
||||
|
||||
TRACE (("sedp: write topic %s via %x:%x:%x:%x\n", datap->qos.topic_name, PGUID (sedp_wr->e.guid)));
|
||||
DDS_TRACE("sedp: write topic %s via %x:%x:%x:%x\n", datap->qos.topic_name, PGUID (sedp_wr->e.guid));
|
||||
ret = write_mpayload (sedp_wr, 1, PID_TOPIC_NAME, mpayload);
|
||||
nn_xmsg_free (mpayload);
|
||||
return ret;
|
||||
|
@ -1449,8 +1449,8 @@ int sedp_write_cm_participant (struct participant *pp, int alive)
|
|||
}
|
||||
nn_xmsg_addpar_sentinel (mpayload);
|
||||
|
||||
TRACE (("sedp: write CMParticipant ST%x for %x:%x:%x:%x via %x:%x:%x:%x\n",
|
||||
alive ? 0 : NN_STATUSINFO_DISPOSE | NN_STATUSINFO_UNREGISTER, PGUID (pp->e.guid), PGUID (sedp_wr->e.guid)));
|
||||
DDS_TRACE("sedp: write CMParticipant ST%x for %x:%x:%x:%x via %x:%x:%x:%x\n",
|
||||
alive ? 0 : NN_STATUSINFO_DISPOSE | NN_STATUSINFO_UNREGISTER, PGUID (pp->e.guid), PGUID (sedp_wr->e.guid));
|
||||
ret = write_mpayload (sedp_wr, alive, PID_PARTICIPANT_GUID, mpayload);
|
||||
nn_xmsg_free (mpayload);
|
||||
return ret;
|
||||
|
@ -1459,12 +1459,12 @@ int sedp_write_cm_participant (struct participant *pp, int alive)
|
|||
static void handle_SEDP_CM (const struct receiver_state *rst, nn_entityid_t wr_entity_id, nn_wctime_t timestamp, unsigned statusinfo, const void *vdata, unsigned len)
|
||||
{
|
||||
const struct CDRHeader *data = vdata; /* built-ins not deserialized (yet) */
|
||||
nn_log (LC_DISCOVERY, "SEDP_CM ST%x", statusinfo);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "SEDP_CM ST%x", statusinfo);
|
||||
assert (wr_entity_id.u == NN_ENTITYID_SEDP_BUILTIN_CM_PARTICIPANT_WRITER);
|
||||
(void) wr_entity_id;
|
||||
if (data == NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " no payload?\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " no payload?\n");
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -1478,7 +1478,7 @@ static void handle_SEDP_CM (const struct receiver_state *rst, nn_entityid_t wr_e
|
|||
src.bufsz = len - 4;
|
||||
if (nn_plist_init_frommsg (&decoded_data, NULL, ~(uint64_t)0, ~(uint64_t)0, &src) < 0)
|
||||
{
|
||||
NN_WARNING ("SEDP_CM (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
DDS_WARNING("SEDP_CM (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1487,7 +1487,7 @@ static void handle_SEDP_CM (const struct receiver_state *rst, nn_entityid_t wr_e
|
|||
{
|
||||
struct proxy_participant *proxypp;
|
||||
if (!(decoded_data.present & PP_PARTICIPANT_GUID))
|
||||
NN_WARNING ("SEDP_CM (vendor %u.%u): missing participant GUID\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
DDS_WARNING("SEDP_CM (vendor %u.%u): missing participant GUID\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
else
|
||||
{
|
||||
if ((proxypp = ephash_lookup_proxy_participant_guid (&decoded_data.participant_guid)) == NULL)
|
||||
|
@ -1499,7 +1499,7 @@ static void handle_SEDP_CM (const struct receiver_state *rst, nn_entityid_t wr_e
|
|||
|
||||
nn_plist_fini (&decoded_data);
|
||||
}
|
||||
nn_log (LC_DISCOVERY, "\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "\n");
|
||||
}
|
||||
|
||||
static struct participant *group_guid_to_participant (const nn_guid_t *group_guid)
|
||||
|
@ -1520,8 +1520,8 @@ int sedp_write_cm_publisher (const struct nn_plist *datap, int alive)
|
|||
|
||||
if ((pp = group_guid_to_participant (&datap->group_guid)) == NULL)
|
||||
{
|
||||
TRACE (("sedp: write CMPublisher alive:%d for %x:%x:%x:%x dropped: no participant\n",
|
||||
alive, PGUID (datap->group_guid)));
|
||||
DDS_TRACE("sedp: write CMPublisher alive:%d for %x:%x:%x:%x dropped: no participant\n",
|
||||
alive, PGUID (datap->group_guid));
|
||||
return 0;
|
||||
}
|
||||
sedp_wr = get_sedp_writer (pp, NN_ENTITYID_SEDP_BUILTIN_CM_PUBLISHER_WRITER);
|
||||
|
@ -1556,8 +1556,8 @@ int sedp_write_cm_subscriber (const struct nn_plist *datap, int alive)
|
|||
|
||||
if ((pp = group_guid_to_participant (&datap->group_guid)) == NULL)
|
||||
{
|
||||
TRACE (("sedp: write CMSubscriber alive:%d for %x:%x:%x:%x dropped: no participant\n",
|
||||
alive, PGUID (datap->group_guid)));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "sedp: write CMSubscriber alive:%d for %x:%x:%x:%x dropped: no participant\n",
|
||||
alive, PGUID (datap->group_guid));
|
||||
return 0;
|
||||
}
|
||||
sedp_wr = get_sedp_writer (pp, NN_ENTITYID_SEDP_BUILTIN_CM_SUBSCRIBER_WRITER);
|
||||
|
@ -1584,19 +1584,19 @@ int sedp_write_cm_subscriber (const struct nn_plist *datap, int alive)
|
|||
|
||||
static void handle_SEDP_GROUP_alive (nn_plist_t *datap /* note: potentially modifies datap */, nn_wctime_t timestamp)
|
||||
{
|
||||
#define E(msg, lbl) do { nn_log (LC_DISCOVERY, (msg)); goto lbl; } while (0)
|
||||
#define E(msg, lbl) do { DDS_LOG(DDS_LC_DISCOVERY, msg); goto lbl; } while (0)
|
||||
nn_guid_t ppguid;
|
||||
|
||||
if (!(datap->present & PP_GROUP_GUID))
|
||||
E (" no guid?\n", err);
|
||||
nn_log (LC_DISCOVERY, " %x:%x:%x:%x", PGUID (datap->group_guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " %x:%x:%x:%x", PGUID (datap->group_guid));
|
||||
|
||||
ppguid.prefix = datap->group_guid.prefix;
|
||||
ppguid.entityid.u = NN_ENTITYID_PARTICIPANT;
|
||||
if (ephash_lookup_proxy_participant_guid (&ppguid) == NULL)
|
||||
E (" unknown proxy pp?\n", err);
|
||||
|
||||
nn_log (LC_DISCOVERY, " alive\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " alive\n");
|
||||
|
||||
{
|
||||
char *name = (datap->present & PP_ENTITY_NAME) ? datap->entity_name : "";
|
||||
|
@ -1611,20 +1611,20 @@ static void handle_SEDP_GROUP_dead (nn_plist_t *datap, nn_wctime_t timestamp)
|
|||
{
|
||||
if (!(datap->present & PP_GROUP_GUID))
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " no guid?\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " no guid?\n");
|
||||
return;
|
||||
}
|
||||
nn_log (LC_DISCOVERY, " %x:%x:%x:%x\n", PGUID (datap->group_guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " %x:%x:%x:%x\n", PGUID (datap->group_guid));
|
||||
delete_proxy_group (&datap->group_guid, timestamp, 0);
|
||||
}
|
||||
|
||||
static void handle_SEDP_GROUP (const struct receiver_state *rst, nn_wctime_t timestamp, unsigned statusinfo, const void *vdata, unsigned len)
|
||||
{
|
||||
const struct CDRHeader *data = vdata; /* built-ins not deserialized (yet) */
|
||||
nn_log (LC_DISCOVERY, "SEDP_GROUP ST%x", statusinfo);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "SEDP_GROUP ST%x", statusinfo);
|
||||
if (data == NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " no payload?\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " no payload?\n");
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -1638,7 +1638,7 @@ static void handle_SEDP_GROUP (const struct receiver_state *rst, nn_wctime_t tim
|
|||
src.bufsz = len - 4;
|
||||
if (nn_plist_init_frommsg (&decoded_data, NULL, ~(uint64_t)0, ~(uint64_t)0, &src) < 0)
|
||||
{
|
||||
NN_WARNING ("SEDP_GROUP (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
DDS_WARNING("SEDP_GROUP (vendor %u.%u): invalid qos/parameters\n", src.vendorid.id[0], src.vendorid.id[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1759,7 +1759,7 @@ int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const str
|
|||
src.bufsz = NN_RDATA_PAYLOAD_OFF (fragchain) - qos_offset;
|
||||
if (nn_plist_init_frommsg (&qos, NULL, PP_STATUSINFO | PP_KEYHASH, 0, &src) < 0)
|
||||
{
|
||||
NN_WARNING ("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": invalid inline qos\n",
|
||||
DDS_WARNING("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": invalid inline qos\n",
|
||||
src.vendorid.id[0], src.vendorid.id[1], PGUID (srcguid), sampleinfo->seq);
|
||||
goto done_upd_deliv;
|
||||
}
|
||||
|
@ -1783,7 +1783,7 @@ int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const str
|
|||
{
|
||||
if (datasz == 0 || !(data_smhdr_flags & DATA_FLAG_DATAFLAG))
|
||||
{
|
||||
NN_WARNING ("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": "
|
||||
DDS_WARNING("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": "
|
||||
"built-in data but no payload\n",
|
||||
sampleinfo->rst->vendor.id[0], sampleinfo->rst->vendor.id[1],
|
||||
PGUID (srcguid), sampleinfo->seq);
|
||||
|
@ -1797,7 +1797,7 @@ int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const str
|
|||
hasn't been checked fully yet. */
|
||||
if (!(data_smhdr_flags & DATA_FLAG_KEYFLAG))
|
||||
{
|
||||
NN_WARNING ("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": "
|
||||
DDS_WARNING("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": "
|
||||
"dispose/unregister of built-in data but payload not just key\n",
|
||||
sampleinfo->rst->vendor.id[0], sampleinfo->rst->vendor.id[1],
|
||||
PGUID (srcguid), sampleinfo->seq);
|
||||
|
@ -1839,7 +1839,7 @@ int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const str
|
|||
pid = PID_ENDPOINT_GUID;
|
||||
break;
|
||||
default:
|
||||
NN_WARNING ("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": mapping keyhash to ENDPOINT_GUID",
|
||||
DDS_WARNING("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": mapping keyhash to ENDPOINT_GUID",
|
||||
sampleinfo->rst->vendor.id[0], sampleinfo->rst->vendor.id[1],
|
||||
PGUID (srcguid), sampleinfo->seq);
|
||||
pid = PID_ENDPOINT_GUID;
|
||||
|
@ -1856,7 +1856,7 @@ int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const str
|
|||
}
|
||||
else
|
||||
{
|
||||
NN_WARNING ("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": "
|
||||
DDS_WARNING("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": "
|
||||
"dispose/unregister with no content\n",
|
||||
sampleinfo->rst->vendor.id[0], sampleinfo->rst->vendor.id[1],
|
||||
PGUID (srcguid), sampleinfo->seq);
|
||||
|
@ -1884,7 +1884,7 @@ int builtins_dqueue_handler (const struct nn_rsample_info *sampleinfo, const str
|
|||
handle_SEDP_GROUP (sampleinfo->rst, timestamp, statusinfo, datap, datasz);
|
||||
break;
|
||||
default:
|
||||
NN_WARNING ("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": not handled\n",
|
||||
DDS_WARNING ("data(builtin, vendor %u.%u): %x:%x:%x:%x #%"PRId64": not handled\n",
|
||||
sampleinfo->rst->vendor.id[0], sampleinfo->rst->vendor.id[1],
|
||||
PGUID (srcguid), sampleinfo->seq);
|
||||
break;
|
||||
|
|
|
@ -352,7 +352,7 @@ struct debug_monitor *new_debug_monitor (int port)
|
|||
dm->servsock = ddsi_factory_create_listener (dm->tran_factory, port, NULL);
|
||||
if (dm->servsock == NULL)
|
||||
{
|
||||
NN_WARNING ("debmon: can't create socket\n");
|
||||
DDS_WARNING("debmon: can't create socket\n");
|
||||
goto err_servsock;
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ struct debug_monitor *new_debug_monitor (int port)
|
|||
nn_locator_t loc;
|
||||
char buf[DDSI_LOCSTRLEN];
|
||||
(void) ddsi_listener_locator(dm->servsock, &loc);
|
||||
nn_log (LC_CONFIG, "debmon at %s\n", ddsi_locator_to_string (buf, sizeof(buf), &loc));
|
||||
DDS_LOG(DDS_LC_CONFIG, "debmon at %s\n", ddsi_locator_to_string (buf, sizeof(buf), &loc));
|
||||
}
|
||||
|
||||
os_mutexInit (&dm->lock);
|
||||
|
|
|
@ -297,7 +297,7 @@ int is_deleted_participant_guid (const struct nn_guid *guid, unsigned for_what)
|
|||
static void remove_deleted_participant_guid (const struct nn_guid *guid, unsigned for_what)
|
||||
{
|
||||
struct deleted_participant *n;
|
||||
nn_log (LC_DISCOVERY, "remove_deleted_participant_guid(%x:%x:%x:%x for_what=%x)\n", PGUID (*guid), for_what);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "remove_deleted_participant_guid(%x:%x:%x:%x for_what=%x)\n", PGUID (*guid), for_what);
|
||||
os_mutexLock (&deleted_participants_lock);
|
||||
if ((n = ut_avlLookup (&deleted_participants_treedef, &deleted_participants, guid)) != NULL)
|
||||
{
|
||||
|
@ -339,7 +339,7 @@ int pp_allocate_entityid(nn_entityid_t *id, unsigned kind, struct participant *p
|
|||
}
|
||||
else
|
||||
{
|
||||
NN_ERROR("pp_allocate_entityid(%x:%x:%x:%x): all ids in use\n", PGUID(pp->e.guid));
|
||||
DDS_ERROR("pp_allocate_entityid(%x:%x:%x:%x): all ids in use\n", PGUID(pp->e.guid));
|
||||
ret = ERR_OUT_OF_IDS;
|
||||
}
|
||||
os_mutexUnlock (&pp->e.lock);
|
||||
|
@ -390,12 +390,12 @@ int new_participant_guid (const nn_guid_t *ppguid, unsigned flags, const nn_plis
|
|||
else
|
||||
{
|
||||
os_mutexUnlock (&gv.participant_set_lock);
|
||||
NN_ERROR ("new_participant(%x:%x:%x:%x, %x) failed: max participants reached\n", PGUID (*ppguid), flags);
|
||||
DDS_ERROR("new_participant(%x:%x:%x:%x, %x) failed: max participants reached\n", PGUID (*ppguid), flags);
|
||||
return ERR_OUT_OF_IDS;
|
||||
}
|
||||
}
|
||||
|
||||
nn_log (LC_DISCOVERY, "new_participant(%x:%x:%x:%x, %x)\n", PGUID (*ppguid), flags);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "new_participant(%x:%x:%x:%x, %x)\n", PGUID (*ppguid), flags);
|
||||
|
||||
pp = os_malloc (sizeof (*pp));
|
||||
|
||||
|
@ -411,11 +411,11 @@ int new_participant_guid (const nn_guid_t *ppguid, unsigned flags, const nn_plis
|
|||
nn_plist_copy (pp->plist, plist);
|
||||
nn_plist_mergein_missing (pp->plist, &gv.default_plist_pp);
|
||||
|
||||
if (config.enabled_logcats & LC_DISCOVERY)
|
||||
if (dds_get_log_mask() & DDS_LC_DISCOVERY)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "PARTICIPANT %x:%x:%x:%x QOS={", PGUID (pp->e.guid));
|
||||
nn_log_xqos (LC_DISCOVERY, &pp->plist->qos);
|
||||
nn_log (LC_DISCOVERY, "}\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "PARTICIPANT %x:%x:%x:%x QOS={", PGUID (pp->e.guid));
|
||||
nn_log_xqos(DDS_LC_DISCOVERY, &pp->plist->qos);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "}\n");
|
||||
}
|
||||
|
||||
if (config.many_sockets_mode == MSM_MANY_UNICAST)
|
||||
|
@ -650,7 +650,7 @@ static struct participant *ref_participant (struct participant *pp, const struct
|
|||
stguid = *guid_of_refing_entity;
|
||||
else
|
||||
memset (&stguid, 0, sizeof (stguid));
|
||||
nn_log (LC_DISCOVERY, "ref_participant(%x:%x:%x:%x @ %p <- %x:%x:%x:%x @ %p) user %d builtin %d\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "ref_participant(%x:%x:%x:%x @ %p <- %x:%x:%x:%x @ %p) user %d builtin %d\n",
|
||||
PGUID (pp->e.guid), (void*)pp, PGUID (stguid), (void*)guid_of_refing_entity, pp->user_refc, pp->builtin_refc);
|
||||
os_mutexUnlock (&pp->refc_lock);
|
||||
return pp;
|
||||
|
@ -691,7 +691,7 @@ static void unref_participant (struct participant *pp, const struct nn_guid *gui
|
|||
stguid = *guid_of_refing_entity;
|
||||
else
|
||||
memset (&stguid, 0, sizeof (stguid));
|
||||
nn_log (LC_DISCOVERY, "unref_participant(%x:%x:%x:%x @ %p <- %x:%x:%x:%x @ %p) user %d builtin %d\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "unref_participant(%x:%x:%x:%x @ %p <- %x:%x:%x:%x @ %p) user %d builtin %d\n",
|
||||
PGUID (pp->e.guid), (void*)pp, PGUID (stguid), (void*)guid_of_refing_entity, pp->user_refc, pp->builtin_refc);
|
||||
|
||||
if (pp->user_refc == 0 && (pp->bes != 0 || pp->prismtech_bes != 0) && !pp->builtins_deleted)
|
||||
|
@ -803,7 +803,7 @@ static void unref_participant (struct participant *pp, const struct nn_guid *gui
|
|||
static void gc_delete_participant (struct gcreq *gcreq)
|
||||
{
|
||||
struct participant *pp = gcreq->arg;
|
||||
nn_log (LC_DISCOVERY, "gc_delete_participant(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (pp->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "gc_delete_participant(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (pp->e.guid));
|
||||
gcreq_free (gcreq);
|
||||
unref_participant (pp, NULL);
|
||||
}
|
||||
|
@ -863,7 +863,7 @@ struct writer *get_builtin_writer (const struct participant *pp, unsigned entity
|
|||
bes_mask = NN_DISC_BUILTIN_ENDPOINT_TOPIC_ANNOUNCER;
|
||||
break;
|
||||
default:
|
||||
NN_FATAL ("get_builtin_writer called with entityid %x\n", entityid);
|
||||
DDS_FATAL ("get_builtin_writer called with entityid %x\n", entityid);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -983,7 +983,7 @@ static void rebuild_make_locs(int *p_nlocs, nn_locator_t **p_locs, struct addrse
|
|||
j++;
|
||||
}
|
||||
nlocs = i+1;
|
||||
nn_log(LC_DISCOVERY, "reduced nlocs=%d\n", nlocs);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "reduced nlocs=%d\n", nlocs);
|
||||
*p_nlocs = nlocs;
|
||||
*p_locs = locs;
|
||||
}
|
||||
|
@ -1069,13 +1069,13 @@ static void rebuild_trace_covered(int nreaders, int nlocs, const nn_locator_t *l
|
|||
{
|
||||
char buf[INET6_ADDRSTRLEN_EXTENDED];
|
||||
ddsi_locator_to_string(buf, sizeof(buf), &locs[i]);
|
||||
nn_log(LC_DISCOVERY, " loc %2d = %-20s %2d {", i, buf, locs_nrds[i]);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " loc %2d = %-20s %2d {", i, buf, locs_nrds[i]);
|
||||
for (j = 0; j < nreaders; j++)
|
||||
if (covered[j * nlocs + i] >= 0)
|
||||
nn_log(LC_DISCOVERY, " %d", covered[j * nlocs + i]);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " %d", covered[j * nlocs + i]);
|
||||
else
|
||||
nn_log(LC_DISCOVERY, " .");
|
||||
nn_log(LC_DISCOVERY, " }\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " .");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1106,7 +1106,7 @@ static void rebuild_add(struct addrset *newas, int locidx, int nreaders, int nlo
|
|||
if (locs[locidx].kind != NN_LOCATOR_KIND_UDPv4MCGEN)
|
||||
{
|
||||
ddsi_locator_to_string(str, sizeof(str), &locs[locidx]);
|
||||
nn_log(LC_DISCOVERY, " simple %s\n", str);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " simple %s\n", str);
|
||||
add_to_addrset(newas, &locs[locidx]);
|
||||
}
|
||||
else /* convert MC gen to the correct multicast address */
|
||||
|
@ -1125,7 +1125,7 @@ static void rebuild_add(struct addrset *newas, int locidx, int nreaders, int nlo
|
|||
ipn = htonl(iph);
|
||||
memcpy(l.address + 12, &ipn, 4);
|
||||
ddsi_locator_to_string(str, sizeof(str), &l);
|
||||
nn_log(LC_DISCOVERY, " mcgen %s\n", str);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " mcgen %s\n", str);
|
||||
add_to_addrset(newas, &l);
|
||||
}
|
||||
}
|
||||
|
@ -1158,7 +1158,8 @@ static void rebuild_writer_addrset_setcover(struct addrset *newas, struct writer
|
|||
int best;
|
||||
if ((all_addrs = rebuild_make_all_addrs(&nreaders, wr)) == NULL)
|
||||
return;
|
||||
nn_log_addrset(LC_DISCOVERY, "setcover: all_addrs", all_addrs); nn_log(LC_DISCOVERY, "\n");
|
||||
nn_log_addrset(DDS_LC_DISCOVERY, "setcover: all_addrs", all_addrs);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "\n");
|
||||
rebuild_make_locs(&nlocs, &locs, all_addrs);
|
||||
unref_addrset(all_addrs);
|
||||
rebuild_make_covered(&covered, wr, &nreaders, nlocs, locs);
|
||||
|
@ -1168,7 +1169,7 @@ static void rebuild_writer_addrset_setcover(struct addrset *newas, struct writer
|
|||
while ((best = rebuild_select(nlocs, locs, locs_nrds)) >= 0)
|
||||
{
|
||||
rebuild_trace_covered(nreaders, nlocs, locs, locs_nrds, covered);
|
||||
nn_log(LC_DISCOVERY, " best = %d\n", best);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " best = %d\n", best);
|
||||
rebuild_add(newas, best, nreaders, nlocs, locs, covered);
|
||||
rebuild_drop(best, nreaders, nlocs, locs_nrds, covered);
|
||||
assert (locs_nrds[best] == 0);
|
||||
|
@ -1196,9 +1197,9 @@ static void rebuild_writer_addrset (struct writer *wr)
|
|||
wr->as = newas;
|
||||
unref_addrset (oldas);
|
||||
|
||||
nn_log (LC_DISCOVERY, "rebuild_writer_addrset(%x:%x:%x:%x):", PGUID (wr->e.guid));
|
||||
nn_log_addrset (LC_DISCOVERY, "", wr->as);
|
||||
nn_log (LC_DISCOVERY, "\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "rebuild_writer_addrset(%x:%x:%x:%x):", PGUID (wr->e.guid));
|
||||
nn_log_addrset(DDS_LC_DISCOVERY, "", wr->as);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "\n");
|
||||
}
|
||||
|
||||
void rebuild_or_clear_writer_addrsets(int rebuild)
|
||||
|
@ -1206,7 +1207,7 @@ void rebuild_or_clear_writer_addrsets(int rebuild)
|
|||
struct ephash_enum_writer est;
|
||||
struct writer *wr;
|
||||
struct addrset *empty = rebuild ? NULL : new_addrset();
|
||||
nn_log (LC_DISCOVERY, "rebuild_or_delete_writer_addrsets(%d)\n", rebuild);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "rebuild_or_delete_writer_addrsets(%d)\n", rebuild);
|
||||
ephash_enum_writer_init (&est);
|
||||
os_rwlockRead (&gv.qoslock);
|
||||
while ((wr = ephash_enum_writer_next (&est)) != NULL)
|
||||
|
@ -1234,7 +1235,7 @@ void rebuild_or_clear_writer_addrsets(int rebuild)
|
|||
}
|
||||
os_rwlockUnlock (&gv.qoslock);
|
||||
ephash_enum_writer_fini (&est);
|
||||
nn_log (LC_DISCOVERY, "rebuild_or_delete_writer_addrsets(%d) done\n", rebuild);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "rebuild_or_delete_writer_addrsets(%d) done\n", rebuild);
|
||||
}
|
||||
|
||||
static void free_wr_prd_match (struct wr_prd_match *m)
|
||||
|
@ -1256,7 +1257,7 @@ static void free_rd_pwr_match (struct rd_pwr_match *m)
|
|||
assert (ddsi_is_mcaddr (&m->ssm_mc_loc));
|
||||
assert (!is_unspec_locator (&m->ssm_src_loc));
|
||||
if (ddsi_leave_mc (gv.data_conn_mc, &m->ssm_src_loc, &m->ssm_mc_loc) < 0)
|
||||
nn_log (LC_WARNING, "failed to leave network partition ssm group\n");
|
||||
DDS_WARNING("failed to leave network partition ssm group\n");
|
||||
}
|
||||
#endif
|
||||
os_free (m);
|
||||
|
@ -1421,19 +1422,19 @@ static void update_reader_init_acknack_count (const struct nn_guid *rd_guid, nn_
|
|||
|
||||
/* Update the initial acknack sequence number for the reader. See
|
||||
also reader_add_connection(). */
|
||||
nn_log (LC_DISCOVERY, "update_reader_init_acknack_count (%x:%x:%x:%x, %d): ", PGUID (*rd_guid), count);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "update_reader_init_acknack_count (%x:%x:%x:%x, %d): ", PGUID (*rd_guid), count);
|
||||
if ((rd = ephash_lookup_reader_guid (rd_guid)) != NULL)
|
||||
{
|
||||
os_mutexLock (&rd->e.lock);
|
||||
nn_log (LC_DISCOVERY, "%d -> ", rd->init_acknack_count);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "%d -> ", rd->init_acknack_count);
|
||||
if (count > rd->init_acknack_count)
|
||||
rd->init_acknack_count = count;
|
||||
nn_log (LC_DISCOVERY, "%d\n", count);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "%d\n", count);
|
||||
os_mutexUnlock (&rd->e.lock);
|
||||
}
|
||||
else
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "reader no longer exists\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "reader no longer exists\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1502,7 +1503,7 @@ static void writer_add_connection (struct writer *wr, struct proxy_reader *prd)
|
|||
os_mutexLock (&prd->e.lock);
|
||||
if (prd->deleting)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " writer_add_connection(wr %x:%x:%x:%x prd %x:%x:%x:%x) - prd is being deleted\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " writer_add_connection(wr %x:%x:%x:%x prd %x:%x:%x:%x) - prd is being deleted\n",
|
||||
PGUID (wr->e.guid), PGUID (prd->e.guid));
|
||||
pretend_everything_acked = 1;
|
||||
}
|
||||
|
@ -1530,14 +1531,14 @@ static void writer_add_connection (struct writer *wr, struct proxy_reader *prd)
|
|||
m->seq = wr->seq;
|
||||
if (ut_avlLookupIPath (&wr_readers_treedef, &wr->readers, &prd->e.guid, &path))
|
||||
{
|
||||
nn_log(LC_DISCOVERY, " writer_add_connection(wr %x:%x:%x:%x prd %x:%x:%x:%x) - already connected\n", PGUID (wr->e.guid), PGUID (prd->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " writer_add_connection(wr %x:%x:%x:%x prd %x:%x:%x:%x) - already connected\n", PGUID (wr->e.guid), PGUID (prd->e.guid));
|
||||
os_mutexUnlock (&wr->e.lock);
|
||||
nn_lat_estim_fini (&m->hb_to_ack_latency);
|
||||
os_free (m);
|
||||
}
|
||||
else
|
||||
{
|
||||
nn_log(LC_DISCOVERY, " writer_add_connection(wr %x:%x:%x:%x prd %x:%x:%x:%x) - ack seq %"PRId64"\n", PGUID (wr->e.guid), PGUID (prd->e.guid), m->seq);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " writer_add_connection(wr %x:%x:%x:%x prd %x:%x:%x:%x) - ack seq %"PRId64"\n", PGUID (wr->e.guid), PGUID (prd->e.guid), m->seq);
|
||||
ut_avlInsertIPath (&wr_readers_treedef, &wr->readers, m, &path);
|
||||
rebuild_writer_addrset (wr);
|
||||
wr->num_reliable_readers += m->is_reliable;
|
||||
|
@ -1587,13 +1588,13 @@ static void writer_add_local_connection (struct writer *wr, struct reader *rd)
|
|||
os_mutexLock (&wr->e.lock);
|
||||
if (ut_avlLookupIPath (&wr_local_readers_treedef, &wr->local_readers, &rd->e.guid, &path))
|
||||
{
|
||||
nn_log(LC_DISCOVERY, " writer_add_local_connection(wr %x:%x:%x:%x rd %x:%x:%x:%x) - already connected\n", PGUID (wr->e.guid), PGUID (rd->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " writer_add_local_connection(wr %x:%x:%x:%x rd %x:%x:%x:%x) - already connected\n", PGUID (wr->e.guid), PGUID (rd->e.guid));
|
||||
os_mutexUnlock (&wr->e.lock);
|
||||
os_free (m);
|
||||
return;
|
||||
}
|
||||
|
||||
nn_log(LC_DISCOVERY, " writer_add_local_connection(wr %x:%x:%x:%x rd %x:%x:%x:%x)", PGUID (wr->e.guid), PGUID (rd->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " writer_add_local_connection(wr %x:%x:%x:%x rd %x:%x:%x:%x)", PGUID (wr->e.guid), PGUID (rd->e.guid));
|
||||
m->rd_guid = rd->e.guid;
|
||||
ut_avlInsertIPath (&wr_local_readers_treedef, &wr->local_readers, m, &path);
|
||||
local_reader_ary_insert (&wr->rdary, rd);
|
||||
|
@ -1620,7 +1621,7 @@ static void writer_add_local_connection (struct writer *wr, struct reader *rd)
|
|||
|
||||
os_mutexUnlock (&wr->e.lock);
|
||||
|
||||
nn_log(LC_DISCOVERY, "\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "\n");
|
||||
|
||||
if (wr->status_cb)
|
||||
{
|
||||
|
@ -1647,19 +1648,19 @@ static void reader_add_connection (struct reader *rd, struct proxy_writer *pwr,
|
|||
writer will always see monotonically increasing sequence numbers
|
||||
from one particular reader. This is then used for the
|
||||
pwr_rd_match initialization */
|
||||
nn_log (LC_DISCOVERY, " reader %x:%x:%x:%x init_acknack_count = %d\n", PGUID (rd->e.guid), rd->init_acknack_count);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " reader %x:%x:%x:%x init_acknack_count = %d\n", PGUID (rd->e.guid), rd->init_acknack_count);
|
||||
*init_count = rd->init_acknack_count;
|
||||
|
||||
if (ut_avlLookupIPath (&rd_writers_treedef, &rd->writers, &pwr->e.guid, &path))
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " reader_add_connection(pwr %x:%x:%x:%x rd %x:%x:%x:%x) - already connected\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " reader_add_connection(pwr %x:%x:%x:%x rd %x:%x:%x:%x) - already connected\n",
|
||||
PGUID (pwr->e.guid), PGUID (rd->e.guid));
|
||||
os_mutexUnlock (&rd->e.lock);
|
||||
os_free (m);
|
||||
}
|
||||
else
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " reader_add_connection(pwr %x:%x:%x:%x rd %x:%x:%x:%x)\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " reader_add_connection(pwr %x:%x:%x:%x rd %x:%x:%x:%x)\n",
|
||||
PGUID (pwr->e.guid), PGUID (rd->e.guid));
|
||||
ut_avlInsertIPath (&rd_writers_treedef, &rd->writers, m, &path);
|
||||
os_mutexUnlock (&rd->e.lock);
|
||||
|
@ -1707,13 +1708,13 @@ static void reader_add_local_connection (struct reader *rd, struct writer *wr)
|
|||
|
||||
if (ut_avlLookupIPath (&rd_local_writers_treedef, &rd->local_writers, &wr->e.guid, &path))
|
||||
{
|
||||
nn_log(LC_DISCOVERY, " reader_add_local_connection(wr %x:%x:%x:%x rd %x:%x:%x:%x) - already connected\n", PGUID (wr->e.guid), PGUID (rd->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " reader_add_local_connection(wr %x:%x:%x:%x rd %x:%x:%x:%x) - already connected\n", PGUID (wr->e.guid), PGUID (rd->e.guid));
|
||||
os_mutexUnlock (&rd->e.lock);
|
||||
os_free (m);
|
||||
}
|
||||
else
|
||||
{
|
||||
nn_log(LC_DISCOVERY, " reader_add_local_connection(wr %x:%x:%x:%x rd %x:%x:%x:%x)\n", PGUID (wr->e.guid), PGUID (rd->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " reader_add_local_connection(wr %x:%x:%x:%x rd %x:%x:%x:%x)\n", PGUID (wr->e.guid), PGUID (rd->e.guid));
|
||||
ut_avlInsertIPath (&rd_local_writers_treedef, &rd->local_writers, m, &path);
|
||||
os_mutexUnlock (&rd->e.lock);
|
||||
|
||||
|
@ -1750,7 +1751,7 @@ static void proxy_writer_add_connection (struct proxy_writer *pwr, struct reader
|
|||
pwr->ddsi2direct_cbarg = rd->ddsi2direct_cbarg;
|
||||
}
|
||||
|
||||
nn_log (LC_DISCOVERY, " proxy_writer_add_connection(pwr %x:%x:%x:%x rd %x:%x:%x:%x)",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " proxy_writer_add_connection(pwr %x:%x:%x:%x rd %x:%x:%x:%x)",
|
||||
PGUID (pwr->e.guid), PGUID (rd->e.guid));
|
||||
m->rd_guid = rd->e.guid;
|
||||
m->tcreate = now_mt ();
|
||||
|
@ -1785,7 +1786,7 @@ static void proxy_writer_add_connection (struct proxy_writer *pwr, struct reader
|
|||
m->in_sync = PRMSS_TLCATCHUP;
|
||||
m->u.not_in_sync.end_of_tl_seq = MAX_SEQ_NUMBER;
|
||||
if (m->in_sync != PRMSS_SYNC)
|
||||
nn_log (LC_DISCOVERY, " - tlcatchup");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " - tlcatchup");
|
||||
}
|
||||
else if (!config.conservative_builtin_reader_startup && is_builtin_entityid (rd->e.guid.entityid, ownvendorid) && !ut_avlIsEmpty (&pwr->readers))
|
||||
{
|
||||
|
@ -1798,7 +1799,7 @@ static void proxy_writer_add_connection (struct proxy_writer *pwr, struct reader
|
|||
m->in_sync = PRMSS_OUT_OF_SYNC;
|
||||
m->u.not_in_sync.end_of_tl_seq = pwr->last_seq;
|
||||
m->u.not_in_sync.end_of_out_of_sync_seq = last_deliv_seq;
|
||||
nn_log(LC_DISCOVERY, " - out-of-sync %"PRId64, m->u.not_in_sync.end_of_out_of_sync_seq);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " - out-of-sync %"PRId64, m->u.not_in_sync.end_of_out_of_sync_seq);
|
||||
}
|
||||
if (m->in_sync != PRMSS_SYNC)
|
||||
pwr->n_readers_out_of_sync++;
|
||||
|
@ -1828,7 +1829,7 @@ static void proxy_writer_add_connection (struct proxy_writer *pwr, struct reader
|
|||
os_mutexUnlock (&pwr->e.lock);
|
||||
qxev_pwr_entityid (pwr, &rd->e.guid.prefix);
|
||||
|
||||
nn_log (LC_DISCOVERY, "\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "\n");
|
||||
|
||||
if (rd->status_cb)
|
||||
{
|
||||
|
@ -1843,7 +1844,7 @@ static void proxy_writer_add_connection (struct proxy_writer *pwr, struct reader
|
|||
|
||||
already_matched:
|
||||
assert (is_builtin_entityid (pwr->e.guid.entityid, pwr->c.vendor) ? (pwr->c.topic == NULL) : (pwr->c.topic != NULL));
|
||||
nn_log (LC_DISCOVERY, " proxy_writer_add_connection(pwr %x:%x:%x:%x rd %x:%x:%x:%x) - already connected\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " proxy_writer_add_connection(pwr %x:%x:%x:%x rd %x:%x:%x:%x) - already connected\n",
|
||||
PGUID (pwr->e.guid), PGUID (rd->e.guid));
|
||||
os_mutexUnlock (&pwr->e.lock);
|
||||
os_free (m);
|
||||
|
@ -1861,14 +1862,14 @@ static void proxy_reader_add_connection (struct proxy_reader *prd, struct writer
|
|||
prd->c.topic = wr->topic;
|
||||
if (ut_avlLookupIPath (&prd_writers_treedef, &prd->writers, &wr->e.guid, &path))
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " proxy_reader_add_connection(wr %x:%x:%x:%x prd %x:%x:%x:%x) - already connected\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " proxy_reader_add_connection(wr %x:%x:%x:%x prd %x:%x:%x:%x) - already connected\n",
|
||||
PGUID (wr->e.guid), PGUID (prd->e.guid));
|
||||
os_mutexUnlock (&prd->e.lock);
|
||||
os_free (m);
|
||||
}
|
||||
else
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " proxy_reader_add_connection(wr %x:%x:%x:%x prd %x:%x:%x:%x)\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " proxy_reader_add_connection(wr %x:%x:%x:%x prd %x:%x:%x:%x)\n",
|
||||
PGUID (wr->e.guid), PGUID (prd->e.guid));
|
||||
ut_avlInsertIPath (&prd_writers_treedef, &prd->writers, m, &path);
|
||||
os_mutexUnlock (&prd->e.lock);
|
||||
|
@ -2195,7 +2196,7 @@ static void generic_do_match (struct entity_common *e, nn_mtime_t tnow)
|
|||
enum entity_kind mkind = generic_do_match_mkind(e->kind);
|
||||
if (!is_builtin_entityid (e->guid.entityid, ownvendorid))
|
||||
{
|
||||
nn_log(LC_DISCOVERY, "match_%s_with_%ss(%s %x:%x:%x:%x) scanning all %ss\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "match_%s_with_%ss(%s %x:%x:%x:%x) scanning all %ss\n",
|
||||
generic_do_match_kindstr_us (e->kind), generic_do_match_kindstr_us (mkind),
|
||||
generic_do_match_kindabbrev (e->kind), PGUID (e->guid),
|
||||
generic_do_match_kindstr(mkind));
|
||||
|
@ -2216,7 +2217,7 @@ static void generic_do_match (struct entity_common *e, nn_mtime_t tnow)
|
|||
/* Built-ins have fixed QoS */
|
||||
nn_entityid_t tgt_ent = builtin_entityid_match (e->guid.entityid);
|
||||
enum entity_kind pkind = generic_do_match_isproxy (e) ? EK_PARTICIPANT : EK_PROXY_PARTICIPANT;
|
||||
nn_log(LC_DISCOVERY, "match_%s_with_%ss(%s %x:%x:%x:%x) scanning %sparticipants tgt=%x\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "match_%s_with_%ss(%s %x:%x:%x:%x) scanning %sparticipants tgt=%x\n",
|
||||
generic_do_match_kindstr_us (e->kind), generic_do_match_kindstr_us (mkind),
|
||||
generic_do_match_kindabbrev (e->kind), PGUID (e->guid),
|
||||
generic_do_match_isproxy (e) ? "" : "proxy ",
|
||||
|
@ -2247,7 +2248,7 @@ static void generic_do_local_match (struct entity_common *e, nn_mtime_t tnow)
|
|||
/* never a need for local matches on discovery endpoints */
|
||||
return;
|
||||
mkind = generic_do_local_match_mkind(e->kind);
|
||||
nn_log(LC_DISCOVERY, "match_%s_with_%ss(%s %x:%x:%x:%x) scanning all %ss\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "match_%s_with_%ss(%s %x:%x:%x:%x) scanning all %ss\n",
|
||||
generic_do_match_kindstr_us (e->kind), generic_do_match_kindstr_us (mkind),
|
||||
generic_do_match_kindabbrev (e->kind), PGUID (e->guid),
|
||||
generic_do_match_kindstr(mkind));
|
||||
|
@ -2314,7 +2315,7 @@ static void new_reader_writer_common (const struct nn_guid *guid, const struct d
|
|||
if (xqos->partition.n > 1)
|
||||
partition_suffix = "+";
|
||||
}
|
||||
nn_log (LC_DISCOVERY, "new_%s(guid %x:%x:%x:%x, %s%s.%s/%s)\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "new_%s(guid %x:%x:%x:%x, %s%s.%s/%s)\n",
|
||||
is_writer_entityid (guid->entityid) ? "writer" : "reader",
|
||||
PGUID (*guid),
|
||||
partition, partition_suffix,
|
||||
|
@ -2377,7 +2378,7 @@ static uint32_t get_partitionid_from_mapping (const char *partition, const char
|
|||
return 0;
|
||||
else
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "matched writer for topic \"%s\" in partition \"%s\" to networkPartition \"%s\"\n", topic, partition, pm->networkPartition);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "matched writer for topic \"%s\" in partition \"%s\" to networkPartition \"%s\"\n", topic, partition, pm->networkPartition);
|
||||
return pm->partition->partitionId;
|
||||
}
|
||||
}
|
||||
|
@ -2549,7 +2550,7 @@ unsigned remove_acked_messages (struct writer *wr, struct whc_state *whcst, stru
|
|||
writer_clear_retransmitting (wr);
|
||||
if (wr->state == WRST_LINGERING && whcst->unacked_bytes == 0)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "remove_acked_messages: deleting lingering writer %x:%x:%x:%x\n", PGUID (wr->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "remove_acked_messages: deleting lingering writer %x:%x:%x:%x\n", PGUID (wr->e.guid));
|
||||
delete_writer_nolinger_locked (wr);
|
||||
}
|
||||
return n;
|
||||
|
@ -2604,11 +2605,11 @@ static struct writer * new_writer_guid (const struct nn_guid *guid, const struct
|
|||
assert (wr->xqos->aliased == 0);
|
||||
set_topic_type_name (wr->xqos, topic);
|
||||
|
||||
if (config.enabled_logcats & LC_DISCOVERY)
|
||||
if (dds_get_log_mask() & DDS_LC_DISCOVERY)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "WRITER %x:%x:%x:%x QOS={", PGUID (wr->e.guid));
|
||||
nn_log_xqos (LC_DISCOVERY, wr->xqos);
|
||||
nn_log (LC_DISCOVERY, "}\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "WRITER %x:%x:%x:%x QOS={", PGUID (wr->e.guid));
|
||||
nn_log_xqos (DDS_LC_DISCOVERY, wr->xqos);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "}\n");
|
||||
}
|
||||
assert (wr->xqos->present & QP_RELIABILITY);
|
||||
wr->reliable = (wr->xqos->reliability.kind != NN_BEST_EFFORT_RELIABILITY_QOS);
|
||||
|
@ -2698,9 +2699,9 @@ static struct writer * new_writer_guid (const struct nn_guid *guid, const struct
|
|||
wr->supports_ssm = 1;
|
||||
wr->ssm_as = new_addrset ();
|
||||
add_to_addrset (wr->ssm_as, &loc);
|
||||
nn_log (LC_DISCOVERY, "writer %x:%x:%x:%x: ssm=%d", PGUID (wr->e.guid), wr->supports_ssm);
|
||||
nn_log_addrset (LC_DISCOVERY, "", wr->ssm_as);
|
||||
nn_log (LC_DISCOVERY, "\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "writer %x:%x:%x:%x: ssm=%d", PGUID (wr->e.guid), wr->supports_ssm);
|
||||
nn_log_addrset (DDS_LC_DISCOVERY, "", wr->ssm_as);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -2711,7 +2712,7 @@ static struct writer * new_writer_guid (const struct nn_guid *guid, const struct
|
|||
if (!is_builtin_entityid (wr->e.guid.entityid, ownvendorid))
|
||||
{
|
||||
struct config_channel_listelem *channel = find_channel (wr->xqos->transport_priority);
|
||||
nn_log (LC_DISCOVERY, "writer %x:%x:%x:%x: transport priority %d => channel '%s' priority %d\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "writer %x:%x:%x:%x: transport priority %d => channel '%s' priority %d\n",
|
||||
PGUID (wr->e.guid), wr->xqos->transport_priority.value, channel->name, channel->priority);
|
||||
wr->evq = channel->evq ? channel->evq : gv.xevents;
|
||||
}
|
||||
|
@ -2739,7 +2740,7 @@ static struct writer * new_writer_guid (const struct nn_guid *guid, const struct
|
|||
if (wr->xqos->liveliness.kind != NN_AUTOMATIC_LIVELINESS_QOS ||
|
||||
nn_from_ddsi_duration (wr->xqos->liveliness.lease_duration) != T_NEVER)
|
||||
{
|
||||
nn_log (LC_INFO | LC_DISCOVERY, "writer %x:%x:%x:%x: incorrectly treating it as of automatic liveliness kind with lease duration = inf (%d, %"PRId64")\n", PGUID (wr->e.guid), (int) wr->xqos->liveliness.kind, nn_from_ddsi_duration (wr->xqos->liveliness.lease_duration));
|
||||
DDS_LOG(DDS_LC_INFO | DDS_LC_DISCOVERY, "writer %x:%x:%x:%x: incorrectly treating it as of automatic liveliness kind with lease duration = inf (%d, %"PRId64")\n", PGUID (wr->e.guid), (int) wr->xqos->liveliness.kind, nn_from_ddsi_duration (wr->xqos->liveliness.lease_duration));
|
||||
}
|
||||
wr->lease_duration = T_NEVER; /* FIXME */
|
||||
|
||||
|
@ -2798,7 +2799,7 @@ struct writer * new_writer (struct nn_guid *wrguid, const struct nn_guid *group_
|
|||
|
||||
if ((pp = ephash_lookup_participant_guid (ppguid)) == NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "new_writer - participant %x:%x:%x:%x not found\n", PGUID (*ppguid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "new_writer - participant %x:%x:%x:%x not found\n", PGUID (*ppguid));
|
||||
return NULL;
|
||||
}
|
||||
/* participant can't be freed while we're mucking around cos we are
|
||||
|
@ -2814,7 +2815,7 @@ struct writer * new_writer (struct nn_guid *wrguid, const struct nn_guid *group_
|
|||
static void gc_delete_writer (struct gcreq *gcreq)
|
||||
{
|
||||
struct writer *wr = gcreq->arg;
|
||||
nn_log (LC_DISCOVERY, "gc_delete_writer(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (wr->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "gc_delete_writer(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (wr->e.guid));
|
||||
gcreq_free (gcreq);
|
||||
|
||||
/* We now allow GC while blocked on a full WHC, but we still don't allow deleting a writer while blocked on it. The writer's state must be DELETING by the time we get here, and that means the transmit path is no longer blocked. It doesn't imply that the write thread is no longer in throttle_writer(), just that if it is, it will soon return from there. Therefore, block until it isn't throttling anymore. We can safely lock the writer, as we're on the separate GC thread. */
|
||||
|
@ -2873,7 +2874,7 @@ static void gc_delete_writer (struct gcreq *gcreq)
|
|||
static void gc_delete_writer_throttlewait (struct gcreq *gcreq)
|
||||
{
|
||||
struct writer *wr = gcreq->arg;
|
||||
nn_log (LC_DISCOVERY, "gc_delete_writer_throttlewait(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (wr->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "gc_delete_writer_throttlewait(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (wr->e.guid));
|
||||
/* We now allow GC while blocked on a full WHC, but we still don't allow deleting a writer while blocked on it. The writer's state must be DELETING by the time we get here, and that means the transmit path is no longer blocked. It doesn't imply that the write thread is no longer in throttle_writer(), just that if it is, it will soon return from there. Therefore, block until it isn't throttling anymore. We can safely lock the writer, as we're on the separate GC thread. */
|
||||
assert (wr->state == WRST_DELETING);
|
||||
os_mutexLock (&wr->e.lock);
|
||||
|
@ -2886,7 +2887,7 @@ static void gc_delete_writer_throttlewait (struct gcreq *gcreq)
|
|||
static void writer_set_state (struct writer *wr, enum writer_state newstate)
|
||||
{
|
||||
ASSERT_MUTEX_HELD (&wr->e.lock);
|
||||
nn_log (LC_DISCOVERY, "writer_set_state(%x:%x:%x:%x) state transition %d -> %d\n", PGUID (wr->e.guid), wr->state, newstate);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "writer_set_state(%x:%x:%x:%x) state transition %d -> %d\n", PGUID (wr->e.guid), wr->state, newstate);
|
||||
assert (newstate > wr->state);
|
||||
if (wr->state == WRST_OPERATIONAL)
|
||||
{
|
||||
|
@ -2903,7 +2904,7 @@ static void writer_set_state (struct writer *wr, enum writer_state newstate)
|
|||
|
||||
int delete_writer_nolinger_locked (struct writer *wr)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "delete_writer_nolinger(guid %x:%x:%x:%x) ...\n", PGUID (wr->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_writer_nolinger(guid %x:%x:%x:%x) ...\n", PGUID (wr->e.guid));
|
||||
ASSERT_MUTEX_HELD (&wr->e.lock);
|
||||
local_reader_ary_setinvalid (&wr->rdary);
|
||||
ephash_remove_writer_guid (wr);
|
||||
|
@ -2924,10 +2925,10 @@ int delete_writer_nolinger (const struct nn_guid *guid)
|
|||
assert (is_writer_entityid (guid->entityid));
|
||||
if ((wr = ephash_lookup_writer_guid (guid)) == NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "delete_writer_nolinger(guid %x:%x:%x:%x) - unknown guid\n", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_writer_nolinger(guid %x:%x:%x:%x) - unknown guid\n", PGUID (*guid));
|
||||
return ERR_UNKNOWN_ENTITY;
|
||||
}
|
||||
nn_log (LC_DISCOVERY, "delete_writer_nolinger(guid %x:%x:%x:%x) ...\n", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_writer_nolinger(guid %x:%x:%x:%x) ...\n", PGUID (*guid));
|
||||
os_mutexLock (&wr->e.lock);
|
||||
delete_writer_nolinger_locked (wr);
|
||||
os_mutexUnlock (&wr->e.lock);
|
||||
|
@ -2940,10 +2941,10 @@ int delete_writer (const struct nn_guid *guid)
|
|||
struct whc_state whcst;
|
||||
if ((wr = ephash_lookup_writer_guid (guid)) == NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "delete_writer(guid %x:%x:%x:%x) - unknown guid\n", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_writer(guid %x:%x:%x:%x) - unknown guid\n", PGUID (*guid));
|
||||
return ERR_UNKNOWN_ENTITY;
|
||||
}
|
||||
nn_log (LC_DISCOVERY, "delete_writer(guid %x:%x:%x:%x) ...\n", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_writer(guid %x:%x:%x:%x) ...\n", PGUID (*guid));
|
||||
os_mutexLock (&wr->e.lock);
|
||||
|
||||
/* If no unack'ed data, don't waste time or resources (expected to
|
||||
|
@ -2953,7 +2954,7 @@ int delete_writer (const struct nn_guid *guid)
|
|||
whc_get_state(wr->whc, &whcst);
|
||||
if (whcst.unacked_bytes == 0)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "delete_writer(guid %x:%x:%x:%x) - no unack'ed samples\n", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_writer(guid %x:%x:%x:%x) - no unack'ed samples\n", PGUID (*guid));
|
||||
delete_writer_nolinger_locked (wr);
|
||||
os_mutexUnlock (&wr->e.lock);
|
||||
}
|
||||
|
@ -2965,7 +2966,7 @@ int delete_writer (const struct nn_guid *guid)
|
|||
os_mutexUnlock (&wr->e.lock);
|
||||
tsched = add_duration_to_mtime (now_mt (), config.writer_linger_duration);
|
||||
mtime_to_sec_usec (&tsec, &tusec, tsched);
|
||||
nn_log (LC_DISCOVERY, "delete_writer(guid %x:%x:%x:%x) - unack'ed samples, will delete when ack'd or at t = %d.%06d\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_writer(guid %x:%x:%x:%x) - unack'ed samples, will delete when ack'd or at t = %d.%06d\n",
|
||||
PGUID (*guid), tsec, tusec);
|
||||
qxev_delete_writer (tsched, &wr->e.guid);
|
||||
}
|
||||
|
@ -2984,7 +2985,7 @@ void writer_exit_startup_mode (struct writer *wr)
|
|||
cnt += remove_acked_messages (wr, &whcst, &deferred_free_list);
|
||||
cnt += whc_downgrade_to_volatile (wr->whc, &whcst);
|
||||
writer_clear_retransmitting (wr);
|
||||
nn_log (LC_DISCOVERY, " %x:%x:%x:%x: dropped %u samples\n", PGUID(wr->e.guid), cnt);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " %x:%x:%x:%x: dropped %u samples\n", PGUID(wr->e.guid), cnt);
|
||||
}
|
||||
os_mutexUnlock (&wr->e.lock);
|
||||
whc_free_deferred_free_list (wr->whc, deferred_free_list);
|
||||
|
@ -3013,7 +3014,7 @@ static struct addrset * get_as_from_mapping (const char *partition, const char *
|
|||
struct addrset *as = new_addrset ();
|
||||
if ((pm = find_partitionmapping (partition, topic)) != NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "matched reader for topic \"%s\" in partition \"%s\" to networkPartition \"%s\"\n", topic, partition, pm->networkPartition);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "matched reader for topic \"%s\" in partition \"%s\" to networkPartition \"%s\"\n", topic, partition, pm->networkPartition);
|
||||
assert (pm->partition->as);
|
||||
copy_addrset_into_addrset (as, pm->partition->as);
|
||||
}
|
||||
|
@ -3029,7 +3030,7 @@ static void join_mcast_helper (const nn_locator_t *n, void * varg)
|
|||
{
|
||||
if (ddsi_join_mc (conn, NULL, n) < 0)
|
||||
{
|
||||
nn_log (LC_WARNING, "failed to join network partition multicast group\n");
|
||||
DDS_LOG(DDS_LC_WARNING, "failed to join network partition multicast group\n");
|
||||
}
|
||||
}
|
||||
else /* join all addresses that include this node */
|
||||
|
@ -3053,7 +3054,7 @@ static void join_mcast_helper (const nn_locator_t *n, void * varg)
|
|||
memcpy(l.address + 12, &ipn, 4);
|
||||
if (ddsi_join_mc (conn, NULL, &l) < 0)
|
||||
{
|
||||
nn_log (LC_WARNING, "failed to join network partition multicast group\n");
|
||||
DDS_LOG(DDS_LC_WARNING, "failed to join network partition multicast group\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3071,7 +3072,7 @@ static void leave_mcast_helper (const nn_locator_t *n, void * varg)
|
|||
{
|
||||
if (ddsi_leave_mc (conn, NULL, n) < 0)
|
||||
{
|
||||
nn_log (LC_WARNING, "failed to leave network partition multicast group\n");
|
||||
DDS_LOG(DDS_LC_WARNING, "failed to leave network partition multicast group\n");
|
||||
}
|
||||
}
|
||||
else /* join all addresses that include this node */
|
||||
|
@ -3095,7 +3096,7 @@ static void leave_mcast_helper (const nn_locator_t *n, void * varg)
|
|||
memcpy(l.address + 12, &ipn, 4);
|
||||
if (ddsi_leave_mc (conn, NULL, &l) < 0)
|
||||
{
|
||||
nn_log (LC_WARNING, "failed to leave network partition multicast group\n");
|
||||
DDS_LOG(DDS_LC_WARNING, "failed to leave network partition multicast group\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3138,11 +3139,11 @@ static struct reader * new_reader_guid
|
|||
assert (rd->xqos->aliased == 0);
|
||||
set_topic_type_name (rd->xqos, topic);
|
||||
|
||||
if (config.enabled_logcats & LC_DISCOVERY)
|
||||
if (dds_get_log_mask() & DDS_LC_DISCOVERY)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "READER %x:%x:%x:%x QOS={", PGUID (rd->e.guid));
|
||||
nn_log_xqos (LC_DISCOVERY, rd->xqos);
|
||||
nn_log (LC_DISCOVERY, "}\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "READER %x:%x:%x:%x QOS={", PGUID (rd->e.guid));
|
||||
nn_log_xqos (DDS_LC_DISCOVERY, rd->xqos);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "}\n");
|
||||
}
|
||||
assert (rd->xqos->present & QP_RELIABILITY);
|
||||
rd->reliable = (rd->xqos->reliability.kind != NN_BEST_EFFORT_RELIABILITY_QOS);
|
||||
|
@ -3171,7 +3172,7 @@ static struct reader * new_reader_guid
|
|||
if (rd->xqos->liveliness.kind != NN_AUTOMATIC_LIVELINESS_QOS ||
|
||||
nn_from_ddsi_duration (rd->xqos->liveliness.lease_duration) != T_NEVER)
|
||||
{
|
||||
nn_log (LC_INFO | LC_DISCOVERY, "reader %x:%x:%x:%x: incorrectly treating it as of automatic liveliness kind with lease duration = inf (%d, %"PRId64")\n", PGUID (rd->e.guid), (int) rd->xqos->liveliness.kind, nn_from_ddsi_duration (rd->xqos->liveliness.lease_duration));
|
||||
DDS_LOG(DDS_LC_INFO | DDS_LC_DISCOVERY, "reader %x:%x:%x:%x: incorrectly treating it as of automatic liveliness kind with lease duration = inf (%d, %"PRId64")\n", PGUID (rd->e.guid), (int) rd->xqos->liveliness.kind, nn_from_ddsi_duration (rd->xqos->liveliness.lease_duration));
|
||||
}
|
||||
|
||||
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
|
||||
|
@ -3203,11 +3204,11 @@ static struct reader * new_reader_guid
|
|||
* - Join the socket if a multicast address
|
||||
*/
|
||||
addrset_forall (rd->as, join_mcast_helper, gv.data_conn_mc);
|
||||
if (config.enabled_logcats & LC_DISCOVERY)
|
||||
if (dds_get_log_mask() & DDS_LC_DISCOVERY)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "READER %x:%x:%x:%x locators={", PGUID (rd->e.guid));
|
||||
nn_log_addrset (LC_DISCOVERY, "", rd->as);
|
||||
nn_log (LC_DISCOVERY, "}\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "READER %x:%x:%x:%x locators={", PGUID (rd->e.guid));
|
||||
nn_log_addrset(DDS_LC_DISCOVERY, "", rd->as);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "}\n");
|
||||
}
|
||||
}
|
||||
#ifdef DDSI_INCLUDE_SSM
|
||||
|
@ -3223,7 +3224,7 @@ static struct reader * new_reader_guid
|
|||
}
|
||||
#ifdef DDSI_INCLUDE_SSM
|
||||
if (rd->favours_ssm)
|
||||
nn_log (LC_DISCOVERY, "READER %x:%x:%x:%x ssm=%d\n", PGUID (rd->e.guid), rd->favours_ssm);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "READER %x:%x:%x:%x ssm=%d\n", PGUID (rd->e.guid), rd->favours_ssm);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -3254,7 +3255,7 @@ struct reader * new_reader
|
|||
|
||||
if ((pp = ephash_lookup_participant_guid (ppguid)) == NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "new_reader - participant %x:%x:%x:%x not found\n", PGUID (*ppguid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "new_reader - participant %x:%x:%x:%x not found\n", PGUID (*ppguid));
|
||||
return NULL;
|
||||
}
|
||||
rdguid->prefix = pp->e.guid.prefix;
|
||||
|
@ -3268,7 +3269,7 @@ static void gc_delete_reader (struct gcreq *gcreq)
|
|||
{
|
||||
/* see gc_delete_writer for comments */
|
||||
struct reader *rd = gcreq->arg;
|
||||
nn_log (LC_DISCOVERY, "gc_delete_reader(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (rd->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "gc_delete_reader(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (rd->e.guid));
|
||||
gcreq_free (gcreq);
|
||||
|
||||
while (!ut_avlIsEmpty (&rd->writers))
|
||||
|
@ -3317,14 +3318,14 @@ int delete_reader (const struct nn_guid *guid)
|
|||
assert (!is_writer_entityid (guid->entityid));
|
||||
if ((rd = ephash_lookup_reader_guid (guid)) == NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "delete_reader_guid(guid %x:%x:%x:%x) - unknown guid\n", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_reader_guid(guid %x:%x:%x:%x) - unknown guid\n", PGUID (*guid));
|
||||
return ERR_UNKNOWN_ENTITY;
|
||||
}
|
||||
if (rd->rhc)
|
||||
{
|
||||
(ddsi_plugin.rhc_plugin.rhc_fini_fn) (rd->rhc);
|
||||
}
|
||||
nn_log (LC_DISCOVERY, "delete_reader_guid(guid %x:%x:%x:%x) ...\n", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_reader_guid(guid %x:%x:%x:%x) ...\n", PGUID (*guid));
|
||||
ephash_remove_reader_guid (rd);
|
||||
gcreq_reader (rd);
|
||||
return 0;
|
||||
|
@ -3669,7 +3670,7 @@ static void unref_proxy_participant (struct proxy_participant *proxypp, struct p
|
|||
{
|
||||
assert (proxypp->endpoints == NULL);
|
||||
os_mutexUnlock (&proxypp->e.lock);
|
||||
nn_log (LC_DISCOVERY, "unref_proxy_participant(%x:%x:%x:%x): refc=0, freeing\n", PGUID (proxypp->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "unref_proxy_participant(%x:%x:%x:%x): refc=0, freeing\n", PGUID (proxypp->e.guid));
|
||||
|
||||
|
||||
unref_addrset (proxypp->as_default);
|
||||
|
@ -3686,7 +3687,7 @@ static void unref_proxy_participant (struct proxy_participant *proxypp, struct p
|
|||
{
|
||||
assert (refc == 1);
|
||||
os_mutexUnlock (&proxypp->e.lock);
|
||||
nn_log (LC_DISCOVERY, "unref_proxy_participant(%x:%x:%x:%x): refc=%u, no endpoints, implicitly created, deleting\n", PGUID (proxypp->e.guid), (unsigned) refc);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "unref_proxy_participant(%x:%x:%x:%x): refc=%u, no endpoints, implicitly created, deleting\n", PGUID (proxypp->e.guid), (unsigned) refc);
|
||||
delete_proxy_participant_by_guid(&proxypp->e.guid, tnow, 1);
|
||||
/* Deletion is still (and has to be) asynchronous. A parallel endpoint creation may or may not
|
||||
succeed, and if it succeeds it will be deleted along with the proxy participant. So "your
|
||||
|
@ -3695,14 +3696,14 @@ static void unref_proxy_participant (struct proxy_participant *proxypp, struct p
|
|||
else
|
||||
{
|
||||
os_mutexUnlock (&proxypp->e.lock);
|
||||
nn_log (LC_DISCOVERY, "unref_proxy_participant(%x:%x:%x:%x): refc=%u\n", PGUID (proxypp->e.guid), (unsigned) refc);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "unref_proxy_participant(%x:%x:%x:%x): refc=%u\n", PGUID (proxypp->e.guid), (unsigned) refc);
|
||||
}
|
||||
}
|
||||
|
||||
static void gc_delete_proxy_participant (struct gcreq *gcreq)
|
||||
{
|
||||
struct proxy_participant *proxypp = gcreq->arg;
|
||||
nn_log (LC_DISCOVERY, "gc_delete_proxy_participant(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (proxypp->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "gc_delete_proxy_participant(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (proxypp->e.guid));
|
||||
gcreq_free (gcreq);
|
||||
unref_proxy_participant (proxypp, NULL);
|
||||
}
|
||||
|
@ -3735,7 +3736,7 @@ static void delete_or_detach_dependent_pp (struct proxy_participant *p, struct p
|
|||
{
|
||||
nn_etime_t texp = add_duration_to_etime (now_et(), config.ds_grace_period);
|
||||
/* Clear dependency (but don't touch entity id, which must be 0x1c1) and set the lease ticking */
|
||||
nn_log (LC_DISCOVERY, "%x:%x:%x:%x detach-from-DS %x:%x:%x:%x\n", PGUID(p->e.guid), PGUID(proxypp->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "%x:%x:%x:%x detach-from-DS %x:%x:%x:%x\n", PGUID(p->e.guid), PGUID(proxypp->e.guid));
|
||||
memset (&p->privileged_pp_guid.prefix, 0, sizeof (p->privileged_pp_guid.prefix));
|
||||
lease_set_expiry (os_atomic_ldvoidp (&p->lease), texp);
|
||||
os_mutexUnlock (&p->e.lock);
|
||||
|
@ -3748,7 +3749,7 @@ static void delete_ppt (struct proxy_participant * proxypp, nn_wctime_t timestam
|
|||
int ret;
|
||||
|
||||
/* if any proxy participants depend on this participant, delete them */
|
||||
nn_log (LC_DISCOVERY, "delete_ppt(%x:%x:%x:%x) - deleting dependent proxy participants\n", PGUID (proxypp->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_ppt(%x:%x:%x:%x) - deleting dependent proxy participants\n", PGUID (proxypp->e.guid));
|
||||
{
|
||||
struct ephash_enum_proxy_participant est;
|
||||
struct proxy_participant *p;
|
||||
|
@ -3765,11 +3766,11 @@ static void delete_ppt (struct proxy_participant * proxypp, nn_wctime_t timestam
|
|||
if (isimplicit)
|
||||
proxypp->lease_expired = 1;
|
||||
|
||||
nn_log (LC_DISCOVERY, "delete_ppt(%x:%x:%x:%x) - deleting groups\n", PGUID (proxypp->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_ppt(%x:%x:%x:%x) - deleting groups\n", PGUID (proxypp->e.guid));
|
||||
while (!ut_avlIsEmpty (&proxypp->groups))
|
||||
delete_proxy_group_locked (ut_avlRoot (&proxypp_groups_treedef, &proxypp->groups), timestamp, isimplicit);
|
||||
|
||||
nn_log (LC_DISCOVERY, "delete_ppt(%x:%x:%x:%x) - deleting endpoints\n", PGUID (proxypp->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_ppt(%x:%x:%x:%x) - deleting endpoints\n", PGUID (proxypp->e.guid));
|
||||
c = proxypp->endpoints;
|
||||
while (c)
|
||||
{
|
||||
|
@ -3834,16 +3835,16 @@ int delete_proxy_participant_by_guid (const struct nn_guid * guid, nn_wctime_t t
|
|||
{
|
||||
struct proxy_participant * ppt;
|
||||
|
||||
nn_log (LC_DISCOVERY, "delete_proxy_participant_by_guid(%x:%x:%x:%x) ", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_proxy_participant_by_guid(%x:%x:%x:%x) ", PGUID (*guid));
|
||||
os_mutexLock (&gv.lock);
|
||||
ppt = ephash_lookup_proxy_participant_guid (guid);
|
||||
if (ppt == NULL)
|
||||
{
|
||||
os_mutexUnlock (&gv.lock);
|
||||
nn_log (LC_DISCOVERY, "- unknown\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "- unknown\n");
|
||||
return ERR_UNKNOWN_ENTITY;
|
||||
}
|
||||
nn_log (LC_DISCOVERY, "- deleting\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "- deleting\n");
|
||||
propagate_builtin_topic_cmparticipant(&(ppt->e), ppt->plist, timestamp, false);
|
||||
propagate_builtin_topic_participant(&(ppt->e), ppt->plist, timestamp, false);
|
||||
remember_deleted_participant_guid (&ppt->e.guid);
|
||||
|
@ -3879,7 +3880,7 @@ int new_proxy_group (const struct nn_guid *guid, const char *name, const struct
|
|||
ppguid.entityid.u = NN_ENTITYID_PARTICIPANT;
|
||||
if ((proxypp = ephash_lookup_proxy_participant_guid (&ppguid)) == NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "new_proxy_group(%x:%x:%x:%x) - unknown participant\n", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "new_proxy_group(%x:%x:%x:%x) - unknown participant\n", PGUID (*guid));
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
|
@ -3896,7 +3897,7 @@ int new_proxy_group (const struct nn_guid *guid, const char *name, const struct
|
|||
is_sub = 1;
|
||||
break;
|
||||
default:
|
||||
NN_WARNING ("new_proxy_group: unrecognised entityid: %x\n", guid->entityid.u);
|
||||
DDS_WARNING("new_proxy_group: unrecognised entityid: %x\n", guid->entityid.u);
|
||||
return ERR_INVALID_DATA;
|
||||
}
|
||||
os_mutexLock (&proxypp->e.lock);
|
||||
|
@ -3911,7 +3912,7 @@ int new_proxy_group (const struct nn_guid *guid, const char *name, const struct
|
|||
else
|
||||
{
|
||||
/* Always have a guid, may not have a gid */
|
||||
nn_log (LC_DISCOVERY, "new_proxy_group(%x:%x:%x:%x): new\n", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "new_proxy_group(%x:%x:%x:%x): new\n", PGUID (*guid));
|
||||
pgroup = os_malloc (sizeof (*pgroup));
|
||||
pgroup->guid = *guid;
|
||||
pgroup->proxypp = proxypp;
|
||||
|
@ -3922,14 +3923,14 @@ int new_proxy_group (const struct nn_guid *guid, const char *name, const struct
|
|||
if (name)
|
||||
{
|
||||
assert (xqos != NULL);
|
||||
nn_log (LC_DISCOVERY, "new_proxy_group(%x:%x:%x:%x): setting name (%s) and qos\n", PGUID (*guid), name);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "new_proxy_group(%x:%x:%x:%x): setting name (%s) and qos\n", PGUID (*guid), name);
|
||||
pgroup->name = os_strdup (name);
|
||||
pgroup->xqos = nn_xqos_dup (xqos);
|
||||
nn_xqos_mergein_missing (pgroup->xqos, is_sub ? &gv.default_xqos_sub : &gv.default_xqos_pub);
|
||||
}
|
||||
out:
|
||||
os_mutexUnlock (&proxypp->e.lock);
|
||||
nn_log (LC_DISCOVERY, "\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -3940,7 +3941,7 @@ static void delete_proxy_group_locked (struct proxy_group *pgroup, nn_wctime_t t
|
|||
(void)timestamp;
|
||||
(void)isimplicit;
|
||||
assert ((pgroup->xqos != NULL) == (pgroup->name != NULL));
|
||||
nn_log (LC_DISCOVERY, "delete_proxy_group_locked %x:%x:%x:%x\n", PGUID (pgroup->guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_proxy_group_locked %x:%x:%x:%x\n", PGUID (pgroup->guid));
|
||||
ut_avlDelete (&proxypp_groups_treedef, &proxypp->groups, pgroup);
|
||||
/* Publish corresponding built-in topic only if it is not a place
|
||||
holder: in that case we haven't announced its presence and
|
||||
|
@ -4029,7 +4030,7 @@ int new_proxy_writer (const struct nn_guid *ppguid, const struct nn_guid *guid,
|
|||
|
||||
if ((proxypp = ephash_lookup_proxy_participant_guid (ppguid)) == NULL)
|
||||
{
|
||||
NN_WARNING ("new_proxy_writer(%x:%x:%x:%x): proxy participant unknown\n", PGUID (*guid));
|
||||
DDS_WARNING("new_proxy_writer(%x:%x:%x:%x): proxy participant unknown\n", PGUID (*guid));
|
||||
return ERR_UNKNOWN_ENTITY;
|
||||
}
|
||||
|
||||
|
@ -4071,12 +4072,12 @@ int new_proxy_writer (const struct nn_guid *ppguid, const struct nn_guid *guid,
|
|||
|
||||
assert (pwr->c.xqos->present & QP_LIVELINESS);
|
||||
if (pwr->c.xqos->liveliness.kind != NN_AUTOMATIC_LIVELINESS_QOS)
|
||||
nn_log (LC_DISCOVERY, " FIXME: only AUTOMATIC liveliness supported");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " FIXME: only AUTOMATIC liveliness supported");
|
||||
#if 0
|
||||
pwr->tlease_dur = nn_from_ddsi_duration (pwr->c.xqos->liveliness.lease_duration);
|
||||
if (pwr->tlease_dur == 0)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, " FIXME: treating lease_duration=0 as inf");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, " FIXME: treating lease_duration=0 as inf");
|
||||
pwr->tlease_dur = T_NEVER;
|
||||
}
|
||||
pwr->tlease_end = add_duration_to_wctime (tnow, pwr->tlease_dur);
|
||||
|
@ -4194,7 +4195,7 @@ void update_proxy_reader (struct proxy_reader * prd, struct addrset * as)
|
|||
static void gc_delete_proxy_writer (struct gcreq *gcreq)
|
||||
{
|
||||
struct proxy_writer *pwr = gcreq->arg;
|
||||
nn_log (LC_DISCOVERY, "gc_delete_proxy_writer(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (pwr->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "gc_delete_proxy_writer(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (pwr->e.guid));
|
||||
gcreq_free (gcreq);
|
||||
|
||||
while (!ut_avlIsEmpty (&pwr->readers))
|
||||
|
@ -4217,12 +4218,12 @@ int delete_proxy_writer (const struct nn_guid *guid, nn_wctime_t timestamp, int
|
|||
struct proxy_writer *pwr;
|
||||
(void)timestamp;
|
||||
(void)isimplicit;
|
||||
nn_log (LC_DISCOVERY, "delete_proxy_writer (%x:%x:%x:%x) ", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_proxy_writer (%x:%x:%x:%x) ", PGUID (*guid));
|
||||
os_mutexLock (&gv.lock);
|
||||
if ((pwr = ephash_lookup_proxy_writer_guid (guid)) == NULL)
|
||||
{
|
||||
os_mutexUnlock (&gv.lock);
|
||||
nn_log (LC_DISCOVERY, "- unknown\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "- unknown\n");
|
||||
return ERR_UNKNOWN_ENTITY;
|
||||
}
|
||||
/* Set "deleting" flag in particular for Lite, to signal to the receive path it can't
|
||||
|
@ -4230,7 +4231,7 @@ int delete_proxy_writer (const struct nn_guid *guid, nn_wctime_t timestamp, int
|
|||
table will prevent the readers from looking up the proxy writer, and consequently
|
||||
from removing themselves from the proxy writer's rdary[]. */
|
||||
local_reader_ary_setinvalid (&pwr->rdary);
|
||||
nn_log(LC_DISCOVERY, "- deleting\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "- deleting\n");
|
||||
ephash_remove_proxy_writer_guid (pwr);
|
||||
os_mutexUnlock (&gv.lock);
|
||||
gcreq_proxy_writer (pwr);
|
||||
|
@ -4255,7 +4256,7 @@ int new_proxy_reader (const struct nn_guid *ppguid, const struct nn_guid *guid,
|
|||
|
||||
if ((proxypp = ephash_lookup_proxy_participant_guid (ppguid)) == NULL)
|
||||
{
|
||||
NN_WARNING ("new_proxy_reader(%x:%x:%x:%x): proxy participant unknown\n", PGUID (*guid));
|
||||
DDS_WARNING("new_proxy_reader(%x:%x:%x:%x): proxy participant unknown\n", PGUID (*guid));
|
||||
return ERR_UNKNOWN_ENTITY;
|
||||
}
|
||||
|
||||
|
@ -4328,7 +4329,7 @@ static void proxy_reader_set_delete_and_ack_all_messages (struct proxy_reader *p
|
|||
static void gc_delete_proxy_reader (struct gcreq *gcreq)
|
||||
{
|
||||
struct proxy_reader *prd = gcreq->arg;
|
||||
nn_log (LC_DISCOVERY, "gc_delete_proxy_reader(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (prd->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "gc_delete_proxy_reader(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (prd->e.guid));
|
||||
gcreq_free (gcreq);
|
||||
|
||||
while (!ut_avlIsEmpty (&prd->writers))
|
||||
|
@ -4348,17 +4349,17 @@ int delete_proxy_reader (const struct nn_guid *guid, nn_wctime_t timestamp, int
|
|||
struct proxy_reader *prd;
|
||||
(void)timestamp;
|
||||
(void)isimplicit;
|
||||
nn_log (LC_DISCOVERY, "delete_proxy_reader (%x:%x:%x:%x) ", PGUID (*guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "delete_proxy_reader (%x:%x:%x:%x) ", PGUID (*guid));
|
||||
os_mutexLock (&gv.lock);
|
||||
if ((prd = ephash_lookup_proxy_reader_guid (guid)) == NULL)
|
||||
{
|
||||
os_mutexUnlock (&gv.lock);
|
||||
nn_log (LC_DISCOVERY, "- unknown\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "- unknown\n");
|
||||
return ERR_UNKNOWN_ENTITY;
|
||||
}
|
||||
ephash_remove_proxy_reader_guid (prd);
|
||||
os_mutexUnlock (&gv.lock);
|
||||
nn_log (LC_DISCOVERY, "- deleting\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "- deleting\n");
|
||||
|
||||
/* If the proxy reader is reliable, pretend it has just acked all
|
||||
messages: this allows a throttled writer to once again make
|
||||
|
@ -4408,7 +4409,7 @@ static void gc_delete_proxy_writer_dqueue_bubble_cb (struct gcreq *gcreq)
|
|||
{
|
||||
/* delete proxy_writer, phase 3 */
|
||||
struct proxy_writer *pwr = gcreq->arg;
|
||||
nn_log (LC_DISCOVERY, "gc_delete_proxy_writer_dqueue_bubble(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (pwr->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "gc_delete_proxy_writer_dqueue_bubble(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (pwr->e.guid));
|
||||
gcreq_requeue (gcreq, gc_delete_proxy_writer);
|
||||
}
|
||||
|
||||
|
@ -4417,7 +4418,7 @@ static void gc_delete_proxy_writer_dqueue (struct gcreq *gcreq)
|
|||
/* delete proxy_writer, phase 2 */
|
||||
struct proxy_writer *pwr = gcreq->arg;
|
||||
struct nn_dqueue *dqueue = pwr->dqueue;
|
||||
nn_log (LC_DISCOVERY, "gc_delete_proxy_writer_dqueue(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (pwr->e.guid));
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "gc_delete_proxy_writer_dqueue(%p, %x:%x:%x:%x)\n", (void *) gcreq, PGUID (pwr->e.guid));
|
||||
nn_dqueue_enqueue_callback (dqueue, (void (*) (void *)) gc_delete_proxy_writer_dqueue_bubble_cb, gcreq);
|
||||
}
|
||||
|
||||
|
|
|
@ -134,24 +134,24 @@ static uint32_t gcreq_queue_thread (struct gcreq_queue *q)
|
|||
if (!threads_vtime_check (&gcreq->nvtimes, gcreq->vtimes))
|
||||
{
|
||||
/* Not all threads made enough progress => gcreq is not ready
|
||||
yet => sleep for a bit and rety. Note that we can't even
|
||||
yet => sleep for a bit and retry. Note that we can't even
|
||||
terminate while this gcreq is waiting and that there is no
|
||||
condition on which to wait, so a plain sleep is quite
|
||||
reasonable. */
|
||||
if (trace_shortsleep)
|
||||
{
|
||||
TRACE (("gc %p: not yet, shortsleep\n", (void*)gcreq));
|
||||
DDS_TRACE("gc %p: not yet, shortsleep\n", (void*)gcreq);
|
||||
trace_shortsleep = 0;
|
||||
}
|
||||
os_nanoSleep (shortsleep);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Sufficent progress has been made: may now continue deleting
|
||||
/* Sufficient progress has been made: may now continue deleting
|
||||
it; the callback is responsible for requeueing (if complex
|
||||
multi-phase delete) or freeing the delete request. Reset
|
||||
the current gcreq as this one obviously is no more. */
|
||||
TRACE (("gc %p: deleting\n", (void*)gcreq));
|
||||
DDS_TRACE("gc %p: deleting\n", (void*)gcreq);
|
||||
thread_state_awake (self);
|
||||
gcreq->cb (gcreq);
|
||||
thread_state_asleep (self);
|
||||
|
|
|
@ -96,7 +96,7 @@ static int make_uc_sockets (uint32_t * pdisc, uint32_t * pdata, int ppid)
|
|||
}
|
||||
else
|
||||
{
|
||||
NN_FATAL ("make_uc_sockets: invalid participant index %d\n", ppid);
|
||||
DDS_FATAL("make_uc_sockets: invalid participant index %d\n", ppid);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ static int set_recvips (void)
|
|||
#if OS_SOCKET_HAS_IPV6
|
||||
if (gv.ipv6_link_local)
|
||||
{
|
||||
NN_WARNING ("DDSI2EService/General/MulticastRecvNetworkInterfaceAddresses: using 'preferred' instead of 'all' because of IPv6 link-local address\n");
|
||||
DDS_WARNING("DDSI2EService/General/MulticastRecvNetworkInterfaceAddresses: using 'preferred' instead of 'all' because of IPv6 link-local address\n");
|
||||
gv.recvips_mode = RECVIPS_MODE_PREFERRED;
|
||||
}
|
||||
else
|
||||
|
@ -163,7 +163,7 @@ static int set_recvips (void)
|
|||
#if OS_SOCKET_HAS_IPV6
|
||||
if (gv.ipv6_link_local)
|
||||
{
|
||||
NN_ERROR ("DDSI2EService/General/MulticastRecvNetworkInterfaceAddresses: 'any' is unsupported in combination with an IPv6 link-local address\n");
|
||||
DDS_ERROR("DDSI2EService/General/MulticastRecvNetworkInterfaceAddresses: 'any' is unsupported in combination with an IPv6 link-local address\n");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
@ -189,7 +189,7 @@ static int set_recvips (void)
|
|||
nn_locator_t loc;
|
||||
if (ddsi_locator_from_string(&loc, config.networkRecvAddressStrings[i]) != AFSR_OK)
|
||||
{
|
||||
NN_ERROR ("%s: not a valid address in DDSI2EService/General/MulticastRecvNetworkInterfaceAddresses\n", config.networkRecvAddressStrings[i]);
|
||||
DDS_ERROR("%s: not a valid address in DDSI2EService/General/MulticastRecvNetworkInterfaceAddresses\n", config.networkRecvAddressStrings[i]);
|
||||
return -1;
|
||||
}
|
||||
if (compare_locators(&loc, &gv.interfaces[gv.selected_interface].loc) == 0)
|
||||
|
@ -200,7 +200,7 @@ static int set_recvips (void)
|
|||
gv.recvips_mode = have_selected ? RECVIPS_MODE_PREFERRED : RECVIPS_MODE_NONE;
|
||||
if (have_others)
|
||||
{
|
||||
NN_WARNING ("DDSI2EService/General/MulticastRecvNetworkInterfaceAddresses: using 'preferred' because of IPv6 local address\n");
|
||||
DDS_WARNING("DDSI2EService/General/MulticastRecvNetworkInterfaceAddresses: using 'preferred' because of IPv6 local address\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -214,7 +214,7 @@ static int set_recvips (void)
|
|||
nn_locator_t loc;
|
||||
if (ddsi_locator_from_string(&loc, config.networkRecvAddressStrings[i]) != AFSR_OK)
|
||||
{
|
||||
NN_ERROR ("%s: not a valid address in DDSI2EService/General/MulticastRecvNetworkInterfaceAddresses\n", config.networkRecvAddressStrings[i]);
|
||||
DDS_ERROR("%s: not a valid address in DDSI2EService/General/MulticastRecvNetworkInterfaceAddresses\n", config.networkRecvAddressStrings[i]);
|
||||
return -1;
|
||||
}
|
||||
for (j = 0; j < gv.n_interfaces; j++)
|
||||
|
@ -224,7 +224,7 @@ static int set_recvips (void)
|
|||
}
|
||||
if (j == gv.n_interfaces)
|
||||
{
|
||||
NN_ERROR ("No interface bound to requested address '%s'\n", config.networkRecvAddressStrings[i]);
|
||||
DDS_ERROR("No interface bound to requested address '%s'\n", config.networkRecvAddressStrings[i]);
|
||||
return -1;
|
||||
}
|
||||
*recvnode = os_malloc (sizeof (struct ospl_in_addr_node));
|
||||
|
@ -255,13 +255,13 @@ static int string_to_default_locator (nn_locator_t *loc, const char *string, uin
|
|||
case AFSR_OK:
|
||||
break;
|
||||
case AFSR_INVALID:
|
||||
NN_ERROR ("%s: not a valid address (%s)\n", string, tag);
|
||||
DDS_ERROR("%s: not a valid address (%s)\n", string, tag);
|
||||
return -1;
|
||||
case AFSR_UNKNOWN:
|
||||
NN_ERROR ("%s: address name resolution failure (%s)\n", string, tag);
|
||||
DDS_ERROR("%s: address name resolution failure (%s)\n", string, tag);
|
||||
return -1;
|
||||
case AFSR_MISMATCH:
|
||||
NN_ERROR ("%s: invalid address kind (%s)\n", string, tag);
|
||||
DDS_ERROR("%s: invalid address kind (%s)\n", string, tag);
|
||||
return -1;
|
||||
}
|
||||
if (port != 0 && !is_unspec_locator(loc))
|
||||
|
@ -275,7 +275,7 @@ static int string_to_default_locator (nn_locator_t *loc, const char *string, uin
|
|||
const int ismc = is_unspec_locator (loc) || ddsi_is_mcaddr (loc);
|
||||
if (mc != ismc)
|
||||
{
|
||||
NN_ERROR ("%s: %s %s be the unspecified address or a multicast address\n", string, tag, rel);
|
||||
DDS_ERROR("%s: %s %s be the unspecified address or a multicast address\n", string, tag, rel);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ static int set_spdp_address (void)
|
|||
#ifdef DDSI_INCLUDE_SSM
|
||||
if (gv.loc_spdp_mc.kind != NN_LOCATOR_KIND_INVALID && ddsi_is_ssm_mcaddr (&gv.loc_spdp_mc))
|
||||
{
|
||||
NN_ERROR ("%s: SPDP address may not be an SSM address\n", config.spdpMulticastAddressString);
|
||||
DDS_ERROR("%s: SPDP address may not be an SSM address\n", config.spdpMulticastAddressString);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
@ -348,7 +348,7 @@ static int set_ext_address_and_mask (void)
|
|||
else if ((rc = string_to_default_locator (&loc, config.externalAddressString, 0, 0, "external address")) < 0)
|
||||
return rc;
|
||||
else if (rc == 0) {
|
||||
NN_WARNING ("Ignoring ExternalNetworkAddress %s\n", config.externalAddressString);
|
||||
DDS_WARNING("Ignoring ExternalNetworkAddress %s\n", config.externalAddressString);
|
||||
gv.extloc = gv.ownloc;
|
||||
} else {
|
||||
gv.extloc = loc;
|
||||
|
@ -362,7 +362,7 @@ static int set_ext_address_and_mask (void)
|
|||
}
|
||||
else if (config.transport_selector != TRANS_UDP)
|
||||
{
|
||||
NN_ERROR ("external network masks only supported in IPv4 mode\n");
|
||||
DDS_ERROR("external network masks only supported in IPv4 mode\n");
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
|
@ -412,11 +412,11 @@ static int check_thread_properties (void)
|
|||
}
|
||||
if (chanprefix[i] == NULL)
|
||||
{
|
||||
NN_ERROR ("config: DDSI2Service/Threads/Thread[@name=\"%s\"]: unknown thread\n", e->name);
|
||||
DDS_ERROR("config: DDSI2Service/Threads/Thread[@name=\"%s\"]: unknown thread\n", e->name);
|
||||
ok = 0;
|
||||
}
|
||||
#else
|
||||
NN_ERROR ("config: DDSI2Service/Threads/Thread[@name=\"%s\"]: unknown thread\n", e->name);
|
||||
DDS_ERROR("config: DDSI2Service/Threads/Thread[@name=\"%s\"]: unknown thread\n", e->name);
|
||||
ok = 0;
|
||||
#endif /* DDSI_INCLUDE_NETWORK_CHANNELS */
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ int rtps_config_open (void)
|
|||
}
|
||||
else if ((config.tracingOutputFile = fopen (config.tracingOutputFileName, config.tracingAppendToFile ? "a" : "w")) == NULL)
|
||||
{
|
||||
NN_ERROR ("%s: cannot open for writing\n", config.tracingOutputFileName);
|
||||
DDS_ERROR("%s: cannot open for writing\n", config.tracingOutputFileName);
|
||||
status = 0;
|
||||
}
|
||||
else
|
||||
|
@ -454,6 +454,10 @@ int rtps_config_open (void)
|
|||
status = 1;
|
||||
}
|
||||
|
||||
dds_set_log_mask(config.enabled_logcats);
|
||||
dds_set_log_file(config.tracingOutputFile);
|
||||
dds_set_trace_file(config.tracingOutputFile);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -471,7 +475,7 @@ int rtps_config_prep (struct cfgst *cfgst)
|
|||
config.whc_init_highwater_mark.value < config.whc_lowwater_mark ||
|
||||
config.whc_init_highwater_mark.value > config.whc_highwater_mark)
|
||||
{
|
||||
NN_ERROR ("Invalid watermark settings\n");
|
||||
DDS_ERROR("Invalid watermark settings\n");
|
||||
goto err_config_late_error;
|
||||
}
|
||||
|
||||
|
@ -483,7 +487,7 @@ int rtps_config_prep (struct cfgst *cfgst)
|
|||
inherited by readers/writers), but in many sockets mode each
|
||||
participant has its own socket, and therefore unique address
|
||||
set */
|
||||
NN_ERROR ("Minimal built-in endpoint set mode and ManySocketsMode are incompatible\n");
|
||||
DDS_ERROR("Minimal built-in endpoint set mode and ManySocketsMode are incompatible\n");
|
||||
goto err_config_late_error;
|
||||
}
|
||||
|
||||
|
@ -509,7 +513,7 @@ int rtps_config_prep (struct cfgst *cfgst)
|
|||
{
|
||||
double max = (double) config.auxiliary_bandwidth_limit * ((double) config.nack_delay / 1e9);
|
||||
if (max < 0)
|
||||
NN_FATAL ("AuxiliaryBandwidthLimit * NackDelay = %g bytes is insane\n", max);
|
||||
DDS_FATAL("AuxiliaryBandwidthLimit * NackDelay = %g bytes is insane\n", max);
|
||||
if (max > 2147483647.0)
|
||||
config.max_queued_rexmit_bytes = 2147483647u;
|
||||
else
|
||||
|
@ -523,7 +527,7 @@ int rtps_config_prep (struct cfgst *cfgst)
|
|||
/* Verify thread properties refer to defined threads */
|
||||
if (!check_thread_properties ())
|
||||
{
|
||||
NN_ERROR ("Could not initialise configuration\n");
|
||||
DDS_ERROR("Could not initialise configuration\n");
|
||||
goto err_config_late_error;
|
||||
}
|
||||
|
||||
|
@ -534,7 +538,7 @@ int rtps_config_prep (struct cfgst *cfgst)
|
|||
have chosen the latter. */
|
||||
if (config.useIpv6)
|
||||
{
|
||||
NN_ERROR ("IPv6 addressing requested but not supported on this platform\n");
|
||||
DDS_ERROR("IPv6 addressing requested but not supported on this platform\n");
|
||||
goto err_config_late_error;
|
||||
}
|
||||
#endif
|
||||
|
@ -559,7 +563,7 @@ int rtps_config_prep (struct cfgst *cfgst)
|
|||
|
||||
if (config.transport_selector != TRANS_UDP && chptr->diffserv_field != 0)
|
||||
{
|
||||
NN_ERROR ("channel %s specifies IPv4 DiffServ settings which is incompatible with IPv6 use\n",
|
||||
DDS_ERROR("channel %s specifies IPv4 DiffServ settings which is incompatible with IPv6 use\n",
|
||||
chptr->name);
|
||||
error = 1;
|
||||
}
|
||||
|
@ -583,7 +587,7 @@ int rtps_config_prep (struct cfgst *cfgst)
|
|||
printed */
|
||||
if (! rtps_config_open ())
|
||||
{
|
||||
NN_ERROR ("Could not initialise configuration\n");
|
||||
DDS_ERROR("Could not initialise configuration\n");
|
||||
goto err_config_late_error;
|
||||
}
|
||||
|
||||
|
@ -654,7 +658,7 @@ int joinleave_spdp_defmcip (int dojoin)
|
|||
unref_addrset (as);
|
||||
if (arg.errcount)
|
||||
{
|
||||
NN_ERROR ("rtps_init: failed to join multicast groups for domain %d participant %d\n", config.domainId.value, config.participantIndex);
|
||||
DDS_ERROR("rtps_init: failed to join multicast groups for domain %d participant %d\n", config.domainId.value, config.participantIndex);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -686,8 +690,8 @@ int create_multicast_sockets(void)
|
|||
|
||||
gv.disc_conn_mc = disc;
|
||||
gv.data_conn_mc = data;
|
||||
TRACE (("Multicast Ports: discovery %d data %d \n",
|
||||
ddsi_tran_port (gv.disc_conn_mc), ddsi_tran_port (gv.data_conn_mc)));
|
||||
DDS_TRACE("Multicast Ports: discovery %d data %d \n",
|
||||
ddsi_tran_port (gv.disc_conn_mc), ddsi_tran_port (gv.data_conn_mc));
|
||||
return 1;
|
||||
|
||||
err_data:
|
||||
|
@ -735,7 +739,7 @@ static void wait_for_receive_threads (void)
|
|||
/* retrying is to deal a packet geting lost because the socket buffer is full or because the
|
||||
macOS firewall (and perhaps others) likes to ask if the process is allowed to receive data,
|
||||
dropping the packets until the user approves. */
|
||||
NN_WARNING ("wait_for_receive_threads: failed to schedule periodic triggering of the receive threads to deal with packet loss\n");
|
||||
DDS_WARNING("wait_for_receive_threads: failed to schedule periodic triggering of the receive threads to deal with packet loss\n");
|
||||
}
|
||||
for (i = 0; i < gv.n_recv_threads; i++)
|
||||
{
|
||||
|
@ -835,20 +839,20 @@ static int setup_and_start_recv_threads (void)
|
|||
it before it does anything with it. */
|
||||
if ((gv.recv_threads[i].arg.rbpool = nn_rbufpool_new (config.rbuf_size, config.rmsg_chunk_size)) == NULL)
|
||||
{
|
||||
NN_ERROR ("rtps_init: can't allocate receive buffer pool for thread %s\n", gv.recv_threads[i].name);
|
||||
DDS_ERROR("rtps_init: can't allocate receive buffer pool for thread %s\n", gv.recv_threads[i].name);
|
||||
goto fail;
|
||||
}
|
||||
if (gv.recv_threads[i].arg.mode == RTM_MANY)
|
||||
{
|
||||
if ((gv.recv_threads[i].arg.u.many.ws = os_sockWaitsetNew ()) == NULL)
|
||||
{
|
||||
NN_ERROR ("rtps_init: can't allocate sock waitset for thread %s\n", gv.recv_threads[i].name);
|
||||
DDS_ERROR("rtps_init: can't allocate sock waitset for thread %s\n", gv.recv_threads[i].name);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
if ((gv.recv_threads[i].ts = create_thread (gv.recv_threads[i].name, recv_thread, &gv.recv_threads[i].arg)) == NULL)
|
||||
{
|
||||
NN_ERROR ("rtps_init: failed to start thread %s\n", gv.recv_threads[i].name);
|
||||
DDS_ERROR("rtps_init: failed to start thread %s\n", gv.recv_threads[i].name);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
@ -889,7 +893,7 @@ int rtps_init (void)
|
|||
gv.debmon = NULL;
|
||||
|
||||
/* Print start time for referencing relative times in the remainder
|
||||
of the nn_log. */
|
||||
of the DDS_LOG. */
|
||||
{
|
||||
int sec = (int) (gv.tstart.v / 1000000000);
|
||||
int usec = (int) (gv.tstart.v % 1000000000) / 1000;
|
||||
|
@ -898,7 +902,7 @@ int rtps_init (void)
|
|||
tv.tv_sec = sec;
|
||||
tv.tv_nsec = usec * 1000;
|
||||
os_ctime_r (&tv, str, sizeof(str));
|
||||
nn_log (LC_INFO | LC_CONFIG, "started at %d.06%d -- %s\n", sec, usec, str);
|
||||
DDS_LOG(DDS_LC_INFO | DDS_LC_CONFIG, "started at %d.06%d -- %s\n", sec, usec, str);
|
||||
}
|
||||
|
||||
/* Initialize thread pool */
|
||||
|
@ -947,14 +951,14 @@ int rtps_init (void)
|
|||
|
||||
if (!find_own_ip (config.networkAddressString))
|
||||
{
|
||||
NN_ERROR ("No network interface selected\n");
|
||||
DDS_ERROR("No network interface selected\n");
|
||||
goto err_find_own_ip;
|
||||
}
|
||||
if (config.allowMulticast)
|
||||
{
|
||||
if (!gv.interfaces[gv.selected_interface].mc_capable)
|
||||
{
|
||||
NN_WARNING ("selected interface is not multicast-capable: disabling multicast\n");
|
||||
DDS_WARNING("selected interface is not multicast-capable: disabling multicast\n");
|
||||
config.suppress_spdp_multicast = 1;
|
||||
config.allowMulticast = AMC_FALSE;
|
||||
}
|
||||
|
@ -971,19 +975,19 @@ int rtps_init (void)
|
|||
{
|
||||
char buf[DDSI_LOCSTRLEN];
|
||||
/* the "ownip", "extip" labels in the trace have been there for so long, that it seems worthwhile to retain them even though they need not be IP any longer */
|
||||
nn_log (LC_CONFIG, "ownip: %s\n", ddsi_locator_to_string_no_port (buf, sizeof(buf), &gv.ownloc));
|
||||
nn_log (LC_CONFIG, "extip: %s\n", ddsi_locator_to_string_no_port (buf, sizeof(buf), &gv.extloc));
|
||||
nn_log (LC_CONFIG, "extmask: %s%s\n", ddsi_locator_to_string_no_port (buf, sizeof(buf), &gv.extmask), gv.m_factory->m_kind != NN_LOCATOR_KIND_UDPv4 ? " (not applicable)" : "");
|
||||
nn_log (LC_CONFIG, "networkid: 0x%lx\n", (unsigned long) gv.myNetworkId);
|
||||
nn_log (LC_CONFIG, "SPDP MC: %s\n", ddsi_locator_to_string_no_port (buf, sizeof(buf), &gv.loc_spdp_mc));
|
||||
nn_log (LC_CONFIG, "default MC: %s\n", ddsi_locator_to_string_no_port (buf, sizeof(buf), &gv.loc_default_mc));
|
||||
DDS_LOG(DDS_LC_CONFIG, "ownip: %s\n", ddsi_locator_to_string_no_port (buf, sizeof(buf), &gv.ownloc));
|
||||
DDS_LOG(DDS_LC_CONFIG, "extip: %s\n", ddsi_locator_to_string_no_port (buf, sizeof(buf), &gv.extloc));
|
||||
DDS_LOG(DDS_LC_CONFIG, "extmask: %s%s\n", ddsi_locator_to_string_no_port (buf, sizeof(buf), &gv.extmask), gv.m_factory->m_kind != NN_LOCATOR_KIND_UDPv4 ? " (not applicable)" : "");
|
||||
DDS_LOG(DDS_LC_CONFIG, "networkid: 0x%lx\n", (unsigned long) gv.myNetworkId);
|
||||
DDS_LOG(DDS_LC_CONFIG, "SPDP MC: %s\n", ddsi_locator_to_string_no_port (buf, sizeof(buf), &gv.loc_spdp_mc));
|
||||
DDS_LOG(DDS_LC_CONFIG, "default MC: %s\n", ddsi_locator_to_string_no_port (buf, sizeof(buf), &gv.loc_default_mc));
|
||||
#ifdef DDSI_INCLUDE_SSM
|
||||
nn_log (LC_CONFIG, "SSM support included\n");
|
||||
DDS_LOG(DDS_LC_CONFIG, "SSM support included\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
if (gv.ownloc.kind != gv.extloc.kind)
|
||||
NN_FATAL ("mismatch between network address kinds\n");
|
||||
DDS_FATAL("mismatch between network address kinds\n");
|
||||
|
||||
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
|
||||
/* Convert address sets in partition mappings from string to address sets */
|
||||
|
@ -1007,7 +1011,7 @@ int rtps_init (void)
|
|||
#endif
|
||||
|
||||
gv.startup_mode = (config.startup_mode_duration > 0) ? 1 : 0;
|
||||
nn_log (LC_CONFIG, "startup-mode: %s\n", gv.startup_mode ? "enabled" : "disabled");
|
||||
DDS_LOG(DDS_LC_CONFIG, "startup-mode: %s\n", gv.startup_mode ? "enabled" : "disabled");
|
||||
|
||||
(ddsi_plugin.init_fn) ();
|
||||
|
||||
|
@ -1018,7 +1022,7 @@ int rtps_init (void)
|
|||
if (q_security_plugin.new_decoder)
|
||||
{
|
||||
gv.recvSecurityCodec = (q_security_plugin.new_decoder) ();
|
||||
nn_log (LC_CONFIG, "decoderset created\n");
|
||||
DDS_LOG(DDS_LC_CONFIG, "decoderset created\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1064,7 +1068,7 @@ int rtps_init (void)
|
|||
{
|
||||
if (make_uc_sockets (&port_disc_uc, &port_data_uc, config.participantIndex) < 0)
|
||||
{
|
||||
NN_ERROR ("rtps_init: failed to create unicast sockets for domain %d participant %d\n", config.domainId.value, config.participantIndex);
|
||||
DDS_ERROR("rtps_init: failed to create unicast sockets for domain %d participant %d\n", config.domainId.value, config.participantIndex);
|
||||
goto err_unicast_sockets;
|
||||
}
|
||||
}
|
||||
|
@ -1072,7 +1076,7 @@ int rtps_init (void)
|
|||
{
|
||||
/* try to find a free one, and update config.participantIndex */
|
||||
int ppid;
|
||||
nn_log (LC_CONFIG, "rtps_init: trying to find a free participant index\n");
|
||||
DDS_LOG(DDS_LC_CONFIG, "rtps_init: trying to find a free participant index\n");
|
||||
for (ppid = 0; ppid <= config.maxAutoParticipantIndex; ppid++)
|
||||
{
|
||||
int r = make_uc_sockets (&port_disc_uc, &port_data_uc, ppid);
|
||||
|
@ -1082,13 +1086,13 @@ int rtps_init (void)
|
|||
continue;
|
||||
else /* Oops! */
|
||||
{
|
||||
NN_ERROR ("rtps_init: failed to create unicast sockets for domain %d participant %d\n", config.domainId.value, ppid);
|
||||
DDS_ERROR("rtps_init: failed to create unicast sockets for domain %d participant %d\n", config.domainId.value, ppid);
|
||||
goto err_unicast_sockets;
|
||||
}
|
||||
}
|
||||
if (ppid > config.maxAutoParticipantIndex)
|
||||
{
|
||||
NN_ERROR ("rtps_init: failed to find a free participant index for domain %d\n", config.domainId.value);
|
||||
DDS_ERROR("rtps_init: failed to find a free participant index for domain %d\n", config.domainId.value);
|
||||
goto err_unicast_sockets;
|
||||
}
|
||||
config.participantIndex = ppid;
|
||||
|
@ -1097,9 +1101,9 @@ int rtps_init (void)
|
|||
{
|
||||
assert(0);
|
||||
}
|
||||
nn_log (LC_CONFIG, "rtps_init: uc ports: disc %u data %u\n", port_disc_uc, port_data_uc);
|
||||
DDS_LOG(DDS_LC_CONFIG, "rtps_init: uc ports: disc %u data %u\n", port_disc_uc, port_data_uc);
|
||||
}
|
||||
nn_log (LC_CONFIG, "rtps_init: domainid %d participantid %d\n", config.domainId.value, config.participantIndex);
|
||||
DDS_LOG(DDS_LC_CONFIG, "rtps_init: domainid %d participantid %d\n", config.domainId.value, config.participantIndex);
|
||||
|
||||
if (config.pcap_file && *config.pcap_file)
|
||||
{
|
||||
|
@ -1119,7 +1123,7 @@ int rtps_init (void)
|
|||
if (gv.m_factory->m_connless)
|
||||
{
|
||||
if (!(config.many_sockets_mode == MSM_NO_UNICAST && config.allowMulticast))
|
||||
TRACE (("Unicast Ports: discovery %d data %d\n", ddsi_tran_port (gv.disc_conn_uc), ddsi_tran_port (gv.data_conn_uc)));
|
||||
DDS_TRACE("Unicast Ports: discovery %d data %d\n", ddsi_tran_port (gv.disc_conn_uc), ddsi_tran_port (gv.data_conn_uc));
|
||||
|
||||
if (config.allowMulticast)
|
||||
{
|
||||
|
@ -1154,7 +1158,7 @@ int rtps_init (void)
|
|||
gv.listener = ddsi_factory_create_listener (gv.m_factory, config.tcp_port, NULL);
|
||||
if (gv.listener == NULL || ddsi_listener_listen (gv.listener) != 0)
|
||||
{
|
||||
NN_ERROR ("Failed to create %s listener\n", gv.m_factory->m_typename);
|
||||
DDS_ERROR("Failed to create %s listener\n", gv.m_factory->m_typename);
|
||||
if (gv.listener)
|
||||
ddsi_listener_free(gv.listener);
|
||||
goto err_mc_conn;
|
||||
|
@ -1173,7 +1177,7 @@ int rtps_init (void)
|
|||
/* Create shared transmit connection */
|
||||
|
||||
gv.tev_conn = gv.data_conn_uc;
|
||||
TRACE (("Timed event transmit port: %d\n", (int) ddsi_tran_port (gv.tev_conn)));
|
||||
DDS_TRACE("Timed event transmit port: %d\n", (int) ddsi_tran_port (gv.tev_conn));
|
||||
|
||||
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
||||
{
|
||||
|
@ -1194,14 +1198,14 @@ int rtps_init (void)
|
|||
ddsi_tran_free_qos (qos);
|
||||
if (chptr->transmit_conn == NULL)
|
||||
{
|
||||
NN_FATAL ("failed to create transmit connection for channel %s\n", chptr->name);
|
||||
DDS_FATAL("failed to create transmit connection for channel %s\n", chptr->name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
chptr->transmit_conn = gv.data_conn_uc;
|
||||
}
|
||||
TRACE (("channel %s: transmit port %d\n", chptr->name, (int) ddsi_tran_port (chptr->transmit_conn)));
|
||||
DDS_TRACE("channel %s: transmit port %d\n", chptr->name, (int) ddsi_tran_port (chptr->transmit_conn));
|
||||
|
||||
#ifdef DDSI_INCLUDE_BANDWIDTH_LIMITING
|
||||
if (chptr->auxiliary_bandwidth_limit > 0 || lookup_thread_properties (tname))
|
||||
|
@ -1270,7 +1274,7 @@ int rtps_init (void)
|
|||
gv.builtins_dqueue = nn_dqueue_new ("builtins", config.delivery_queue_maxsamples, builtins_dqueue_handler, NULL);
|
||||
if ((r = xeventq_start (gv.xevents, NULL)) < 0)
|
||||
{
|
||||
NN_FATAL ("failed to start global event processing thread (%d)\n", r);
|
||||
DDS_FATAL("failed to start global event processing thread (%d)\n", r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1291,7 +1295,7 @@ int rtps_init (void)
|
|||
{
|
||||
int r;
|
||||
if ((r = xeventq_start (chptr->evq, chptr->name)) < 0)
|
||||
NN_FATAL ("failed to start event processing thread for channel '%s' (%d)\n", chptr->name, r);
|
||||
DDS_FATAL("failed to start event processing thread for channel '%s' (%d)\n", chptr->name, r);
|
||||
}
|
||||
chptr = chptr->next;
|
||||
}
|
||||
|
@ -1302,7 +1306,7 @@ int rtps_init (void)
|
|||
|
||||
if (setup_and_start_recv_threads () < 0)
|
||||
{
|
||||
NN_FATAL ("failed to start receive threads\n");
|
||||
DDS_FATAL("failed to start receive threads\n");
|
||||
}
|
||||
|
||||
if (gv.listener)
|
||||
|
@ -1660,5 +1664,5 @@ OS_WARNING_MSVC_ON(6001);
|
|||
ddsi_serdatapool_free (gv.serpool);
|
||||
nn_xmsgpool_free (gv.xmsgpool);
|
||||
(ddsi_plugin.fini_fn) ();
|
||||
nn_log (LC_CONFIG, "Finis.\n");
|
||||
DDS_LOG(DDS_LC_CONFIG, "Finis.\n");
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ void nn_lat_estim_update (struct nn_lat_estim *le, int64_t est)
|
|||
le->smoothed = (1.0f - alpha) * le->smoothed + alpha * med;
|
||||
}
|
||||
|
||||
int nn_lat_estim_log (logcat_t logcat, const char *tag, const struct nn_lat_estim *le)
|
||||
int nn_lat_estim_log (uint32_t logcat, const char *tag, const struct nn_lat_estim *le)
|
||||
{
|
||||
if (le->smoothed == 0.0f)
|
||||
return 0;
|
||||
|
@ -67,12 +67,12 @@ int nn_lat_estim_log (logcat_t logcat, const char *tag, const struct nn_lat_esti
|
|||
memcpy (tmp, le->window, sizeof (tmp));
|
||||
qsort (tmp, NN_LAT_ESTIM_MEDIAN_WINSZ, sizeof (tmp[0]), (int (*) (const void *, const void *)) cmpfloat);
|
||||
if (tag)
|
||||
nn_log (logcat, " LAT(%s: %e {", tag, le->smoothed);
|
||||
DDS_LOG(logcat, " LAT(%s: %e {", tag, le->smoothed);
|
||||
else
|
||||
nn_log (logcat, " LAT(%e {", le->smoothed);
|
||||
DDS_LOG(logcat, " LAT(%e {", le->smoothed);
|
||||
for (i = 0; i < NN_LAT_ESTIM_MEDIAN_WINSZ; i++)
|
||||
nn_log (logcat, "%s%e", (i > 0) ? "," : "", tmp[i]);
|
||||
nn_log (logcat, "})");
|
||||
DDS_LOG(logcat, "%s%e", (i > 0) ? "," : "", tmp[i]);
|
||||
DDS_LOG(logcat, "})");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ struct lease *lease_new (nn_etime_t texpire, int64_t tdur, struct entity_common
|
|||
struct lease *l;
|
||||
if ((l = os_malloc (sizeof (*l))) == NULL)
|
||||
return NULL;
|
||||
TRACE (("lease_new(tdur %"PRId64" guid %x:%x:%x:%x) @ %p\n", tdur, PGUID (e->guid), (void *) l));
|
||||
DDS_TRACE("lease_new(tdur %"PRId64" guid %x:%x:%x:%x) @ %p\n", tdur, PGUID (e->guid), (void *) l);
|
||||
l->tdur = tdur;
|
||||
l->tend = texpire;
|
||||
l->tsched.v = TSCHED_NOT_ON_HEAP;
|
||||
|
@ -119,7 +119,7 @@ struct lease *lease_new (nn_etime_t texpire, int64_t tdur, struct entity_common
|
|||
|
||||
void lease_register (struct lease *l)
|
||||
{
|
||||
TRACE (("lease_register(l %p guid %x:%x:%x:%x)\n", (void *) l, PGUID (l->entity->guid)));
|
||||
DDS_TRACE("lease_register(l %p guid %x:%x:%x:%x)\n", (void *) l, PGUID (l->entity->guid));
|
||||
os_mutexLock (&gv.leaseheap_lock);
|
||||
lock_lease (l);
|
||||
assert (l->tsched.v == TSCHED_NOT_ON_HEAP);
|
||||
|
@ -137,7 +137,7 @@ void lease_register (struct lease *l)
|
|||
|
||||
void lease_free (struct lease *l)
|
||||
{
|
||||
TRACE (("lease_free(l %p guid %x:%x:%x:%x)\n", (void *) l, PGUID (l->entity->guid)));
|
||||
DDS_TRACE("lease_free(l %p guid %x:%x:%x:%x)\n", (void *) l, PGUID (l->entity->guid));
|
||||
os_mutexLock (&gv.leaseheap_lock);
|
||||
if (l->tsched.v != TSCHED_NOT_ON_HEAP)
|
||||
ut_fibheapDelete (&lease_fhdef, &gv.leaseheap, l);
|
||||
|
@ -163,16 +163,16 @@ void lease_renew (struct lease *l, nn_etime_t tnowE)
|
|||
}
|
||||
unlock_lease (l);
|
||||
|
||||
if (did_update && (config.enabled_logcats & LC_TRACE))
|
||||
if (did_update && (dds_get_log_mask() & DDS_LC_TRACE))
|
||||
{
|
||||
int tsec, tusec;
|
||||
TRACE ((" L("));
|
||||
DDS_TRACE(" L(");
|
||||
if (l->entity->guid.entityid.u == NN_ENTITYID_PARTICIPANT)
|
||||
TRACE ((":%x", l->entity->guid.entityid.u));
|
||||
DDS_TRACE(":%x", l->entity->guid.entityid.u);
|
||||
else
|
||||
TRACE (("%x:%x:%x:%x", PGUID (l->entity->guid)));
|
||||
DDS_TRACE("%x:%x:%x:%x", PGUID (l->entity->guid));
|
||||
etime_to_sec_usec (&tsec, &tusec, tend_new);
|
||||
TRACE ((" %d.%06d)", tsec, tusec));
|
||||
DDS_TRACE(" %d.%06d)", tsec, tusec);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -234,7 +234,7 @@ int64_t check_and_handle_lease_expiration (UNUSED_ARG (struct thread_state1 *sel
|
|||
continue;
|
||||
}
|
||||
|
||||
nn_log (LC_DISCOVERY, "lease expired: l %p guid %x:%x:%x:%x tend %"PRId64" < now %"PRId64"\n", (void *) l, PGUID (g), l->tend.v, tnowE.v);
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "lease expired: l %p guid %x:%x:%x:%x tend %"PRId64" < now %"PRId64"\n", (void *) l, PGUID (g), l->tend.v, tnowE.v);
|
||||
|
||||
/* If the proxy participant is relying on another participant for
|
||||
writing its discovery data (on the privileged participant,
|
||||
|
@ -267,7 +267,7 @@ int64_t check_and_handle_lease_expiration (UNUSED_ARG (struct thread_state1 *sel
|
|||
if ((proxypp = ephash_lookup_proxy_participant_guid (&g)) != NULL &&
|
||||
ephash_lookup_proxy_participant_guid (&proxypp->privileged_pp_guid) != NULL)
|
||||
{
|
||||
nn_log (LC_DISCOVERY, "but postponing because privileged pp %x:%x:%x:%x is still live\n",
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "but postponing because privileged pp %x:%x:%x:%x is still live\n",
|
||||
PGUID (proxypp->privileged_pp_guid));
|
||||
l->tsched = l->tend = add_duration_to_etime (tnowE, 200 * T_MILLISECOND);
|
||||
unlock_lease (l);
|
||||
|
@ -317,15 +317,15 @@ static void debug_print_rawdata (const char *msg, const void *data, size_t len)
|
|||
{
|
||||
const unsigned char *c = data;
|
||||
size_t i;
|
||||
TRACE (("%s<", msg));
|
||||
DDS_TRACE("%s<", msg);
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (32 < c[i] && c[i] <= 127)
|
||||
TRACE (("%s%c", (i > 0 && (i%4) == 0) ? " " : "", c[i]));
|
||||
DDS_TRACE("%s%c", (i > 0 && (i%4) == 0) ? " " : "", c[i]);
|
||||
else
|
||||
TRACE (("%s\\x%02x", (i > 0 && (i%4) == 0) ? " " : "", c[i]));
|
||||
DDS_TRACE("%s\\x%02x", (i > 0 && (i%4) == 0) ? " " : "", c[i]);
|
||||
}
|
||||
TRACE ((">"));
|
||||
DDS_TRACE(">");
|
||||
}
|
||||
|
||||
void handle_PMD (UNUSED_ARG (const struct receiver_state *rst), nn_wctime_t timestamp, unsigned statusinfo, const void *vdata, unsigned len)
|
||||
|
@ -334,10 +334,10 @@ void handle_PMD (UNUSED_ARG (const struct receiver_state *rst), nn_wctime_t time
|
|||
const int bswap = (data->identifier == CDR_LE) ^ PLATFORM_IS_LITTLE_ENDIAN;
|
||||
struct proxy_participant *pp;
|
||||
nn_guid_t ppguid;
|
||||
TRACE ((" PMD ST%x", statusinfo));
|
||||
DDS_TRACE(" PMD ST%x", statusinfo);
|
||||
if (data->identifier != CDR_LE && data->identifier != CDR_BE)
|
||||
{
|
||||
TRACE ((" PMD data->identifier %u !?\n", ntohs (data->identifier)));
|
||||
DDS_TRACE(" PMD data->identifier %u !?\n", ntohs (data->identifier));
|
||||
return;
|
||||
}
|
||||
switch (statusinfo & (NN_STATUSINFO_DISPOSE | NN_STATUSINFO_UNREGISTER))
|
||||
|
@ -351,7 +351,7 @@ void handle_PMD (UNUSED_ARG (const struct receiver_state *rst), nn_wctime_t time
|
|||
nn_guid_prefix_t p = nn_ntoh_guid_prefix (pmd->participantGuidPrefix);
|
||||
unsigned kind = ntohl (pmd->kind);
|
||||
unsigned length = bswap ? bswap4u (pmd->length) : pmd->length;
|
||||
TRACE ((" pp %x:%x:%x kind %u data %u", p.u[0], p.u[1], p.u[2], kind, length));
|
||||
DDS_TRACE(" pp %x:%x:%x kind %u data %u", p.u[0], p.u[1], p.u[2], kind, length);
|
||||
if (len - sizeof (struct CDRHeader) - offsetof (ParticipantMessageData_t, value) < length)
|
||||
debug_print_rawdata (" SHORT2", pmd->value, len - sizeof (struct CDRHeader) - offsetof (ParticipantMessageData_t, value));
|
||||
else
|
||||
|
@ -359,7 +359,7 @@ void handle_PMD (UNUSED_ARG (const struct receiver_state *rst), nn_wctime_t time
|
|||
ppguid.prefix = p;
|
||||
ppguid.entityid.u = NN_ENTITYID_PARTICIPANT;
|
||||
if ((pp = ephash_lookup_proxy_participant_guid (&ppguid)) == NULL)
|
||||
TRACE ((" PPunknown"));
|
||||
DDS_TRACE(" PPunknown");
|
||||
else
|
||||
{
|
||||
/* Renew lease if arrival of this message didn't already do so, also renew the lease
|
||||
|
@ -382,11 +382,11 @@ void handle_PMD (UNUSED_ARG (const struct receiver_state *rst), nn_wctime_t time
|
|||
ppguid.prefix = nn_ntoh_guid_prefix (*((nn_guid_prefix_t *) (data + 1)));
|
||||
ppguid.entityid.u = NN_ENTITYID_PARTICIPANT;
|
||||
if (delete_proxy_participant_by_guid (&ppguid, timestamp, 0) < 0)
|
||||
TRACE ((" unknown"));
|
||||
DDS_TRACE(" unknown");
|
||||
else
|
||||
TRACE ((" delete"));
|
||||
DDS_TRACE(" delete");
|
||||
}
|
||||
break;
|
||||
}
|
||||
TRACE (("\n"));
|
||||
DDS_TRACE("\n");
|
||||
}
|
||||
|
|
|
@ -1,185 +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 <stdio.h>
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "os/os.h"
|
||||
|
||||
#include "ddsi/q_config.h"
|
||||
#include "ddsi/q_globals.h"
|
||||
#include "ddsi/q_thread.h"
|
||||
#include "ddsi/q_time.h"
|
||||
#include "ddsi/q_log.h"
|
||||
|
||||
#define MAX_TIMESTAMP_LENGTH (10 + 1 + 6)
|
||||
#define MAX_TID_LENGTH 10
|
||||
#define MAX_HDR_LENGTH (MAX_TIMESTAMP_LENGTH + 1 + MAX_TID_LENGTH + + 2)
|
||||
|
||||
#define BUF_OFFSET MAX_HDR_LENGTH
|
||||
|
||||
static void logbuf_flush_real (struct thread_state1 *self, logbuf_t lb)
|
||||
{
|
||||
if (config.tracingOutputFile != NULL)
|
||||
{
|
||||
const char *tname = self ? self->name : "(anon)";
|
||||
char hdr[MAX_HDR_LENGTH + 1];
|
||||
int n, tsec, tusec;
|
||||
if (lb->tstamp.v < 0)
|
||||
lb->tstamp = now ();
|
||||
wctime_to_sec_usec (&tsec, &tusec, lb->tstamp);
|
||||
lb->tstamp.v = -1;
|
||||
n = snprintf (hdr, sizeof (hdr), "%d.%06d/%*.*s: ", tsec, tusec, MAX_TID_LENGTH, MAX_TID_LENGTH, tname);
|
||||
assert (0 < n && n <= BUF_OFFSET);
|
||||
memcpy (lb->buf + BUF_OFFSET - n, hdr, (size_t) n);
|
||||
fwrite (lb->buf + BUF_OFFSET - n, 1, lb->pos - BUF_OFFSET + (size_t) n, config.tracingOutputFile);
|
||||
fflush (config.tracingOutputFile);
|
||||
}
|
||||
lb->pos = BUF_OFFSET;
|
||||
lb->buf[lb->pos] = 0;
|
||||
}
|
||||
|
||||
static void logbuf_flush (struct thread_state1 *self, logbuf_t lb)
|
||||
{
|
||||
if (lb->pos > BUF_OFFSET)
|
||||
{
|
||||
if (lb->pos < (int) sizeof (lb->buf))
|
||||
lb->buf[lb->pos++] = '\n';
|
||||
else
|
||||
lb->buf[sizeof (lb->buf) - 1] = '\n';
|
||||
logbuf_flush_real (self, lb);
|
||||
}
|
||||
}
|
||||
|
||||
void logbuf_init (logbuf_t lb)
|
||||
{
|
||||
lb->bufsz = sizeof (lb->buf);
|
||||
lb->pos = BUF_OFFSET;
|
||||
lb->tstamp.v = -1;
|
||||
lb->buf[lb->pos] = 0;
|
||||
}
|
||||
|
||||
logbuf_t logbuf_new (void)
|
||||
{
|
||||
logbuf_t lb = os_malloc (sizeof (*lb));
|
||||
logbuf_init (lb);
|
||||
return lb;
|
||||
}
|
||||
|
||||
void logbuf_free (logbuf_t lb)
|
||||
{
|
||||
logbuf_flush (lookup_thread_state (), lb);
|
||||
os_free (lb);
|
||||
}
|
||||
|
||||
/* LOGGING ROUTINES */
|
||||
|
||||
static void nn_vlogb (struct thread_state1 *self, const char *fmt, va_list ap)
|
||||
{
|
||||
int n, trunc = 0;
|
||||
size_t nrem;
|
||||
logbuf_t lb;
|
||||
if (*fmt == 0)
|
||||
return;
|
||||
if (self->lb)
|
||||
lb = self->lb;
|
||||
else
|
||||
{
|
||||
lb = &gv.static_logbuf;
|
||||
if (gv.static_logbuf_lock_inited)
|
||||
{
|
||||
/* not supposed to be multi-threaded when mutex not
|
||||
initialized */
|
||||
os_mutexLock (&gv.static_logbuf_lock);
|
||||
}
|
||||
}
|
||||
|
||||
nrem = lb->bufsz - lb->pos;
|
||||
if (nrem > 0)
|
||||
{
|
||||
n = os_vsnprintf (lb->buf + lb->pos, nrem, fmt, ap);
|
||||
if (n >= 0 && (size_t) n < nrem)
|
||||
lb->pos += (size_t) n;
|
||||
else
|
||||
{
|
||||
lb->pos += nrem;
|
||||
trunc = 1;
|
||||
}
|
||||
if (trunc)
|
||||
{
|
||||
static const char msg[] = "(trunc)\n";
|
||||
const size_t msglen = sizeof (msg) - 1;
|
||||
assert (lb->pos <= lb->bufsz);
|
||||
assert (lb->pos >= msglen);
|
||||
memcpy (lb->buf + lb->pos - msglen, msg, msglen);
|
||||
}
|
||||
}
|
||||
if (fmt[strlen (fmt) - 1] == '\n')
|
||||
{
|
||||
logbuf_flush_real (self, lb);
|
||||
}
|
||||
|
||||
if (lb == &gv.static_logbuf && gv.static_logbuf_lock_inited)
|
||||
{
|
||||
os_mutexUnlock (&gv.static_logbuf_lock);
|
||||
}
|
||||
}
|
||||
|
||||
int nn_vlog (logcat_t cat, const char *fmt, va_list ap)
|
||||
{
|
||||
if (config.enabled_logcats & cat)
|
||||
{
|
||||
struct thread_state1 *self = lookup_thread_state ();
|
||||
nn_vlogb (self, fmt, ap);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nn_log (_In_ logcat_t cat, _In_z_ _Printf_format_string_ const char *fmt, ...)
|
||||
{
|
||||
if (config.enabled_logcats & cat)
|
||||
{
|
||||
struct thread_state1 *self = lookup_thread_state ();
|
||||
va_list ap;
|
||||
va_start (ap, fmt);
|
||||
nn_vlogb (self, fmt, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
if (cat == LC_FATAL)
|
||||
{
|
||||
abort ();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nn_trace (_In_z_ _Printf_format_string_ const char *fmt, ...)
|
||||
{
|
||||
if (config.enabled_logcats & LC_TRACE)
|
||||
{
|
||||
struct thread_state1 *self = lookup_thread_state ();
|
||||
va_list ap;
|
||||
va_start (ap, fmt);
|
||||
nn_vlogb (self, fmt, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void nn_log_set_tstamp (nn_wctime_t tnow)
|
||||
{
|
||||
struct thread_state1 *self = lookup_thread_state ();
|
||||
if (self && self->lb)
|
||||
self->lb->tstamp = tnow;
|
||||
}
|
|
@ -36,7 +36,7 @@
|
|||
static void print_sockerror (const char *msg)
|
||||
{
|
||||
int err = os_getErrno ();
|
||||
NN_ERROR ("SOCKET %s errno %d\n", msg, err);
|
||||
DDS_ERROR("SOCKET %s errno %d\n", msg, err);
|
||||
}
|
||||
|
||||
unsigned locator_to_hopefully_unique_uint32 (const nn_locator_t *src)
|
||||
|
@ -141,15 +141,15 @@ static int set_rcvbuf (os_socket socket)
|
|||
}
|
||||
if (ReceiveBufferSize < socket_min_rcvbuf_size)
|
||||
{
|
||||
/* NN_ERROR does more than just nn_log(LC_ERROR), hence the duplication */
|
||||
/* NN_ERROR does more than just DDS_ERROR(), hence the duplication */
|
||||
if (config.socket_min_rcvbuf_size.isdefault)
|
||||
nn_log (LC_CONFIG, "failed to increase socket receive buffer size to %u bytes, continuing with %u bytes\n", socket_min_rcvbuf_size, ReceiveBufferSize);
|
||||
DDS_LOG(DDS_LC_CONFIG, "failed to increase socket receive buffer size to %u bytes, continuing with %u bytes\n", socket_min_rcvbuf_size, ReceiveBufferSize);
|
||||
else
|
||||
NN_ERROR ("failed to increase socket receive buffer size to %u bytes, continuing with %u bytes\n", socket_min_rcvbuf_size, ReceiveBufferSize);
|
||||
DDS_ERROR("failed to increase socket receive buffer size to %u bytes, continuing with %u bytes\n", socket_min_rcvbuf_size, ReceiveBufferSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
nn_log (LC_CONFIG, "socket receive buffer size set to %u bytes\n", ReceiveBufferSize);
|
||||
DDS_LOG(DDS_LC_CONFIG, "socket receive buffer size set to %u bytes\n", ReceiveBufferSize);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -463,13 +463,13 @@ int find_own_ip (const char *requested_address)
|
|||
int selected_idx = -1;
|
||||
char addrbuf[DDSI_LOCSTRLEN];
|
||||
|
||||
nn_log (LC_CONFIG, "interfaces:");
|
||||
DDS_LOG(DDS_LC_CONFIG, "interfaces:");
|
||||
|
||||
{
|
||||
int ret;
|
||||
ret = ddsi_enumerate_interfaces(gv.m_factory, &ifa_root);
|
||||
if (ret < 0) {
|
||||
NN_ERROR("ddsi_enumerate_interfaces(%s): %d\n", gv.m_factory->m_typename, ret);
|
||||
DDS_ERROR("ddsi_enumerate_interfaces(%s): %d\n", gv.m_factory->m_typename, ret);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -485,15 +485,15 @@ int find_own_ip (const char *requested_address)
|
|||
if_name[sizeof (if_name) - 1] = 0;
|
||||
|
||||
if (strcmp (if_name, last_if_name))
|
||||
nn_log (LC_CONFIG, "%s%s", sep, if_name);
|
||||
DDS_LOG(DDS_LC_CONFIG, "%s%s", sep, if_name);
|
||||
strcpy (last_if_name, if_name);
|
||||
|
||||
/* interface must be up */
|
||||
if ((ifa->flags & IFF_UP) == 0) {
|
||||
nn_log (LC_CONFIG, " (interface down)");
|
||||
DDS_LOG(DDS_LC_CONFIG, " (interface down)");
|
||||
continue;
|
||||
} else if (os_sockaddr_is_unspecified(ifa->addr)) {
|
||||
nn_log (LC_CONFIG, " (address unspecified)");
|
||||
DDS_LOG(DDS_LC_CONFIG, " (address unspecified)");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -513,11 +513,11 @@ int find_own_ip (const char *requested_address)
|
|||
ddsi_ipaddr_to_loc(&gv.interfaces[gv.n_interfaces].loc, ifa->addr, gv.m_factory->m_kind);
|
||||
}
|
||||
ddsi_locator_to_string_no_port(addrbuf, sizeof(addrbuf), &gv.interfaces[gv.n_interfaces].loc);
|
||||
nn_log (LC_CONFIG, " %s(", addrbuf);
|
||||
DDS_LOG(DDS_LC_CONFIG, " %s(", addrbuf);
|
||||
|
||||
if (!(ifa->flags & IFF_MULTICAST) && multicast_override (if_name))
|
||||
{
|
||||
nn_log (LC_CONFIG, "assume-mc:");
|
||||
DDS_LOG(DDS_LC_CONFIG, "assume-mc:");
|
||||
ifa->flags |= IFF_MULTICAST;
|
||||
}
|
||||
|
||||
|
@ -560,7 +560,7 @@ int find_own_ip (const char *requested_address)
|
|||
q += 2;
|
||||
}
|
||||
|
||||
nn_log (LC_CONFIG, "q%d)", q);
|
||||
DDS_LOG(DDS_LC_CONFIG, "q%d)", q);
|
||||
if (q == quality) {
|
||||
maxq_list[maxq_count] = gv.n_interfaces;
|
||||
maxq_strlen += 2 + strlen (if_name);
|
||||
|
@ -590,7 +590,7 @@ int find_own_ip (const char *requested_address)
|
|||
gv.interfaces[gv.n_interfaces].name = os_strdup (if_name);
|
||||
gv.n_interfaces++;
|
||||
}
|
||||
nn_log (LC_CONFIG, "\n");
|
||||
DDS_LOG(DDS_LC_CONFIG, "\n");
|
||||
os_freeifaddrs (ifa_root);
|
||||
|
||||
if (requested_address == NULL)
|
||||
|
@ -605,7 +605,7 @@ int find_own_ip (const char *requested_address)
|
|||
p = 0;
|
||||
for (i = 0; i < maxq_count && (size_t) p < maxq_strlen; i++)
|
||||
p += snprintf (names + p, maxq_strlen - (size_t) p, ", %s", gv.interfaces[maxq_list[i]].name);
|
||||
NN_WARNING ("using network interface %s (%s) selected arbitrarily from: %s\n",
|
||||
DDS_WARNING("using network interface %s (%s) selected arbitrarily from: %s\n",
|
||||
gv.interfaces[idx].name, addrbuf, names + 2);
|
||||
os_free (names);
|
||||
}
|
||||
|
@ -613,7 +613,7 @@ int find_own_ip (const char *requested_address)
|
|||
if (maxq_count > 0)
|
||||
selected_idx = maxq_list[0];
|
||||
else
|
||||
NN_ERROR ("failed to determine default own IP address\n");
|
||||
DDS_ERROR("failed to determine default own IP address\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -660,7 +660,7 @@ int find_own_ip (const char *requested_address)
|
|||
if (i < gv.n_interfaces)
|
||||
selected_idx = i;
|
||||
else
|
||||
NN_ERROR ("%s: does not match an available interface\n", config.networkAddressString);
|
||||
DDS_ERROR("%s: does not match an available interface\n", config.networkAddressString);
|
||||
}
|
||||
|
||||
if (selected_idx < 0)
|
||||
|
@ -682,7 +682,7 @@ int find_own_ip (const char *requested_address)
|
|||
gv.ipv6_link_local = 0;
|
||||
}
|
||||
#endif
|
||||
nn_log (LC_CONFIG, "selected interface: %s (index %u)\n",
|
||||
DDS_LOG(DDS_LC_CONFIG, "selected interface: %s (index %u)\n",
|
||||
gv.interfaces[selected_idx].name, gv.interfaceNo);
|
||||
|
||||
return 1;
|
||||
|
|
|
@ -86,7 +86,7 @@ FILE *new_pcap_file (const char *name)
|
|||
|
||||
if ((fp = fopen (name, "wb")) == NULL)
|
||||
{
|
||||
NN_WARNING ("packet capture disabled: file %s could not be opened for writing\n", name);
|
||||
DDS_WARNING ("packet capture disabled: file %s could not be opened for writing\n", name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -42,20 +42,6 @@
|
|||
|
||||
#include "ddsi/sysdeps.h"
|
||||
|
||||
/* Avoiding all nn_log-related activities when LC_RADMIN is not set
|
||||
(and it hardly ever is, as it is not even included in "trace")
|
||||
saves a couple of % CPU on a high-rate subscriber - that's worth
|
||||
it. So we need a macro & a support function. */
|
||||
static int trace_radmin (const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, fmt);
|
||||
nn_vlog (LC_RADMIN, fmt, ap);
|
||||
va_end (ap);
|
||||
return 0;
|
||||
}
|
||||
#define TRACE_RADMIN(args) ((config.enabled_logcats & LC_RADMIN) ? (trace_radmin args) : 0)
|
||||
|
||||
/* OVERVIEW ------------------------------------------------------------
|
||||
|
||||
The receive path of DDSI2 has any number of receive threads that
|
||||
|
@ -439,7 +425,7 @@ static struct nn_rbuf *nn_rbuf_alloc_new (struct nn_rbufpool *rbufpool)
|
|||
rb->size = rbufpool->rbuf_size;
|
||||
rb->max_rmsg_size = rbufpool->max_rmsg_size;
|
||||
rb->freeptr = rb->u.raw;
|
||||
TRACE_RADMIN (("rbuf_alloc_new(%p) = %p\n", rbufpool, rb));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rbuf_alloc_new(%p) = %p\n", rbufpool, rb);
|
||||
return rb;
|
||||
}
|
||||
|
||||
|
@ -461,10 +447,10 @@ static struct nn_rbuf *nn_rbuf_new (struct nn_rbufpool *rbufpool)
|
|||
static void nn_rbuf_release (struct nn_rbuf *rbuf)
|
||||
{
|
||||
struct nn_rbufpool *rbp = rbuf->rbufpool;
|
||||
TRACE_RADMIN (("rbuf_release(%p) pool %p current %p\n", rbuf, rbp, rbp->current));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rbuf_release(%p) pool %p current %p\n", rbuf, rbp, rbp->current);
|
||||
if (os_atomic_dec32_ov (&rbuf->n_live_rmsg_chunks) == 1)
|
||||
{
|
||||
TRACE_RADMIN (("rbuf_release(%p) free\n", rbuf));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rbuf_release(%p) free\n", rbuf);
|
||||
os_free (rbuf);
|
||||
}
|
||||
}
|
||||
|
@ -491,7 +477,7 @@ static void *nn_rbuf_alloc (struct nn_rbufpool *rbufpool)
|
|||
/* Note: only one thread calls nn_rmsg_new on a pool */
|
||||
uint32_t asize = max_rmsg_size_w_hdr (rbufpool->max_rmsg_size);
|
||||
struct nn_rbuf *rb;
|
||||
TRACE_RADMIN (("rmsg_rbuf_alloc(%p, %u)\n", (void *) rbufpool, asize));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_rbuf_alloc(%p, %u)\n", (void *) rbufpool, asize);
|
||||
ASSERT_RBUFPOOL_OWNER (rbufpool);
|
||||
rb = rbufpool->current;
|
||||
assert (rb != NULL);
|
||||
|
@ -508,7 +494,7 @@ static void *nn_rbuf_alloc (struct nn_rbufpool *rbufpool)
|
|||
assert ((uint32_t) (rb->u.raw + rb->size - rb->freeptr) >= asize);
|
||||
}
|
||||
|
||||
TRACE_RADMIN (("rmsg_rbuf_alloc(%p, %u) = %p\n", (void *) rbufpool, asize, (void *) rb->freeptr));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_rbuf_alloc(%p, %u) = %p\n", (void *) rbufpool, asize, (void *) rb->freeptr);
|
||||
#if USE_VALGRIND
|
||||
VALGRIND_MEMPOOL_ALLOC (rbufpool, rb->freeptr, asize);
|
||||
#endif
|
||||
|
@ -527,7 +513,7 @@ struct nn_rmsg *nn_rmsg_new (struct nn_rbufpool *rbufpool)
|
|||
{
|
||||
/* Note: only one thread calls nn_rmsg_new on a pool */
|
||||
struct nn_rmsg *rmsg;
|
||||
TRACE_RADMIN (("rmsg_new(%p)\n", rbufpool));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_new(%p)\n", rbufpool);
|
||||
|
||||
rmsg = nn_rbuf_alloc (rbufpool);
|
||||
if (rmsg == NULL)
|
||||
|
@ -540,14 +526,14 @@ struct nn_rmsg *nn_rmsg_new (struct nn_rbufpool *rbufpool)
|
|||
rmsg->lastchunk = &rmsg->chunk;
|
||||
/* Incrementing freeptr happens in commit(), so that discarding the
|
||||
message is really simple. */
|
||||
TRACE_RADMIN (("rmsg_new(%p) = %p\n", rbufpool, rmsg));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_new(%p) = %p\n", rbufpool, rmsg);
|
||||
return rmsg;
|
||||
}
|
||||
|
||||
void nn_rmsg_setsize (struct nn_rmsg *rmsg, uint32_t size)
|
||||
{
|
||||
uint32_t size8 = align8uint32 (size);
|
||||
TRACE_RADMIN (("rmsg_setsize(%p, %u => %u)\n", rmsg, size, size8));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_setsize(%p, %u => %u)\n", rmsg, size, size8);
|
||||
ASSERT_RBUFPOOL_OWNER (rmsg->chunk.rbuf->rbufpool);
|
||||
ASSERT_RMSG_UNCOMMITTED (rmsg);
|
||||
assert (os_atomic_ld32 (&rmsg->refcount) == RMSG_REFCOUNT_UNCOMMITTED_BIAS);
|
||||
|
@ -570,7 +556,7 @@ void nn_rmsg_free (struct nn_rmsg *rmsg)
|
|||
free() which we don't do currently. And ideally, you'd use
|
||||
compare-and-swap for this. */
|
||||
struct nn_rmsg_chunk *c;
|
||||
TRACE_RADMIN (("rmsg_free(%p)\n", rmsg));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_free(%p)\n", rmsg);
|
||||
assert (os_atomic_ld32 (&rmsg->refcount) == 0);
|
||||
c = &rmsg->chunk;
|
||||
while (c)
|
||||
|
@ -593,7 +579,7 @@ void nn_rmsg_free (struct nn_rmsg *rmsg)
|
|||
static void commit_rmsg_chunk (struct nn_rmsg_chunk *chunk)
|
||||
{
|
||||
struct nn_rbuf *rbuf = chunk->rbuf;
|
||||
TRACE_RADMIN (("commit_rmsg_chunk(%p)\n", chunk));
|
||||
DDS_LOG(DDS_LC_RADMIN, "commit_rmsg_chunk(%p)\n", chunk);
|
||||
rbuf->freeptr = chunk->u.payload + chunk->size;
|
||||
}
|
||||
|
||||
|
@ -608,8 +594,8 @@ void nn_rmsg_commit (struct nn_rmsg *rmsg)
|
|||
happens to be such that any asynchronous activities have
|
||||
completed before we got to commit. */
|
||||
struct nn_rmsg_chunk *chunk = rmsg->lastchunk;
|
||||
TRACE_RADMIN (("rmsg_commit(%p) refcount 0x%x last-chunk-size %u\n",
|
||||
rmsg, rmsg->refcount, chunk->size));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_commit(%p) refcount 0x%x last-chunk-size %u\n",
|
||||
rmsg, rmsg->refcount.v, chunk->size);
|
||||
ASSERT_RBUFPOOL_OWNER (chunk->rbuf->rbufpool);
|
||||
ASSERT_RMSG_UNCOMMITTED (rmsg);
|
||||
assert (chunk->size <= chunk->rbuf->max_rmsg_size);
|
||||
|
@ -624,7 +610,7 @@ void nn_rmsg_commit (struct nn_rmsg *rmsg)
|
|||
{
|
||||
/* Other references exist, so either stored in defrag, reorder
|
||||
and/or delivery queue */
|
||||
TRACE_RADMIN (("rmsg_commit(%p) => keep\n", rmsg));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_commit(%p) => keep\n", rmsg);
|
||||
commit_rmsg_chunk (chunk);
|
||||
}
|
||||
}
|
||||
|
@ -637,7 +623,7 @@ static void nn_rmsg_addbias (struct nn_rmsg *rmsg)
|
|||
|
||||
However, other threads (e.g., delivery threads) may have been
|
||||
triggered already, so the increment must be done atomically. */
|
||||
TRACE_RADMIN (("rmsg_addbias(%p)\n", rmsg));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_addbias(%p)\n", rmsg);
|
||||
ASSERT_RBUFPOOL_OWNER (rmsg->chunk.rbuf->rbufpool);
|
||||
ASSERT_RMSG_UNCOMMITTED (rmsg);
|
||||
os_atomic_add32 (&rmsg->refcount, RMSG_REFCOUNT_RDATA_BIAS);
|
||||
|
@ -649,7 +635,7 @@ static void nn_rmsg_rmbias_and_adjust (struct nn_rmsg *rmsg, int adjust)
|
|||
progressing through the pipeline, but only by the receive
|
||||
thread. Can't require it to be uncommitted. */
|
||||
uint32_t sub;
|
||||
TRACE_RADMIN (("rmsg_rmbias_and_adjust(%p, %d)\n", rmsg, adjust));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_rmbias_and_adjust(%p, %d)\n", rmsg, adjust);
|
||||
ASSERT_RBUFPOOL_OWNER (rmsg->chunk.rbuf->rbufpool);
|
||||
assert (adjust >= 0);
|
||||
assert ((uint32_t) adjust < RMSG_REFCOUNT_RDATA_BIAS);
|
||||
|
@ -663,14 +649,14 @@ static void nn_rmsg_rmbias_anythread (struct nn_rmsg *rmsg)
|
|||
{
|
||||
/* For removing garbage when freeing a nn_defrag. */
|
||||
uint32_t sub = RMSG_REFCOUNT_RDATA_BIAS;
|
||||
TRACE_RADMIN (("rmsg_rmbias_anythread(%p)\n", rmsg));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_rmbias_anythread(%p)\n", rmsg);
|
||||
assert (os_atomic_ld32 (&rmsg->refcount) >= sub);
|
||||
if (os_atomic_sub32_nv (&rmsg->refcount, sub) == 0)
|
||||
nn_rmsg_free (rmsg);
|
||||
}
|
||||
static void nn_rmsg_unref (struct nn_rmsg *rmsg)
|
||||
{
|
||||
TRACE_RADMIN (("rmsg_unref(%p)\n", rmsg));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_unref(%p)\n", rmsg);
|
||||
assert (os_atomic_ld32 (&rmsg->refcount) > 0);
|
||||
if (os_atomic_dec32_ov (&rmsg->refcount) == 1)
|
||||
nn_rmsg_free (rmsg);
|
||||
|
@ -682,7 +668,7 @@ void *nn_rmsg_alloc (struct nn_rmsg *rmsg, uint32_t size)
|
|||
struct nn_rbuf *rbuf = chunk->rbuf;
|
||||
uint32_t size8 = align8uint32 (size);
|
||||
void *ptr;
|
||||
TRACE_RADMIN (("rmsg_alloc(%p, %u => %u)\n", rmsg, size, size8));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_alloc(%p, %u => %u)\n", rmsg, size, size8);
|
||||
ASSERT_RBUFPOOL_OWNER (rbuf->rbufpool);
|
||||
ASSERT_RMSG_UNCOMMITTED (rmsg);
|
||||
assert ((chunk->size % 8) == 0);
|
||||
|
@ -692,12 +678,12 @@ void *nn_rmsg_alloc (struct nn_rmsg *rmsg, uint32_t size)
|
|||
{
|
||||
struct nn_rbufpool *rbufpool = rbuf->rbufpool;
|
||||
struct nn_rmsg_chunk *newchunk;
|
||||
TRACE_RADMIN (("rmsg_alloc(%p, %u) limit hit - new chunk\n", rmsg, size));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_alloc(%p, %u) limit hit - new chunk\n", rmsg, size);
|
||||
commit_rmsg_chunk (chunk);
|
||||
newchunk = nn_rbuf_alloc (rbufpool);
|
||||
if (newchunk == NULL)
|
||||
{
|
||||
NN_WARNING ("nn_rmsg_alloc: can't allocate more memory (%u bytes) ... giving up\n", size);
|
||||
DDS_WARNING ("nn_rmsg_alloc: can't allocate more memory (%u bytes) ... giving up\n", size);
|
||||
return NULL;
|
||||
}
|
||||
init_rmsg_chunk (newchunk, rbufpool->current);
|
||||
|
@ -707,7 +693,7 @@ void *nn_rmsg_alloc (struct nn_rmsg *rmsg, uint32_t size)
|
|||
|
||||
ptr = chunk->u.payload + chunk->size;
|
||||
chunk->size += size8;
|
||||
TRACE_RADMIN (("rmsg_alloc(%p, %u) = %p\n", rmsg, size, ptr));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rmsg_alloc(%p, %u) = %p\n", rmsg, size, ptr);
|
||||
#if USE_VALGRIND
|
||||
if (chunk == &rmsg->chunk) {
|
||||
VALGRIND_MEMPOOL_CHANGE (rbuf->rbufpool, rmsg, rmsg, offsetof (struct nn_rmsg, chunk.u.payload) + chunk->size);
|
||||
|
@ -734,13 +720,13 @@ struct nn_rdata *nn_rdata_new (struct nn_rmsg *rmsg, uint32_t start, uint32_t en
|
|||
#ifndef NDEBUG
|
||||
os_atomic_st32 (&d->refcount_bias_added, 0);
|
||||
#endif
|
||||
TRACE_RADMIN (("rdata_new(%p, bytes [%u,%u), submsg @ %u, payload @ %u) = %p\n", rmsg, start, endp1, NN_RDATA_SUBMSG_OFF (d), NN_RDATA_PAYLOAD_OFF (d), d));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rdata_new(%p, bytes [%u,%u), submsg @ %u, payload @ %u) = %p\n", rmsg, start, endp1, NN_RDATA_SUBMSG_OFF (d), NN_RDATA_PAYLOAD_OFF (d), d);
|
||||
return d;
|
||||
}
|
||||
|
||||
static void nn_rdata_addbias (struct nn_rdata *rdata)
|
||||
{
|
||||
TRACE_RADMIN (("rdata_addbias(%p)\n", rdata));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rdata_addbias(%p)\n", rdata);
|
||||
#ifndef NDEBUG
|
||||
ASSERT_RBUFPOOL_OWNER (rdata->rmsg->chunk.rbuf->rbufpool);
|
||||
if (os_atomic_inc32_nv (&rdata->refcount_bias_added) != 1)
|
||||
|
@ -751,7 +737,7 @@ static void nn_rdata_addbias (struct nn_rdata *rdata)
|
|||
|
||||
static void nn_rdata_rmbias_and_adjust (struct nn_rdata *rdata, int adjust)
|
||||
{
|
||||
TRACE_RADMIN (("rdata_rmbias_and_adjust(%p, %d)\n", rdata, adjust));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rdata_rmbias_and_adjust(%p, %d)\n", rdata, adjust);
|
||||
#ifndef NDEBUG
|
||||
if (os_atomic_dec32_ov (&rdata->refcount_bias_added) != 1)
|
||||
abort ();
|
||||
|
@ -761,7 +747,7 @@ static void nn_rdata_rmbias_and_adjust (struct nn_rdata *rdata, int adjust)
|
|||
|
||||
static void nn_rdata_rmbias_anythread (struct nn_rdata *rdata)
|
||||
{
|
||||
TRACE_RADMIN (("rdata_rmbias_anytrhead(%p, %d)\n", rdata));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rdata_rmbias_anythread(%p)\n", rdata);
|
||||
#ifndef NDEBUG
|
||||
if (os_atomic_dec32_ov (&rdata->refcount_bias_added) != 1)
|
||||
abort ();
|
||||
|
@ -771,7 +757,7 @@ static void nn_rdata_rmbias_anythread (struct nn_rdata *rdata)
|
|||
|
||||
static void nn_rdata_unref (struct nn_rdata *rdata)
|
||||
{
|
||||
TRACE_RADMIN (("rdata_rdata_unref(%p)\n", rdata));
|
||||
DDS_LOG(DDS_LC_RADMIN, "rdata_rdata_unref(%p)\n", rdata);
|
||||
nn_rmsg_unref (rdata->rmsg);
|
||||
}
|
||||
|
||||
|
@ -908,7 +894,7 @@ struct nn_defrag *nn_defrag_new (enum nn_defrag_drop_mode drop_mode, uint32_t ma
|
|||
void nn_fragchain_adjust_refcount (struct nn_rdata *frag, int adjust)
|
||||
{
|
||||
struct nn_rdata *frag1;
|
||||
TRACE_RADMIN (("fragchain_adjust_refcount(%p, %d)\n", frag, adjust));
|
||||
DDS_LOG(DDS_LC_RADMIN, "fragchain_adjust_refcount(%p, %d)\n", frag, adjust);
|
||||
while (frag)
|
||||
{
|
||||
frag1 = frag->nextfrag;
|
||||
|
@ -920,7 +906,7 @@ void nn_fragchain_adjust_refcount (struct nn_rdata *frag, int adjust)
|
|||
static void nn_fragchain_rmbias_anythread (struct nn_rdata *frag, UNUSED_ARG (int adjust))
|
||||
{
|
||||
struct nn_rdata *frag1;
|
||||
TRACE_RADMIN (("fragchain_rmbias_anythread(%p)\n", frag));
|
||||
DDS_LOG(DDS_LC_RADMIN, "fragchain_rmbias_anythread(%p)\n", frag);
|
||||
while (frag)
|
||||
{
|
||||
frag1 = frag->nextfrag;
|
||||
|
@ -940,7 +926,7 @@ static void defrag_rsample_drop (struct nn_defrag *defrag, struct nn_rsample *rs
|
|||
inorder treewalk does provide. */
|
||||
ut_avlIter_t iter;
|
||||
struct nn_defrag_iv *iv;
|
||||
TRACE_RADMIN ((" defrag_rsample_drop (%p, %p)\n", (void *) defrag, (void *) rsample));
|
||||
DDS_LOG(DDS_LC_RADMIN, " defrag_rsample_drop (%p, %p)\n", (void *) defrag, (void *) rsample);
|
||||
ut_avlDelete (&defrag_sampletree_treedef, &defrag->sampletree, rsample);
|
||||
assert (defrag->n_samples > 0);
|
||||
defrag->n_samples--;
|
||||
|
@ -954,7 +940,7 @@ void nn_defrag_free (struct nn_defrag *defrag)
|
|||
s = ut_avlFindMin (&defrag_sampletree_treedef, &defrag->sampletree);
|
||||
while (s)
|
||||
{
|
||||
TRACE_RADMIN (("defrag_free(%p, sample %p seq %lld)\n", defrag, s, s->u.defrag.seq));
|
||||
DDS_LOG(DDS_LC_RADMIN, "defrag_free(%p, sample %p seq %"PRId64")\n", defrag, s, s->u.defrag.seq);
|
||||
defrag_rsample_drop (defrag, s, nn_fragchain_rmbias_anythread);
|
||||
s = ut_avlFindMin (&defrag_sampletree_treedef, &defrag->sampletree);
|
||||
}
|
||||
|
@ -966,21 +952,21 @@ static int defrag_try_merge_with_succ (struct nn_rsample_defrag *sample, struct
|
|||
{
|
||||
struct nn_defrag_iv *succ;
|
||||
|
||||
TRACE_RADMIN ((" defrag_try_merge_with_succ(%p [%u..%u)):\n",
|
||||
(void *) node, node->min, node->maxp1));
|
||||
DDS_LOG(DDS_LC_RADMIN, " defrag_try_merge_with_succ(%p [%u..%u)):\n",
|
||||
(void *) node, node->min, node->maxp1);
|
||||
if (node == sample->lastfrag)
|
||||
{
|
||||
/* there is no interval following node */
|
||||
TRACE_RADMIN ((" node is lastfrag\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " node is lastfrag\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
succ = ut_avlFindSucc (&rsample_defrag_fragtree_treedef, &sample->fragtree, node);
|
||||
assert (succ != NULL);
|
||||
TRACE_RADMIN ((" succ is %p [%u..%u)\n", (void *) succ, succ->min, succ->maxp1));
|
||||
DDS_LOG(DDS_LC_RADMIN, " succ is %p [%u..%u)\n", (void *) succ, succ->min, succ->maxp1);
|
||||
if (succ->min > node->maxp1)
|
||||
{
|
||||
TRACE_RADMIN ((" gap between node and succ\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " gap between node and succ\n");
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
|
@ -993,7 +979,7 @@ static int defrag_try_merge_with_succ (struct nn_rsample_defrag *sample, struct
|
|||
ut_avlDelete (&rsample_defrag_fragtree_treedef, &sample->fragtree, succ);
|
||||
if (sample->lastfrag == succ)
|
||||
{
|
||||
TRACE_RADMIN ((" succ is lastfrag\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " succ is lastfrag\n");
|
||||
sample->lastfrag = node;
|
||||
}
|
||||
|
||||
|
@ -1008,9 +994,9 @@ static int defrag_try_merge_with_succ (struct nn_rsample_defrag *sample, struct
|
|||
references to rmsgs of the rdata in succ, freeing it may cause
|
||||
the rsample to be freed as well. */
|
||||
if (node->maxp1 < succ_maxp1)
|
||||
TRACE_RADMIN ((" succ adds data to node\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " succ adds data to node\n");
|
||||
else
|
||||
TRACE_RADMIN ((" succ is contained in node\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " succ is contained in node\n");
|
||||
|
||||
node->last->nextfrag = succ->first;
|
||||
node->last = succ->last;
|
||||
|
@ -1181,9 +1167,9 @@ static struct nn_rsample *defrag_add_fragment (struct nn_rsample *sample, struct
|
|||
/* relatively expensive test: lastfrag, tree must be consistent */
|
||||
assert (dfsample->lastfrag == ut_avlFindMax (&rsample_defrag_fragtree_treedef, &dfsample->fragtree));
|
||||
|
||||
TRACE_RADMIN ((" lastfrag %p [%u..%u)\n",
|
||||
DDS_LOG(DDS_LC_RADMIN, " lastfrag %p [%u..%u)\n",
|
||||
(void *) dfsample->lastfrag,
|
||||
dfsample->lastfrag->min, dfsample->lastfrag->maxp1));
|
||||
dfsample->lastfrag->min, dfsample->lastfrag->maxp1);
|
||||
|
||||
/* Interval tree is sorted on min offset; each key is unique:
|
||||
otherwise one would be wholly contained in another. */
|
||||
|
@ -1191,15 +1177,15 @@ static struct nn_rsample *defrag_add_fragment (struct nn_rsample *sample, struct
|
|||
{
|
||||
/* Assumed normal case: fragment appends data */
|
||||
predeq = dfsample->lastfrag;
|
||||
TRACE_RADMIN ((" fast path: predeq = lastfrag\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " fast path: predeq = lastfrag\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Slow path: find preceding fragment by tree search */
|
||||
predeq = ut_avlLookupPredEq (&rsample_defrag_fragtree_treedef, &dfsample->fragtree, &min);
|
||||
assert (predeq);
|
||||
TRACE_RADMIN ((" slow path: predeq = lookup %u => %p [%u..%u)\n",
|
||||
min, (void *) predeq, predeq->min, predeq->maxp1));
|
||||
DDS_LOG(DDS_LC_RADMIN, " slow path: predeq = lookup %u => %p [%u..%u)\n",
|
||||
min, (void *) predeq, predeq->min, predeq->maxp1);
|
||||
}
|
||||
|
||||
/* we have a sentinel interval of [0,0) until we receive a packet
|
||||
|
@ -1211,7 +1197,7 @@ static struct nn_rsample *defrag_add_fragment (struct nn_rsample *sample, struct
|
|||
{
|
||||
/* new is contained in predeq, discard new; rdata did not cause
|
||||
completion of a sample */
|
||||
TRACE_RADMIN ((" new contained in predeq\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " new contained in predeq\n");
|
||||
return NULL;
|
||||
}
|
||||
else if (min <= predeq->maxp1)
|
||||
|
@ -1219,7 +1205,7 @@ static struct nn_rsample *defrag_add_fragment (struct nn_rsample *sample, struct
|
|||
/* new extends predeq, add it to the chain (necessarily at the
|
||||
end); this may close the gap to the successor of predeq; predeq
|
||||
need not have a fragment chain yet (it may be the sentinel) */
|
||||
TRACE_RADMIN ((" grow predeq with new\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " grow predeq with new\n");
|
||||
nn_rdata_addbias (rdata);
|
||||
rdata->nextfrag = NULL;
|
||||
if (predeq->first)
|
||||
|
@ -1247,8 +1233,8 @@ static struct nn_rsample *defrag_add_fragment (struct nn_rsample *sample, struct
|
|||
fragment in the chain adds value); but doesn't overlap with
|
||||
predeq so the tree structure doesn't change even though the key
|
||||
does change */
|
||||
TRACE_RADMIN ((" extending succ %p [%u..%u) at head\n",
|
||||
(void *) succ, succ->min, succ->maxp1));
|
||||
DDS_LOG(DDS_LC_RADMIN, " extending succ %p [%u..%u) at head\n",
|
||||
(void *) succ, succ->min, succ->maxp1);
|
||||
nn_rdata_addbias (rdata);
|
||||
rdata->nextfrag = succ->first;
|
||||
succ->first = rdata;
|
||||
|
@ -1258,7 +1244,7 @@ static struct nn_rsample *defrag_add_fragment (struct nn_rsample *sample, struct
|
|||
succ-succ */
|
||||
if (maxp1 > succ->maxp1)
|
||||
{
|
||||
TRACE_RADMIN ((" extending succ at end as well\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " extending succ at end as well\n");
|
||||
succ->maxp1 = maxp1;
|
||||
while (defrag_try_merge_with_succ (dfsample, succ))
|
||||
;
|
||||
|
@ -1271,7 +1257,7 @@ static struct nn_rsample *defrag_add_fragment (struct nn_rsample *sample, struct
|
|||
/* doesn't extend either predeq at the end or succ at the head =>
|
||||
new interval; rdata did not cause completion of sample */
|
||||
ut_avlIPath_t path;
|
||||
TRACE_RADMIN ((" new interval\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " new interval\n");
|
||||
if (ut_avlLookupIPath (&rsample_defrag_fragtree_treedef, &dfsample->fragtree, &min, &path))
|
||||
assert (0);
|
||||
defrag_rsample_addiv (dfsample, rdata, &path);
|
||||
|
@ -1294,25 +1280,25 @@ static int defrag_limit_samples (struct nn_defrag *defrag, seqno_t seq, seqno_t
|
|||
return 1;
|
||||
/* max_samples >= 1 => some sample present => max_sample != NULL */
|
||||
assert (defrag->max_sample != NULL);
|
||||
TRACE_RADMIN ((" max samples reached\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " max samples reached\n");
|
||||
switch (defrag->drop_mode)
|
||||
{
|
||||
case NN_DEFRAG_DROP_LATEST:
|
||||
TRACE_RADMIN ((" drop mode = DROP_LATEST\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " drop mode = DROP_LATEST\n");
|
||||
if (seq > defrag->max_sample->u.defrag.seq)
|
||||
{
|
||||
TRACE_RADMIN ((" new sample is new latest => discarding it\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " new sample is new latest => discarding it\n");
|
||||
return 0;
|
||||
}
|
||||
sample_to_drop = defrag->max_sample;
|
||||
break;
|
||||
case NN_DEFRAG_DROP_OLDEST:
|
||||
TRACE_RADMIN ((" drop mode = DROP_OLDEST\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " drop mode = DROP_OLDEST\n");
|
||||
sample_to_drop = ut_avlFindMin (&defrag_sampletree_treedef, &defrag->sampletree);
|
||||
assert (sample_to_drop);
|
||||
if (seq < sample_to_drop->u.defrag.seq)
|
||||
{
|
||||
TRACE_RADMIN ((" new sample is new oldest => discarding it\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " new sample is new oldest => discarding it\n");
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
@ -1323,9 +1309,9 @@ static int defrag_limit_samples (struct nn_defrag *defrag, seqno_t seq, seqno_t
|
|||
{
|
||||
defrag->max_sample = ut_avlFindMax (&defrag_sampletree_treedef, &defrag->sampletree);
|
||||
*max_seq = defrag->max_sample ? defrag->max_sample->u.defrag.seq : 0;
|
||||
TRACE_RADMIN ((" updating max_sample: now %p %lld\n",
|
||||
DDS_LOG(DDS_LC_RADMIN, " updating max_sample: now %p %"PRId64"\n",
|
||||
(void *) defrag->max_sample,
|
||||
defrag->max_sample ? defrag->max_sample->u.defrag.seq : 0));
|
||||
defrag->max_sample ? defrag->max_sample->u.defrag.seq : 0);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -1370,20 +1356,20 @@ struct nn_rsample *nn_defrag_rsample (struct nn_defrag *defrag, struct nn_rdata
|
|||
consistent. Max_sample must be consistent with tree */
|
||||
assert (defrag->max_sample == ut_avlFindMax (&defrag_sampletree_treedef, &defrag->sampletree));
|
||||
max_seq = defrag->max_sample ? defrag->max_sample->u.defrag.seq : 0;
|
||||
TRACE_RADMIN (("defrag_rsample(%p, %p [%u..%u) msg %p, %p seq %lld size %u) max_seq %p %lld:\n",
|
||||
(void *) defrag, (void *) rdata, rdata->min, rdata->maxp1, rdata->rmsg,
|
||||
(void *) sampleinfo, sampleinfo->seq, sampleinfo->size,
|
||||
(void *) defrag->max_sample, max_seq));
|
||||
DDS_LOG(DDS_LC_RADMIN, "defrag_rsample(%p, %p [%u..%u) msg %p, %p seq %"PRId64" size %u) max_seq %p %"PRId64":\n",
|
||||
(void *) defrag, (void *) rdata, rdata->min, rdata->maxp1, rdata->rmsg,
|
||||
(void *) sampleinfo, sampleinfo->seq, sampleinfo->size,
|
||||
(void *) defrag->max_sample, max_seq);
|
||||
/* fast path: rdata is part of message with the highest sequence
|
||||
number we're currently defragmenting, or is beyond that */
|
||||
if (sampleinfo->seq == max_seq)
|
||||
{
|
||||
TRACE_RADMIN ((" add fragment to max_sample\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " add fragment to max_sample\n");
|
||||
result = defrag_add_fragment (defrag->max_sample, rdata, sampleinfo);
|
||||
}
|
||||
else if (!defrag_limit_samples (defrag, sampleinfo->seq, &max_seq))
|
||||
{
|
||||
TRACE_RADMIN ((" discarding sample\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " discarding sample\n");
|
||||
result = NULL;
|
||||
}
|
||||
else if (sampleinfo->seq > max_seq)
|
||||
|
@ -1391,7 +1377,7 @@ struct nn_rsample *nn_defrag_rsample (struct nn_defrag *defrag, struct nn_rdata
|
|||
/* a node with a key greater than the maximum always is the right
|
||||
child of the old maximum node */
|
||||
/* FIXME: MERGE THIS ONE WITH THE NEXT */
|
||||
TRACE_RADMIN ((" new max sample\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " new max sample\n");
|
||||
ut_avlLookupIPath (&defrag_sampletree_treedef, &defrag->sampletree, &sampleinfo->seq, &path);
|
||||
if ((sample = defrag_rsample_new (rdata, sampleinfo)) == NULL)
|
||||
return NULL;
|
||||
|
@ -1403,7 +1389,7 @@ struct nn_rsample *nn_defrag_rsample (struct nn_defrag *defrag, struct nn_rdata
|
|||
else if ((sample = ut_avlLookupIPath (&defrag_sampletree_treedef, &defrag->sampletree, &sampleinfo->seq, &path)) == NULL)
|
||||
{
|
||||
/* a new sequence number, but smaller than the maximum */
|
||||
TRACE_RADMIN ((" new sample less than max\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " new sample less than max\n");
|
||||
assert (sampleinfo->seq < max_seq);
|
||||
if ((sample = defrag_rsample_new (rdata, sampleinfo)) == NULL)
|
||||
return NULL;
|
||||
|
@ -1414,7 +1400,7 @@ struct nn_rsample *nn_defrag_rsample (struct nn_defrag *defrag, struct nn_rdata
|
|||
else
|
||||
{
|
||||
/* adds (or, as the case may be, doesn't add) to a known message */
|
||||
TRACE_RADMIN ((" add fragment to %p\n", (void *) sample));
|
||||
DDS_LOG(DDS_LC_RADMIN, " add fragment to %p\n", (void *) sample);
|
||||
result = defrag_add_fragment (sample, rdata, sampleinfo);
|
||||
}
|
||||
|
||||
|
@ -1423,16 +1409,16 @@ struct nn_rsample *nn_defrag_rsample (struct nn_defrag *defrag, struct nn_rdata
|
|||
/* Once completed, remove from defrag sample tree and convert to
|
||||
reorder format. If it is the sample with the maximum sequence in
|
||||
the tree, an update of max_sample is required. */
|
||||
TRACE_RADMIN ((" complete\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " complete\n");
|
||||
ut_avlDelete (&defrag_sampletree_treedef, &defrag->sampletree, result);
|
||||
assert (defrag->n_samples > 0);
|
||||
defrag->n_samples--;
|
||||
if (result == defrag->max_sample)
|
||||
{
|
||||
defrag->max_sample = ut_avlFindMax (&defrag_sampletree_treedef, &defrag->sampletree);
|
||||
TRACE_RADMIN ((" updating max_sample: now %p %lld\n",
|
||||
(void *) defrag->max_sample,
|
||||
defrag->max_sample ? defrag->max_sample->u.defrag.seq : 0));
|
||||
DDS_LOG(DDS_LC_RADMIN, " updating max_sample: now %p %"PRId64"\n",
|
||||
(void *) defrag->max_sample,
|
||||
defrag->max_sample ? defrag->max_sample->u.defrag.seq : 0);
|
||||
}
|
||||
rsample_convert_defrag_to_reorder (result);
|
||||
}
|
||||
|
@ -1729,28 +1715,28 @@ static int reorder_try_append_and_discard (struct nn_reorder *reorder, struct nn
|
|||
{
|
||||
if (todiscard == NULL)
|
||||
{
|
||||
TRACE_RADMIN ((" try_append_and_discard: fail: todiscard = NULL\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " try_append_and_discard: fail: todiscard = NULL\n");
|
||||
return 0;
|
||||
}
|
||||
else if (appendto->u.reorder.maxp1 < todiscard->u.reorder.min)
|
||||
{
|
||||
TRACE_RADMIN ((" try_append_and_discard: fail: appendto = [%lld,%lld) @ %p, "
|
||||
"todiscard = [%lld,%lld) @ %p - gap\n",
|
||||
appendto->u.reorder.min, appendto->u.reorder.maxp1, (void *) appendto,
|
||||
todiscard->u.reorder.min, todiscard->u.reorder.maxp1, (void *) todiscard));
|
||||
DDS_LOG(DDS_LC_RADMIN, " try_append_and_discard: fail: appendto = [%"PRId64",%"PRId64") @ %p, "
|
||||
"todiscard = [%"PRId64",%"PRId64") @ %p - gap\n",
|
||||
appendto->u.reorder.min, appendto->u.reorder.maxp1, (void *) appendto,
|
||||
todiscard->u.reorder.min, todiscard->u.reorder.maxp1, (void *) todiscard);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE_RADMIN ((" try_append_and_discard: success: appendto = [%lld,%lld) @ %p, "
|
||||
"todiscard = [%lld,%lld) @ %p\n",
|
||||
appendto->u.reorder.min, appendto->u.reorder.maxp1, (void *) appendto,
|
||||
todiscard->u.reorder.min, todiscard->u.reorder.maxp1, (void *) todiscard));
|
||||
DDS_LOG(DDS_LC_RADMIN, " try_append_and_discard: success: appendto = [%"PRId64",%"PRId64") @ %p, "
|
||||
"todiscard = [%"PRId64",%"PRId64") @ %p\n",
|
||||
appendto->u.reorder.min, appendto->u.reorder.maxp1, (void *) appendto,
|
||||
todiscard->u.reorder.min, todiscard->u.reorder.maxp1, (void *) todiscard);
|
||||
assert (todiscard->u.reorder.min == appendto->u.reorder.maxp1);
|
||||
ut_avlDelete (&reorder_sampleivtree_treedef, &reorder->sampleivtree, todiscard);
|
||||
append_rsample_interval (appendto, todiscard);
|
||||
TRACE_RADMIN ((" try_append_and_discard: max_sampleiv needs update? %s\n",
|
||||
(todiscard == reorder->max_sampleiv) ? "yes" : "no"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " try_append_and_discard: max_sampleiv needs update? %s\n",
|
||||
(todiscard == reorder->max_sampleiv) ? "yes" : "no");
|
||||
/* Inform caller whether reorder->max must be updated -- the
|
||||
expected thing to do is to update it to appendto here, but that
|
||||
fails if appendto isn't actually in the tree. And that happens
|
||||
|
@ -1825,7 +1811,7 @@ static void delete_last_sample (struct nn_reorder *reorder)
|
|||
{
|
||||
/* Last sample is in an interval of its own - delete it, and
|
||||
recalc max_sampleiv. */
|
||||
TRACE_RADMIN ((" delete_last_sample: in singleton interval\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " delete_last_sample: in singleton interval\n");
|
||||
fragchain = last->sc.first->fragchain;
|
||||
ut_avlDelete (&reorder_sampleivtree_treedef, &reorder->sampleivtree, reorder->max_sampleiv);
|
||||
reorder->max_sampleiv = ut_avlFindMax (&reorder_sampleivtree_treedef, &reorder->sampleivtree);
|
||||
|
@ -1841,8 +1827,8 @@ static void delete_last_sample (struct nn_reorder *reorder)
|
|||
large!). Can't be a singleton list, so might as well chop off
|
||||
one evaluation of the loop condition. */
|
||||
struct nn_rsample_chain_elem *e, *pe;
|
||||
TRACE_RADMIN ((" delete_last_sample: scanning last interval [%llu..%llu)\n",
|
||||
last->min, last->maxp1));
|
||||
DDS_LOG(DDS_LC_RADMIN, " delete_last_sample: scanning last interval [%"PRId64"..%"PRId64")\n",
|
||||
last->min, last->maxp1);
|
||||
assert (last->n_samples >= 1);
|
||||
assert (last->min + last->n_samples <= last->maxp1);
|
||||
e = last->sc.first;
|
||||
|
@ -1872,7 +1858,7 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
refcount_adjust is incremented if the sample is not discarded. */
|
||||
struct nn_rsample_reorder *s = &rsampleiv->u.reorder;
|
||||
|
||||
TRACE_RADMIN (("reorder_sample(%p %c, %lld @ %p) expecting %lld:\n", (void *) reorder, reorder_mode_as_char (reorder), rsampleiv->u.reorder.min, (void *) rsampleiv, reorder->next_seq));
|
||||
DDS_LOG(DDS_LC_RADMIN, "reorder_sample(%p %c, %"PRId64" @ %p) expecting %"PRId64":\n", (void *) reorder, reorder_mode_as_char (reorder), rsampleiv->u.reorder.min, (void *) rsampleiv, reorder->next_seq);
|
||||
|
||||
/* Incoming rsample must be a singleton */
|
||||
assert (rsample_is_singleton (s));
|
||||
|
@ -1883,7 +1869,7 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
{
|
||||
struct nn_rsample *min = ut_avlFindMin (&reorder_sampleivtree_treedef, &reorder->sampleivtree);
|
||||
if (min)
|
||||
TRACE_RADMIN ((" min = %lld @ %p\n", min->u.reorder.min, (void *) min));
|
||||
DDS_LOG(DDS_LC_RADMIN, " min = %"PRId64" @ %p\n", min->u.reorder.min, (void *) min);
|
||||
assert (min == NULL || reorder->next_seq < min->u.reorder.min);
|
||||
assert ((reorder->max_sampleiv == NULL && min == NULL) ||
|
||||
(reorder->max_sampleiv != NULL && min != NULL));
|
||||
|
@ -1893,7 +1879,7 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
assert (reorder->max_sampleiv == NULL || reorder->max_sampleiv == ut_avlFindMax (&reorder_sampleivtree_treedef, &reorder->sampleivtree));
|
||||
assert (reorder->n_samples <= reorder->max_samples);
|
||||
if (reorder->max_sampleiv)
|
||||
TRACE_RADMIN ((" max = [%lld,%lld) @ %p\n", reorder->max_sampleiv->u.reorder.min, reorder->max_sampleiv->u.reorder.maxp1, (void *) reorder->max_sampleiv));
|
||||
DDS_LOG(DDS_LC_RADMIN, " max = [%"PRId64",%"PRId64") @ %p\n", reorder->max_sampleiv->u.reorder.min, reorder->max_sampleiv->u.reorder.maxp1, (void *) reorder->max_sampleiv);
|
||||
|
||||
if (s->min == reorder->next_seq ||
|
||||
(s->min > reorder->next_seq && reorder->mode == NN_REORDER_MODE_MONOTONICALLY_INCREASING) ||
|
||||
|
@ -1907,7 +1893,7 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
admin, or things go wrong very quickly.) */
|
||||
if (delivery_queue_full_p)
|
||||
{
|
||||
TRACE_RADMIN ((" discarding deliverable sample: delivery queue is full\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " discarding deliverable sample: delivery queue is full\n");
|
||||
return NN_REORDER_REJECT;
|
||||
}
|
||||
|
||||
|
@ -1918,14 +1904,14 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
if (reorder->max_sampleiv != NULL)
|
||||
{
|
||||
struct nn_rsample *min = ut_avlFindMin (&reorder_sampleivtree_treedef, &reorder->sampleivtree);
|
||||
TRACE_RADMIN ((" try append_and_discard\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " try append_and_discard\n");
|
||||
if (reorder_try_append_and_discard (reorder, rsampleiv, min))
|
||||
reorder->max_sampleiv = NULL;
|
||||
}
|
||||
reorder->next_seq = s->maxp1;
|
||||
*sc = rsampleiv->u.reorder.sc;
|
||||
(*refcount_adjust)++;
|
||||
TRACE_RADMIN ((" return [%lld,%lld)\n", s->min, s->maxp1));
|
||||
DDS_LOG(DDS_LC_RADMIN, " return [%"PRId64",%"PRId64")\n", s->min, s->maxp1);
|
||||
|
||||
/* Adjust reorder->n_samples, new sample is not counted yet */
|
||||
assert (s->maxp1 - s->min >= 1);
|
||||
|
@ -1939,7 +1925,7 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
{
|
||||
/* we've moved beyond this one: discard it; no need to adjust
|
||||
n_samples */
|
||||
TRACE_RADMIN ((" discard: too old\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " discard: too old\n");
|
||||
return NN_REORDER_TOO_OLD; /* don't want refcount increment */
|
||||
}
|
||||
else if (ut_avlIsEmpty (&reorder->sampleivtree))
|
||||
|
@ -1948,10 +1934,10 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
is technically allowed, and potentially useful, so check for
|
||||
it */
|
||||
assert (reorder->n_samples == 0);
|
||||
TRACE_RADMIN ((" adding to empty store\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " adding to empty store\n");
|
||||
if (reorder->max_samples == 0)
|
||||
{
|
||||
TRACE_RADMIN ((" NOT - max_samples hit\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " NOT - max_samples hit\n");
|
||||
return NN_REORDER_REJECT;
|
||||
}
|
||||
else
|
||||
|
@ -1968,12 +1954,12 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
if (delivery_queue_full_p)
|
||||
{
|
||||
/* growing last inteval will not be accepted when this flag is set */
|
||||
TRACE_RADMIN ((" discarding sample: only accepting delayed samples due to backlog in delivery queue\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " discarding sample: only accepting delayed samples due to backlog in delivery queue\n");
|
||||
return NN_REORDER_REJECT;
|
||||
}
|
||||
|
||||
/* grow the last interval, if we're still accepting samples */
|
||||
TRACE_RADMIN ((" growing last interval\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " growing last interval\n");
|
||||
if (reorder->n_samples < reorder->max_samples)
|
||||
{
|
||||
append_rsample_interval (reorder->max_sampleiv, rsampleiv);
|
||||
|
@ -1981,7 +1967,7 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
}
|
||||
else
|
||||
{
|
||||
TRACE_RADMIN ((" discarding sample: max_samples reached and sample at end\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " discarding sample: max_samples reached and sample at end\n");
|
||||
return NN_REORDER_REJECT;
|
||||
}
|
||||
}
|
||||
|
@ -1990,19 +1976,19 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
if (delivery_queue_full_p)
|
||||
{
|
||||
/* new interval at the end will not be accepted when this flag is set */
|
||||
TRACE_RADMIN ((" discarding sample: only accepting delayed samples due to backlog in delivery queue\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " discarding sample: only accepting delayed samples due to backlog in delivery queue\n");
|
||||
return NN_REORDER_REJECT;
|
||||
}
|
||||
if (reorder->n_samples < reorder->max_samples)
|
||||
{
|
||||
TRACE_RADMIN ((" new interval at end\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " new interval at end\n");
|
||||
reorder_add_rsampleiv (reorder, rsampleiv);
|
||||
reorder->max_sampleiv = rsampleiv;
|
||||
reorder->n_samples++;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE_RADMIN ((" discarding sample: max_samples reached and sample at end\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " discarding sample: max_samples reached and sample at end\n");
|
||||
return NN_REORDER_REJECT;
|
||||
}
|
||||
}
|
||||
|
@ -2016,37 +2002,37 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
- if immsucc exists we can prepend s to immsucc
|
||||
- and possibly join predeq, s, and immsucc */
|
||||
struct nn_rsample *predeq, *immsucc;
|
||||
TRACE_RADMIN ((" hard case ...\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " hard case ...\n");
|
||||
|
||||
if (config.late_ack_mode && delivery_queue_full_p)
|
||||
{
|
||||
TRACE_RADMIN ((" discarding sample: delivery queue full\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " discarding sample: delivery queue full\n");
|
||||
return NN_REORDER_REJECT;
|
||||
}
|
||||
|
||||
predeq = ut_avlLookupPredEq (&reorder_sampleivtree_treedef, &reorder->sampleivtree, &s->min);
|
||||
if (predeq)
|
||||
TRACE_RADMIN ((" predeq = [%lld,%lld) @ %p\n",
|
||||
predeq->u.reorder.min, predeq->u.reorder.maxp1, (void *) predeq));
|
||||
DDS_LOG(DDS_LC_RADMIN, " predeq = [%"PRId64",%"PRId64") @ %p\n",
|
||||
predeq->u.reorder.min, predeq->u.reorder.maxp1, (void *) predeq);
|
||||
else
|
||||
TRACE_RADMIN ((" predeq = null\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " predeq = null\n");
|
||||
if (predeq && s->min >= predeq->u.reorder.min && s->min < predeq->u.reorder.maxp1)
|
||||
{
|
||||
/* contained in predeq */
|
||||
TRACE_RADMIN ((" discard: contained in predeq\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " discard: contained in predeq\n");
|
||||
return NN_REORDER_REJECT;
|
||||
}
|
||||
|
||||
immsucc = ut_avlLookup (&reorder_sampleivtree_treedef, &reorder->sampleivtree, &s->maxp1);
|
||||
if (immsucc)
|
||||
TRACE_RADMIN ((" immsucc = [%lld,%lld) @ %p\n",
|
||||
immsucc->u.reorder.min, immsucc->u.reorder.maxp1, (void *) immsucc));
|
||||
DDS_LOG(DDS_LC_RADMIN, " immsucc = [%"PRId64",%"PRId64") @ %p\n",
|
||||
immsucc->u.reorder.min, immsucc->u.reorder.maxp1, (void *) immsucc);
|
||||
else
|
||||
TRACE_RADMIN ((" immsucc = null\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " immsucc = null\n");
|
||||
if (predeq && s->min == predeq->u.reorder.maxp1)
|
||||
{
|
||||
/* grow predeq at end, and maybe append immsucc as well */
|
||||
TRACE_RADMIN ((" growing predeq at end ...\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " growing predeq at end ...\n");
|
||||
append_rsample_interval (predeq, rsampleiv);
|
||||
if (reorder_try_append_and_discard (reorder, predeq, immsucc))
|
||||
reorder->max_sampleiv = predeq;
|
||||
|
@ -2056,7 +2042,7 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
/* no predecessor, grow immsucc at head, which _does_ alter the
|
||||
key of the node in the tree, but _doesn't_ change the tree's
|
||||
structure. */
|
||||
TRACE_RADMIN ((" growing immsucc at head\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " growing immsucc at head\n");
|
||||
s->sc.last->next = immsucc->u.reorder.sc.first;
|
||||
immsucc->u.reorder.sc.first = s->sc.first;
|
||||
immsucc->u.reorder.min = s->min;
|
||||
|
@ -2082,7 +2068,7 @@ nn_reorder_result_t nn_reorder_rsample (struct nn_rsample_chain *sc, struct nn_r
|
|||
else
|
||||
{
|
||||
/* neither extends predeq nor immsucc */
|
||||
TRACE_RADMIN ((" new interval\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " new interval\n");
|
||||
reorder_add_rsampleiv (reorder, rsampleiv);
|
||||
}
|
||||
|
||||
|
@ -2209,18 +2195,18 @@ nn_reorder_result_t nn_reorder_gap (struct nn_rsample_chain *sc, struct nn_reord
|
|||
struct nn_rsample *coalesced;
|
||||
int valuable;
|
||||
|
||||
TRACE_RADMIN (("reorder_gap(%p %c, [%lld,%lld) data %p) expecting %lld:\n",
|
||||
DDS_LOG(DDS_LC_RADMIN, "reorder_gap(%p %c, [%"PRId64",%"PRId64") data %p) expecting %"PRId64":\n",
|
||||
(void *) reorder, reorder_mode_as_char (reorder),
|
||||
min, maxp1, (void *) rdata, reorder->next_seq));
|
||||
min, maxp1, (void *) rdata, reorder->next_seq);
|
||||
|
||||
if (maxp1 <= reorder->next_seq)
|
||||
{
|
||||
TRACE_RADMIN ((" too old\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " too old\n");
|
||||
return NN_REORDER_TOO_OLD;
|
||||
}
|
||||
if (reorder->mode != NN_REORDER_MODE_NORMAL)
|
||||
{
|
||||
TRACE_RADMIN ((" special mode => don't care\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " special mode => don't care\n");
|
||||
return NN_REORDER_REJECT;
|
||||
}
|
||||
|
||||
|
@ -2228,10 +2214,10 @@ nn_reorder_result_t nn_reorder_gap (struct nn_rsample_chain *sc, struct nn_reord
|
|||
if ((coalesced = coalesce_intervals_touching_range (reorder, min, maxp1, &valuable)) == NULL)
|
||||
{
|
||||
nn_reorder_result_t res;
|
||||
TRACE_RADMIN ((" coalesced = null\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " coalesced = null\n");
|
||||
if (min <= reorder->next_seq)
|
||||
{
|
||||
TRACE_RADMIN ((" next expected: %lld\n", maxp1));
|
||||
DDS_LOG(DDS_LC_RADMIN, " next expected: %"PRId64"\n", maxp1);
|
||||
reorder->next_seq = maxp1;
|
||||
res = NN_REORDER_ACCEPT;
|
||||
}
|
||||
|
@ -2239,17 +2225,17 @@ nn_reorder_result_t nn_reorder_gap (struct nn_rsample_chain *sc, struct nn_reord
|
|||
(reorder->max_sampleiv == NULL || min > reorder->max_sampleiv->u.reorder.maxp1))
|
||||
{
|
||||
/* n_samples = max_samples => (max_sampleiv = NULL <=> max_samples = 0) */
|
||||
TRACE_RADMIN ((" discarding gap: max_samples reached and gap at end\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " discarding gap: max_samples reached and gap at end\n");
|
||||
res = NN_REORDER_REJECT;
|
||||
}
|
||||
else if (!reorder_insert_gap (reorder, rdata, min, maxp1))
|
||||
{
|
||||
TRACE_RADMIN ((" store gap failed: no memory\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " store gap failed: no memory\n");
|
||||
res = NN_REORDER_REJECT;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE_RADMIN ((" storing gap\n"));
|
||||
DDS_LOG(DDS_LC_RADMIN, " storing gap\n");
|
||||
res = NN_REORDER_ACCEPT;
|
||||
/* do not let radmin grow beyond max_samples; there is a small
|
||||
possibility that we insert it & delete it immediately
|
||||
|
@ -2265,15 +2251,15 @@ nn_reorder_result_t nn_reorder_gap (struct nn_rsample_chain *sc, struct nn_reord
|
|||
}
|
||||
else if (coalesced->u.reorder.min <= reorder->next_seq)
|
||||
{
|
||||
TRACE_RADMIN ((" coalesced = [%lld,%lld) @ %p containing %d samples\n",
|
||||
coalesced->u.reorder.min, coalesced->u.reorder.maxp1,
|
||||
(void *) coalesced, coalesced->u.reorder.n_samples));
|
||||
DDS_LOG(DDS_LC_RADMIN, " coalesced = [%"PRId64",%"PRId64") @ %p containing %d samples\n",
|
||||
coalesced->u.reorder.min, coalesced->u.reorder.maxp1,
|
||||
(void *) coalesced, coalesced->u.reorder.n_samples);
|
||||
ut_avlDelete (&reorder_sampleivtree_treedef, &reorder->sampleivtree, coalesced);
|
||||
if (coalesced->u.reorder.min <= reorder->next_seq)
|
||||
assert (min <= reorder->next_seq);
|
||||
reorder->next_seq = coalesced->u.reorder.maxp1;
|
||||
reorder->max_sampleiv = ut_avlFindMax (&reorder_sampleivtree_treedef, &reorder->sampleivtree);
|
||||
TRACE_RADMIN ((" next expected: %lld\n", reorder->next_seq));
|
||||
DDS_LOG(DDS_LC_RADMIN, " next expected: %"PRId64"\n", reorder->next_seq);
|
||||
*sc = coalesced->u.reorder.sc;
|
||||
|
||||
/* Adjust n_samples */
|
||||
|
@ -2284,8 +2270,8 @@ nn_reorder_result_t nn_reorder_gap (struct nn_rsample_chain *sc, struct nn_reord
|
|||
}
|
||||
else
|
||||
{
|
||||
TRACE_RADMIN ((" coalesced = [%lld,%lld) @ %p - that is all\n",
|
||||
coalesced->u.reorder.min, coalesced->u.reorder.maxp1, (void *) coalesced));
|
||||
DDS_LOG(DDS_LC_RADMIN, " coalesced = [%"PRId64",%"PRId64") @ %p - that is all\n",
|
||||
coalesced->u.reorder.min, coalesced->u.reorder.maxp1, (void *) coalesced);
|
||||
reorder->max_sampleiv = ut_avlFindMax (&reorder_sampleivtree_treedef, &reorder->sampleivtree);
|
||||
return valuable ? NN_REORDER_ACCEPT : NN_REORDER_REJECT;
|
||||
}
|
||||
|
@ -2325,13 +2311,13 @@ unsigned nn_reorder_nackmap (struct nn_reorder *reorder, seqno_t base, seqno_t m
|
|||
#else
|
||||
if (base > reorder->next_seq)
|
||||
{
|
||||
NN_ERROR ("nn_reorder_nackmap: incorrect base sequence number supplied (%"PRId64" > %"PRId64")\n", base, reorder->next_seq);
|
||||
DDS_ERROR("nn_reorder_nackmap: incorrect base sequence number supplied (%"PRId64" > %"PRId64")\n", base, reorder->next_seq);
|
||||
base = reorder->next_seq;
|
||||
}
|
||||
#endif
|
||||
if (maxseq + 1 < base)
|
||||
{
|
||||
NN_ERROR ("nn_reorder_nackmap: incorrect max sequence number supplied (maxseq %"PRId64" base %"PRId64")\n", maxseq, base);
|
||||
DDS_ERROR("nn_reorder_nackmap: incorrect max sequence number supplied (maxseq %"PRId64" base %"PRId64")\n", maxseq, base);
|
||||
maxseq = base - 1;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -79,7 +79,7 @@
|
|||
|
||||
#define Q_REPORT_OPENSSL_ERR(x) \
|
||||
while ( ERR_peek_error() ) \
|
||||
NN_ERROR(x "%s", ERR_error_string(ERR_get_error(), NULL));
|
||||
DDS_ERROR(x "%s", ERR_error_string(ERR_get_error(), NULL));
|
||||
|
||||
|
||||
|
||||
|
@ -315,10 +315,10 @@ static void tdumpCounter(unsigned char* counter, int counterLength)
|
|||
if (counter) {
|
||||
for (i=0; i<counterLength; ++i) {
|
||||
unsigned int tmpChar = (unsigned int) counter[i]; /* dont know how to tell ::printf the argument is simple char*/
|
||||
TRACE(("%02x", tmpChar));
|
||||
DDS_TRACE("%02x", tmpChar);
|
||||
}
|
||||
} else {
|
||||
TRACE(( "NULL"));
|
||||
DDS_TRACE("NULL");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -334,24 +334,24 @@ static void tdumpPayload (unsigned char* buffer, int mesgLength, int bufferLengt
|
|||
int current = where;
|
||||
|
||||
/* line index */
|
||||
TRACE((" 0x%08x", i));
|
||||
DDS_TRACE(" 0x%08x", i);
|
||||
|
||||
/* 16 octets in hex format */
|
||||
for (j=0; current<bufferLength && j<perLine; ++j, ++current) {
|
||||
unsigned int tmpChar = buffer[current];
|
||||
if (current != mesgLength) {
|
||||
TRACE((" %02x", tmpChar));
|
||||
DDS_TRACE(" %02x", tmpChar);
|
||||
} else {
|
||||
/* with marker */
|
||||
TRACE(("#%02x", tmpChar));
|
||||
DDS_TRACE("#%02x", tmpChar);
|
||||
}
|
||||
}
|
||||
/* padding */
|
||||
while(j++<perLine) {
|
||||
TRACE((" "));
|
||||
DDS_TRACE(" ");
|
||||
}
|
||||
/* seperator */
|
||||
TRACE(( " "));
|
||||
DDS_TRACE(" ");
|
||||
|
||||
current = where;
|
||||
/* the same octets as before as plain text, if alpha-num,
|
||||
|
@ -366,7 +366,7 @@ static void tdumpPayload (unsigned char* buffer, int mesgLength, int bufferLengt
|
|||
}
|
||||
}
|
||||
|
||||
TRACE(("\n"));
|
||||
DDS_TRACE("\n");
|
||||
|
||||
where = current;
|
||||
}
|
||||
|
@ -389,10 +389,10 @@ static void tdumpBuffer
|
|||
(void) partitionName;
|
||||
(void) partitionId;
|
||||
|
||||
TRACE(("[%s] Buffer HexDump %u Counter: ", direction, (unsigned int) length));
|
||||
DDS_TRACE("[%s] Buffer HexDump %u Counter: ", direction, (unsigned int) length);
|
||||
|
||||
tdumpCounter(counter, counterLength);
|
||||
TRACE(("\n"));
|
||||
DDS_TRACE("\n");
|
||||
|
||||
tdumpPayload(buffer, length, bufferLength);
|
||||
}
|
||||
|
@ -573,7 +573,7 @@ static c_bool q_securityResolveCipherKeyFromUri
|
|||
|
||||
fclose(file);
|
||||
} else {
|
||||
NN_ERROR("q_securityResolveCipherKeyFromUri: Could not open %s",uriStr);
|
||||
DDS_ERROR("q_securityResolveCipherKeyFromUri: Could not open %s",uriStr);
|
||||
}
|
||||
|
||||
os_free(filename);
|
||||
|
@ -610,7 +610,7 @@ static c_bool q_securityCipherTypeFromString(const char* cipherName,
|
|||
{
|
||||
if (cipherName == NULL)
|
||||
{
|
||||
NN_ERROR("q_securityCipherTypeFromString:internal error, empty cipher string");
|
||||
DDS_ERROR("q_securityCipherTypeFromString:internal error, empty cipher string");
|
||||
*cipherType = Q_CIPHER_UNDEFINED;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -712,7 +712,7 @@ q_securityPartitionEncoderInit(q_securityPartitionEncoder encoder,struct config_
|
|||
|
||||
|
||||
if (!connected) {
|
||||
TRACE(("Network Partition '%s' (%d) not connected, dropping outbound traffic permanently", partitionName, partitionId));
|
||||
DDS_TRACE("Network Partition '%s' (%d) not connected, dropping outbound traffic permanently", partitionName, partitionId);
|
||||
|
||||
encoder->state = Q_CODEC_STATE_DROP_PERM;
|
||||
encoder->cipherType = Q_CIPHER_UNDEFINED;
|
||||
|
@ -804,7 +804,7 @@ q_securityPartitionEncoderInit(q_securityPartitionEncoder encoder,struct config_
|
|||
/* intitialize the key-buffer */
|
||||
if (cipherType != Q_CIPHER_NULL && cipherType != Q_CIPHER_NONE &&
|
||||
!q_securityResolveCipherKeyFromUri(cipherKeyURL,cipherKeyLength,cipherKey)) {
|
||||
NN_ERROR("DDSI Security Encoder: dropping traffic of partition '%s' (%d) due to invalid cipher key",
|
||||
DDS_ERROR("DDSI Security Encoder: dropping traffic of partition '%s' (%d) due to invalid cipher key",
|
||||
encoder->partitionName, partitionId);
|
||||
encoder->state = Q_CODEC_STATE_DROP_TEMP;
|
||||
}
|
||||
|
@ -855,7 +855,7 @@ q_securityPartitionDecoderInit(q_securityPartitionDecoder decoder,struct config_
|
|||
memset(cipherKey, 0, sizeof(cipherKey));
|
||||
|
||||
if (!connected) {
|
||||
TRACE(("Network Partition '%s' (%d) not connected, dropping inbound traffic permanently\n", partitionName, partitionId));
|
||||
DDS_TRACE("Network Partition '%s' (%d) not connected, dropping inbound traffic permanently\n", partitionName, partitionId);
|
||||
|
||||
decoder->state = Q_CODEC_STATE_DROP_PERM;
|
||||
decoder->cipherType = Q_CIPHER_UNDEFINED;
|
||||
|
@ -921,7 +921,7 @@ q_securityPartitionDecoderInit(q_securityPartitionDecoder decoder,struct config_
|
|||
/* init key-buffer from URL */
|
||||
if (cipherType != Q_CIPHER_NULL && cipherType != Q_CIPHER_NONE &&
|
||||
!q_securityResolveCipherKeyFromUri(cipherKeyURL,cipherKeyLength,cipherKey)) {
|
||||
NN_ERROR("DDSI Security Decoder: dropping traffic of partition '%s' (%d) due to invalid cipher key",
|
||||
DDS_ERROR("DDSI Security Decoder: dropping traffic of partition '%s' (%d) due to invalid cipher key",
|
||||
decoder->partitionName, partitionId);
|
||||
/* can be solved by re-keying, rewriting the file */
|
||||
decoder->state = Q_CODEC_STATE_DROP_TEMP;
|
||||
|
@ -1002,15 +1002,15 @@ static q_securityEncoderSet q_securityEncoderSetNew (void)
|
|||
/* the codec config is faulty, the codec has been set into
|
||||
* DROP_TERMP or DROP_PERM state, depending on the kind of
|
||||
* fault. Continue to intitialize remaining codecs */
|
||||
NN_ERROR("q_securityEncoderSet:failed to initialize codec of partition '%s' (%d)\n",
|
||||
DDS_ERROR("q_securityEncoderSet:failed to initialize codec of partition '%s' (%d)\n",
|
||||
p->name,p->partitionId );
|
||||
}
|
||||
|
||||
TRACE(("Network Partition '%s' (%d) encoder secured by %s cipher, in status '%s'\n",
|
||||
p->name,
|
||||
p->partitionId,
|
||||
cipherTypeAsString(currentEncoder->cipherType),
|
||||
stateAsString(currentEncoder->state)));
|
||||
DDS_TRACE("Network Partition '%s' (%d) encoder secured by %s cipher, in status '%s'\n",
|
||||
p->name,
|
||||
p->partitionId,
|
||||
cipherTypeAsString(currentEncoder->cipherType),
|
||||
stateAsString(currentEncoder->state));
|
||||
|
||||
headerSizeProfile = cipherTypeToHeaderSize(currentEncoder->cipherType);
|
||||
result->headerSizeMax = (headerSizeProfile > (result->headerSizeMax)) ? headerSizeProfile: (result->headerSizeMax);
|
||||
|
@ -1021,9 +1021,9 @@ static q_securityEncoderSet q_securityEncoderSetNew (void)
|
|||
currentEncoder->cipherType = Q_CIPHER_NONE;
|
||||
currentEncoder->partitionName = p->name;
|
||||
|
||||
TRACE(("Network Partition '%s' (%d) is not secured by a cipher\n",
|
||||
p->name,
|
||||
p->partitionId));
|
||||
DDS_TRACE("Network Partition '%s' (%d) is not secured by a cipher\n",
|
||||
p->name,
|
||||
p->partitionId);
|
||||
}
|
||||
/* count up step by step, so in case of error
|
||||
* q_securityEncoderSetFree will only iterate those already
|
||||
|
@ -1034,8 +1034,7 @@ static q_securityEncoderSet q_securityEncoderSetNew (void)
|
|||
}
|
||||
|
||||
|
||||
TRACE(("reserving %d bytes for security header\n", result->headerSizeMax));
|
||||
|
||||
DDS_TRACE("reserving %d bytes for security header\n", result->headerSizeMax);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -1084,24 +1083,24 @@ static q_securityDecoderSet q_securityDecoderSetNew (void)
|
|||
/* the codec config is faulty, the codec has been set into
|
||||
* DROP_TERMP or DROP_PERM state, depending on the kind of
|
||||
* fault. Continue to intitialize remaining codecs */
|
||||
NN_ERROR("q_securityDecoderSet:failed to initialize codec of partition '%s' (%d)\n",
|
||||
DDS_ERROR("q_securityDecoderSet:failed to initialize codec of partition '%s' (%d)\n",
|
||||
p->name,p->partitionId);
|
||||
}
|
||||
|
||||
TRACE(("Network Partition '%s' (%d) decoder secured by %s cipher, in status '%s'\n",
|
||||
DDS_TRACE("Network Partition '%s' (%d) decoder secured by %s cipher, in status '%s'\n",
|
||||
p->name,
|
||||
p->partitionId,
|
||||
cipherTypeAsString(currentDecoder->cipherType),
|
||||
stateAsString(currentDecoder->state)));
|
||||
stateAsString(currentDecoder->state));
|
||||
} else {
|
||||
memset(currentDecoder, 0, sizeof(*currentDecoder));
|
||||
currentDecoder->state = Q_CODEC_STATE_DROP_PERM;
|
||||
currentDecoder->cipherType = Q_CIPHER_NONE;
|
||||
currentDecoder->partitionName = p->name;
|
||||
|
||||
TRACE(("Network Partition '%s' (%d) is not secured by a cipher\n",
|
||||
DDS_TRACE("Network Partition '%s' (%d) is not secured by a cipher\n",
|
||||
p->name,
|
||||
p->partitionId));
|
||||
p->partitionId);
|
||||
}
|
||||
/* count up step by step, so in case of error
|
||||
* q_securityEncoderSetFree will only iterate those already
|
||||
|
@ -1202,7 +1201,7 @@ static c_bool counterEncryptOrDecryptInPlace
|
|||
/* encrypt the current counter */
|
||||
if (!EVP_EncryptUpdate(ctx, keyStream, &num, counter, bl)) { /* ECB encrypts exactly 'bl' bytes */
|
||||
|
||||
NN_WARNING("Incoming encrypted sub-message dropped: Decrypt failed (bufferLength %u, blockSize %u, where %u)",length, bl, where);
|
||||
DDS_WARNING("Incoming encrypted sub-message dropped: Decrypt failed (bufferLength %u, blockSize %u, where %u)\n",length, bl, where);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1446,7 +1445,7 @@ static c_bool q_securityDecodeInPlace_Generic
|
|||
result = verifySha1(cipherText, *dataLength, sha1HeaderStart);
|
||||
TRACE((":BLF:%s", result?"OK":"ERROR")); /* debug */
|
||||
if (!result) {
|
||||
NN_WARNING("Incoming encrypted sub-message dropped: Decrypt (blowfish) verification failed for partition '%s' - possible Key-mismatch", decoder->partitionName);
|
||||
DDS_WARNING("Incoming encrypted sub-message dropped: Decrypt (blowfish) verification failed for partition '%s' - possible Key-mismatch\n", decoder->partitionName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1479,9 +1478,9 @@ static c_bool q_securityDecodeInPlace_Generic
|
|||
if ( result){
|
||||
/* will zero out the sha1Header values in buffer */
|
||||
result = verifySha1(cipherText, *dataLength, sha1HeaderStart);
|
||||
TRACE((":AES:%s", result?"OK":"ERROR")); /* debug */
|
||||
DDS_TRACE(":AES:%s", result?"OK":"ERROR"); /* debug */
|
||||
if (!result) {
|
||||
NN_WARNING("Incoming encrypted sub-message dropped: Decrypt (AES) verification failed for partition '%s' - possible Key-mismatch", decoder->partitionName);
|
||||
DDS_WARNING("Incoming encrypted sub-message dropped: Decrypt (AES) verification failed for partition '%s' - possible Key-mismatch", decoder->partitionName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1492,7 +1491,7 @@ static c_bool q_securityDecodeInPlace_Generic
|
|||
assert(0 && "do not reach");
|
||||
}
|
||||
|
||||
TRACE((":(%d->%d)", *dataLength, *dataLength - overallHeaderSize));
|
||||
DDS_TRACE(":(%d->%d)", *dataLength, *dataLength - overallHeaderSize);
|
||||
|
||||
*dataLength -= overallHeaderSize; /* out */
|
||||
|
||||
|
@ -1527,7 +1526,7 @@ static c_bool q_securityEncodeInPlace
|
|||
if (partitionId == 0 || partitionId > codec->nofPartitions) {
|
||||
/* if partitionId is larger than number of partitions, network service
|
||||
* seems to be in undefined state */
|
||||
NN_ERROR("q_securityEncodeInPlace:Sending message blocked, bad partitionid '%d'",
|
||||
DDS_ERROR("q_securityEncodeInPlace:Sending message blocked, bad partitionid '%d'\n",
|
||||
partitionId);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1536,20 +1535,20 @@ static c_bool q_securityEncodeInPlace
|
|||
|
||||
|
||||
if (encoderIsBlocked(encoder)) {
|
||||
NN_ERROR("q_securityEncodeInPlace:Sending message blocked, encoder of partitionid '%d' in bad state",
|
||||
DDS_ERROR("q_securityEncodeInPlace:Sending message blocked, encoder of partitionid '%d' in bad state\n",
|
||||
partitionId);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (*dataLength <= 0) {
|
||||
NN_WARNING("q_securityEncodeInPlace:encoder called with empty buffer");
|
||||
DDS_WARNING("q_securityEncodeInPlace:encoder called with empty buffer\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
overallHeaderSize = cipherTypeToHeaderSize(encoder->cipherType);
|
||||
|
||||
if (*dataLength + overallHeaderSize > fragmentLength) {
|
||||
NN_ERROR("q_securityEncodeInPlace:sending message of %"PA_PRIu32" bytes overlaps with reserved space of %"PA_PRIu32" bytes",
|
||||
DDS_ERROR("q_securityEncodeInPlace:sending message of %"PA_PRIu32" bytes overlaps with reserved space of %"PA_PRIu32" bytes\n",
|
||||
*dataLength, overallHeaderSize);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1620,7 +1619,7 @@ static c_bool q_securityDecodeInPlace
|
|||
}
|
||||
|
||||
if ((partitionId < 1) || (partitionId > codec->nofPartitions)) {
|
||||
NN_WARNING("Incoming encrypted sub-message dropped, bad partition hash '%u'", hash);
|
||||
DDS_WARNING("Incoming encrypted sub-message dropped, bad partition hash '%u'\n", hash);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1629,16 +1628,16 @@ static c_bool q_securityDecodeInPlace
|
|||
overallHeaderSize = cipherTypeToHeaderSize(sendersCipherType);
|
||||
|
||||
if (sendersCipherType!=decoder->cipherType) {
|
||||
NN_WARNING("Incoming encrypted sub-message dropped: cipherType mismatch (%d != %d) for partition '%s'", sendersCipherType,decoder->cipherType, decoder->partitionName);
|
||||
DDS_WARNING("Incoming encrypted sub-message dropped: cipherType mismatch (%d != %d) for partition '%s'\n", sendersCipherType,decoder->cipherType, decoder->partitionName);
|
||||
return FALSE;
|
||||
}
|
||||
if (decoderIsBlocked(decoder)) {
|
||||
NN_WARNING("Incoming encrypted sub-message dropped: decoder is blocked for partition '%s'", decoder->partitionName);
|
||||
DDS_WARNING("Incoming encrypted sub-message dropped: decoder is blocked for partition '%s'\n", decoder->partitionName);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (overallHeaderSize > dataLength32) {
|
||||
NN_WARNING("Incoming encrypted sub-message dropped: submessage too small(%"PA_PRIu32" bytes),for partition '%s'", dataLength32, decoder->partitionName);
|
||||
DDS_WARNING("Incoming encrypted sub-message dropped: submessage too small(%"PA_PRIu32" bytes),for partition '%s'\n", dataLength32, decoder->partitionName);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ static uint32_t lease_renewal_thread (struct nn_servicelease *sl)
|
|||
|
||||
LOG_THREAD_CPUTIME (next_thread_cputime);
|
||||
|
||||
TRACE (("servicelease: tnow %"PRId64":", tnow.v));
|
||||
DDS_TRACE("servicelease: tnow %"PRId64":", tnow.v);
|
||||
|
||||
/* Check progress only if enough time has passed: there is no
|
||||
guarantee that os_cond_timedwait wont ever return early, and we
|
||||
|
@ -106,7 +106,7 @@ static uint32_t lease_renewal_thread (struct nn_servicelease *sl)
|
|||
vtime_t wd = thread_states.ts[i].watchdog;
|
||||
int alive = vtime_asleep_p (vt) || vtime_asleep_p (wd) || vtime_gt (wd, sl->av_ary[i].wd);
|
||||
n_alive += (unsigned) alive;
|
||||
TRACE ((" %u(%s):%c:%u:%u->%u:", i, thread_states.ts[i].name, alive ? 'a' : 'd', vt, sl->av_ary[i].wd, wd));
|
||||
DDS_TRACE(" %u(%s):%c:%u:%u->%u:", i, thread_states.ts[i].name, alive ? 'a' : 'd', vt, sl->av_ary[i].wd, wd);
|
||||
sl->av_ary[i].wd = wd;
|
||||
if (sl->av_ary[i].alive != alive)
|
||||
{
|
||||
|
@ -116,7 +116,7 @@ static uint32_t lease_renewal_thread (struct nn_servicelease *sl)
|
|||
msg = "failed to make progress";
|
||||
else
|
||||
msg = "once again made progress";
|
||||
NN_WARNING ("thread %s %s\n", name ? name : "(anon)", msg);
|
||||
DDS_WARNING("thread %s %s\n", name ? name : "(anon)", msg);
|
||||
sl->av_ary[i].alive = (char) alive;
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ static uint32_t lease_renewal_thread (struct nn_servicelease *sl)
|
|||
the DDSI2 service to be marked as dead. */
|
||||
if (n_alive == thread_states.nthreads)
|
||||
{
|
||||
TRACE ((": [%u] renewing\n", n_alive));
|
||||
DDS_TRACE(": [%u] renewing\n", n_alive);
|
||||
/* FIXME: perhaps it would be nice to control automatic
|
||||
liveliness updates from here.
|
||||
FIXME: should terminate failure of renew_cb() */
|
||||
|
@ -138,7 +138,7 @@ static uint32_t lease_renewal_thread (struct nn_servicelease *sl)
|
|||
}
|
||||
else
|
||||
{
|
||||
TRACE ((": [%u] NOT renewing\n", n_alive));
|
||||
DDS_TRACE(": [%u] NOT renewing\n", n_alive);
|
||||
if (was_alive)
|
||||
log_stack_traces ();
|
||||
was_alive = 0;
|
||||
|
@ -149,16 +149,16 @@ static uint32_t lease_renewal_thread (struct nn_servicelease *sl)
|
|||
statistics to the trace. Getrusage() can't fail if the
|
||||
parameters are valid, and these are by the book. Still we
|
||||
check. */
|
||||
if (config.enabled_logcats & LC_TIMING)
|
||||
if (dds_get_log_mask() & DDS_LC_TIMING)
|
||||
{
|
||||
struct rusage u;
|
||||
if (getrusage (RUSAGE_SELF, &u) == 0)
|
||||
{
|
||||
nn_log (LC_TIMING,
|
||||
"rusage: utime %d.%06d stime %d.%06d maxrss %ld data %ld vcsw %ld ivcsw %ld\n",
|
||||
(int) u.ru_utime.tv_sec, (int) u.ru_utime.tv_usec,
|
||||
(int) u.ru_stime.tv_sec, (int) u.ru_stime.tv_usec,
|
||||
u.ru_maxrss, u.ru_idrss, u.ru_nvcsw, u.ru_nivcsw);
|
||||
DDS_LOG(DDS_LC_TIMING,
|
||||
"rusage: utime %d.%06d stime %d.%06d maxrss %ld data %ld vcsw %ld ivcsw %ld\n",
|
||||
(int) u.ru_utime.tv_sec, (int) u.ru_utime.tv_usec,
|
||||
(int) u.ru_stime.tv_sec, (int) u.ru_stime.tv_usec,
|
||||
u.ru_maxrss, u.ru_idrss, u.ru_nvcsw, u.ru_nivcsw);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -169,7 +169,7 @@ void os_sockWaitsetTrigger (os_sockWaitset ws)
|
|||
if (n != 1)
|
||||
{
|
||||
err = os_getErrno ();
|
||||
NN_WARNING ("os_sockWaitsetTrigger: read failed on trigger pipe, errno = %d", err);
|
||||
DDS_WARNING("os_sockWaitsetTrigger: read failed on trigger pipe, errno = %d\n", err);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ os_sockWaitsetCtx os_sockWaitsetWait (os_sockWaitset ws)
|
|||
nevs = 0;
|
||||
else
|
||||
{
|
||||
NN_WARNING ("os_sockWaitsetWait: kevent failed, errno = %d", os_getErrno());
|
||||
DDS_WARNING("os_sockWaitsetWait: kevent failed, errno = %d\n", os_getErrno());
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ void os_sockWaitsetPurge (os_sockWaitset ws, unsigned index)
|
|||
ws->ctx.conns[i] = NULL;
|
||||
if (!WSACloseEvent (ws->ctx.events[i]))
|
||||
{
|
||||
NN_WARNING ("os_sockWaitsetPurge: WSACloseEvent (%x failed, error %d", (os_uint32) ws->ctx.events[i], os_getErrno ());
|
||||
DDS_WARNING("os_sockWaitsetPurge: WSACloseEvent (%x failed, error %d\n", (os_uint32) ws->ctx.events[i], os_getErrno ());
|
||||
}
|
||||
}
|
||||
ws->ctx.n = index + 1;
|
||||
|
@ -363,7 +363,7 @@ void os_sockWaitsetTrigger (os_sockWaitset ws)
|
|||
{
|
||||
if (! WSASetEvent (ws->ctx.events[0]))
|
||||
{
|
||||
NN_WARNING ("os_sockWaitsetTrigger: WSASetEvent(%x) failed, error %d", (os_uint32) ws->ctx.events[0], os_getErrno ());
|
||||
DDS_WARNING("os_sockWaitsetTrigger: WSASetEvent(%x) failed, error %d\n", (os_uint32) ws->ctx.events[0], os_getErrno ());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -392,7 +392,7 @@ int os_sockWaitsetAdd (os_sockWaitset ws, ddsi_tran_conn_t conn)
|
|||
{
|
||||
if (WSAEventSelect (sock, ev, FD_READ) == SOCKET_ERROR)
|
||||
{
|
||||
NN_WARNING ("os_sockWaitsetAdd: WSAEventSelect(%x,%x) failed, error %d", (os_uint32) sock, (os_uint32) ev, os_getErrno ());
|
||||
DDS_WARNING("os_sockWaitsetAdd: WSAEventSelect(%x,%x) failed, error %d\n", (os_uint32) sock, (os_uint32) ev, os_getErrno ());
|
||||
WSACloseEvent (ev);
|
||||
ret = -1;
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ os_sockWaitsetCtx os_sockWaitsetWait (os_sockWaitset ws)
|
|||
|
||||
if ((idx = WSAWaitForMultipleEvents (ws->ctx0.n, ws->ctx0.events, FALSE, WSA_INFINITE, FALSE)) == WSA_WAIT_FAILED)
|
||||
{
|
||||
NN_WARNING ("os_sockWaitsetWait: WSAWaitForMultipleEvents(%d,...,0,0,0) failed, error %d", ws->ctx0.n, os_getErrno ());
|
||||
DDS_WARNING("os_sockWaitsetWait: WSAWaitForMultipleEvents(%d,...,0,0,0) failed, error %d\n", ws->ctx0.n, os_getErrno ());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -445,11 +445,11 @@ os_sockWaitsetCtx os_sockWaitsetWait (os_sockWaitset ws)
|
|||
if (idx == WAIT_IO_COMPLETION)
|
||||
{
|
||||
/* Presumably can't happen with alertable = FALSE */
|
||||
NN_WARNING ("os_sockWaitsetWait: WSAWaitForMultipleEvents(%d,...,0,0,0) returned unexpected WAIT_IO_COMPLETION", ws->ctx0.n);
|
||||
DDS_WARNING("os_sockWaitsetWait: WSAWaitForMultipleEvents(%d,...,0,0,0) returned unexpected WAIT_IO_COMPLETION\n", ws->ctx0.n);
|
||||
}
|
||||
else
|
||||
{
|
||||
NN_WARNING ("os_sockWaitsetWait: WSAWaitForMultipleEvents(%d,...,0,0,0) returned unrecognised %d", ws->ctx0.n, idx);
|
||||
DDS_WARNING("os_sockWaitsetWait: WSAWaitForMultipleEvents(%d,...,0,0,0) returned unrecognised %d\n", ws->ctx0.n, idx);
|
||||
}
|
||||
#ifdef TEMP_DEF_WAIT_IO_COMPLETION
|
||||
#undef WAIT_IO_COMPLETION
|
||||
|
@ -488,7 +488,7 @@ int os_sockWaitsetNextEvent (os_sockWaitsetCtx ctx, ddsi_tran_conn_t * conn)
|
|||
{
|
||||
/* May have a wakeup and a close in parallel, so the handle
|
||||
need not exist anymore. */
|
||||
NN_ERROR ("os_sockWaitsetNextEvent: WSAEnumNetworkEvents(%x,%x,...) failed, error %d", (os_uint32) handle, (os_uint32) ctx->events[idx], err);
|
||||
DDS_ERROR("os_sockWaitsetNextEvent: WSAEnumNetworkEvents(%x,%x,...) failed, error %d", (os_uint32) handle, (os_uint32) ctx->events[idx], err);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -753,7 +753,7 @@ void os_sockWaitsetTrigger (os_sockWaitset ws)
|
|||
if (n != 1)
|
||||
{
|
||||
err = os_getErrno ();
|
||||
NN_WARNING ("os_sockWaitsetTrigger: read failed on trigger pipe, errno = %d", err);
|
||||
DDS_WARNING("os_sockWaitsetTrigger: read failed on trigger pipe, errno = %d", err);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -882,7 +882,7 @@ os_sockWaitsetCtx os_sockWaitsetWait (os_sockWaitset ws)
|
|||
err = os_getErrno ();
|
||||
if ((err != os_sockEINTR) && (err != os_sockEAGAIN))
|
||||
{
|
||||
NN_WARNING ("os_sockWaitsetWait: select failed, errno = %d", err);
|
||||
DDS_WARNING("os_sockWaitsetWait: select failed, errno = %d", err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -905,7 +905,7 @@ os_sockWaitsetCtx os_sockWaitsetWait (os_sockWaitset ws)
|
|||
if (n1 != 1)
|
||||
{
|
||||
err = os_getErrno ();
|
||||
NN_WARNING ("os_sockWaitsetWait: read failed on trigger pipe, errno = %d", err);
|
||||
DDS_WARNING("os_sockWaitsetWait: read failed on trigger pipe, errno = %d", err);
|
||||
assert (0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ static void os_free_aligned ( _Pre_maybenull_ _Post_invalid_ void *ptr)
|
|||
void thread_states_init_static (void)
|
||||
{
|
||||
static struct thread_state1 ts =
|
||||
{ .state = THREAD_STATE_ALIVE, .vtime = 1, .watchdog = 1, .lb = NULL, .name = "(anon)" };
|
||||
{ .state = THREAD_STATE_ALIVE, .vtime = 1, .watchdog = 1, .name = "(anon)" };
|
||||
tsd_thread_state = &ts;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,6 @@ OS_WARNING_MSVC_OFF(6386);
|
|||
thread_states.ts[i].state = THREAD_STATE_ZERO;
|
||||
thread_states.ts[i].vtime = 1;
|
||||
thread_states.ts[i].watchdog = 1;
|
||||
thread_states.ts[i].lb = NULL;
|
||||
thread_states.ts[i].name = NULL;
|
||||
}
|
||||
OS_WARNING_MSVC_ON(6386);
|
||||
|
@ -134,10 +133,9 @@ lookup_thread_state(
|
|||
ts1 = init_thread_state(tname);
|
||||
if (ts1 != NULL) {
|
||||
os_osInit();
|
||||
ts1->lb = 0;
|
||||
ts1->extTid = tid;
|
||||
ts1->tid = tid;
|
||||
nn_log (LC_INFO, "started application thread %s\n", tname);
|
||||
DDS_LOG(DDS_LC_INFO, "started application thread %s\n", tname);
|
||||
os_threadCleanupPush(&cleanup_thread_state, NULL);
|
||||
}
|
||||
os_mutexUnlock(&thread_states.lock);
|
||||
|
@ -177,7 +175,6 @@ static uint32_t create_thread_wrapper (_In_ _Post_invalid_ struct thread_context
|
|||
uint32_t ret;
|
||||
ctxt->self->tid = os_threadIdSelf ();
|
||||
ret = ctxt->f (ctxt->arg);
|
||||
logbuf_free (ctxt->self->lb);
|
||||
os_free (ctxt);
|
||||
return ret;
|
||||
}
|
||||
|
@ -194,7 +191,7 @@ static int find_free_slot (_In_z_ const char *name)
|
|||
break;
|
||||
}
|
||||
if (cand == -1)
|
||||
NN_FATAL ("create_thread: %s: no free slot\n", name ? name : "(anon)");
|
||||
DDS_FATAL("create_thread: %s: no free slot\n", name ? name : "(anon)");
|
||||
return cand;
|
||||
}
|
||||
|
||||
|
@ -210,7 +207,6 @@ void upgrade_main_thread (void)
|
|||
assert (vtime_asleep_p (ts1->vtime));
|
||||
ts1->state = THREAD_STATE_ALIVE;
|
||||
ts1->tid = os_threadIdSelf ();
|
||||
ts1->lb = logbuf_new ();
|
||||
ts1->name = main_thread_name;
|
||||
os_mutexUnlock (&thread_states.lock);
|
||||
tsd_thread_state = ts1;
|
||||
|
@ -259,7 +255,6 @@ struct thread_state1 *create_thread (_In_z_ const char *name, _In_ uint32_t (*f)
|
|||
if (ts1 == NULL)
|
||||
goto fatal;
|
||||
|
||||
ts1->lb = logbuf_new ();
|
||||
ctxt->self = ts1;
|
||||
ctxt->f = f;
|
||||
ctxt->arg = arg;
|
||||
|
@ -272,15 +267,15 @@ struct thread_state1 *create_thread (_In_z_ const char *name, _In_ uint32_t (*f)
|
|||
if (!tprops->stack_size.isdefault)
|
||||
tattr.stackSize = tprops->stack_size.value;
|
||||
}
|
||||
TRACE (("create_thread: %s: class %d priority %d stack %u\n", name, (int) tattr.schedClass, tattr.schedPriority, tattr.stackSize));
|
||||
DDS_TRACE("create_thread: %s: class %d priority %d stack %u\n", name, (int) tattr.schedClass, tattr.schedPriority, tattr.stackSize);
|
||||
|
||||
if (os_threadCreate (&tid, name, &tattr, (os_threadRoutine)&create_thread_wrapper, ctxt) != os_resultSuccess)
|
||||
{
|
||||
ts1->state = THREAD_STATE_ZERO;
|
||||
NN_FATAL ("create_thread: %s: os_threadCreate failed\n", name);
|
||||
DDS_FATAL("create_thread: %s: os_threadCreate failed\n", name);
|
||||
goto fatal;
|
||||
}
|
||||
nn_log (LC_INFO, "started new thread 0x%"PRIxMAX" : %s\n", os_threadIdToInteger (tid), name);
|
||||
DDS_LOG(DDS_LC_INFO, "started new thread 0x%"PRIxMAX" : %s\n", os_threadIdToInteger (tid), name);
|
||||
ts1->extTid = tid; /* overwrite the temporary value with the correct external one */
|
||||
os_mutexUnlock (&thread_states.lock);
|
||||
return ts1;
|
||||
|
@ -329,7 +324,6 @@ void downgrade_main_thread (void)
|
|||
{
|
||||
struct thread_state1 *ts1 = lookup_thread_state ();
|
||||
thread_state_asleep (ts1);
|
||||
logbuf_free (ts1->lb);
|
||||
/* no need to sync with service lease: already stopped */
|
||||
reap_thread_state (ts1, 0);
|
||||
thread_states_init_static ();
|
||||
|
|
|
@ -184,16 +184,16 @@ struct nn_xmsg *writer_hbcontrol_create_heartbeat (struct writer *wr, const stru
|
|||
}
|
||||
}
|
||||
|
||||
TRACE (("writer_hbcontrol: wr %x:%x:%x:%x ", PGUID (wr->e.guid)));
|
||||
DDS_TRACE("writer_hbcontrol: wr %x:%x:%x:%x ", PGUID (wr->e.guid));
|
||||
if (prd_guid == NULL)
|
||||
TRACE (("multicasting "));
|
||||
DDS_TRACE("multicasting ");
|
||||
else
|
||||
TRACE (("unicasting to prd %x:%x:%x:%x ", PGUID (*prd_guid)));
|
||||
TRACE (("(rel-prd %d seq-eq-max %d seq %"PRId64" maxseq %"PRId64")\n",
|
||||
DDS_TRACE("unicasting to prd %x:%x:%x:%x ", PGUID (*prd_guid));
|
||||
DDS_TRACE("(rel-prd %d seq-eq-max %d seq %"PRId64" maxseq %"PRId64")\n",
|
||||
wr->num_reliable_readers,
|
||||
ut_avlIsEmpty (&wr->readers) ? -1 : root_rdmatch (wr)->num_reliable_readers_where_seq_equals_max,
|
||||
wr->seq,
|
||||
ut_avlIsEmpty (&wr->readers) ? (seqno_t) -1 : root_rdmatch (wr)->max_seq));
|
||||
ut_avlIsEmpty (&wr->readers) ? (seqno_t) -1 : root_rdmatch (wr)->max_seq);
|
||||
|
||||
if (prd_guid == NULL)
|
||||
{
|
||||
|
@ -208,7 +208,7 @@ struct nn_xmsg *writer_hbcontrol_create_heartbeat (struct writer *wr, const stru
|
|||
struct proxy_reader *prd;
|
||||
if ((prd = ephash_lookup_proxy_reader_guid (prd_guid)) == NULL)
|
||||
{
|
||||
TRACE (("writer_hbcontrol: wr %x:%x:%x:%x unknown prd %x:%x:%x:%x\n", PGUID (wr->e.guid), PGUID (*prd_guid)));
|
||||
DDS_TRACE("writer_hbcontrol: wr %x:%x:%x:%x unknown prd %x:%x:%x:%x\n", PGUID (wr->e.guid), PGUID (*prd_guid));
|
||||
nn_xmsg_free (msg);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -306,13 +306,13 @@ struct nn_xmsg *writer_hbcontrol_piggyback (struct writer *wr, const struct whc_
|
|||
|
||||
if (msg)
|
||||
{
|
||||
TRACE (("heartbeat(wr %x:%x:%x:%x%s) piggybacked, resched in %g s (min-ack %"PRId64"%s, avail-seq %"PRId64", xmit %"PRId64")\n",
|
||||
DDS_TRACE("heartbeat(wr %x:%x:%x:%x%s) piggybacked, resched in %g s (min-ack %"PRId64"%s, avail-seq %"PRId64", xmit %"PRId64")\n",
|
||||
PGUID (wr->e.guid),
|
||||
*hbansreq ? "" : " final",
|
||||
(hbc->tsched.v == T_NEVER) ? POS_INFINITY_DOUBLE : (double) (hbc->tsched.v - tnow.v) / 1e9,
|
||||
ut_avlIsEmpty (&wr->readers) ? -1 : root_rdmatch (wr)->min_seq,
|
||||
ut_avlIsEmpty (&wr->readers) || root_rdmatch (wr)->all_have_replied_to_hb ? "" : "!",
|
||||
whcst->max_seq, READ_SEQ_XMIT(wr)));
|
||||
whcst->max_seq, READ_SEQ_XMIT(wr));
|
||||
}
|
||||
|
||||
return msg;
|
||||
|
@ -400,13 +400,12 @@ static int create_fragment_message_simple (struct writer *wr, seqno_t seq, struc
|
|||
#define TEST_KEYHASH 0
|
||||
const size_t expected_inline_qos_size = 4+8+20+4 + 32;
|
||||
struct nn_xmsg_marker sm_marker;
|
||||
unsigned char contentflag;
|
||||
unsigned char contentflag = 0;
|
||||
Data_t *data;
|
||||
|
||||
switch (serdata->kind)
|
||||
{
|
||||
case SDK_EMPTY:
|
||||
contentflag = 0;
|
||||
break;
|
||||
case SDK_KEY:
|
||||
#if TEST_KEYHASH
|
||||
|
@ -634,9 +633,9 @@ int create_fragment_message (struct writer *wr, seqno_t seq, const struct nn_pli
|
|||
nn_xmsg_serdata (*pmsg, serdata, fragstart, fraglen);
|
||||
nn_xmsg_submsg_setnext (*pmsg, sm_marker);
|
||||
#if 0
|
||||
TRACE (("queue data%s %x:%x:%x:%x #%lld/%u[%u..%u)\n",
|
||||
DDS_TRACE("queue data%s %x:%x:%x:%x #%lld/%u[%u..%u)\n",
|
||||
fragging ? "frag" : "", PGUID (wr->e.guid),
|
||||
seq, fragnum+1, fragstart, fragstart + fraglen));
|
||||
seq, fragnum+1, fragstart, fragstart + fraglen);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
|
@ -859,7 +858,7 @@ static int insert_sample_in_whc (struct writer *wr, seqno_t seq, struct nn_plist
|
|||
|
||||
ASSERT_MUTEX_HELD (&wr->e.lock);
|
||||
|
||||
if (config.enabled_logcats & LC_TRACE)
|
||||
if (dds_get_log_mask() & DDS_LC_TRACE)
|
||||
{
|
||||
char ppbuf[1024];
|
||||
int tmp;
|
||||
|
@ -867,10 +866,10 @@ static int insert_sample_in_whc (struct writer *wr, seqno_t seq, struct nn_plist
|
|||
const char *ttname = wr->topic ? wr->topic->typename : "(null)";
|
||||
ppbuf[0] = '\0';
|
||||
tmp = sizeof (ppbuf) - 1;
|
||||
nn_log (LC_TRACE, "write_sample %x:%x:%x:%x #%"PRId64"", PGUID (wr->e.guid), seq);
|
||||
DDS_TRACE("write_sample %x:%x:%x:%x #%"PRId64"", PGUID (wr->e.guid), seq);
|
||||
if (plist != 0 && (plist->present & PP_COHERENT_SET))
|
||||
nn_log (LC_TRACE, " C#%"PRId64"", fromSN (plist->coherent_set_seqno));
|
||||
nn_log (LC_TRACE, ": ST%u %s/%s:%s%s\n", serdata->statusinfo, tname, ttname, ppbuf, tmp < (int) sizeof (ppbuf) ? "" : " (trunc)");
|
||||
DDS_TRACE(" C#%"PRId64"", fromSN (plist->coherent_set_seqno));
|
||||
DDS_TRACE(": ST%u %s/%s:%s%s\n", serdata->statusinfo, tname, ttname, ppbuf, tmp < (int) sizeof (ppbuf) ? "" : " (trunc)");
|
||||
}
|
||||
|
||||
assert (wr->reliable || have_reliable_subs (wr) == 0);
|
||||
|
@ -959,7 +958,7 @@ static os_result throttle_writer (struct nn_xpack *xp, struct writer *wr)
|
|||
assert (!is_builtin_entityid(wr->e.guid.entityid, ownvendorid));
|
||||
}
|
||||
|
||||
nn_log (LC_THROTTLE, "writer %x:%x:%x:%x waiting for whc to shrink below low-water mark (whc %"PRIuSIZE" low=%u high=%u)\n", PGUID (wr->e.guid), whcst.unacked_bytes, wr->whc_low, wr->whc_high);
|
||||
DDS_LOG(DDS_LC_THROTTLE, "writer %x:%x:%x:%x waiting for whc to shrink below low-water mark (whc %"PRIuSIZE" low=%u high=%u)\n", PGUID (wr->e.guid), whcst.unacked_bytes, wr->whc_low, wr->whc_high);
|
||||
wr->throttling = 1;
|
||||
wr->throttle_count++;
|
||||
|
||||
|
@ -1007,7 +1006,7 @@ static os_result throttle_writer (struct nn_xpack *xp, struct writer *wr)
|
|||
os_condBroadcast (&wr->throttle_cond);
|
||||
}
|
||||
|
||||
nn_log (LC_THROTTLE, "writer %x:%x:%x:%x done waiting for whc to shrink below low-water mark (whc %"PRIuSIZE" low=%u high=%u)\n", PGUID (wr->e.guid), whcst.unacked_bytes, wr->whc_low, wr->whc_high);
|
||||
DDS_LOG(DDS_LC_THROTTLE, "writer %x:%x:%x:%x done waiting for whc to shrink below low-water mark (whc %"PRIuSIZE" low=%u high=%u)\n", PGUID (wr->e.guid), whcst.unacked_bytes, wr->whc_low, wr->whc_high);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1046,7 +1045,7 @@ static int write_sample_eot (struct nn_xpack *xp, struct writer *wr, struct nn_p
|
|||
const char *ttname = wr->topic ? wr->topic->typename : "(null)";
|
||||
ppbuf[0] = '\0';
|
||||
tmp = sizeof (ppbuf) - 1;
|
||||
NN_WARNING ("dropping oversize (%u > %u) sample from local writer %x:%x:%x:%x %s/%s:%s%s\n",
|
||||
DDS_WARNING ("dropping oversize (%u > %u) sample from local writer %x:%x:%x:%x %s/%s:%s%s\n",
|
||||
ddsi_serdata_size (serdata), config.max_sample_size,
|
||||
PGUID (wr->e.guid), tname, ttname, ppbuf,
|
||||
tmp < (int) sizeof (ppbuf) ? "" : " (trunc)");
|
||||
|
|
|
@ -175,7 +175,7 @@ static int compare_xevent_tsched (const void *va, const void *vb)
|
|||
static void update_rexmit_counts (struct xeventq *evq, struct xevent_nt *ev)
|
||||
{
|
||||
#if 0
|
||||
TRACE (("ZZZ(%p,%"PA_PRIuSIZE")", (void *) ev, ev->u.msg_rexmit.queued_rexmit_bytes));
|
||||
DDS_TRACE(("ZZZ(%p,%"PA_PRIuSIZE")", (void *) ev, ev->u.msg_rexmit.queued_rexmit_bytes);
|
||||
#endif
|
||||
assert (ev->kind == XEVK_MSG_REXMIT);
|
||||
assert (ev->u.msg_rexmit.queued_rexmit_bytes <= evq->queued_rexmit_bytes);
|
||||
|
@ -187,13 +187,13 @@ static void update_rexmit_counts (struct xeventq *evq, struct xevent_nt *ev)
|
|||
#if 0
|
||||
static void trace_msg (const char *func, const struct nn_xmsg *m)
|
||||
{
|
||||
if (config.enabled_logcats & LC_TRACE)
|
||||
if (dds_get_log_mask() & DDS_LC_TRACE)
|
||||
{
|
||||
nn_guid_t wrguid;
|
||||
seqno_t wrseq;
|
||||
nn_fragment_number_t wrfragid;
|
||||
nn_xmsg_guid_seq_fragid (m, &wrguid, &wrseq, &wrfragid);
|
||||
TRACE ((" %s(%x:%x:%x:%x/%"PRId64"/%u)", func, PGUID (wrguid), wrseq, wrfragid));
|
||||
DDS_TRACE(" %s(%x:%x:%x:%x/%"PRId64"/%u)", func, PGUID (wrguid), wrseq, wrfragid);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -409,7 +409,7 @@ static struct xevent * qxev_common (struct xeventq *evq, nn_mtime_t tsched, enum
|
|||
if (tsched.v != T_NEVER && config.schedule_time_rounding != 0)
|
||||
{
|
||||
nn_mtime_t tsched_rounded = mtime_round_up (tsched, config.schedule_time_rounding);
|
||||
TRACE (("rounded event scheduled for %"PRId64" to %"PRId64"\n", tsched.v, tsched_rounded.v));
|
||||
DDS_TRACE("rounded event scheduled for %"PRId64" to %"PRId64"\n", tsched.v, tsched_rounded.v);
|
||||
tsched = tsched_rounded;
|
||||
}
|
||||
|
||||
|
@ -462,7 +462,7 @@ static void qxev_insert_nt (struct xevent_nt *ev)
|
|||
struct xeventq *evq = ev->evq;
|
||||
ASSERT_MUTEX_HELD (&evq->lock);
|
||||
add_to_non_timed_xmit_list (evq, ev);
|
||||
TRACE (("non-timed queue now has %d items\n", compute_non_timed_xmit_list_size (evq)));
|
||||
DDS_TRACE("non-timed queue now has %d items\n", compute_non_timed_xmit_list_size (evq));
|
||||
}
|
||||
|
||||
static int msg_xevents_cmp (const void *a, const void *b)
|
||||
|
@ -548,7 +548,7 @@ void xeventq_free (struct xeventq *evq)
|
|||
{
|
||||
union { void *v; void (*f) (struct xevent *ev, void *arg, nn_mtime_t tnow); } fp;
|
||||
fp.f = ev->u.callback.cb;
|
||||
NN_WARNING("xeventq_free: callback %p did not schedule deletion as required, deleting event anyway\n", fp.v);
|
||||
DDS_WARNING("xeventq_free: callback %p did not schedule deletion as required, deleting event anyway\n", fp.v);
|
||||
delete_xevent (ev);
|
||||
}
|
||||
}
|
||||
|
@ -600,8 +600,8 @@ static void handle_xevk_heartbeat (struct nn_xpack *xp, struct xevent *ev, nn_mt
|
|||
|
||||
if ((wr = ephash_lookup_writer_guid (&ev->u.heartbeat.wr_guid)) == NULL)
|
||||
{
|
||||
TRACE (("heartbeat(wr %x:%x:%x:%x) writer gone\n",
|
||||
PGUID (ev->u.heartbeat.wr_guid)));
|
||||
DDS_TRACE("heartbeat(wr %x:%x:%x:%x) writer gone\n",
|
||||
PGUID (ev->u.heartbeat.wr_guid));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -627,14 +627,14 @@ static void handle_xevk_heartbeat (struct nn_xpack *xp, struct xevent *ev, nn_mt
|
|||
t_next.v = tnow.v + writer_hbcontrol_intv (wr, &whcst, tnow);
|
||||
}
|
||||
|
||||
TRACE (("heartbeat(wr %x:%x:%x:%x%s) %s, resched in %g s (min-ack %"PRId64"%s, avail-seq %"PRId64", xmit %"PRId64")\n",
|
||||
DDS_TRACE("heartbeat(wr %x:%x:%x:%x%s) %s, resched in %g s (min-ack %"PRId64"%s, avail-seq %"PRId64", xmit %"PRId64")\n",
|
||||
PGUID (wr->e.guid),
|
||||
hbansreq ? "" : " final",
|
||||
msg ? "sent" : "suppressed",
|
||||
(t_next.v == T_NEVER) ? POS_INFINITY_DOUBLE : (double)(t_next.v - tnow.v) / 1e9,
|
||||
ut_avlIsEmpty (&wr->readers) ? (seqno_t) -1 : ((struct wr_prd_match *) ut_avlRootNonEmpty (&wr_readers_treedef, &wr->readers))->min_seq,
|
||||
ut_avlIsEmpty (&wr->readers) || ((struct wr_prd_match *) ut_avlRootNonEmpty (&wr_readers_treedef, &wr->readers))->all_have_replied_to_hb ? "" : "!",
|
||||
whcst.max_seq, READ_SEQ_XMIT(wr)));
|
||||
whcst.max_seq, READ_SEQ_XMIT(wr));
|
||||
resched_xevent_if_earlier (ev, t_next);
|
||||
wr->hbcontrol.tsched = t_next;
|
||||
os_mutexUnlock (&wr->e.lock);
|
||||
|
@ -822,11 +822,11 @@ static void add_AckNack (struct nn_xmsg *msg, struct proxy_writer *pwr, struct p
|
|||
nn_xmsg_shrink (msg, sm_marker, ACKNACK_SIZE (an->readerSNState.numbits));
|
||||
nn_xmsg_submsg_setnext (msg, sm_marker);
|
||||
|
||||
TRACE (("acknack %x:%x:%x:%x -> %x:%x:%x:%x: #%d:%"PRId64"/%u:",
|
||||
DDS_TRACE("acknack %x:%x:%x:%x -> %x:%x:%x:%x: #%d:%"PRId64"/%u:",
|
||||
PGUID (rwn->rd_guid), PGUID (pwr->e.guid), rwn->count,
|
||||
base, an->readerSNState.numbits));
|
||||
base, an->readerSNState.numbits);
|
||||
for (ui = 0; ui != an->readerSNState.numbits; ui++)
|
||||
TRACE (("%c", nn_bitset_isset (numbits, an->readerSNState.bits, ui) ? '1' : '0'));
|
||||
DDS_TRACE("%c", nn_bitset_isset (numbits, an->readerSNState.bits, ui) ? '1' : '0');
|
||||
}
|
||||
|
||||
if (nackfrag_numbits > 0)
|
||||
|
@ -853,13 +853,13 @@ static void add_AckNack (struct nn_xmsg *msg, struct proxy_writer *pwr, struct p
|
|||
*countp = ++pwr->nackfragcount;
|
||||
nn_xmsg_submsg_setnext (msg, sm_marker);
|
||||
|
||||
TRACE ((" + nackfrag #%d:%"PRId64"/%u/%u:", *countp, fromSN (nf->writerSN), nf->fragmentNumberState.bitmap_base, nf->fragmentNumberState.numbits));
|
||||
DDS_TRACE(" + nackfrag #%d:%"PRId64"/%u/%u:", *countp, fromSN (nf->writerSN), nf->fragmentNumberState.bitmap_base, nf->fragmentNumberState.numbits);
|
||||
for (ui = 0; ui != nf->fragmentNumberState.numbits; ui++)
|
||||
TRACE (("%c", nn_bitset_isset (nf->fragmentNumberState.numbits, nf->fragmentNumberState.bits, ui) ? '1' : '0'));
|
||||
DDS_TRACE("%c", nn_bitset_isset (nf->fragmentNumberState.numbits, nf->fragmentNumberState.bits, ui) ? '1' : '0');
|
||||
}
|
||||
}
|
||||
|
||||
TRACE (("\n"));
|
||||
DDS_TRACE("\n");
|
||||
}
|
||||
|
||||
static void handle_xevk_acknack (UNUSED_ARG (struct nn_xpack *xp), struct xevent *ev, nn_mtime_t tnow)
|
||||
|
@ -918,13 +918,13 @@ static void handle_xevk_acknack (UNUSED_ARG (struct nn_xpack *xp), struct xevent
|
|||
eventually. */
|
||||
resched_xevent_if_earlier (ev, add_duration_to_mtime (tnow, config.auto_resched_nack_delay));
|
||||
}
|
||||
TRACE (("send acknack(rd %x:%x:%x:%x -> pwr %x:%x:%x:%x)\n",
|
||||
PGUID (ev->u.acknack.rd_guid), PGUID (ev->u.acknack.pwr_guid)));
|
||||
DDS_TRACE("send acknack(rd %x:%x:%x:%x -> pwr %x:%x:%x:%x)\n",
|
||||
PGUID (ev->u.acknack.rd_guid), PGUID (ev->u.acknack.pwr_guid));
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE (("skip acknack(rd %x:%x:%x:%x -> pwr %x:%x:%x:%x): no address\n",
|
||||
PGUID (ev->u.acknack.rd_guid), PGUID (ev->u.acknack.pwr_guid)));
|
||||
DDS_TRACE("skip acknack(rd %x:%x:%x:%x -> pwr %x:%x:%x:%x): no address\n",
|
||||
PGUID (ev->u.acknack.rd_guid), PGUID (ev->u.acknack.pwr_guid));
|
||||
msg = NULL;
|
||||
}
|
||||
|
||||
|
@ -972,8 +972,8 @@ static void handle_xevk_spdp (UNUSED_ARG (struct nn_xpack *xp), struct xevent *e
|
|||
|
||||
if ((pp = ephash_lookup_participant_guid (&ev->u.spdp.pp_guid)) == NULL)
|
||||
{
|
||||
TRACE (("handle_xevk_spdp %x:%x:%x:%x - unknown guid\n",
|
||||
PGUID (ev->u.spdp.pp_guid)));
|
||||
DDS_TRACE("handle_xevk_spdp %x:%x:%x:%x - unknown guid\n",
|
||||
PGUID (ev->u.spdp.pp_guid));
|
||||
if (ev->u.spdp.directed)
|
||||
delete_xevent (ev);
|
||||
return;
|
||||
|
@ -981,8 +981,8 @@ static void handle_xevk_spdp (UNUSED_ARG (struct nn_xpack *xp), struct xevent *e
|
|||
|
||||
if ((spdp_wr = get_builtin_writer (pp, NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER)) == NULL)
|
||||
{
|
||||
TRACE (("handle_xevk_spdp %x:%x:%x:%x - spdp writer of participant not found\n",
|
||||
PGUID (ev->u.spdp.pp_guid)));
|
||||
DDS_TRACE("handle_xevk_spdp %x:%x:%x:%x - spdp writer of participant not found\n",
|
||||
PGUID (ev->u.spdp.pp_guid));
|
||||
if (ev->u.spdp.directed)
|
||||
delete_xevent (ev);
|
||||
return;
|
||||
|
@ -1001,7 +1001,7 @@ static void handle_xevk_spdp (UNUSED_ARG (struct nn_xpack *xp), struct xevent *e
|
|||
guid.entityid.u = NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_READER;
|
||||
if ((prd = ephash_lookup_proxy_reader_guid (&guid)) == NULL)
|
||||
{
|
||||
TRACE (("xmit spdp: no proxy reader %x:%x:%x:%x\n", PGUID (guid)));
|
||||
DDS_TRACE("xmit spdp: no proxy reader %x:%x:%x:%x\n", PGUID (guid));
|
||||
goto skip;
|
||||
}
|
||||
}
|
||||
|
@ -1068,8 +1068,8 @@ static void handle_xevk_spdp (UNUSED_ARG (struct nn_xpack *xp), struct xevent *e
|
|||
}
|
||||
else
|
||||
{
|
||||
TRACE (("xmit spdp: suppressing early spdp response from %x:%x:%x:%x to %x:%x:%x:%x\n",
|
||||
PGUID (pp->e.guid), PGUIDPREFIX (ev->u.spdp.dest_proxypp_guid_prefix), NN_ENTITYID_PARTICIPANT));
|
||||
DDS_TRACE("xmit spdp: suppressing early spdp response from %x:%x:%x:%x to %x:%x:%x:%x\n",
|
||||
PGUID (pp->e.guid), PGUIDPREFIX (ev->u.spdp.dest_proxypp_guid_prefix), NN_ENTITYID_PARTICIPANT);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -1084,10 +1084,10 @@ static void handle_xevk_spdp (UNUSED_ARG (struct nn_xpack *xp), struct xevent *e
|
|||
else
|
||||
{
|
||||
nn_mtime_t tnext = add_duration_to_mtime (tnow, T_SECOND);
|
||||
TRACE (("xmit spdp %x:%x:%x:%x to %x:%x:%x:%x (resched %gs)\n",
|
||||
PGUID (pp->e.guid),
|
||||
PGUIDPREFIX (ev->u.spdp.dest_proxypp_guid_prefix), NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_READER,
|
||||
(double)(tnext.v - tnow.v) / 1e9));
|
||||
DDS_TRACE("xmit spdp %x:%x:%x:%x to %x:%x:%x:%x (resched %gs)\n",
|
||||
PGUID (pp->e.guid),
|
||||
PGUIDPREFIX (ev->u.spdp.dest_proxypp_guid_prefix), NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_READER,
|
||||
(double)(tnext.v - tnow.v) / 1e9);
|
||||
resched_xevent_if_earlier (ev, tnext);
|
||||
}
|
||||
}
|
||||
|
@ -1111,10 +1111,10 @@ static void handle_xevk_spdp (UNUSED_ARG (struct nn_xpack *xp), struct xevent *e
|
|||
intv = config.spdp_interval;
|
||||
|
||||
tnext = add_duration_to_mtime (tnow, intv);
|
||||
TRACE (("xmit spdp %x:%x:%x:%x to %x:%x:%x:%x (resched %gs)\n",
|
||||
DDS_TRACE("xmit spdp %x:%x:%x:%x to %x:%x:%x:%x (resched %gs)\n",
|
||||
PGUID (pp->e.guid),
|
||||
PGUIDPREFIX (ev->u.spdp.dest_proxypp_guid_prefix), NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_READER,
|
||||
(double)(tnext.v - tnow.v) / 1e9));
|
||||
(double)(tnext.v - tnow.v) / 1e9);
|
||||
resched_xevent_if_earlier (ev, tnext);
|
||||
}
|
||||
}
|
||||
|
@ -1132,7 +1132,7 @@ static void write_pmd_message (struct nn_xpack *xp, struct participant *pp, unsi
|
|||
|
||||
if ((wr = get_builtin_writer (pp, NN_ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER)) == NULL)
|
||||
{
|
||||
TRACE (("write_pmd_message(%x:%x:%x:%x) - builtin pmd writer not found\n", PGUID (pp->e.guid)));
|
||||
DDS_TRACE("write_pmd_message(%x:%x:%x:%x) - builtin pmd writer not found\n", PGUID (pp->e.guid));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1182,7 +1182,7 @@ static void handle_xevk_pmd_update (struct nn_xpack *xp, struct xevent *ev, nn_m
|
|||
if (intv == T_NEVER)
|
||||
{
|
||||
tnext.v = T_NEVER;
|
||||
TRACE (("resched pmd(%x:%x:%x:%x): never\n", PGUID (pp->e.guid)));
|
||||
DDS_TRACE("resched pmd(%x:%x:%x:%x): never\n", PGUID (pp->e.guid));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1192,7 +1192,7 @@ static void handle_xevk_pmd_update (struct nn_xpack *xp, struct xevent *ev, nn_m
|
|||
tnext.v = tnow.v + intv - 2 * T_SECOND;
|
||||
else
|
||||
tnext.v = tnow.v + 4 * intv / 5;
|
||||
TRACE (("resched pmd(%x:%x:%x:%x): %gs\n", PGUID (pp->e.guid), (double)(tnext.v - tnow.v) / 1e9));
|
||||
DDS_TRACE("resched pmd(%x:%x:%x:%x): %gs\n", PGUID (pp->e.guid), (double)(tnext.v - tnow.v) / 1e9);
|
||||
}
|
||||
|
||||
resched_xevent_if_earlier (ev, tnext);
|
||||
|
@ -1204,7 +1204,7 @@ static void handle_xevk_end_startup_mode (UNUSED_ARG (struct nn_xpack *xp), stru
|
|||
struct ephash_enum_writer est;
|
||||
struct writer *wr;
|
||||
assert (gv.startup_mode);
|
||||
nn_log (LC_DISCOVERY, "end startup mode\n");
|
||||
DDS_LOG(DDS_LC_DISCOVERY, "end startup mode\n");
|
||||
gv.startup_mode = 0;
|
||||
/* FIXME: MEMBAR needed for startup mode (or use a lock) */
|
||||
ephash_enum_writer_init (&est);
|
||||
|
@ -1217,7 +1217,7 @@ static void handle_xevk_end_startup_mode (UNUSED_ARG (struct nn_xpack *xp), stru
|
|||
static void handle_xevk_delete_writer (UNUSED_ARG (struct nn_xpack *xp), struct xevent *ev, UNUSED_ARG (nn_mtime_t tnow))
|
||||
{
|
||||
/* don't worry if the writer is already gone by the time we get here. */
|
||||
TRACE (("handle_xevk_delete_writer: %x:%x:%x:%x\n", PGUID (ev->u.delete_writer.guid)));
|
||||
DDS_TRACE("handle_xevk_delete_writer: %x:%x:%x:%x\n", PGUID (ev->u.delete_writer.guid));
|
||||
delete_writer_nolinger (&ev->u.delete_writer.guid);
|
||||
delete_xevent (ev);
|
||||
}
|
||||
|
@ -1447,7 +1447,7 @@ void qxev_prd_entityid (struct proxy_reader * prd, nn_guid_prefix_t * id)
|
|||
msg = nn_xmsg_new (gv.xmsgpool, id, sizeof (EntityId_t), NN_XMSG_KIND_CONTROL);
|
||||
if (nn_xmsg_setdstPRD (msg, prd) == 0)
|
||||
{
|
||||
TRACE ((" qxev_prd_entityid (%x:%x:%x)\n", PGUIDPREFIX (*id)));
|
||||
DDS_TRACE(" qxev_prd_entityid (%x:%x:%x)\n", PGUIDPREFIX (*id));
|
||||
nn_xmsg_add_entityid (msg);
|
||||
os_mutexLock (&gv.xevents->lock);
|
||||
ev = qxev_common_nt (gv.xevents, XEVK_ENTITYID);
|
||||
|
@ -1474,7 +1474,7 @@ void qxev_pwr_entityid (struct proxy_writer * pwr, nn_guid_prefix_t * id)
|
|||
msg = nn_xmsg_new (gv.xmsgpool, id, sizeof (EntityId_t), NN_XMSG_KIND_CONTROL);
|
||||
if (nn_xmsg_setdstPWR (msg, pwr) == 0)
|
||||
{
|
||||
TRACE ((" qxev_pwr_entityid (%x:%x:%x)\n", PGUIDPREFIX (*id)));
|
||||
DDS_TRACE(" qxev_pwr_entityid (%x:%x:%x)\n", PGUIDPREFIX (*id));
|
||||
nn_xmsg_add_entityid (msg);
|
||||
os_mutexLock (&pwr->evq->lock);
|
||||
ev = qxev_common_nt (pwr->evq, XEVK_ENTITYID);
|
||||
|
@ -1512,8 +1512,8 @@ int qxev_msg_rexmit_wrlock_held (struct xeventq *evq, struct nn_xmsg *msg, int f
|
|||
os_mutexUnlock (&evq->lock);
|
||||
nn_xmsg_free (msg);
|
||||
#if 0
|
||||
TRACE ((" qxev_msg_rexmit%s drop (sz %"PA_PRIuSIZE" qb %"PA_PRIuSIZE" qm %"PA_PRIuSIZE")", force ? "!" : "",
|
||||
msg_size, evq->queued_rexmit_bytes, evq->queued_rexmit_msgs));
|
||||
DDS_TRACE(" qxev_msg_rexmit%s drop (sz %"PA_PRIuSIZE" qb %"PA_PRIuSIZE" qm %"PA_PRIuSIZE")", force ? "!" : "",
|
||||
msg_size, evq->queued_rexmit_bytes, evq->queued_rexmit_msgs);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@ -1526,7 +1526,7 @@ int qxev_msg_rexmit_wrlock_held (struct xeventq *evq, struct nn_xmsg *msg, int f
|
|||
evq->queued_rexmit_msgs++;
|
||||
qxev_insert_nt (ev);
|
||||
#if 0
|
||||
TRACE (("AAA(%p,%"PA_PRIuSIZE")", (void *) ev, msg_size));
|
||||
DDS_TRACE("AAA(%p,%"PA_PRIuSIZE")", (void *) ev, msg_size);
|
||||
#endif
|
||||
os_mutexUnlock (&evq->lock);
|
||||
return 2;
|
||||
|
|
|
@ -256,7 +256,7 @@ static void nn_xmsg_realfree_wrap (void *elem)
|
|||
void nn_xmsgpool_free (struct nn_xmsgpool *pool)
|
||||
{
|
||||
nn_freelist_fini (&pool->freelist, nn_xmsg_realfree_wrap);
|
||||
TRACE (("xmsgpool_free(%p)\n", pool));
|
||||
DDS_TRACE("xmsgpool_free(%p)\n", pool);
|
||||
os_free (pool);
|
||||
}
|
||||
|
||||
|
@ -588,7 +588,7 @@ int nn_xmsg_setdstPRD (struct nn_xmsg *m, const struct proxy_reader *prd)
|
|||
}
|
||||
else
|
||||
{
|
||||
NN_WARNING("nn_xmsg_setdstPRD: no address for %x:%x:%x:%x", PGUID (prd->e.guid));
|
||||
DDS_WARNING("nn_xmsg_setdstPRD: no address for %x:%x:%x:%x", PGUID (prd->e.guid));
|
||||
return ERR_NO_ADDRESS;
|
||||
}
|
||||
}
|
||||
|
@ -601,7 +601,7 @@ int nn_xmsg_setdstPWR (struct nn_xmsg *m, const struct proxy_writer *pwr)
|
|||
nn_xmsg_setdst1 (m, &pwr->e.guid.prefix, &loc);
|
||||
return 0;
|
||||
}
|
||||
NN_WARNING ("nn_xmsg_setdstPRD: no address for %x:%x:%x:%x", PGUID (pwr->e.guid));
|
||||
DDS_WARNING("nn_xmsg_setdstPRD: no address for %x:%x:%x:%x", PGUID (pwr->e.guid));
|
||||
return ERR_NO_ADDRESS;
|
||||
}
|
||||
|
||||
|
@ -657,8 +657,8 @@ int nn_xmsg_merge_rexmit_destinations_wrlock_held (struct nn_xmsg *m, const stru
|
|||
assert (m->kindspecific.data.readerId_off != 0);
|
||||
assert (madd->kindspecific.data.readerId_off != 0);
|
||||
|
||||
TRACE ((" (%x:%x:%x:%x#%"PRId64"/%u:",
|
||||
PGUID (m->kindspecific.data.wrguid), m->kindspecific.data.wrseq, m->kindspecific.data.wrfragid + 1));
|
||||
DDS_TRACE(" (%x:%x:%x:%x#%"PRId64"/%u:",
|
||||
PGUID (m->kindspecific.data.wrguid), m->kindspecific.data.wrseq, m->kindspecific.data.wrfragid + 1);
|
||||
|
||||
switch (m->dstmode)
|
||||
{
|
||||
|
@ -667,7 +667,7 @@ int nn_xmsg_merge_rexmit_destinations_wrlock_held (struct nn_xmsg *m, const stru
|
|||
return 0;
|
||||
|
||||
case NN_XMSG_DST_ALL:
|
||||
TRACE (("*->*)"));
|
||||
DDS_TRACE("*->*)");
|
||||
return 1;
|
||||
|
||||
case NN_XMSG_DST_ONE:
|
||||
|
@ -678,7 +678,7 @@ int nn_xmsg_merge_rexmit_destinations_wrlock_held (struct nn_xmsg *m, const stru
|
|||
return 0;
|
||||
|
||||
case NN_XMSG_DST_ALL:
|
||||
TRACE (("1+*->*)"));
|
||||
DDS_TRACE("1+*->*)");
|
||||
clear_readerId (m);
|
||||
m->dstmode = NN_XMSG_DST_ALL;
|
||||
m->dstaddr.all.as = ref_addrset (madd->dstaddr.all.as);
|
||||
|
@ -697,12 +697,12 @@ int nn_xmsg_merge_rexmit_destinations_wrlock_held (struct nn_xmsg *m, const stru
|
|||
can go and everyone's life will become easier! */
|
||||
if ((wr = ephash_lookup_writer_guid (&m->kindspecific.data.wrguid)) == NULL)
|
||||
{
|
||||
TRACE (("writer-dead)"));
|
||||
DDS_TRACE("writer-dead)");
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE (("1+1->*)"));
|
||||
DDS_TRACE("1+1->*)");
|
||||
clear_readerId (m);
|
||||
m->dstmode = NN_XMSG_DST_ALL;
|
||||
m->dstaddr.all.as = ref_addrset (wr->as);
|
||||
|
@ -712,12 +712,12 @@ int nn_xmsg_merge_rexmit_destinations_wrlock_held (struct nn_xmsg *m, const stru
|
|||
}
|
||||
else if (readerId_compatible (m, madd))
|
||||
{
|
||||
TRACE (("1+1->1)"));
|
||||
DDS_TRACE("1+1->1)");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE (("1+1->2)"));
|
||||
DDS_TRACE("1+1->2)");
|
||||
clear_readerId (m);
|
||||
return 1;
|
||||
}
|
||||
|
@ -1181,19 +1181,19 @@ static void nn_bw_limit_sleep_if_needed(struct nn_bw_limiter* this, ssize_t size
|
|||
this->balance += (target_interval - actual_interval);
|
||||
|
||||
|
||||
TRACE ((" <limiter(us):%"PRId64"",(target_interval - actual_interval)/1000));
|
||||
DDS_TRACE(" <limiter(us):%"PRId64"",(target_interval - actual_interval)/1000);
|
||||
|
||||
if ( this->balance < NN_BW_LIMIT_MAX_BUFFER )
|
||||
{
|
||||
/* We're below the bandwidth limit, do not further accumulate */
|
||||
this->balance = NN_BW_LIMIT_MAX_BUFFER;
|
||||
TRACE ((":%"PRId64":max",this->balance/1000));
|
||||
DDS_TRACE(":%"PRId64":max",this->balance/1000);
|
||||
}
|
||||
else if ( this->balance > NN_BW_LIMIT_MIN_SLEEP )
|
||||
{
|
||||
/* We're over the bandwidth limit far enough, to warrent a sleep. */
|
||||
os_time delay;
|
||||
TRACE ((":%"PRId64":sleep",this->balance/1000));
|
||||
DDS_TRACE(":%"PRId64":sleep",this->balance/1000);
|
||||
delay.tv_sec = (int32_t) (this->balance / T_SECOND);
|
||||
delay.tv_nsec = (int32_t) (this->balance % T_SECOND);
|
||||
thread_state_blocked (lookup_thread_state ());
|
||||
|
@ -1202,9 +1202,9 @@ static void nn_bw_limit_sleep_if_needed(struct nn_bw_limiter* this, ssize_t size
|
|||
}
|
||||
else
|
||||
{
|
||||
TRACE ((":%"PRId64"",this->balance/1000));
|
||||
DDS_TRACE(":%"PRId64"",this->balance/1000);
|
||||
}
|
||||
TRACE ((">"));
|
||||
DDS_TRACE(">");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1312,10 +1312,10 @@ static ssize_t nn_xpack_send1 (const nn_locator_t *loc, void * varg)
|
|||
struct nn_xpack * xp = varg;
|
||||
ssize_t nbytes = 0;
|
||||
|
||||
if (config.enabled_logcats & LC_TRACE)
|
||||
if (dds_get_log_mask() & DDS_LC_TRACE)
|
||||
{
|
||||
char buf[DDSI_LOCSTRLEN];
|
||||
TRACE ((" %s", ddsi_locator_to_string (buf, sizeof(buf), loc)));
|
||||
DDS_TRACE(" %s", ddsi_locator_to_string (buf, sizeof(buf), loc));
|
||||
}
|
||||
|
||||
if (config.xmit_lossiness > 0)
|
||||
|
@ -1324,7 +1324,7 @@ static ssize_t nn_xpack_send1 (const nn_locator_t *loc, void * varg)
|
|||
of all packets to be sent */
|
||||
if ((random () % 1000) < config.xmit_lossiness)
|
||||
{
|
||||
TRACE (("(dropped)"));
|
||||
DDS_TRACE("(dropped)");
|
||||
xp->call_flags = 0;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1344,7 +1344,7 @@ static ssize_t nn_xpack_send1 (const nn_locator_t *loc, void * varg)
|
|||
nbytes = ddsi_conn_write (xp->conn, loc, xp->niov, xp->iov, xp->call_flags);
|
||||
else
|
||||
{
|
||||
TRACE (("(dropped)"));
|
||||
DDS_TRACE("(dropped)");
|
||||
nbytes = (ssize_t) xp->msg_len.length;
|
||||
}
|
||||
}
|
||||
|
@ -1406,17 +1406,17 @@ static void nn_xpack_send_real (struct nn_xpack * xp)
|
|||
|
||||
assert (xp->dstmode != NN_XMSG_DST_UNSET);
|
||||
|
||||
if (config.enabled_logcats & LC_TRACE)
|
||||
if (dds_get_log_mask() & DDS_LC_TRACE)
|
||||
{
|
||||
int i;
|
||||
TRACE (("nn_xpack_send %u:", xp->msg_len.length));
|
||||
DDS_TRACE("nn_xpack_send %u:", xp->msg_len.length);
|
||||
for (i = 0; i < (int) xp->niov; i++)
|
||||
{
|
||||
TRACE ((" %p:%lu", (void *) xp->iov[i].iov_base, (unsigned long) xp->iov[i].iov_len));
|
||||
DDS_TRACE(" %p:%lu", (void *) xp->iov[i].iov_base, (unsigned long) xp->iov[i].iov_len);
|
||||
}
|
||||
}
|
||||
|
||||
TRACE ((" ["));
|
||||
DDS_TRACE(" [");
|
||||
if (xp->dstmode == NN_XMSG_DST_ONE)
|
||||
{
|
||||
calls = 1;
|
||||
|
@ -1459,10 +1459,10 @@ static void nn_xpack_send_real (struct nn_xpack * xp)
|
|||
unref_addrset (xp->dstaddr.all.as_group);
|
||||
}
|
||||
}
|
||||
TRACE ((" ]\n"));
|
||||
DDS_TRACE(" ]\n");
|
||||
if (calls)
|
||||
{
|
||||
nn_log (LC_TRAFFIC, "traffic-xmit (%lu) %u\n", (unsigned long) calls, xp->msg_len.length);
|
||||
DDS_LOG(DDS_LC_TRAFFIC, "traffic-xmit (%lu) %u\n", (unsigned long) calls, xp->msg_len.length);
|
||||
}
|
||||
nn_xmsg_chain_release (&xp->included_msgs);
|
||||
nn_xpack_reinit (xp);
|
||||
|
@ -1692,22 +1692,22 @@ int nn_xpack_addmsg (struct nn_xpack *xp, struct nn_xmsg *m, const uint32_t flag
|
|||
But do make sure we can't run out of iovecs. */
|
||||
assert (niov + NN_XMSG_MAX_SUBMESSAGE_IOVECS <= NN_XMSG_MAX_MESSAGE_IOVECS);
|
||||
|
||||
TRACE (("xpack_addmsg %p %p %u(", (void *) xp, (void *) m, flags));
|
||||
DDS_TRACE("xpack_addmsg %p %p %u(", (void *) xp, (void *) m, flags);
|
||||
switch (m->kind)
|
||||
{
|
||||
case NN_XMSG_KIND_CONTROL:
|
||||
TRACE (("control"));
|
||||
DDS_TRACE("control");
|
||||
break;
|
||||
case NN_XMSG_KIND_DATA:
|
||||
case NN_XMSG_KIND_DATA_REXMIT:
|
||||
TRACE (("%s(%x:%x:%x:%x:#%"PRId64"/%u)",
|
||||
DDS_TRACE("%s(%x:%x:%x:%x:#%"PRId64"/%u)",
|
||||
(m->kind == NN_XMSG_KIND_DATA) ? "data" : "rexmit",
|
||||
PGUID (m->kindspecific.data.wrguid),
|
||||
m->kindspecific.data.wrseq,
|
||||
m->kindspecific.data.wrfragid + 1));
|
||||
m->kindspecific.data.wrfragid + 1);
|
||||
break;
|
||||
}
|
||||
TRACE (("): niov %d sz %"PRIuSIZE, (int) niov, sz));
|
||||
DDS_TRACE("): niov %d sz %"PRIuSIZE, (int) niov, sz);
|
||||
|
||||
/* If a fresh xp has been provided, add an RTPS header */
|
||||
|
||||
|
@ -1835,7 +1835,7 @@ int nn_xpack_addmsg (struct nn_xpack *xp, struct nn_xmsg *m, const uint32_t flag
|
|||
|
||||
if (xpo_niov > 0 && sz > config.max_msg_size)
|
||||
{
|
||||
TRACE ((" => now niov %d sz %"PRIuSIZE" > max_msg_size %u, nn_xpack_send niov %d sz %u now\n", (int) niov, sz, config.max_msg_size, (int) xpo_niov, xpo_sz));
|
||||
DDS_TRACE(" => now niov %d sz %"PRIuSIZE" > max_msg_size %u, nn_xpack_send niov %d sz %u now\n", (int) niov, sz, config.max_msg_size, (int) xpo_niov, xpo_sz);
|
||||
xp->msg_len.length = xpo_sz;
|
||||
xp->niov = xpo_niov;
|
||||
nn_xpack_send (xp, false);
|
||||
|
@ -1845,7 +1845,7 @@ int nn_xpack_addmsg (struct nn_xpack *xp, struct nn_xmsg *m, const uint32_t flag
|
|||
{
|
||||
xp->call_flags = flags;
|
||||
nn_xmsg_chain_add (&xp->included_msgs, m);
|
||||
TRACE ((" => now niov %d sz %"PRIuSIZE"\n", (int) niov, sz));
|
||||
DDS_TRACE(" => now niov %d sz %"PRIuSIZE"\n", (int) niov, sz);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -267,17 +267,17 @@ static void log_stacktrace_sigh (int sig __attribute__ ((unused)))
|
|||
|
||||
void log_stacktrace (const char *name, os_threadId tid)
|
||||
{
|
||||
if (config.enabled_logcats == 0)
|
||||
if (dds_get_log_mask() == 0)
|
||||
; /* no op if nothing logged */
|
||||
else if (!config.noprogress_log_stacktraces)
|
||||
nn_log (~0u, "-- stack trace of %s requested, but traces disabled --\n", name);
|
||||
DDS_LOG(~0u, "-- stack trace of %s requested, but traces disabled --\n", name);
|
||||
else
|
||||
{
|
||||
const os_time d = { 0, 1000000 };
|
||||
struct sigaction act, oact;
|
||||
char **strs;
|
||||
int i;
|
||||
nn_log (~0u, "-- stack trace of %s requested --\n", name);
|
||||
DDS_LOG(~0u, "-- stack trace of %s requested --\n", name);
|
||||
act.sa_handler = log_stacktrace_sigh;
|
||||
act.sa_flags = 0;
|
||||
sigfillset (&act.sa_mask);
|
||||
|
@ -289,15 +289,15 @@ void log_stacktrace (const char *name, os_threadId tid)
|
|||
os_nanoSleep (d);
|
||||
sigaction (SIGXCPU, &oact, NULL);
|
||||
if (pthread_kill (tid.v, 0) != 0)
|
||||
nn_log (~0u, "-- thread exited --\n");
|
||||
DDS_LOG(~0u, "-- thread exited --\n");
|
||||
else
|
||||
{
|
||||
nn_log (~0u, "-- stack trace follows --\n");
|
||||
DDS_LOG(~0u, "-- stack trace follows --\n");
|
||||
strs = backtrace_symbols (log_stacktrace_stk.stk, log_stacktrace_stk.depth);
|
||||
for (i = 0; i < log_stacktrace_stk.depth; i++)
|
||||
nn_log (~0u, "%s\n", strs[i]);
|
||||
DDS_LOG(~0u, "%s\n", strs[i]);
|
||||
free (strs);
|
||||
nn_log (~0u, "-- end of stack trace --\n");
|
||||
DDS_LOG(~0u, "-- end of stack trace --\n");
|
||||
}
|
||||
os_atomic_st32 (&log_stacktrace_flag, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue