Remove use of globals from config processing
Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
782f032df8
commit
f05dd6ac07
6 changed files with 56 additions and 58 deletions
|
@ -52,7 +52,7 @@ static dds_return_t dds_domain_init (dds_domain *domain, dds_domainid_t domain_i
|
||||||
gv.tstart = now ();
|
gv.tstart = now ();
|
||||||
|
|
||||||
(void) ddsrt_getenv ("CYCLONEDDS_URI", &uri);
|
(void) ddsrt_getenv ("CYCLONEDDS_URI", &uri);
|
||||||
domain->cfgst = config_init (uri);
|
domain->cfgst = config_init (uri, &config);
|
||||||
if (domain->cfgst == NULL)
|
if (domain->cfgst == NULL)
|
||||||
{
|
{
|
||||||
DDS_LOG (DDS_LC_CONFIG, "Failed to parse configuration XML file %s\n", uri);
|
DDS_LOG (DDS_LC_CONFIG, "Failed to parse configuration XML file %s\n", uri);
|
||||||
|
|
|
@ -158,7 +158,7 @@ static void dds_writer_status_cb (void *ventity, const status_cb_data_t *data)
|
||||||
static uint32_t get_bandwidth_limit (dds_transport_priority_qospolicy_t transport_priority)
|
static uint32_t get_bandwidth_limit (dds_transport_priority_qospolicy_t transport_priority)
|
||||||
{
|
{
|
||||||
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
||||||
struct config_channel_listelem *channel = find_channel (transport_priority);
|
struct config_channel_listelem *channel = find_channel (&config, transport_priority);
|
||||||
return channel->data_bandwidth_limit;
|
return channel->data_bandwidth_limit;
|
||||||
#else
|
#else
|
||||||
(void) transport_priority;
|
(void) transport_priority;
|
||||||
|
|
|
@ -396,18 +396,18 @@ extern struct config DDS_EXPORT config;
|
||||||
|
|
||||||
struct cfgst;
|
struct cfgst;
|
||||||
|
|
||||||
struct cfgst *config_init (const char *configfile);
|
struct cfgst *config_init (const char *configfile, struct config *cfg);
|
||||||
void config_print_cfgst (struct cfgst *cfgst);
|
void config_print_cfgst (struct cfgst *cfgst);
|
||||||
void config_free_source_info (struct cfgst *cfgst);
|
void config_free_source_info (struct cfgst *cfgst);
|
||||||
void config_fini (struct cfgst *cfgst);
|
void config_fini (struct cfgst *cfgst);
|
||||||
|
|
||||||
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
|
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
|
||||||
struct config_partitionmapping_listelem *find_partitionmapping (const char *partition, const char *topic);
|
struct config_partitionmapping_listelem *find_partitionmapping (const struct config *cfg, const char *partition, const char *topic);
|
||||||
struct config_networkpartition_listelem *find_networkpartition_by_id (uint32_t id);
|
struct config_networkpartition_listelem *find_networkpartition_by_id (const struct config *cfg, uint32_t id);
|
||||||
int is_ignored_partition (const char *partition, const char *topic);
|
int is_ignored_partition (const struct config *cfg, const char *partition, const char *topic);
|
||||||
#endif
|
#endif
|
||||||
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
||||||
struct config_channel_listelem *find_channel (nn_transport_priority_qospolicy_t transport_priority);
|
struct config_channel_listelem *find_channel (const struct config *cfg, nn_transport_priority_qospolicy_t transport_priority);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (__cplusplus)
|
#if defined (__cplusplus)
|
||||||
|
|
|
@ -1500,7 +1500,7 @@ static void pf_logcat (struct cfgst *cfgst, UNUSED_ARG (void *parent), UNUSED_AR
|
||||||
assert (key.e != NULL);
|
assert (key.e != NULL);
|
||||||
if ((n = ddsrt_avl_lookup_succ_eq (&cfgst_found_treedef, &cfgst->found, &key)) != NULL && n->key.e == key.e)
|
if ((n = ddsrt_avl_lookup_succ_eq (&cfgst_found_treedef, &cfgst->found, &key)) != NULL && n->key.e == key.e)
|
||||||
sources |= n->sources;
|
sources |= n->sources;
|
||||||
do_print_uint32_bitset (cfgst, config.enabled_logcats, sizeof (logcat_codes) / sizeof (*logcat_codes), logcat_names, logcat_codes, sources, "");
|
do_print_uint32_bitset (cfgst, cfgst->cfg->enabled_logcats, sizeof (logcat_codes) / sizeof (*logcat_codes), logcat_names, logcat_codes, sources, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *xcheck_names[] = {
|
static const char *xcheck_names[] = {
|
||||||
|
@ -2535,30 +2535,30 @@ static FILE *config_open_file (char *tok, char **cursor)
|
||||||
return fp;
|
return fp;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct cfgst *config_init (const char *configfile)
|
struct cfgst *config_init (const char *configfile, struct config *cfg)
|
||||||
{
|
{
|
||||||
int ok = 1;
|
int ok = 1;
|
||||||
struct cfgst *cfgst;
|
struct cfgst *cfgst;
|
||||||
|
|
||||||
memset (&config, 0, sizeof (config));
|
memset (cfg, 0, sizeof (*cfg));
|
||||||
|
|
||||||
config.tracingOutputFile = stderr;
|
cfgst = ddsrt_malloc (sizeof (*cfgst));
|
||||||
config.enabled_logcats = DDS_LC_ERROR | DDS_LC_WARNING;
|
memset (cfgst, 0, sizeof (*cfgst));
|
||||||
|
ddsrt_avl_init (&cfgst_found_treedef, &cfgst->found);
|
||||||
|
cfgst->cfg = cfg;
|
||||||
|
cfgst->error = 0;
|
||||||
|
cfgst->source = 0;
|
||||||
|
cfgst->enabled_logcats = 0;
|
||||||
|
|
||||||
|
/* Initial logging configuration: configuration errors and warnings are dumped to stderr */
|
||||||
|
cfgst->cfg->tracingOutputFile = stderr;
|
||||||
|
cfgst->cfg->enabled_logcats = DDS_LC_ERROR | DDS_LC_WARNING;
|
||||||
|
|
||||||
/* eventually, we domainId.value will be the real domain id selected, even if it was configured
|
/* 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
|
to the default of "any" and has "isdefault" set; initializing it to the default-default
|
||||||
value of 0 means "any" in the config & DDS_DOMAIN_DEFAULT in create participant automatically
|
value of 0 means "any" in the config & DDS_DOMAIN_DEFAULT in create participant automatically
|
||||||
ends up on the right value */
|
ends up on the right value */
|
||||||
config.domainId.value = 0;
|
cfgst->cfg->domainId.value = 0;
|
||||||
|
|
||||||
cfgst = ddsrt_malloc (sizeof (*cfgst));
|
|
||||||
memset (cfgst, 0, sizeof (*cfgst));
|
|
||||||
|
|
||||||
ddsrt_avl_init (&cfgst_found_treedef, &cfgst->found);
|
|
||||||
cfgst->cfg = &config;
|
|
||||||
cfgst->error = 0;
|
|
||||||
cfgst->source = 0;
|
|
||||||
cfgst->enabled_logcats = 0;
|
|
||||||
|
|
||||||
/* configfile == NULL will get you the default configuration */
|
/* configfile == NULL will get you the default configuration */
|
||||||
if (configfile) {
|
if (configfile) {
|
||||||
|
@ -2597,7 +2597,7 @@ struct cfgst *config_init (const char *configfile)
|
||||||
}
|
}
|
||||||
|
|
||||||
cfgst->implicit_toplevel = (fp == NULL) ? ITL_ALLOWED : ITL_DISALLOWED;
|
cfgst->implicit_toplevel = (fp == NULL) ? ITL_ALLOWED : ITL_DISALLOWED;
|
||||||
cfgst_push (cfgst, 0, &root_cfgelem, &config);
|
cfgst_push (cfgst, 0, &root_cfgelem, cfgst->cfg);
|
||||||
ok = (ddsrt_xmlp_parse (qx) >= 0) && !cfgst->error;
|
ok = (ddsrt_xmlp_parse (qx) >= 0) && !cfgst->error;
|
||||||
assert (!ok ||
|
assert (!ok ||
|
||||||
(cfgst->path_depth == 1 && cfgst->implicit_toplevel != ITL_INSERTED) ||
|
(cfgst->path_depth == 1 && cfgst->implicit_toplevel != ITL_INSERTED) ||
|
||||||
|
@ -2632,9 +2632,9 @@ struct cfgst *config_init (const char *configfile)
|
||||||
{
|
{
|
||||||
case TRANS_DEFAULT:
|
case TRANS_DEFAULT:
|
||||||
if (cfgst->cfg->compat_tcp_enable == BOOLDEF_TRUE)
|
if (cfgst->cfg->compat_tcp_enable == BOOLDEF_TRUE)
|
||||||
cfgst->cfg->transport_selector = (config.compat_use_ipv6 == BOOLDEF_TRUE) ? TRANS_TCP6 : TRANS_TCP;
|
cfgst->cfg->transport_selector = (cfgst->cfg->compat_use_ipv6 == BOOLDEF_TRUE) ? TRANS_TCP6 : TRANS_TCP;
|
||||||
else
|
else
|
||||||
cfgst->cfg->transport_selector = (config.compat_use_ipv6 == BOOLDEF_TRUE) ? TRANS_UDP6 : TRANS_UDP;
|
cfgst->cfg->transport_selector = (cfgst->cfg->compat_use_ipv6 == BOOLDEF_TRUE) ? TRANS_UDP6 : TRANS_UDP;
|
||||||
break;
|
break;
|
||||||
case TRANS_TCP:
|
case TRANS_TCP:
|
||||||
ok1 = !(cfgst->cfg->compat_tcp_enable == BOOLDEF_FALSE || cfgst->cfg->compat_use_ipv6 == BOOLDEF_TRUE);
|
ok1 = !(cfgst->cfg->compat_tcp_enable == BOOLDEF_FALSE || cfgst->cfg->compat_use_ipv6 == BOOLDEF_TRUE);
|
||||||
|
@ -2671,7 +2671,7 @@ struct cfgst *config_init (const char *configfile)
|
||||||
#ifdef DDSI_INCLUDE_ENCRYPTION
|
#ifdef DDSI_INCLUDE_ENCRYPTION
|
||||||
/* Check security profiles */
|
/* Check security profiles */
|
||||||
{
|
{
|
||||||
struct config_securityprofile_listelem *s = config.securityProfiles;
|
struct config_securityprofile_listelem *s = cfgst->cfg->securityProfiles;
|
||||||
while (s)
|
while (s)
|
||||||
{
|
{
|
||||||
switch (s->cipher)
|
switch (s->cipher)
|
||||||
|
@ -2708,8 +2708,8 @@ struct cfgst *config_init (const char *configfile)
|
||||||
securityProfiles and signal errors if profiles do not exist */
|
securityProfiles and signal errors if profiles do not exist */
|
||||||
#endif /* DDSI_INCLUDE_ENCRYPTION */
|
#endif /* DDSI_INCLUDE_ENCRYPTION */
|
||||||
{
|
{
|
||||||
struct config_networkpartition_listelem *p = config.networkPartitions;
|
struct config_networkpartition_listelem *p = cfgst->cfg->networkPartitions;
|
||||||
config.nof_networkPartitions = 0;
|
cfgst->cfg->nof_networkPartitions = 0;
|
||||||
while (p)
|
while (p)
|
||||||
{
|
{
|
||||||
#ifdef DDSI_INCLUDE_ENCRYPTION
|
#ifdef DDSI_INCLUDE_ENCRYPTION
|
||||||
|
@ -2717,7 +2717,7 @@ struct cfgst *config_init (const char *configfile)
|
||||||
p->securityProfile = NULL;
|
p->securityProfile = NULL;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct config_securityprofile_listelem *s = config.securityProfiles;
|
struct config_securityprofile_listelem *s = cfgst->cfg->securityProfiles;
|
||||||
while (s && ddsrt_strcasecmp(p->profileName, s->name) != 0)
|
while (s && ddsrt_strcasecmp(p->profileName, s->name) != 0)
|
||||||
s = s->next;
|
s = s->next;
|
||||||
if (s)
|
if (s)
|
||||||
|
@ -2729,12 +2729,12 @@ struct cfgst *config_init (const char *configfile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* DDSI_INCLUDE_ENCRYPTION */
|
#endif /* DDSI_INCLUDE_ENCRYPTION */
|
||||||
config.nof_networkPartitions++;
|
cfgst->cfg->nof_networkPartitions++;
|
||||||
/* also use crc32 just like native nw and ordinary ddsi2e, only
|
/* also use crc32 just like native nw and ordinary ddsi2e, only
|
||||||
for interoperability because it is asking for trouble &
|
for interoperability because it is asking for trouble &
|
||||||
forces us to include a crc32 routine when we have md5
|
forces us to include a crc32 routine when we have md5
|
||||||
available anyway */
|
available anyway */
|
||||||
p->partitionId = config.nof_networkPartitions; /* starting at 1 */
|
p->partitionId = cfgst->cfg->nof_networkPartitions; /* starting at 1 */
|
||||||
p->partitionHash = crc32_calc(p->name, strlen(p->name));
|
p->partitionHash = crc32_calc(p->name, strlen(p->name));
|
||||||
p = p->next;
|
p = p->next;
|
||||||
}
|
}
|
||||||
|
@ -2743,10 +2743,10 @@ struct cfgst *config_init (const char *configfile)
|
||||||
/* Create links from the partitionmappings to the network partitions
|
/* Create links from the partitionmappings to the network partitions
|
||||||
and signal errors if partitions do not exist */
|
and signal errors if partitions do not exist */
|
||||||
{
|
{
|
||||||
struct config_partitionmapping_listelem * m = config.partitionMappings;
|
struct config_partitionmapping_listelem * m = cfgst->cfg->partitionMappings;
|
||||||
while (m)
|
while (m)
|
||||||
{
|
{
|
||||||
struct config_networkpartition_listelem * p = config.networkPartitions;
|
struct config_networkpartition_listelem * p = cfgst->cfg->networkPartitions;
|
||||||
while (p && ddsrt_strcasecmp(m->networkPartition, p->name) != 0)
|
while (p && ddsrt_strcasecmp(m->networkPartition, p->name) != 0)
|
||||||
p = p->next;
|
p = p->next;
|
||||||
if (p)
|
if (p)
|
||||||
|
@ -2762,11 +2762,11 @@ struct cfgst *config_init (const char *configfile)
|
||||||
#endif /* DDSI_INCLUDE_NETWORK_PARTITIONS */
|
#endif /* DDSI_INCLUDE_NETWORK_PARTITIONS */
|
||||||
|
|
||||||
/* Now switch to configured tracing settings */
|
/* Now switch to configured tracing settings */
|
||||||
config.enabled_logcats = cfgst->enabled_logcats;
|
cfgst->cfg->enabled_logcats = cfgst->enabled_logcats;
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
config.valid = 1;
|
cfgst->cfg->valid = 1;
|
||||||
return cfgst;
|
return cfgst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2793,18 +2793,16 @@ void config_free_source_info (struct cfgst *cfgst)
|
||||||
void config_fini (struct cfgst *cfgst)
|
void config_fini (struct cfgst *cfgst)
|
||||||
{
|
{
|
||||||
assert (cfgst);
|
assert (cfgst);
|
||||||
assert (cfgst->cfg == &config);
|
assert (cfgst->cfg != NULL);
|
||||||
assert (config.valid);
|
assert (cfgst->cfg->valid);
|
||||||
|
|
||||||
free_all_elements (cfgst, cfgst->cfg, root_cfgelems);
|
free_all_elements (cfgst, cfgst->cfg, root_cfgelems);
|
||||||
dds_set_log_file (stderr);
|
dds_set_log_file (stderr);
|
||||||
dds_set_trace_file (stderr);
|
dds_set_trace_file (stderr);
|
||||||
if (config.tracingOutputFile && config.tracingOutputFile != stdout && config.tracingOutputFile != stderr) {
|
if (cfgst->cfg->tracingOutputFile && cfgst->cfg->tracingOutputFile != stdout && cfgst->cfg->tracingOutputFile != stderr) {
|
||||||
fclose(config.tracingOutputFile);
|
fclose(cfgst->cfg->tracingOutputFile);
|
||||||
}
|
}
|
||||||
memset (&config, 0, sizeof (config));
|
memset (cfgst->cfg, 0, sizeof (*cfgst->cfg));
|
||||||
config.valid = 0;
|
|
||||||
|
|
||||||
ddsrt_avl_free (&cfgst_found_treedef, &cfgst->found, ddsrt_free);
|
ddsrt_avl_free (&cfgst_found_treedef, &cfgst->found, ddsrt_free);
|
||||||
ddsrt_free (cfgst);
|
ddsrt_free (cfgst);
|
||||||
}
|
}
|
||||||
|
@ -2818,31 +2816,31 @@ static char *get_partition_search_pattern (const char *partition, const char *to
|
||||||
return pt;
|
return pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct config_partitionmapping_listelem *find_partitionmapping (const char *partition, const char *topic)
|
struct config_partitionmapping_listelem *find_partitionmapping (const struct config *cfg, const char *partition, const char *topic)
|
||||||
{
|
{
|
||||||
char *pt = get_partition_search_pattern (partition, topic);
|
char *pt = get_partition_search_pattern (partition, topic);
|
||||||
struct config_partitionmapping_listelem *pm;
|
struct config_partitionmapping_listelem *pm;
|
||||||
for (pm = config.partitionMappings; pm; pm = pm->next)
|
for (pm = cfg->partitionMappings; pm; pm = pm->next)
|
||||||
if (WildcardOverlap (pt, pm->DCPSPartitionTopic))
|
if (WildcardOverlap (pt, pm->DCPSPartitionTopic))
|
||||||
break;
|
break;
|
||||||
ddsrt_free (pt);
|
ddsrt_free (pt);
|
||||||
return pm;
|
return pm;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct config_networkpartition_listelem *find_networkpartition_by_id (uint32_t id)
|
struct config_networkpartition_listelem *find_networkpartition_by_id (const struct config *cfg, uint32_t id)
|
||||||
{
|
{
|
||||||
struct config_networkpartition_listelem *np;
|
struct config_networkpartition_listelem *np;
|
||||||
for (np = config.networkPartitions; np; np = np->next)
|
for (np = cfg->networkPartitions; np; np = np->next)
|
||||||
if (np->partitionId == id)
|
if (np->partitionId == id)
|
||||||
return np;
|
return np;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int is_ignored_partition (const char *partition, const char *topic)
|
int is_ignored_partition (const struct config *cfg, const char *partition, const char *topic)
|
||||||
{
|
{
|
||||||
char *pt = get_partition_search_pattern (partition, topic);
|
char *pt = get_partition_search_pattern (partition, topic);
|
||||||
struct config_ignoredpartition_listelem *ip;
|
struct config_ignoredpartition_listelem *ip;
|
||||||
for (ip = config.ignoredPartitions; ip; ip = ip->next)
|
for (ip = cfg->ignoredPartitions; ip; ip = ip->next)
|
||||||
if (WildcardOverlap(pt, ip->DCPSPartitionTopic))
|
if (WildcardOverlap(pt, ip->DCPSPartitionTopic))
|
||||||
break;
|
break;
|
||||||
ddsrt_free (pt);
|
ddsrt_free (pt);
|
||||||
|
@ -2851,20 +2849,20 @@ int is_ignored_partition (const char *partition, const char *topic)
|
||||||
#endif /* DDSI_INCLUDE_NETWORK_PARTITIONS */
|
#endif /* DDSI_INCLUDE_NETWORK_PARTITIONS */
|
||||||
|
|
||||||
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
||||||
struct config_channel_listelem *find_channel (nn_transport_priority_qospolicy_t transport_priority)
|
struct config_channel_listelem *find_channel (const struct config *cfg, nn_transport_priority_qospolicy_t transport_priority)
|
||||||
{
|
{
|
||||||
struct config_channel_listelem *c;
|
struct config_channel_listelem *c;
|
||||||
/* Channel selection is to use the channel with the lowest priority
|
/* Channel selection is to use the channel with the lowest priority
|
||||||
not less than transport_priority, or else the one with the
|
not less than transport_priority, or else the one with the
|
||||||
highest priority. */
|
highest priority. */
|
||||||
assert(config.channels != NULL);
|
assert(cfg->channels != NULL);
|
||||||
assert(config.max_channel != NULL);
|
assert(cfg->max_channel != NULL);
|
||||||
for (c = config.channels; c; c = c->next)
|
for (c = cfg->channels; c; c = c->next)
|
||||||
{
|
{
|
||||||
assert(c->next == NULL || c->next->priority > c->priority);
|
assert(c->next == NULL || c->next->priority > c->priority);
|
||||||
if (transport_priority.value <= c->priority)
|
if (transport_priority.value <= c->priority)
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
return config.max_channel;
|
return cfg->max_channel;
|
||||||
}
|
}
|
||||||
#endif /* DDSI_INCLUDE_NETWORK_CHANNELS */
|
#endif /* DDSI_INCLUDE_NETWORK_CHANNELS */
|
||||||
|
|
|
@ -1265,7 +1265,7 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat
|
||||||
assert (!is_builtin_entityid (datap->endpoint_guid.entityid, vendorid));
|
assert (!is_builtin_entityid (datap->endpoint_guid.entityid, vendorid));
|
||||||
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
||||||
{
|
{
|
||||||
struct config_channel_listelem *channel = find_channel (xqos->transport_priority);
|
struct config_channel_listelem *channel = find_channel (&config, xqos->transport_priority);
|
||||||
new_proxy_writer (&ppguid, &datap->endpoint_guid, as, datap, channel->dqueue, channel->evq ? channel->evq : gv.xevents, timestamp);
|
new_proxy_writer (&ppguid, &datap->endpoint_guid, as, datap, channel->dqueue, channel->evq ? channel->evq : gv.xevents, timestamp);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -2501,7 +2501,7 @@ static int set_topic_type_name (dds_qos_t *xqos, const struct ddsi_sertopic * to
|
||||||
static uint32_t get_partitionid_from_mapping (const char *partition, const char *topic)
|
static uint32_t get_partitionid_from_mapping (const char *partition, const char *topic)
|
||||||
{
|
{
|
||||||
struct config_partitionmapping_listelem *pm;
|
struct config_partitionmapping_listelem *pm;
|
||||||
if ((pm = find_partitionmapping (partition, topic)) == NULL)
|
if ((pm = find_partitionmapping (&config, partition, topic)) == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2767,7 +2767,7 @@ static void new_writer_guid_common_init (struct writer *wr, const struct ddsi_se
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const struct config_networkpartition_listelem *np = find_networkpartition_by_id (wr->partition_id);
|
const struct config_networkpartition_listelem *np = find_networkpartition_by_id (&config, wr->partition_id);
|
||||||
assert (np);
|
assert (np);
|
||||||
if (addrset_any_ssm (np->as, &loc))
|
if (addrset_any_ssm (np->as, &loc))
|
||||||
have_loc = 1;
|
have_loc = 1;
|
||||||
|
@ -2789,7 +2789,7 @@ static void new_writer_guid_common_init (struct writer *wr, const struct ddsi_se
|
||||||
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
#ifdef DDSI_INCLUDE_NETWORK_CHANNELS
|
||||||
if (!is_builtin_entityid (wr->e.guid.entityid, ownvendorid))
|
if (!is_builtin_entityid (wr->e.guid.entityid, ownvendorid))
|
||||||
{
|
{
|
||||||
struct config_channel_listelem *channel = find_channel (wr->xqos->transport_priority);
|
struct config_channel_listelem *channel = find_channel (&config, wr->xqos->transport_priority);
|
||||||
DDS_LOG(DDS_LC_DISCOVERY, "writer "PGUIDFMT": transport priority %d => channel '%s' priority %d\n",
|
DDS_LOG(DDS_LC_DISCOVERY, "writer "PGUIDFMT": transport priority %d => channel '%s' priority %d\n",
|
||||||
PGUID (wr->e.guid), wr->xqos->transport_priority.value, channel->name, channel->priority);
|
PGUID (wr->e.guid), wr->xqos->transport_priority.value, channel->name, channel->priority);
|
||||||
wr->evq = channel->evq ? channel->evq : gv.xevents;
|
wr->evq = channel->evq ? channel->evq : gv.xevents;
|
||||||
|
@ -3121,7 +3121,7 @@ static struct addrset * get_as_from_mapping (const char *partition, const char *
|
||||||
{
|
{
|
||||||
struct config_partitionmapping_listelem *pm;
|
struct config_partitionmapping_listelem *pm;
|
||||||
struct addrset *as = new_addrset ();
|
struct addrset *as = new_addrset ();
|
||||||
if ((pm = find_partitionmapping (partition, topic)) != NULL)
|
if ((pm = find_partitionmapping (&config, partition, topic)) != NULL)
|
||||||
{
|
{
|
||||||
DDS_LOG(DDS_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);
|
assert (pm->partition->as);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue