start using the DDSI vendor id code for the Eclipse Foundation

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-02-04 22:41:15 +01:00
parent 92fca549cb
commit 98465035e6
14 changed files with 189 additions and 186 deletions

View file

@ -25,6 +25,7 @@ PREPEND(srcs_ddsi "${CMAKE_CURRENT_LIST_DIR}/src"
ddsi_rhc_plugin.c
ddsi_iid.c
ddsi_tkmap.c
ddsi_vendor.c
q_addrset.c
q_bitset_inlines.c
q_bswap.c
@ -77,6 +78,7 @@ PREPEND(hdrs_private_ddsi "${CMAKE_CURRENT_LIST_DIR}/include/ddsi"
ddsi_rhc_plugin.h
ddsi_iid.h
ddsi_tkmap.h
ddsi_vendor.h
probes-constants.h
q_addrset.h
q_bitset.h

View file

@ -0,0 +1,84 @@
/*
* Copyright(c) 2019 ADLINK Technology Limited and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
* v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
#ifndef DDSI_VENDOR_H
#define DDSI_VENDOR_H
#include <stdint.h>
#include <stdbool.h>
typedef struct {
uint8_t id[2];
} nn_vendorid_t;
/* All existing vendor codes have the major part equal to 1 (and this will probably be true for a long, long time) */
#define NN_VENDORID_MINOR_RTI 0x01
#define NN_VENDORID_MINOR_PRISMTECH_OSPL 0x02
#define NN_VENDORID_MINOR_OCI 0x03
#define NN_VENDORID_MINOR_MILSOFT 0x04
#define NN_VENDORID_MINOR_KONGSBERG 0x05
#define NN_VENDORID_MINOR_TWINOAKS 0x06
#define NN_VENDORID_MINOR_LAKOTA 0x07
#define NN_VENDORID_MINOR_ICOUP 0x08
#define NN_VENDORID_MINOR_ETRI 0x09
#define NN_VENDORID_MINOR_RTI_MICRO 0x0a
#define NN_VENDORID_MINOR_PRISMTECH_JAVA 0x0b
#define NN_VENDORID_MINOR_PRISMTECH_GATEWAY 0x0c
#define NN_VENDORID_MINOR_PRISMTECH_LITE 0x0d
#define NN_VENDORID_MINOR_TECHNICOLOR 0x0e
#define NN_VENDORID_MINOR_EPROSIMA 0x0f
#define NN_VENDORID_MINOR_ECLIPSE 0x10
#define NN_VENDORID_MINOR_PRISMTECH_CLOUD 0x20
#define NN_VENDORID_UNKNOWN ((nn_vendorid_t) {{ 0x00, 0x00 }})
#define NN_VENDORID_ECLIPSE ((nn_vendorid_t) {{ 0x01, 0x10 }})
#if defined (__cplusplus)
extern "C" {
#endif
inline bool vendor_equals (nn_vendorid_t a, nn_vendorid_t b) {
return ((a.id[0] << 8) | a.id[1]) == ((b.id[0] << 8) | b.id[1]);
}
inline bool vendor_is_eclipse (nn_vendorid_t vendor) {
return vendor_equals (vendor, NN_VENDORID_ECLIPSE);
}
inline bool vendor_is_rti (nn_vendorid_t vendor) {
return vendor_equals (vendor, (nn_vendorid_t) { 0x01, NN_VENDORID_MINOR_RTI });
}
inline bool vendor_is_opensplice (nn_vendorid_t vendor) {
return vendor_equals (vendor, (nn_vendorid_t) { 0x01, NN_VENDORID_MINOR_PRISMTECH_OSPL });
}
inline bool vendor_is_twinoaks (nn_vendorid_t vendor) {
return vendor_equals (vendor, (nn_vendorid_t) { 0x01, NN_VENDORID_MINOR_TWINOAKS });
}
inline bool vendor_is_cloud (nn_vendorid_t vendor) {
return vendor_equals (vendor, (nn_vendorid_t) { 0x01, NN_VENDORID_MINOR_PRISMTECH_CLOUD });
}
inline bool vendor_is_eclipse_or_opensplice (nn_vendorid_t vendor) {
return vendor_is_eclipse (vendor) | vendor_is_opensplice (vendor);
}
inline bool vendor_is_prismtech (nn_vendorid_t vendor) {
return (vendor_equals (vendor, (nn_vendorid_t) { 0x01, NN_VENDORID_MINOR_PRISMTECH_OSPL }) ||
vendor_equals (vendor, (nn_vendorid_t) { 0x01, NN_VENDORID_MINOR_PRISMTECH_LITE }) ||
vendor_equals (vendor, (nn_vendorid_t) { 0x01, NN_VENDORID_MINOR_PRISMTECH_GATEWAY }) ||
vendor_equals (vendor, (nn_vendorid_t) { 0x01, NN_VENDORID_MINOR_PRISMTECH_JAVA }) ||
vendor_equals (vendor, (nn_vendorid_t) { 0x01, NN_VENDORID_MINOR_PRISMTECH_CLOUD }));
}
inline bool vendor_is_eclipse_or_prismtech (nn_vendorid_t vendor) {
return vendor_is_eclipse (vendor) || vendor_is_prismtech (vendor);
}
#if defined (__cplusplus)
}
#endif
#endif /* DDSI_VENDOR_H */

View file

@ -18,27 +18,25 @@
extern "C" {
#endif
struct nn_guid;
inline seqno_t fromSN (const nn_sequence_number_t sn) {
return ((seqno_t) sn.high << 32) | sn.low;
}
inline nn_sequence_number_t toSN (seqno_t n) {
nn_sequence_number_t x;
x.high = (int) (n >> 32);
x.low = (unsigned) n;
return x;
}
int vendor_is_lite (nn_vendorid_t vendor);
int vendor_is_opensplice (nn_vendorid_t vid);
int vendor_is_rti (nn_vendorid_t vendor);
int vendor_is_twinoaks (nn_vendorid_t vendor);
int vendor_is_prismtech (nn_vendorid_t vendor);
int vendor_is_cloud (nn_vendorid_t vendor);
int is_own_vendor (nn_vendorid_t vendor);
unsigned char normalize_data_datafrag_flags (const SubmessageHeader_t *smhdr, int datafrag_as_data);
seqno_t fromSN (const nn_sequence_number_t sn);
nn_sequence_number_t toSN (seqno_t);
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
int WildcardOverlap(char * p1, char * p2);
#endif
int ddsi2_patmatch (const char *pat, const char *str);
uint32_t crc32_calc (const void *buf, size_t length);
#if defined (__cplusplus)

View file

@ -123,27 +123,6 @@ struct cdrstring {
#define NN_LOCATOR_KIND_UDPv4MCGEN 0x4fff0000
#define NN_LOCATOR_PORT_INVALID 0
#define NN_VENDORID_UNKNOWN {{ 0x00, 0x00 }}
#define NN_VENDORID_RTI {{ 0x01, 0x01 }}
#define NN_VENDORID_PRISMTECH_OSPL {{ 0x01, 0x02 }}
#define NN_VENDORID_OCI {{ 0x01, 0x03 }}
#define NN_VENDORID_MILSOFT {{ 0x01, 0x04 }}
#define NN_VENDORID_KONGSBERG {{ 0x01, 0x05 }}
#define NN_VENDORID_TWINOAKS {{ 0x01, 0x06 }}
#define NN_VENDORID_LAKOTA {{ 0x01, 0x07 }}
#define NN_VENDORID_ICOUP {{ 0x01, 0x08 }}
#define NN_VENDORID_ETRI {{ 0x01, 0x09 }}
#define NN_VENDORID_RTI_MICRO {{ 0x01, 0x0a }}
#define NN_VENDORID_PRISMTECH_JAVA {{ 0x01, 0x0b }}
#define NN_VENDORID_PRISMTECH_GATEWAY {{ 0x01, 0x0c }}
#define NN_VENDORID_PRISMTECH_LITE {{ 0x01, 0x0d }}
#define NN_VENDORID_TECHNICOLOR {{ 0x01, 0x0e }}
#define NN_VENDORID_EPROSIMA {{ 0x01, 0x0f }}
#define NN_VENDORID_PRISMTECH_CLOUD {{ 0x01, 0x20 }}
#define NN_VENDORID_ECLIPSE_CYCLONEDDS {{ 0x01, 0x0d }} // Since CYCLONEDDS has no owner yet, it uses the same VENDORID as LITE
#define MY_VENDOR_ID NN_VENDORID_ECLIPSE_CYCLONEDDS
/* Only one specific version is grokked */
#define RTPS_MAJOR 2
#define RTPS_MINOR 1
@ -155,15 +134,11 @@ typedef struct Header {
nn_vendorid_t vendorid;
nn_guid_prefix_t guid_prefix;
} Header_t;
#define NN_PROTOCOLID_INITIALIZER {{ 'R','T','P','S' }}
#if PLATFORM_IS_LITTLE_ENDIAN
#define NN_PROTOCOLID_AS_UINT32 (((uint32_t)'R' << 0) | ((uint32_t)'T' << 8) | ((uint32_t)'P' << 16) | ((uint32_t)'S' << 24))
#else
#define NN_PROTOCOLID_AS_UINT32 (((uint32_t)'R' << 24) | ((uint32_t)'T' << 16) | ((uint32_t)'P' << 8) | ((uint32_t)'S' << 0))
#endif
#define NN_PROTOCOL_VERSION_INITIALIZER { RTPS_MAJOR, RTPS_MINOR }
#define NN_VENDORID_INITIALIER MY_VENDOR_ID
#define NN_HEADER_INITIALIZER { NN_PROTOCOLID_INITIALIZER, NN_PROTOCOL_VERSION_INITIALIZER, NN_VENDORID_INITIALIER, NN_GUID_PREFIX_UNKNOWN_INITIALIZER }
#define RTPS_MESSAGE_HEADER_SIZE (sizeof (Header_t))
typedef struct SubmessageHeader {

View file

@ -13,16 +13,14 @@
#define NN_RTPS_H
#include "os/os_defs.h"
#include "ddsi/ddsi_vendor.h"
#if defined (__cplusplus)
extern "C" {
#endif
typedef struct {
unsigned char id[2];
} nn_vendorid_t;
typedef struct {
unsigned char major, minor;
uint8_t major, minor;
} nn_protocol_version_t;
typedef union nn_guid_prefix {
unsigned char s[12];

View file

@ -0,0 +1,24 @@
/*
* Copyright(c) 2019 ADLINK Technology Limited and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
* v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
#include <string.h>
#include "ddsi/ddsi_vendor.h"
extern inline bool vendor_equals (nn_vendorid_t a, nn_vendorid_t b);
extern inline bool vendor_is_rti (nn_vendorid_t vendor);
extern inline bool vendor_is_twinoaks (nn_vendorid_t vendor);
extern inline bool vendor_is_prismtech (nn_vendorid_t vendor);
extern inline bool vendor_is_opensplice (nn_vendorid_t vendor);
extern inline bool vendor_is_cloud (nn_vendorid_t vendor);
extern inline bool vendor_is_eclipse (nn_vendorid_t vendor);
extern inline bool vendor_is_eclipse_or_opensplice (nn_vendorid_t vendor);
extern inline bool vendor_is_eclipse_or_prismtech (nn_vendorid_t vendor);

View file

@ -41,8 +41,6 @@
#include "ddsi/q_md5.h"
#include "ddsi/q_feature_check.h"
static const nn_vendorid_t ownvendorid = MY_VENDOR_ID;
static int get_locator (nn_locator_t *loc, const nn_locators_t *locs, int uc_same_subnet)
{
struct nn_locators_one *l;
@ -182,7 +180,6 @@ static int write_mpayload (struct writer *wr, int alive, nn_parameterid_t keypar
int spdp_write (struct participant *pp)
{
static const nn_vendorid_t myvendorid = MY_VENDOR_ID;
struct nn_xmsg *mpayload;
struct nn_locators_one def_uni_loc_one, def_multi_loc_one, meta_uni_loc_one, meta_multi_loc_one;
nn_plist_t ps;
@ -220,7 +217,7 @@ int spdp_write (struct participant *pp)
ps.builtin_endpoint_set = pp->bes;
ps.protocol_version.major = RTPS_MAJOR;
ps.protocol_version.minor = RTPS_MINOR;
ps.vendorid = myvendorid;
ps.vendorid = NN_VENDORID_ECLIPSE;
if (pp->prismtech_bes)
{
ps.present |= PP_PRISMTECH_BUILTIN_ENDPOINT_SET;
@ -460,7 +457,7 @@ static struct proxy_participant *find_ddsi2_proxy_participant (const nn_guid_t *
ephash_enum_proxy_participant_init (&it);
while ((pp = ephash_enum_proxy_participant_next (&it)) != NULL)
{
if (vendor_is_opensplice (pp->vendor) && pp->e.guid.prefix.u[0] == ppguid->prefix.u[0] && pp->is_ddsi2_pp)
if (vendor_is_eclipse_or_opensplice (pp->vendor) && pp->e.guid.prefix.u[0] == ppguid->prefix.u[0] && pp->is_ddsi2_pp)
break;
}
ephash_enum_proxy_participant_fini (&it);
@ -478,7 +475,7 @@ static void make_participants_dependent_on_ddsi2 (const nn_guid_t *ddsi2guid, nn
ephash_enum_proxy_participant_init (&it);
while ((pp = ephash_enum_proxy_participant_next (&it)) != NULL)
{
if (vendor_is_opensplice (pp->vendor) && pp->e.guid.prefix.u[0] == ddsi2guid->prefix.u[0] && !pp->is_ddsi2_pp)
if (vendor_is_eclipse_or_opensplice (pp->vendor) && pp->e.guid.prefix.u[0] == ddsi2guid->prefix.u[0] && !pp->is_ddsi2_pp)
{
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);
@ -647,7 +644,7 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time
until the "privileged" one expires anyway */
lease_duration = nn_to_ddsi_duration (T_NEVER);
}
else if (vendor_is_opensplice (rst->vendor) && !(custom_flags & CF_PARTICIPANT_IS_DDSI2))
else if (vendor_is_eclipse_or_opensplice (rst->vendor) && !(custom_flags & CF_PARTICIPANT_IS_DDSI2))
{
/* Non-DDSI2 participants are made dependent on DDSI2 (but DDSI2
itself need not be discovered yet) */
@ -868,7 +865,6 @@ static int sedp_write_endpoint
const nn_xqos_t *xqos, struct addrset *as)
{
const nn_xqos_t *defqos = is_writer_entityid (epguid->entityid) ? &gv.default_xqos_wr : &gv.default_xqos_rd;
const nn_vendorid_t my_vendor_id = MY_VENDOR_ID;
struct nn_xmsg *mpayload;
uint64_t qosdiff;
nn_plist_t ps;
@ -898,7 +894,7 @@ static int sedp_write_endpoint
ps.present |= PP_PROTOCOL_VERSION | PP_VENDORID;
ps.protocol_version.major = RTPS_MAJOR;
ps.protocol_version.minor = RTPS_MINOR;
ps.vendorid = my_vendor_id;
ps.vendorid = NN_VENDORID_ECLIPSE;
if (epcommon->group_guid.entityid.u != 0)
{
@ -959,7 +955,7 @@ static struct writer *get_sedp_writer (const struct participant *pp, unsigned en
int sedp_write_writer (struct writer *wr)
{
if ((!is_builtin_entityid(wr->e.guid.entityid, ownvendorid)) && (!wr->e.onlylocal))
if ((!is_builtin_entityid(wr->e.guid.entityid, NN_VENDORID_ECLIPSE)) && (!wr->e.onlylocal))
{
struct writer *sedp_wr = get_sedp_writer (wr->c.pp, NN_ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER);
#ifdef DDSI_INCLUDE_SSM
@ -974,7 +970,7 @@ int sedp_write_writer (struct writer *wr)
int sedp_write_reader (struct reader *rd)
{
if ((!is_builtin_entityid (rd->e.guid.entityid, ownvendorid)) && (!rd->e.onlylocal))
if ((!is_builtin_entityid (rd->e.guid.entityid, NN_VENDORID_ECLIPSE)) && (!rd->e.onlylocal))
{
struct writer *sedp_wr = get_sedp_writer (rd->c.pp, NN_ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER);
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
@ -989,7 +985,7 @@ int sedp_write_reader (struct reader *rd)
int sedp_dispose_unregister_writer (struct writer *wr)
{
if ((!is_builtin_entityid(wr->e.guid.entityid, ownvendorid)) && (!wr->e.onlylocal))
if ((!is_builtin_entityid(wr->e.guid.entityid, NN_VENDORID_ECLIPSE)) && (!wr->e.onlylocal))
{
struct writer *sedp_wr = get_sedp_writer (wr->c.pp, NN_ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER);
return sedp_write_endpoint (sedp_wr, 0, &wr->e.guid, NULL, NULL, NULL, NULL);
@ -999,7 +995,7 @@ int sedp_dispose_unregister_writer (struct writer *wr)
int sedp_dispose_unregister_reader (struct reader *rd)
{
if ((!is_builtin_entityid(rd->e.guid.entityid, ownvendorid)) && (!rd->e.onlylocal))
if ((!is_builtin_entityid(rd->e.guid.entityid, NN_VENDORID_ECLIPSE)) && (!rd->e.onlylocal))
{
struct writer *sedp_wr = get_sedp_writer (rd->c.pp, NN_ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER);
return sedp_write_endpoint (sedp_wr, 0, &rd->e.guid, NULL, NULL, NULL, NULL);
@ -1058,7 +1054,7 @@ static struct proxy_participant *implicitly_create_proxypp (const nn_guid_t *ppg
actual_vendorid = (datap->present & PP_VENDORID) ? datap->vendorid : vendorid;
new_proxy_participant(ppguid, 0, 0, &privguid, new_addrset(), new_addrset(), &pp_plist, T_NEVER, actual_vendorid, CF_IMPLICITLY_CREATED_PROXYPP, timestamp);
}
else if (ppguid->prefix.u[0] == src_guid_prefix->u[0] && vendor_is_opensplice (vendorid))
else if (ppguid->prefix.u[0] == src_guid_prefix->u[0] && vendor_is_eclipse_or_opensplice (vendorid))
{
/* FIXME: requires address sets to be those of ddsi2, no built-in
readers or writers, only if remote ddsi2 is provably running
@ -1148,7 +1144,7 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat
is_writer = is_writer_entityid (datap->endpoint_guid.entityid);
if (!is_writer)
nn_xqos_mergein_missing (xqos, &gv.default_xqos_rd);
else if (vendor_is_prismtech(vendorid))
else if (vendor_is_eclipse_or_prismtech(vendorid))
nn_xqos_mergein_missing (xqos, &gv.default_xqos_wr);
else
nn_xqos_mergein_missing (xqos, &gv.default_xqos_wr_nad);
@ -1251,7 +1247,7 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat
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))
if ((datap->endpoint_guid.entityid.u & NN_ENTITYID_SOURCE_MASK) == NN_ENTITYID_SOURCE_VENDOR && !vendor_is_eclipse_or_prismtech (vendorid))
{
DDS_LOG(DDS_LC_DISCOVERY, "ignoring vendor-specific endpoint %x:%x:%x:%x\n", PGUID (datap->endpoint_guid));
}

View file

@ -53,7 +53,6 @@ struct deleted_participant {
static os_mutex deleted_participants_lock;
static ut_avlTree_t deleted_participants;
static const nn_vendorid_t ownvendorid = MY_VENDOR_ID;
static int compare_guid (const void *va, const void *vb);
static void augment_wr_prd_match (void *vnode, const void *vleft, const void *vright);
@ -140,7 +139,7 @@ int is_builtin_entityid (nn_entityid_t id, nn_vendorid_t vendorid)
return 1;
else if ((id.u & NN_ENTITYID_SOURCE_MASK) != NN_ENTITYID_SOURCE_VENDOR)
return 0;
else if (!vendor_is_prismtech (vendorid))
else if (!vendor_is_eclipse_or_prismtech (vendorid))
return 0;
else
{
@ -157,7 +156,7 @@ int is_builtin_endpoint (nn_entityid_t id, nn_vendorid_t vendorid)
bool is_local_orphan_endpoint (const struct entity_common *e)
{
return (e->guid.prefix.u[0] == 0 && e->guid.prefix.u[1] == 0 && e->guid.prefix.u[2] == 0 &&
is_builtin_endpoint (e->guid.entityid, ownvendorid));
is_builtin_endpoint (e->guid.entityid, NN_VENDORID_ECLIPSE));
}
static void entity_common_init (struct entity_common *e, const struct nn_guid *guid, const char *name, enum entity_kind kind, nn_wctime_t tcreate, nn_vendorid_t vendorid, bool onlylocal)
@ -247,7 +246,7 @@ nn_vendorid_t get_entity_vendorid (const struct entity_common *e)
case EK_PARTICIPANT:
case EK_READER:
case EK_WRITER:
return (nn_vendorid_t) MY_VENDOR_ID;
return NN_VENDORID_ECLIPSE;
case EK_PROXY_PARTICIPANT:
return ((const struct proxy_participant *) e)->vendor;
case EK_PROXY_READER:
@ -256,7 +255,7 @@ nn_vendorid_t get_entity_vendorid (const struct entity_common *e)
return ((const struct proxy_writer *) e)->c.vendor;
}
assert (0);
return (nn_vendorid_t) NN_VENDORID_UNKNOWN;
return NN_VENDORID_UNKNOWN;
}
/* DELETED PARTICIPANTS --------------------------------------------- */
@ -437,7 +436,7 @@ int new_participant_guid (const nn_guid_t *ppguid, unsigned flags, const nn_plis
pp = os_malloc (sizeof (*pp));
entity_common_init (&pp->e, ppguid, "", EK_PARTICIPANT, now (), ownvendorid, ((flags & RTPS_PF_ONLY_LOCAL) != 0));
entity_common_init (&pp->e, ppguid, "", EK_PARTICIPANT, now (), NN_VENDORID_ECLIPSE, ((flags & RTPS_PF_ONLY_LOCAL) != 0));
pp->user_refc = 1;
pp->builtin_refc = 0;
pp->builtins_deleted = 0;
@ -669,7 +668,7 @@ static void delete_builtin_endpoint (const struct nn_guid *ppguid, unsigned enti
nn_guid_t guid;
guid.prefix = ppguid->prefix;
guid.entityid.u = entityid;
assert (is_builtin_entityid (to_entityid (entityid), ownvendorid));
assert (is_builtin_entityid (to_entityid (entityid), NN_VENDORID_ECLIPSE));
if (is_writer_entityid (to_entityid (entityid)))
delete_writer_nolinger (&guid);
else
@ -680,7 +679,7 @@ static struct participant *ref_participant (struct participant *pp, const struct
{
nn_guid_t stguid;
os_mutexLock (&pp->refc_lock);
if (guid_of_refing_entity && is_builtin_endpoint (guid_of_refing_entity->entityid, ownvendorid))
if (guid_of_refing_entity && is_builtin_endpoint (guid_of_refing_entity->entityid, NN_VENDORID_ECLIPSE))
pp->builtin_refc++;
else
pp->user_refc++;
@ -719,7 +718,7 @@ static void unref_participant (struct participant *pp, const struct nn_guid *gui
nn_guid_t stguid;
os_mutexLock (&pp->refc_lock);
if (guid_of_refing_entity && is_builtin_endpoint (guid_of_refing_entity->entityid, ownvendorid))
if (guid_of_refing_entity && is_builtin_endpoint (guid_of_refing_entity->entityid, NN_VENDORID_ECLIPSE))
pp->builtin_refc--;
else
pp->user_refc--;
@ -1817,7 +1816,7 @@ static void proxy_writer_add_connection (struct proxy_writer *pwr, struct reader
{
m->in_sync = PRMSS_SYNC;
}
else if (!config.conservative_builtin_reader_startup && is_builtin_entityid (rd->e.guid.entityid, ownvendorid) && !ut_avlIsEmpty (&pwr->readers))
else if (!config.conservative_builtin_reader_startup && is_builtin_entityid (rd->e.guid.entityid, NN_VENDORID_ECLIPSE) && !ut_avlIsEmpty (&pwr->readers))
{
/* builtins really don't care about multiple copies */
m->in_sync = PRMSS_SYNC;
@ -2023,7 +2022,7 @@ static void reader_qos_mismatch (struct reader * rd, uint32_t reason)
static void connect_writer_with_proxy_reader (struct writer *wr, struct proxy_reader *prd, nn_mtime_t tnow)
{
const int isb0 = (is_builtin_entityid (wr->e.guid.entityid, ownvendorid) != 0);
const int isb0 = (is_builtin_entityid (wr->e.guid.entityid, NN_VENDORID_ECLIPSE) != 0);
const int isb1 = (is_builtin_entityid (prd->e.guid.entityid, prd->c.vendor) != 0);
int32_t reason;
OS_UNUSED_ARG(tnow);
@ -2043,7 +2042,7 @@ static void connect_writer_with_proxy_reader (struct writer *wr, struct proxy_re
static void connect_proxy_writer_with_reader (struct proxy_writer *pwr, struct reader *rd, nn_mtime_t tnow)
{
const int isb0 = (is_builtin_entityid (pwr->e.guid.entityid, pwr->c.vendor) != 0);
const int isb1 = (is_builtin_entityid (rd->e.guid.entityid, ownvendorid) != 0);
const int isb1 = (is_builtin_entityid (rd->e.guid.entityid, NN_VENDORID_ECLIPSE) != 0);
int32_t reason;
nn_count_t init_count;
if (isb0 != isb1)
@ -2063,7 +2062,7 @@ static void connect_writer_with_reader (struct writer *wr, struct reader *rd, nn
{
int32_t reason;
(void)tnow;
if (!is_local_orphan_endpoint (&wr->e) && (is_builtin_entityid (wr->e.guid.entityid, ownvendorid) || is_builtin_entityid (rd->e.guid.entityid, ownvendorid)))
if (!is_local_orphan_endpoint (&wr->e) && (is_builtin_entityid (wr->e.guid.entityid, NN_VENDORID_ECLIPSE) || is_builtin_entityid (rd->e.guid.entityid, NN_VENDORID_ECLIPSE)))
return;
if ((reason = qos_match_p (rd->xqos, wr->xqos)) >= 0)
{
@ -2231,7 +2230,7 @@ static void generic_do_match (struct entity_common *e, nn_mtime_t tnow)
struct ephash_enum est;
struct entity_common *em;
enum entity_kind mkind = generic_do_match_mkind(e->kind);
if (!is_builtin_entityid (e->guid.entityid, ownvendorid))
if (!is_builtin_entityid (e->guid.entityid, NN_VENDORID_ECLIPSE))
{
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),
@ -2281,7 +2280,7 @@ static void generic_do_local_match (struct entity_common *e, nn_mtime_t tnow)
struct ephash_enum est;
struct entity_common *em;
enum entity_kind mkind;
if (is_builtin_entityid (e->guid.entityid, ownvendorid) && !is_local_orphan_endpoint (e))
if (is_builtin_entityid (e->guid.entityid, NN_VENDORID_ECLIPSE) && !is_local_orphan_endpoint (e))
/* never a need for local matches on discovery endpoints */
return;
mkind = generic_do_local_match_mkind(e->kind);
@ -2338,8 +2337,8 @@ static void new_reader_writer_common (const struct nn_guid *guid, const struct d
{
const char *partition = "(default)";
const char *partition_suffix = "";
assert (is_builtin_entityid (guid->entityid, ownvendorid) ? (topic == NULL) : (topic != NULL));
if (is_builtin_entityid (guid->entityid, ownvendorid))
assert (is_builtin_entityid (guid->entityid, NN_VENDORID_ECLIPSE) ? (topic == NULL) : (topic != NULL));
if (is_builtin_entityid (guid->entityid, NN_VENDORID_ECLIPSE))
{
/* continue printing it as not being in a partition, the actual
value doesn't matter because it is never matched based on QoS
@ -2362,7 +2361,7 @@ static void new_reader_writer_common (const struct nn_guid *guid, const struct d
static void endpoint_common_init (struct entity_common *e, struct endpoint_common *c, enum entity_kind kind, const struct nn_guid *guid, const struct nn_guid *group_guid, struct participant *pp)
{
entity_common_init (e, guid, NULL, kind, now (), ownvendorid, pp->e.onlylocal);
entity_common_init (e, guid, NULL, kind, now (), NN_VENDORID_ECLIPSE, pp->e.onlylocal);
c->pp = ref_participant (pp, &e->guid);
if (group_guid)
c->group_guid = *group_guid;
@ -2372,7 +2371,7 @@ static void endpoint_common_init (struct entity_common *e, struct endpoint_commo
static void endpoint_common_fini (struct entity_common *e, struct endpoint_common *c)
{
if (!is_builtin_entityid(e->guid.entityid, ownvendorid))
if (!is_builtin_entityid(e->guid.entityid, NN_VENDORID_ECLIPSE))
pp_release_entityid(c->pp, e->guid.entityid);
if (c->pp)
unref_participant (c->pp, &e->guid);
@ -2627,7 +2626,7 @@ static void new_writer_guid_common_init (struct writer *wr, const struct ddsi_se
assert (wr->xqos->present & QP_RELIABILITY);
wr->reliable = (wr->xqos->reliability.kind != NN_BEST_EFFORT_RELIABILITY_QOS);
assert (wr->xqos->present & QP_DURABILITY);
if (is_builtin_entityid (wr->e.guid.entityid, ownvendorid))
if (is_builtin_entityid (wr->e.guid.entityid, NN_VENDORID_ECLIPSE))
{
assert (wr->xqos->history.kind == NN_KEEP_LAST_HISTORY_QOS);
assert (wr->xqos->durability.kind == NN_TRANSIENT_LOCAL_DURABILITY_QOS);
@ -2771,7 +2770,7 @@ static void new_writer_guid_common_init (struct writer *wr, const struct ddsi_se
wr->whc_low = config.whc_lowwater_mark;
wr->whc_high = config.whc_init_highwater_mark.value;
}
assert (!is_builtin_entityid(wr->e.guid.entityid, ownvendorid) || (wr->whc_low == wr->whc_high && wr->whc_low == INT32_MAX));
assert (!is_builtin_entityid(wr->e.guid.entityid, NN_VENDORID_ECLIPSE) || (wr->whc_low == wr->whc_high && wr->whc_low == INT32_MAX));
/* Connection admin */
ut_avlInit (&wr_readers_treedef, &wr->readers);
@ -2859,7 +2858,7 @@ struct local_orphan_writer *new_local_orphan_writer (nn_entityid_t entityid, str
memset (&guid.prefix, 0, sizeof (guid.prefix));
guid.entityid = entityid;
entity_common_init (&wr->e, &guid, NULL, EK_WRITER, now (), ownvendorid, true);
entity_common_init (&wr->e, &guid, NULL, EK_WRITER, now (), NN_VENDORID_ECLIPSE, true);
wr->c.pp = NULL;
memset (&wr->c.group_guid, 0, sizeof (wr->c.group_guid));
new_writer_guid_common_init (wr, topic, xqos, whc, 0, NULL);
@ -2905,7 +2904,7 @@ static void gc_delete_writer (struct gcreq *gcreq)
}
/* Do last gasp on SEDP and free writer. */
if (!is_builtin_entityid (wr->e.guid.entityid, ownvendorid))
if (!is_builtin_entityid (wr->e.guid.entityid, NN_VENDORID_ECLIPSE))
sedp_dispose_unregister_writer (wr);
if (wr->status_cb)
{
@ -3223,7 +3222,7 @@ static struct reader * new_reader_guid
#endif
if (topic == NULL)
{
assert (is_builtin_entityid (rd->e.guid.entityid, ownvendorid));
assert (is_builtin_entityid (rd->e.guid.entityid, NN_VENDORID_ECLIPSE));
}
rd->status_cb = status_cb;
rd->status_cb_entity = status_entity;
@ -3353,7 +3352,7 @@ static void gc_delete_reader (struct gcreq *gcreq)
free_rd_wr_match (m);
}
if (!is_builtin_entityid (rd->e.guid.entityid, ownvendorid))
if (!is_builtin_entityid (rd->e.guid.entityid, NN_VENDORID_ECLIPSE))
sedp_dispose_unregister_reader (rd);
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
addrset_forall (rd->as, leave_mcast_helper, gv.data_conn_mc);
@ -3542,7 +3541,7 @@ void new_proxy_participant
/* Non-PrismTech doesn't implement the PT extensions and therefore won't generate
a CMParticipant; if a PT peer does not implement a CMParticipant writer, then it
presumably also is a handicapped implementation (perhaps simply an old one) */
if (!vendor_is_prismtech(proxypp->vendor) ||
if (!vendor_is_eclipse_or_prismtech(proxypp->vendor) ||
(proxypp->bes != 0 && !(proxypp->prismtech_bes & NN_DISC_BUILTIN_ENDPOINT_CM_PARTICIPANT_WRITER)))
proxypp->proxypp_have_cm = 1;
else

View file

@ -1499,7 +1499,6 @@ void rtps_stop (void)
}
{
const nn_vendorid_t ownvendorid = MY_VENDOR_ID;
struct ephash_enum_writer est_wr;
struct ephash_enum_reader est_rd;
struct ephash_enum_participant est_pp;
@ -1515,7 +1514,7 @@ void rtps_stop (void)
ephash_enum_writer_init (&est_wr);
while ((wr = ephash_enum_writer_next (&est_wr)) != NULL)
{
if (!is_builtin_entityid (wr->e.guid.entityid, ownvendorid))
if (!is_builtin_entityid (wr->e.guid.entityid, NN_VENDORID_ECLIPSE))
delete_writer_nolinger (&wr->e.guid);
}
ephash_enum_writer_fini (&est_wr);
@ -1523,7 +1522,7 @@ void rtps_stop (void)
ephash_enum_reader_init (&est_rd);
while ((rd = ephash_enum_reader_next (&est_rd)) != NULL)
{
if (!is_builtin_entityid (rd->e.guid.entityid, ownvendorid))
if (!is_builtin_entityid (rd->e.guid.entityid, NN_VENDORID_ECLIPSE))
(void)delete_reader (&rd->e.guid);
}
ephash_enum_reader_fini (&est_rd);

View file

@ -15,71 +15,8 @@
#include "ddsi/q_bswap.h"
#include "ddsi/q_md5.h"
int vendor_is_rti (nn_vendorid_t vendor)
{
const nn_vendorid_t rti = NN_VENDORID_RTI;
return vendor.id[0] == rti.id[0] && vendor.id[1] == rti.id[1];
}
int vendor_is_twinoaks (nn_vendorid_t vendor)
{
const nn_vendorid_t twinoaks = NN_VENDORID_TWINOAKS;
return vendor.id[0] == twinoaks.id[0] && vendor.id[1] == twinoaks.id[1];
}
int vendor_is_cloud (nn_vendorid_t vendor)
{
const nn_vendorid_t cloud = NN_VENDORID_PRISMTECH_CLOUD;
return vendor.id[0] == cloud.id[0] && vendor.id[1] == cloud.id[1];
}
int vendor_is_prismtech (nn_vendorid_t vid)
{
const nn_vendorid_t pt1 = NN_VENDORID_PRISMTECH_OSPL;
const nn_vendorid_t pt2 = NN_VENDORID_PRISMTECH_LITE;
const nn_vendorid_t pt3 = NN_VENDORID_PRISMTECH_GATEWAY;
const nn_vendorid_t pt4 = NN_VENDORID_PRISMTECH_JAVA;
const nn_vendorid_t pt5 = NN_VENDORID_PRISMTECH_CLOUD;
const nn_vendorid_t pt6 = NN_VENDORID_ECLIPSE_CYCLONEDDS;
return
(vid.id[0] == pt1.id[0]) &&
((vid.id[1] == pt1.id[1]) || (vid.id[1] == pt2.id[1])
|| (vid.id[1] == pt3.id[1]) || (vid.id[1] == pt4.id[1])
|| (vid.id[1] == pt5.id[1]) || (vid.id[1] == pt6.id[1]));
}
int vendor_is_opensplice (nn_vendorid_t vid)
{
const nn_vendorid_t pt1 = NN_VENDORID_PRISMTECH_OSPL;
return (vid.id[0] == pt1.id[0] && vid.id[1] == pt1.id[1]);
}
int vendor_is_lite (nn_vendorid_t vid)
{
const nn_vendorid_t pt1 = NN_VENDORID_PRISMTECH_LITE;
return (vid.id[0] == pt1.id[0] && vid.id[1] == pt1.id[1]);
}
int is_own_vendor (nn_vendorid_t vendor)
{
const nn_vendorid_t ownid = MY_VENDOR_ID;
return vendor.id[0] == ownid.id[0] && vendor.id[1] == ownid.id[1];
}
seqno_t fromSN (const nn_sequence_number_t sn)
{
return ((seqno_t) sn.high << 32) | sn.low;
}
nn_sequence_number_t toSN (seqno_t n)
{
nn_sequence_number_t x;
x.high = (int) (n >> 32);
x.low = (unsigned) n;
return x;
}
extern inline seqno_t fromSN (const nn_sequence_number_t sn);
extern inline nn_sequence_number_t toSN (seqno_t n);
#ifdef DDSI_INCLUDE_NETWORK_PARTITIONS
int WildcardOverlap(char * p1, char * p2)

View file

@ -82,8 +82,7 @@ static size_t align4u (size_t x)
static int protocol_version_is_newer (nn_protocol_version_t pv)
{
const nn_protocol_version_t mv = NN_PROTOCOL_VERSION_INITIALIZER;
return (pv.major < mv.major) ? 0 : (pv.major > mv.major) ? 1 : (pv.minor > mv.minor);
return (pv.major < RTPS_MAJOR) ? 0 : (pv.major > RTPS_MAJOR) ? 1 : (pv.minor > RTPS_MINOR);
}
static int validate_string (const struct dd *dd, size_t *len)
@ -1819,10 +1818,7 @@ static int valid_endpoint_guid (const nn_guid_t *g, const struct dd *dd)
}
}
case NN_ENTITYID_SOURCE_VENDOR:
/* vendor specific: always ok, unless vendor is PrismTech, 'cos
we don't do that! (FIXME, might be worthwhile to be less
strict, or add an implementation version number here) */
if (!is_own_vendor (dd->vendorid) || protocol_version_is_newer (dd->protocol_version))
if (!vendor_is_eclipse (dd->vendorid))
return 0;
else
{
@ -1840,7 +1836,7 @@ static int valid_endpoint_guid (const nn_guid_t *g, const struct dd *dd)
return 0;
else
{
DDS_TRACE("plist/valid_endpoint_guid[src=VENDOR,proto=%u.%u]: invalid entityid (%x)\n",
DDS_TRACE("plist/valid_endpoint_guid[src=VENDOR,proto=%u.%u]: unexpected entityid (%x)\n",
dd->protocol_version.major, dd->protocol_version.minor, g->entityid.u);
return 0;
}
@ -1891,7 +1887,7 @@ static void bswap_prismtech_participant_version_info (nn_prismtech_participant_v
static int do_prismtech_participant_version_info (nn_prismtech_participant_version_info_t *pvi, uint64_t *present, uint64_t *aliased, const struct dd *dd)
{
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
else if (dd->bufsz < NN_PRISMTECH_PARTICIPANT_VERSION_INFO_FIXED_CDRSIZE)
{
@ -2230,7 +2226,7 @@ static int init_one_parameter
case PID_PRISMTECH_READER_DATA_LIFECYCLE: /* PrismTech specific */
{
int ret;
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
if (dd->bufsz >= sizeof (nn_reader_data_lifecycle_qospolicy_t))
ret = do_reader_data_lifecycle_v1 (&dest->qos.reader_data_lifecycle, dd);
@ -2246,7 +2242,7 @@ static int init_one_parameter
return ret;
}
case PID_PRISMTECH_WRITER_DATA_LIFECYCLE: /* PrismTech specific */
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
else
{
@ -2288,7 +2284,7 @@ static int init_one_parameter
}
case PID_PRISMTECH_RELAXED_QOS_MATCHING:
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
else if (dd->bufsz < sizeof (dest->qos.relaxed_qos_matching))
{
@ -2309,7 +2305,7 @@ static int init_one_parameter
}
case PID_PRISMTECH_SYNCHRONOUS_ENDPOINT: /* PrismTech specific */
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
else if (dd->bufsz < sizeof (dest->qos.synchronous_endpoint))
{
@ -2492,7 +2488,7 @@ static int init_one_parameter
return 0;
case PID_PRISMTECH_BUILTIN_ENDPOINT_SET:
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
else if (dd->bufsz < sizeof (dest->prismtech_builtin_endpoint_set))
{
@ -2545,7 +2541,7 @@ static int init_one_parameter
}
/* Clear all bits we don't understand, then add the extended bits if present */
dest->statusinfo &= NN_STATUSINFO_STANDARDIZED;
if (dd->bufsz >= 2 * sizeof (dest->statusinfo) && vendor_is_opensplice(dd->vendorid))
if (dd->bufsz >= 2 * sizeof (dest->statusinfo) && vendor_is_eclipse_or_opensplice(dd->vendorid))
{
uint32_t statusinfox;
Q_STATIC_ASSERT_CODE (sizeof(statusinfox) == sizeof(dest->statusinfo));
@ -2603,7 +2599,7 @@ static int init_one_parameter
return do_guid (&dest->endpoint_guid, &dest->present, PP_ENDPOINT_GUID, valid_endpoint_guid, dd);
case PID_PRISMTECH_ENDPOINT_GUID: /* case PID_RTI_TYPECODE: */
if (vendor_is_prismtech (dd->vendorid))
if (vendor_is_eclipse_or_prismtech (dd->vendorid))
{
/* PrismTech specific variant of ENDPOINT_GUID, for strict compliancy */
return do_guid (&dest->endpoint_guid, &dest->present, PP_ENDPOINT_GUID, valid_endpoint_guid, dd);
@ -2624,33 +2620,33 @@ static int init_one_parameter
return do_prismtech_participant_version_info(&dest->prismtech_participant_version_info, &dest->present, &dest->aliased, dd);
case PID_PRISMTECH_SUBSCRIPTION_KEYS:
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
return do_subscription_keys_qospolicy (&dest->qos.subscription_keys, &dest->qos.present, &dest->qos.aliased, QP_PRISMTECH_SUBSCRIPTION_KEYS, dd);
case PID_PRISMTECH_READER_LIFESPAN:
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
return do_reader_lifespan_qospolicy (&dest->qos.reader_lifespan, &dest->qos.present, QP_PRISMTECH_READER_LIFESPAN, dd);
case PID_PRISMTECH_ENTITY_FACTORY:
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
return do_entity_factory_qospolicy (&dest->qos.entity_factory, &dest->qos.present, QP_PRISMTECH_ENTITY_FACTORY, dd);
case PID_PRISMTECH_NODE_NAME:
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
return do_string (&dest->node_name, &dest->present, &dest->aliased, pwanted, PP_PRISMTECH_NODE_NAME, dd);
case PID_PRISMTECH_EXEC_NAME:
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
return do_string (&dest->exec_name, &dest->present, &dest->aliased, pwanted, PP_PRISMTECH_EXEC_NAME, dd);
case PID_PRISMTECH_SERVICE_TYPE:
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
if (dd->bufsz < sizeof (dest->service_type))
{
@ -2664,7 +2660,7 @@ static int init_one_parameter
return 0;
case PID_PRISMTECH_PROCESS_ID:
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
if (dd->bufsz < sizeof (dest->process_id))
{
@ -2678,12 +2674,12 @@ static int init_one_parameter
return 0;
case PID_PRISMTECH_TYPE_DESCRIPTION:
if (!vendor_is_prismtech (dd->vendorid))
if (!vendor_is_eclipse_or_prismtech (dd->vendorid))
return 0;
return do_string (&dest->type_description, &dest->present, &dest->aliased, pwanted, PP_PRISMTECH_TYPE_DESCRIPTION, dd);
case PID_PRISMTECH_EOTINFO:
if (!vendor_is_opensplice (dd->vendorid))
if (!vendor_is_eclipse_or_opensplice (dd->vendorid))
return 0;
else if (dd->bufsz < 2*sizeof (uint32_t))
{
@ -3135,7 +3131,7 @@ unsigned char *nn_plist_quickscan (struct nn_rsample_info *dest, const struct nn
else
{
unsigned stinfo = fromBE4u (*((unsigned *) pl));
unsigned stinfox = (length < 8 || !vendor_is_opensplice(src->vendorid)) ? 0 : fromBE4u (*((unsigned *) pl + 1));
unsigned stinfox = (length < 8 || !vendor_is_eclipse_or_opensplice(src->vendorid)) ? 0 : fromBE4u (*((unsigned *) pl + 1));
#if (NN_STATUSINFO_DISPOSE | NN_STATUSINFO_UNREGISTER) != 3
#error "expected dispose/unregister to be in lowest 2 bits"
#endif

View file

@ -2837,7 +2837,7 @@ static int handle_submsg_sequence
break;
case SMID_PT_INFO_CONTAINER:
if (is_own_vendor (rst->vendor) || vendor_is_lite(rst->vendor))
if (vendor_is_eclipse_or_prismtech (rst->vendor))
{
state = "parse:pt_info_container";
DDS_TRACE("PT_INFO_CONTAINER(");
@ -2898,7 +2898,7 @@ static int handle_submsg_sequence
rst->protocol_version.minor < RTPS_MINOR_MINIMUM))
goto malformed;
}
else if (is_own_vendor (rst->vendor))
else if (vendor_is_eclipse (rst->vendor))
{
/* One wouldn't expect undefined stuff from ourselves,
except that we need to be up- and backwards compatible

View file

@ -953,13 +953,10 @@ static os_result throttle_writer (struct nn_xpack *xp, struct writer *wr)
whc_get_state(wr->whc, &whcst);
{
#ifndef NDEBUG
nn_vendorid_t ownvendorid = MY_VENDOR_ID;
#endif
ASSERT_MUTEX_HELD (&wr->e.lock);
assert (wr->throttling == 0);
assert (vtime_awake_p (lookup_thread_state ()->vtime));
assert (!is_builtin_entityid(wr->e.guid.entityid, ownvendorid));
assert (!is_builtin_entityid(wr->e.guid.entityid, NN_VENDORID_ECLIPSE));
}
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);

View file

@ -288,7 +288,6 @@ static void nn_xmsg_reinit (struct nn_xmsg *m, enum nn_xmsg_kind kind)
static struct nn_xmsg *nn_xmsg_allocnew (struct nn_xmsgpool *pool, size_t expected_size, enum nn_xmsg_kind kind)
{
const nn_vendorid_t myvendorid = MY_VENDOR_ID;
struct nn_xmsg *m;
struct nn_xmsg_data *d;
@ -312,7 +311,7 @@ static struct nn_xmsg *nn_xmsg_allocnew (struct nn_xmsgpool *pool, size_t expect
d->src.unused = 0;
d->src.version.major = RTPS_MAJOR;
d->src.version.minor = RTPS_MINOR;
d->src.vendorid = myvendorid;
d->src.vendorid = NN_VENDORID_ECLIPSE;
d->dst.smhdr.submessageId = SMID_INFO_DST;
d->dst.smhdr.flags = (PLATFORM_IS_LITTLE_ENDIAN ? SMFLAG_ENDIANNESS : 0);
d->dst.smhdr.octetsToNextHeader = sizeof (d->dst.guid_prefix);
@ -1239,7 +1238,6 @@ static void nn_xpack_reinit (struct nn_xpack *xp)
struct nn_xpack * nn_xpack_new (ddsi_tran_conn_t conn, uint32_t bw_limit, bool async_mode)
{
const nn_vendorid_t myvendorid = MY_VENDOR_ID;
struct nn_xpack *xp;
/* Disallow setting async_mode if not configured to enable async mode: this way we
@ -1257,7 +1255,7 @@ struct nn_xpack * nn_xpack_new (ddsi_tran_conn_t conn, uint32_t bw_limit, bool a
xp->hdr.protocol.id[3] = 'S';
xp->hdr.version.major = RTPS_MAJOR;
xp->hdr.version.minor = RTPS_MINOR;
xp->hdr.vendorid = myvendorid;
xp->hdr.vendorid = NN_VENDORID_ECLIPSE;
/* MSG_LEN first sub message for stream based connections */