-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[WIP] Add GDS push management functionality to the information model #6515
base: master
Are you sure you want to change the base?
[WIP] Add GDS push management functionality to the information model #6515
Conversation
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.
Looks good!
Comments inline.
CMakeLists.txt
Outdated
@@ -108,6 +108,7 @@ option(UA_ENABLE_DISCOVERY "Enable Discovery Service (LDS)" ON) | |||
option(UA_ENABLE_JSON_ENCODING "Enable JSON encoding" ON) | |||
option(UA_ENABLE_XML_ENCODING "Enable XML encoding (EXPERIMENTAL)" OFF) | |||
option(UA_ENABLE_NODESETLOADER "Enable nodesetLoader public API" OFF) | |||
option(UA_ENABLE_PUSHMANAGEMENT "Enable pushManagement support" OFF) |
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.
The build flag should contain the term "GDS".
For example UA_ENABLE_GDS_PUSHMANAGEMENT
.
Can we differentiate the name for push-management between the GDS appliance and the receiving end?
* Copyright 2024 (c) Fraunhofer IOSB (Author: Noel Graf) | ||
*/ | ||
|
||
#include "ua_server_internal.h" |
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.
Rename the file to ua_server_ns0_gds.c
.
length = (fileContext->file->length - fileContext->currentPos); | ||
} | ||
|
||
UA_ByteString *readBuffer = UA_ByteString_new(); |
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.
This can be done easier once the length is correct.
UA_ByteString localCopy = fileContext->file;
localCopy.length = length;
localCopy.data += fileContext->currentPos;
UA_ByteString_copy(&localCopy, readBuffer);
fileContext->currentPos += length;
And of course check the result of the _copy as well.
ce80bce
to
9fd9fe5
Compare
9fd9fe5
to
cdada25
Compare
Hi Noel, |
UA_CertificateGroup *transactionCertGroup = | ||
UA_Transaction_getCertificateGroup(server->transaction, certGroup); | ||
if(transactionCertGroup == NULL) { | ||
return UA_STATUSCODE_BADINTERNALERROR; | ||
} |
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.
As far as I understand it, both the "AddCertificate" and "RemoveCertificate" Methods are supposed to work atomically, bypassing the transaction mechanism completely. As they do not return an "applyChanges" boolean, a user would not be able to derive if the Method started a transaction and hence requires a subsequent call to "applyChanges" later - or not.
What is more, the specification states that these functions shall abort with Bad_TransactionPending when a transaction is currently active on the specific CertificateGroup, see
https://reference.opcfoundation.org/GDS/v105/docs/7.8.2.4
That said, I think the code should rather look like this:
/* abort when a transaction is active on this CertGroup */ if(UA_GDSTransaction_containsCertificateGroup(server->transaction, certGroup->certificateGroupId)) { return UA_STATUSCODE_BADTRANSACTIONPENDING; }
UA_CertificateGroup *transactionCertGroup = | ||
UA_Transaction_getCertificateGroup(server->transaction, certGroup); | ||
if(transactionCertGroup == NULL) { | ||
return UA_STATUSCODE_BADINTERNALERROR; | ||
} |
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.
See comment for "addCertificate".
No description provided.