Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NoelGraf
Copy link
Member

No description provided.

Copy link
Member

@jpfr jpfr left a 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)
Copy link
Member

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"
Copy link
Member

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();
Copy link
Member

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.

@NoelGraf NoelGraf force-pushed the feat_gds_push_information_model branch from 9fd9fe5 to cdada25 Compare June 25, 2024 12:01
@mcpat
Copy link
Contributor

mcpat commented Jul 15, 2024

Hi Noel,
the "LastUpdateTime" property of TrustListType seems to be missing (if I'm not mistaken).

Comment on lines +291 to +295
UA_CertificateGroup *transactionCertGroup =
UA_Transaction_getCertificateGroup(server->transaction, certGroup);
if(transactionCertGroup == NULL) {
return UA_STATUSCODE_BADINTERNALERROR;
}

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; }

Comment on lines +372 to +376
UA_CertificateGroup *transactionCertGroup =
UA_Transaction_getCertificateGroup(server->transaction, certGroup);
if(transactionCertGroup == NULL) {
return UA_STATUSCODE_BADINTERNALERROR;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment for "addCertificate".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants