ANSI C Based OPC UA Client/Server/PubSub SDK  1.9.1.442
UaServerUtilities

Functions

OpcUa_StatusCode UaServer_ProviderList_AddProvider (UaServer *a_pServer, UaServer_Provider *a_pProvider)
 Adds a new provider to the server configuration. More...
 
OpcUa_StatusCode UaServer_ProviderList_Create (UaServer *a_pServer)
 Initialize and Fill the Provider List. More...
 
OpcUa_StatusCode UaServer_ProviderList_ReserveProviders (UaServer *a_pServer, int numProviders)
 Reserves space in provider list to avoid later reallocation when calling AddProvider. More...
 
OpcUa_StatusCode UaServer_ProviderList_DeleteProvider (UaServer *a_pServer, OpcUa_UInt16 a_uNamespaceIndex)
 Deletes an existing provider. More...
 
UaServer_ProviderUaServer_ProviderList_GetProvider (UaServer *a_pServer, OpcUa_UInt16 a_NamespaceIndex)
 Returns the provider for the given namespace index. More...
 
UaServer_ProviderUaServer_ProviderList_GetProviderByName (UaServer *a_pServer, OpcUa_String *a_pProviderName)
 Returns the provider with the given name. More...
 
OpcUa_StatusCode UaServer_CreateVariantStringArray (OpcUa_Variant *pVariant, const OpcUa_CharA **pStringArray, OpcUa_UInt32 uNumberOfStrings)
 ToDoDoc. More...
 
OpcUa_StatusCode UaServer_CreateVariantUInt32Array (OpcUa_Variant *pVariant, OpcUa_UInt32 *pUInt32Array, OpcUa_UInt32 uNumberOfUInt32s)
 Create an array of Variant UInts. More...
 
OpcUa_Boolean OpcUa_Variant_CompareDeadbandAbsolute (OpcUa_Variant *a, OpcUa_Variant *b, OpcUa_Double deadbandValue)
 Compares two variants considering a deadband value. More...
 
OpcUa_Boolean OpcUa_Variant_CompareDeadbandPercent (OpcUa_Variant *a, OpcUa_Variant *b, OpcUa_Double deadbandValue, OpcUa_Double dLow, OpcUa_Double dHigh)
 Compares two variants considering a deadband percent value. More...
 
OpcUa_StatusCode UaServer_ParseIndexRange (const OpcUa_String *a_pString, UaServer_NumericRange *a_pRangeArray, OpcUa_UInt32 *a_pMaxRanges)
 Parses a NumericRange string. More...
 
OpcUa_StatusCode UaServer_VariantNumericRangePlausible (OpcUa_Variant *a_pVariant, UaServer_NumericRange *a_pRangeArray, OpcUa_Int32 a_NumRanges)
 Check if the given NumericRangeArray fits the Variant. More...
 
OpcUa_StatusCode UaServer_StringGetSubstring (const OpcUa_String *a_pString, OpcUa_UInt32 a_uFrom, OpcUa_UInt32 a_uTo, OpcUa_String **a_ppSubString)
 Returns a newly created string that is a substring of the given string. More...
 
OpcUa_StatusCode UaServer_VariantAdjustElementsByNumericRanges (OpcUa_Variant *a_pVariant, UaServer_NumericRange *a_pRangeArray, OpcUa_Int32 a_NumRanges)
 Choose the elements defined in the NumericRange array in the given Variant. More...
 
OpcUa_UInt16 UaServer_NamespaceIndex_GetByUri (const OpcUa_CharA *a_NamespaceURI)
 Returns the NamespaceIndex to the given NamespaceURI. More...
 
OpcUa_StatusCode UaServer_GetNonValueAttribute (OpcUa_UInt32 a_AttributeId, OpcUa_BaseNode *a_pNode, OpcUa_Variant *a_pValue, const UaServer_PublicSession *a_pSession)
 Fills the value of the given attribute of the node into a variant. More...
 
OpcUa_StatusCode UaServer_DecryptPassword (UaServer_PublicSession *a_pSession, OpcUa_ByteString *a_bsPassword, OpcUa_String *a_sEncryptionAlgorithm, OpcUa_String *a_sPassword)
 Decrypts a password from an OpcUa_UserNameIdentityToken. More...
 
static OpcUa_StatusCode UaServer_GetUserIdentity (OpcUa_String *a_sUsername, OpcUa_uid_t *a_pUID, OpcUa_gid_t *a_pGID, OpcUa_String *a_sPasswordHash, OpcUa_String *a_sPasswordSalt, OpcUa_String *a_sHashType, OpcUa_UInt32 *a_uHashRounds)
 Returns user identity information. More...
 
OpcUa_StatusCode UaServer_GetUserIdFromFile (OpcUa_String *a_sUsername, OpcUa_uid_t *a_pUID, OpcUa_gid_t *a_pGID)
 Returns user identity information. More...
 
OpcUa_StatusCode UaServer_GetGroupIdFromFile (OpcUa_String *a_sGroupname, OpcUa_gid_t *a_pGID)
 Returns the GID for the given groupname. More...
 
OpcUa_StatusCode UaServer_GetUserGroupsFromFile (OpcUa_String *a_sUsername, OpcUa_UInt16 *a_piNoGroups, OpcUa_gid_t a_pGroups[])
 Returns list of groups to which a user belongs. More...
 
OpcUa_StatusCode UaServer_GetUserPasswordHashFromFile (OpcUa_String *a_sUsername, OpcUa_String *a_sPasswordHash)
 Returns user password information. More...
 
OpcUa_StatusCode UaServer_GetUserPasswordHashFromFile_Ex (OpcUa_String *a_sUsername, OpcUa_String *a_sPasswordHash, OpcUa_String *a_sPasswordSalt, OpcUa_String *a_sHashType, OpcUa_UInt32 *a_uHashRounds)
 Returns user password information. More...
 

Detailed Description

Function Documentation

OpcUa_Boolean OpcUa_Variant_CompareDeadbandAbsolute ( OpcUa_Variant a,
OpcUa_Variant b,
OpcUa_Double  deadbandValue 
)

Compares two variants considering a deadband value.

Parameters
[in]aThe first variant to compare
[in]bThe second variant to compare
[in]deadbandValueThe deadband value to include
Returns
OpcUa_True if the difference between the values is bigger than the deadband value, OpcUa_False otherwise. OpcUa_False is also returned if the type or array sizes of the two variants don't match.
OpcUa_Boolean OpcUa_Variant_CompareDeadbandPercent ( OpcUa_Variant a,
OpcUa_Variant b,
OpcUa_Double  deadbandValue,
OpcUa_Double  dLow,
OpcUa_Double  dHigh 
)

Compares two variants considering a deadband percent value.

Parameters
[in]aThe first variant to compare
[in]bThe second variant to compare
[in]deadbandValueThe deadband value to include
[in]dLowThe low limit of the value's EURange
[in]dHighThe high limit of the value's EURange
Returns
OpcUa_True if (absolute value of (last cached value - current value) > (deadbandValue/100.0) * ((high–low) of EURange))), OpcUa_False otherwise. OpcUa_False is also returned if the type or array sizes of the two variants don't match.
OpcUa_StatusCode UaServer_CreateVariantStringArray ( OpcUa_Variant pVariant,
const OpcUa_CharA **  pStringArray,
OpcUa_UInt32  uNumberOfStrings 
)

ToDoDoc.

Parameters
pVarianta pointer to a variant variable.
pStringArraypointer to an array of Strings.
uNumberOfStringsthe number of Strings.
Returns
the OPC UA Status code.
OpcUa_StatusCode UaServer_CreateVariantUInt32Array ( OpcUa_Variant pVariant,
OpcUa_UInt32 *  pUInt32Array,
OpcUa_UInt32  uNumberOfUInt32s 
)

Create an array of Variant UInts.

Parameters
pVarianta pointer to a variant variable.
pUInt32Arraypointer to an array of UInts.
uNumberOfUInt32sthe number of UInts.
Returns
the OPC UA Status code.
OpcUa_StatusCode UaServer_DecryptPassword ( UaServer_PublicSession a_pSession,
OpcUa_ByteString a_bsPassword,
OpcUa_String a_sEncryptionAlgorithm,
OpcUa_String a_sPassword 
)

Decrypts a password from an OpcUa_UserNameIdentityToken.

Parameters
a_pSessionThe session the OpcUa_UserNameIdentityToken belongs to.
a_bsPasswordThe encrypted password.
a_sEncryptionAlgorithmThe encryption algorithm used to encrypt the password. If this string is empty, the password is assumed to be unencrypted and is copied to the output a_sPassword.
a_sPasswordPointer to a string where the decrypted password will be stored in. The string has to be freed after it has been used.
Returns
OpcUa_Good if decryption was successful
OpcUa_StatusCode UaServer_GetGroupIdFromFile ( OpcUa_String a_sGroupname,
OpcUa_gid_t *  a_pGID 
)

Returns the GID for the given groupname.

Parameters
a_sGroupnameName of the group.
a_pGIDNumeric group ID to return.
Returns
OpcUa_Good on success, OpcUa_Bad otherwise.
OpcUa_StatusCode UaServer_GetNonValueAttribute ( OpcUa_UInt32  a_AttributeId,
OpcUa_BaseNode *  a_pNode,
OpcUa_Variant a_pValue,
const UaServer_PublicSession a_pSession 
)

Fills the value of the given attribute of the node into a variant.

Parameters
a_AttributeIdthe attribute ID to get.
a_pNodethe node to get the data from.
a_pValuethe variant to store the data in.
a_pSessionthe session reading the value.
Returns
Good if successful, otherwise BadAttributeIdInvalid.
OpcUa_StatusCode UaServer_GetUserGroupsFromFile ( OpcUa_String a_sUsername,
OpcUa_UInt16 *  a_piNoGroups,
OpcUa_gid_t  a_pGroups[] 
)

Returns list of groups to which a user belongs.

Parameters
a_sUsernameThe username.
a_piNoGroupsNumber of groups.
a_pGroupsArray of group IDs.
Returns
OpcUa_Good on success, OpcUa_Bad otherwise.
static OpcUa_StatusCode UaServer_GetUserIdentity ( OpcUa_String a_sUsername,
OpcUa_uid_t *  a_pUID,
OpcUa_gid_t *  a_pGID,
OpcUa_String a_sPasswordHash,
OpcUa_String a_sPasswordSalt,
OpcUa_String a_sHashType,
OpcUa_UInt32 *  a_uHashRounds 
)
static

Returns user identity information.

Parameters
a_sUsernameThe username to lookup.
a_pUIDThe user id.
a_pGIDThe user's group id.
a_sPasswordHashThe user's password hash.
a_sPasswordSaltThe salt used for building the hash of the user's password.
a_sHashTypeThe hash function used, can be one of sha1, sha224, sha256, sha384, sha512, PBKDF2sha1, PBKDF2sha224, PBKDF2sha256, PBKDF2sha384, PBKDF2sha512.
a_uHashRoundsThe number of iterations for hashing.
Returns
OpcUa_Good on success, OpcUa_Bad otherwise.
OpcUa_StatusCode UaServer_GetUserIdFromFile ( OpcUa_String a_sUsername,
OpcUa_uid_t *  a_pUID,
OpcUa_gid_t *  a_pGID 
)

Returns user identity information.

Parameters
a_sUsernameThe username to lookup.
a_pUIDThe user id.
a_pGIDThe user's group id.
Returns
OpcUa_Good on success, OpcUa_Bad otherwise.
OpcUa_StatusCode UaServer_GetUserPasswordHashFromFile ( OpcUa_String a_sUsername,
OpcUa_String a_sPasswordHash 
)

Returns user password information.

Parameters
a_sUsernameThe username to lookup.
a_sPasswordHashThe hash of the user's password.
Returns
OpcUa_Good on success, OpcUa_Bad otherwise.
OpcUa_StatusCode UaServer_GetUserPasswordHashFromFile_Ex ( OpcUa_String a_sUsername,
OpcUa_String a_sPasswordHash,
OpcUa_String a_sPasswordSalt,
OpcUa_String a_sHashType,
OpcUa_UInt32 *  a_uHashRounds 
)

Returns user password information.

Parameters
a_sUsernameThe username to lookup.
a_sPasswordHashThe user's password hash.
a_sPasswordSaltThe salt used for building the hash of the user's password.
a_sHashTypeThe hash function used, can be one of sha1, sha224, sha256, sha384, sha512, PBKDF2sha1, PBKDF2sha224, PBKDF2sha256, PBKDF2sha384, PBKDF2sha512.
a_uHashRoundsThe number of iterations for hashing.
Returns
OpcUa_Good on success, OpcUa_Bad otherwise.
OpcUa_UInt16 UaServer_NamespaceIndex_GetByUri ( const OpcUa_CharA *  a_NamespaceURI)

Returns the NamespaceIndex to the given NamespaceURI.

Parameters
a_NamespaceURIthe NamespaceURI.
Returns
the NamespaceIndex.
OpcUa_StatusCode UaServer_ParseIndexRange ( const OpcUa_String a_pString,
UaServer_NumericRange *  a_pRangeArray,
OpcUa_UInt32 *  a_pMaxRanges 
)

Parses a NumericRange string.

Parameters
a_pStringString to parse.
a_pRangeArrayArray of ranges to fill.
a_pMaxRangesNumber of elements in array.
Returns
StatusCode
OpcUa_StatusCode UaServer_ProviderList_AddProvider ( UaServer a_pServer,
UaServer_Provider a_pProvider 
)

Adds a new provider to the server configuration.

Parameters
a_pServerDeprecated, can be omitted.
a_pProviderProvider configuration.
OpcUa_StatusCode UaServer_ProviderList_Create ( UaServer a_pServer)

Initialize and Fill the Provider List.

Parameters
a_pServera pointer to the actual server.
Returns
the OPC UA Status code.
OpcUa_StatusCode UaServer_ProviderList_DeleteProvider ( UaServer a_pServer,
OpcUa_UInt16  a_uNamespaceIndex 
)

Deletes an existing provider.

Parameters
a_pServerDeprecated, can be omitted.
a_uNamespaceIndexOne of the provider's namespace indices.
UaServer_Provider * UaServer_ProviderList_GetProvider ( UaServer a_pServer,
OpcUa_UInt16  a_NamespaceIndex 
)

Returns the provider for the given namespace index.

Parameters
a_pServerServer context.
a_NamespaceIndexThe namespace index.
Returns
Returns the pointer to the provider context if found or NULL if not found.
UaServer_Provider * UaServer_ProviderList_GetProviderByName ( UaServer a_pServer,
OpcUa_String a_pProviderName 
)

Returns the provider with the given name.

Parameters
a_pServerServer context.
a_pProviderNameThe name to search for.
Returns
Returns the pointer to the provider context if found or NULL if not found.
OpcUa_StatusCode UaServer_ProviderList_ReserveProviders ( UaServer a_pServer,
int  numProviders 
)

Reserves space in provider list to avoid later reallocation when calling AddProvider.

Parameters
a_pServerServer context.
numProvidersNumber of provider elements to preallocate.
OpcUa_StatusCode UaServer_StringGetSubstring ( const OpcUa_String a_pString,
OpcUa_UInt32  a_uFrom,
OpcUa_UInt32  a_uTo,
OpcUa_String **  a_ppSubString 
)

Returns a newly created string that is a substring of the given string.

Parameters
a_pStringthe string to get the substring from.
a_uFromthe starting point of the substring.
a_uTothe last position of the substring.
a_ppSubStringpointer to store the created substring in.
Returns
OpcUa_Good if ok
OpcUa_StatusCode UaServer_VariantAdjustElementsByNumericRanges ( OpcUa_Variant a_pVariant,
UaServer_NumericRange *  a_pRangeArray,
OpcUa_Int32  a_NumRanges 
)

Choose the elements defined in the NumericRange array in the given Variant.

Parameters
a_pVariantthe Variant to adjust.
a_pRangeArrayArray of ranges.
a_NumRangesNumber of elements in a_pRangeArray.
Returns
OpcUa_Good if ok
OpcUa_StatusCode UaServer_VariantNumericRangePlausible ( OpcUa_Variant a_pVariant,
UaServer_NumericRange *  a_pRangeArray,
OpcUa_Int32  a_NumRanges 
)

Check if the given NumericRangeArray fits the Variant.

Parameters
a_pVariantThe Variant to check.
a_pRangeArrayArray of ranges to check.
a_NumRangesNumber of elements in a_pRangeArray.
Returns
OpcUa_Good if ok