/* ========================================================================
* Copyright (c) 2005-2025 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using MQTTnet.Formatter;
namespace Opc.Ua.PubSub
{
///
/// The possible values for the FieldType encoding byte.
///
[Flags]
internal enum FieldTypeEncodingMask : byte
{
Variant = 0,
RawData = 1,
DataValue = 2,
Reserved = RawData | DataValue
}
///
/// The possible values for the NetworkMessage DataSetFlags1 encoding byte.
///
[Flags]
public enum DataSetFlags1EncodingMask : byte
{
///
/// No dataset flags usage.
///
None = 0,
///
/// Dataset flag set as message is valid.
///
MessageIsValid = 1,
// Field type options (FieldTypeEncodingMask)
///
/// Dataset flag SequenceNumber is set.
///
SequenceNumber = 8,
///
/// Dataset flag Status is set.
///
Status = 16,
///
/// Dataset flag ConfigurationVersionMajorVersion is set.
///
ConfigurationVersionMajorVersion = 32,
///
/// Dataset flags ConfigurationVersionMinorVersion is set.
///
ConfigurationVersionMinorVersion = 64,
///
/// DataSetFlags2 option is set.
///
DataSetFlags2 = 128
}
///
/// The possible values for the NetworkMessage DataSetFlags2 encoding byte.
///
[Flags]
public enum DataSetFlags2EncodingMask : byte
{
///
/// No dataset flag usage. Key Frame message
///
DataKeyFrame = 0,
///
/// Data Delta Frame message
///
DataDeltaFrame = 1,
///
/// Event DataSet message
///
Event = 2,
///
/// Dataset flag Timestamp is set.
///
Timestamp = 16,
///
/// Dataset flag PicoSeconds is set.
///
PicoSeconds = 32,
///
/// Dataset flag is reserved.
///
#pragma warning disable CA1700 // Do not name enum values 'Reserved'
Reserved = 64,
#pragma warning restore CA1700 // Do not name enum values 'Reserved'
///
/// Dataset flag is reserved for extended flags.
///
#pragma warning disable CA1700 // Do not name enum values 'Reserved'
ReservedForExtendedFlags = 128
#pragma warning restore CA1700 // Do not name enum values 'Reserved'
}
///
/// The possible values for the NetworkMessage UADPFlags encoding byte.
///
[Flags]
public enum UADPFlagsEncodingMask : byte
{
///
/// No UADP flag usage.
///
None = 0,
///
/// UADP PublisherId option is used.
///
PublisherId = 16,
///
/// UADP GroupHeader option is used.
///
GroupHeader = 32,
///
/// UADP PayloadHeader option is used.
///
PayloadHeader = 64,
///
/// UADP ExtendedFlags1 option is used.
///
ExtendedFlags1 = 128
}
///
/// The possible types of UADP network messages
///
[Flags]
public enum UADPNetworkMessageType
{
///
/// DataSet message
///
DataSetMessage = 0,
///
/// Discovery Request message
///
DiscoveryRequest = 4,
///
/// Discovery Response message
///
DiscoveryResponse = 8
}
///
/// The possible types of UADP network discovery response types
///
[Flags]
public enum UADPNetworkMessageDiscoveryType
{
///
/// Default value, no discovery response type.
///
None = 0,
///
/// Discovery Response message - PublisherEndpoint
///
PublisherEndpoint = 2,
///
/// Discovery Response message - MetaData
///
DataSetMetaData = 4,
///
/// Discovery Response message - MetaData
///
DataSetWriterConfiguration = 8
}
///
/// The possible values for the NetworkMessage ExtendedFlags1 encoding byte.
///
[Flags]
public enum ExtendedFlags1EncodingMask : byte
{
///
/// No ExtendedFlags1 usage.
///
None = 0,
// PublishedId type merge
///
/// UADP DataSetClassId option is used.
///
DataSetClassId = 8,
///
/// UADP Security option is used.
///
Security = 16,
///
/// UADP Timestamp option is used.
///
Timestamp = 32,
///
/// UADP PicoSeconds option is used.
///
PicoSeconds = 64,
///
/// UADP ExtendedFlags2 options are used.
///
ExtendedFlags2 = 128
}
///
/// The possible values for the NetworkMessage ExtendedFlags2 encoding byte.
///
[Flags]
public enum ExtendedFlags2EncodingMask : byte
{
///
/// No ExtendedFlags2 usage.
///
None = 0,
///
/// UADP ChunkMessage type is used.
///
ChunkMessage = 1,
///
/// UADP PromotedFields type are used.
///
PromotedFields = 2,
///
/// UADP NetworkMessageWithDiscoveryRequest type is used.
///
NetworkMessageWithDiscoveryRequest = 4,
///
/// UADP NetworkMessageWithDiscoveryResponse type is used.
///
NetworkMessageWithDiscoveryResponse = 8,
///
/// UADP ExtendedFlags2 type is reserved.
///
#pragma warning disable CA1700 // Do not name enum values 'Reserved'
Reserved = 16
#pragma warning restore CA1700 // Do not name enum values 'Reserved'
}
///
/// The possible values for the NetworkMessage PublisherIdType encoding byte.
///
[Flags]
internal enum PublisherIdTypeEncodingMask : byte
{
Byte = 0,
UInt16 = 1,
UInt32 = 2,
UInt64 = UInt16 | UInt32,
String = 4,
Reserved = UInt16 | String
}
///
/// The possible values for the NetworkMessage GroupFlags encoding byte.
///
[Flags]
public enum GroupFlagsEncodingMask : byte
{
///
/// No ExtendedFlags2 usage.
///
None = 0,
///
/// UADP GroupFlags WriterGroupId is used.
///
WriterGroupId = 1,
///
/// UADP GroupFlags GroupVersion is used.
///
GroupVersion = 2,
///
/// UADP GroupFlags NetworkMessageNumber is used.
///
NetworkMessageNumber = 4,
///
/// UADP GroupFlags SequenceNumber is used.
///
SequenceNumber = 8
}
///
/// The possible values for the NetworkMessage SecurityFlags encoding byte.
///
[Flags]
public enum SecurityFlagsEncodingMask : byte
{
///
/// No SecurityFlags usage.
///
None = 0,
///
/// UADP SecurityFlags NetworkMessageSigned is used.
///
NetworkMessageSigned = 1,
///
/// UADP SecurityFlags NetworkMessageEncrypted is used.
///
NetworkMessageEncrypted = 2,
///
/// UADP SecurityFlags SecurityFooter is used.
///
SecurityFooter = 4,
///
/// UADP SecurityFlags ForceKeyReset is used.
///
ForceKeyReset = 8,
///
/// UADP SecurityFlags is reserved.
///
#pragma warning disable CA1700 // Do not name enum values 'Reserved'
Reserved = 16
#pragma warning restore CA1700 // Do not name enum values 'Reserved'
}
///
/// Enumeration for possible transport protocols used with PubSub
///
public enum TransportProtocol
{
///
/// Not available.
///
NotAvailable,
///
/// UDP protocol.
///
UDP,
///
/// MQTT protocol.
///
MQTT,
///
/// AMQP protocol.
///
AMQP
}
///
/// The Mqtt Protocol Versions
///
public enum EnumMqttProtocolVersion
{
///
/// Unknown version
///
Unknown = MqttProtocolVersion.Unknown,
///
/// Mqtt V310
///
V310 = MqttProtocolVersion.V310,
///
/// Mqtt V311
///
V311 = MqttProtocolVersion.V311,
///
/// Mqtt V500
///
V500 = MqttProtocolVersion.V500
}
///
/// The identifiers of the MqttClientConfigurationParameters
///
internal enum EnumMqttClientConfigurationParameters
{
UserName,
Password,
AzureClientId,
CleanSession,
ProtocolVersion,
TlsCertificateCaCertificatePath,
TlsCertificateClientCertificatePath,
TlsCertificateClientCertificatePassword,
TlsProtocolVersion,
TlsAllowUntrustedCertificates,
TlsIgnoreCertificateChainErrors,
TlsIgnoreRevocationListErrors,
TrustedIssuerCertificatesStoreType,
TrustedIssuerCertificatesStorePath,
TrustedPeerCertificatesStoreType,
TrustedPeerCertificatesStorePath,
RejectedCertificateStoreStoreType,
RejectedCertificateStoreStorePath
}
///
/// Where is a method call used in
///
internal enum UsedInContext
{
///
/// Publisher context call
///
Publisher,
///
/// Subscriber context call
///
Subscriber,
///
/// Discovery context call
///
Discovery
}
///
/// The reason an error has been detected while decoding a DataSet
///
public enum DataSetDecodeErrorReason
{
///
/// There is no error detected
///
NoError,
///
/// The MetadataMajorVersion is different
///
MetadataMajorVersion
}
///
/// Enum that specifies the message mapping for a UaPubSub connection
///
public enum MessageMapping
{
///
/// UADP message type
///
Uadp,
///
/// JSON message type
///
Json
}
///
/// Enum that specifies the possible JSON message types
///
[Flags]
public enum JSONNetworkMessageType
{
///
/// The JSON message is invalid
///
Invalid = 0,
///
/// DataSet message
///
DataSetMessage = 1,
///
/// DataSetMetaData message
///
DataSetMetaData = 2
}
///
/// Enumeration that represents the possible Properties of an object from the that can be changed during runtime.
///
public enum ConfigurationProperty
{
///
/// None
///
None,
///
/// DataSetMetaData
///
DataSetMetaData,
///
/// ConfigurationVersion
///
ConfigurationVersion
}
}