-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/implement-PID_PRODUCT_VERSION #2132
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -264,6 +264,7 @@ typedef union ddsi_rtps_submessage { | |||
#define DDSI_PID_TRANSPORT_PRIORITY 0x49u | ||||
#define DDSI_PID_PROTOCOL_VERSION 0x15u | ||||
#define DDSI_PID_VENDORID 0x16u | ||||
#define DDSI_PID_PRODUCT_VERSION 0x8000u | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The vendor-specific flags are defined below, e.g., line 349 where it defines cyclonedds/src/core/ddsi/src/ddsi_plist.c Line 2110 in d8cef89
I suspect |
||||
#define DDSI_PID_UNICAST_LOCATOR 0x2fu | ||||
#define DDSI_PID_MULTICAST_LOCATOR 0x30u | ||||
#define DDSI_PID_MULTICAST_IPADDRESS 0x11u | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,10 +160,14 @@ static int sedp_write_endpoint_impl | |
else | ||
{ | ||
assert (xqos != NULL); | ||
ps.present |= PP_PROTOCOL_VERSION | PP_VENDORID; | ||
ps.present |= PP_PROTOCOL_VERSION | PP_VENDORID | PP_PRODUCT_VERSION; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't add it to endpoint discovery: the version is constant for all endpoints in a participant, endpoint discovery only runs after participant discovery and participant discovery messages are periodic. So putting in participant discovery both ensures you eventually will find out, and avoids sending it for potentially thousands of endpoints. |
||
ps.protocol_version.major = DDSI_RTPS_MAJOR; | ||
ps.protocol_version.minor = DDSI_RTPS_MINOR; | ||
ps.vendorid = DDSI_VENDORID_ECLIPSE; | ||
ps.product_version.major = DDS_VERSION_MAJOR; | ||
ps.product_version.minor = DDS_VERSION_MINOR; | ||
ps.product_version.release = DDS_VERSION_PATCH; | ||
ps.product_version.revision = DDS_VERSION_TWEAK; | ||
|
||
assert (epcommon != NULL); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,13 +81,17 @@ void ddsi_get_participant_builtin_topic_data (const struct ddsi_participant *pp, | |
|
||
ddsi_plist_init_empty (dst); | ||
dst->present |= PP_PARTICIPANT_GUID | PP_BUILTIN_ENDPOINT_SET | | ||
PP_PROTOCOL_VERSION | PP_VENDORID | PP_DOMAIN_ID; | ||
PP_PROTOCOL_VERSION | PP_VENDORID | PP_DOMAIN_ID | PP_PRODUCT_VERSION; | ||
dst->participant_guid = pp->e.guid; | ||
dst->builtin_endpoint_set = pp->bes; | ||
dst->protocol_version.major = DDSI_RTPS_MAJOR; | ||
dst->protocol_version.minor = DDSI_RTPS_MINOR; | ||
dst->vendorid = DDSI_VENDORID_ECLIPSE; | ||
dst->domain_id = gv->config.extDomainId.value; | ||
dst->product_version.major = DDS_VERSION_MAJOR; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you look a bit further down in the function can also see that it already puts something called "adlink version info" in. I am not sure the format is ideal, nor that we should keep it at all, but the name is irrelevant for compatibility and we could clean it up a bit. For example, we could also redefine typedef struct ddsi_cyclonedds_version
{
uint8_t major;
uint8_t minor;
uint8_t release;
uint8_t revision;
uint32_t flags;
uint32_t unused[3];
char *internals;
} ddsi_cyclonedds_version_t; It has proven useful to have a bunch of flags ready for use. The string can probably be replaced by something more useful, but if we really replace it by some other type (and not just change the contents) then we would need to change the parameter id to avoid upsetting "old" Cyclone versions. OpenSplice doesn't interpret this if it comes from Cyclone, so we really have some freedom. |
||
dst->product_version.minor = DDS_VERSION_MINOR; | ||
dst->product_version.release = DDS_VERSION_PATCH; | ||
dst->product_version.revision = DDS_VERSION_TWEAK; | ||
/* Be sure not to send a DOMAIN_TAG when it is the default (an empty) | ||
string: it is an "incompatible-if-unrecognized" parameter, and so | ||
implementations that don't understand the parameter will refuse to | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
#include <string.h> | ||
#include <stdlib.h> | ||
|
||
#include "dds/version.h" | ||
#include "dds/ddsrt/heap.h" | ||
#include "dds/ddsrt/log.h" | ||
#include "dds/ddsi/ddsi_domaingv.h" | ||
|
@@ -41,10 +42,14 @@ static int ddsi_sedp_write_topic_impl (struct ddsi_writer *wr, int alive, const | |
ps.topic_guid = *guid; | ||
|
||
assert (xqos != NULL); | ||
ps.present |= PP_PROTOCOL_VERSION | PP_VENDORID; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like with the endpoints, I wouldn't add it for the topics either. I think we should just clean up/improve version information in SPDP. |
||
ps.present |= PP_PROTOCOL_VERSION | PP_VENDORID | PP_PRODUCT_VERSION; | ||
ps.protocol_version.major = DDSI_RTPS_MAJOR; | ||
ps.protocol_version.minor = DDSI_RTPS_MINOR; | ||
ps.vendorid = DDSI_VENDORID_ECLIPSE; | ||
ps.product_version.major = DDS_VERSION_MAJOR; | ||
ps.product_version.minor = DDS_VERSION_MINOR; | ||
ps.product_version.release = DDS_VERSION_PATCH; | ||
ps.product_version.revision = DDS_VERSION_TWEAK; | ||
|
||
uint64_t qosdiff = ddsi_xqos_delta (xqos, defqos, ~(uint64_t)0); | ||
if (gv->config.explicitly_publish_qos_set_to_default) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2049,6 +2049,7 @@ static const struct piddesc piddesc_omg[] = { | |
#endif | ||
PP (PROTOCOL_VERSION, protocol_version, Xox2), | ||
PP (VENDORID, vendorid, Xox2), | ||
PP (PRODUCT_VERSION, product_version, Xox2), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Almost right! This would be a vendor-specific code, and so it would need to be moved to the vendor-specific code tables, though. And as I remarked before, I think I would first see if it wouldn't make sense to clean up the |
||
PP (EXPECTS_INLINE_QOS, expects_inline_qos, Xb), | ||
PP (PARTICIPANT_MANUAL_LIVELINESS_COUNT, participant_manual_liveliness_count, Xi), | ||
PP (PARTICIPANT_BUILTIN_ENDPOINTS, participant_builtin_endpoints, Xu), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ | |
#define PID_TRANSPORT_PRIORITY 0x49u | ||
#define PID_PROTOCOL_VERSION 0x15u | ||
#define PID_VENDORID 0x16u | ||
#define PID_PRODUCT_VERSION 0x8000u | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As the product version is only informational now, I don't think anything is to be gained by also burdening the serializer used for the DDS Security with it. The clear text SPDP message will be good enough for the purpose. Note that we shouldn't even have a separate "DDS Security" serializer. It only exists because the in-memory representation in the spec'd plug-in interface is different, and the dice landed the wrong way when a choice had to be made between adding a second serializer or having only a single serializer and converting between in-memory representations. Given the security sensitivity of (in particular de-)serializers, we should get rid of the second one. In short, I wouldn't add it here. |
||
#define PID_UNICAST_LOCATOR 0x2fu | ||
#define PID_MULTICAST_LOCATOR 0x30u | ||
#define PID_MULTICAST_IPADDRESS 0x11u | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now it is major, minor, "something" ("patch"?) and I don't know that having four fields won't make life more complicated. What I would find really useful is to also have a commit hash in there (or perhaps just the first few bytes to keep the size in check).