Quellcode durchsuchen

simplify alloc, add statuscode as enum

Julius Pfrommer vor 10 Jahren
Ursprung
Commit
ed7b8bf2c8

+ 1 - 1
CMakeLists.txt

@@ -4,9 +4,9 @@ cmake_minimum_required(VERSION 2.8.8)
 project(open62541 C)
 set(open62541_VERSION_MAJOR 0)
 set(open62541_VERSION_MINOR 1)
-set(CMAKE_C_FLAGS_DEBUG "-DDEBUG")
 
 set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
+set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG")
 
 # main sources of libopen62541
 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")

+ 227 - 0
include/ua_statuscodes.h

@@ -0,0 +1,227 @@
+/* This file shall only be included in ua_types.h */
+#ifdef UA_TYPES_H_
+#ifndef OPCUA_STATUSCODES_H_
+#define OPCUA_STATUSCODES_H_
+
+enum UA_StatusCode {
+	UA_STATUSCODE_GOOD = (UA_Int32) 0x00,
+	UA_STATUSCODE_BADUNEXPECTEDERROR = (UA_Int32) 0x80010000, // An unexpected error occurred.
+	UA_STATUSCODE_BADINTERNALERROR = (UA_Int32) 0x80020000, // An internal error occurred as a result of a programming or configuration error.
+	UA_STATUSCODE_BADOUTOFMEMORY = (UA_Int32) 0x80030000, // Not enough memory to complete the operation.
+	UA_STATUSCODE_BADRESOURCEUNAVAILABLE = (UA_Int32) 0x80040000, // An operating system resource is not available.
+	UA_STATUSCODE_BADCOMMUNICATIONERROR = (UA_Int32) 0x80050000, // A low level communication error occurred.
+	UA_STATUSCODE_BADENCODINGERROR = (UA_Int32) 0x80060000, // Encoding halted because of invalid data in the objects being serialized.
+	UA_STATUSCODE_BADDECODINGERROR = (UA_Int32) 0x80070000, // Decoding halted because of invalid data in the stream.
+	UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED = (UA_Int32) 0x80080000, // The message encoding/decoding limits imposed by the stack have been exceeded.
+	UA_STATUSCODE_BADREQUESTTOOLARGE = (UA_Int32) 0x80b80000, // The request message size exceeds limits set by the server.
+	UA_STATUSCODE_BADRESPONSETOOLARGE = (UA_Int32) 0x80b90000, // The response message size exceeds limits set by the client.
+	UA_STATUSCODE_BADUNKNOWNRESPONSE = (UA_Int32) 0x80090000, // An unrecognized response was received from the server.
+	UA_STATUSCODE_BADTIMEOUT = (UA_Int32) 0x800a0000, // The operation timed out.
+	UA_STATUSCODE_BADSERVICEUNSUPPORTED = (UA_Int32) 0x800b0000, // The server does not support the requested service.
+	UA_STATUSCODE_BADSHUTDOWN = (UA_Int32) 0x800c0000, // The operation was cancelled because the application is shutting down.
+	UA_STATUSCODE_BADSERVERNOTCONNECTED = (UA_Int32) 0x800d0000, // The operation could not complete because the client is not connected to the server.
+	UA_STATUSCODE_BADSERVERHALTED = (UA_Int32) 0x800e0000, // The server has stopped and cannot process any requests.
+	UA_STATUSCODE_BADNOTHINGTODO = (UA_Int32) 0x800f0000, // There was nothing to do because the client passed a list of operations with no elements.
+	UA_STATUSCODE_BADTOOMANYOPERATIONS = (UA_Int32) 0x80100000, // The request could not be processed because it specified too many operations.
+	UA_STATUSCODE_BADTOOMANYMONITOREDITEMS = (UA_Int32) 0x80db0000, // The request could not be processed because there are too many monitored items in the subscription.
+	UA_STATUSCODE_BADDATATYPEIDUNKNOWN = (UA_Int32) 0x80110000, // The extension object cannot be (de)serialized because the data type id is not recognized.
+	UA_STATUSCODE_BADCERTIFICATEINVALID = (UA_Int32) 0x80120000, // The certificate provided as a parameter is not valid.
+	UA_STATUSCODE_BADSECURITYCHECKSFAILED = (UA_Int32) 0x80130000, // An error occurred verifying security.
+	UA_STATUSCODE_BADCERTIFICATETIMEINVALID = (UA_Int32) 0x80140000, // The Certificate has expired or is not yet valid.
+	UA_STATUSCODE_BADCERTIFICATEISSUERTIMEINVALID = (UA_Int32) 0x80150000, // An Issuer Certificate has expired or is not yet valid.
+	UA_STATUSCODE_BADCERTIFICATEHOSTNAMEINVALID = (UA_Int32) 0x80160000, // The HostName used to connect to a Server does not match a HostName in the Certificate.
+	UA_STATUSCODE_BADCERTIFICATEURIINVALID = (UA_Int32) 0x80170000, // The URI specified in the ApplicationDescription does not match the URI in the Certificate.
+	UA_STATUSCODE_BADCERTIFICATEUSENOTALLOWED = (UA_Int32) 0x80180000, // The Certificate may not be used for the requested operation.
+	UA_STATUSCODE_BADCERTIFICATEISSUERUSENOTALLOWED = (UA_Int32) 0x80190000, // The Issuer Certificate may not be used for the requested operation.
+	UA_STATUSCODE_BADCERTIFICATEUNTRUSTED = (UA_Int32) 0x801a0000, // The Certificate is not trusted.
+	UA_STATUSCODE_BADCERTIFICATEREVOCATIONUNKNOWN = (UA_Int32) 0x801b0000, // It was not possible to determine if the Certificate has been revoked.
+	UA_STATUSCODE_BADCERTIFICATEISSUERREVOCATIONUNKNOWN = (UA_Int32) 0x801c0000, // It was not possible to determine if the Issuer Certificate has been revoked.
+	UA_STATUSCODE_BADCERTIFICATEREVOKED = (UA_Int32) 0x801d0000, // The Certificate has been revoked.
+	UA_STATUSCODE_BADCERTIFICATEISSUERREVOKED = (UA_Int32) 0x801e0000, // The Issuer Certificate has been revoked.
+	UA_STATUSCODE_BADUSERACCESSDENIED = (UA_Int32) 0x801f0000, // User does not have permission to perform the requested operation.
+	UA_STATUSCODE_BADIDENTITYTOKENINVALID = (UA_Int32) 0x80200000, // The user identity token is not valid.
+	UA_STATUSCODE_BADIDENTITYTOKENREJECTED = (UA_Int32) 0x80210000, // The user identity token is valid but the server has rejected it.
+	UA_STATUSCODE_BADSECURECHANNELIDINVALID = (UA_Int32) 0x80220000, // The specified secure channel is no longer valid.
+	UA_STATUSCODE_BADINVALIDTIMESTAMP = (UA_Int32) 0x80230000, // The timestamp is outside the range allowed by the server.
+	UA_STATUSCODE_BADNONCEINVALID = (UA_Int32) 0x80240000, // The nonce does appear to be not a random value or it is not the correct length.
+	UA_STATUSCODE_BADSESSIONIDINVALID = (UA_Int32) 0x80250000, // The session id is not valid.
+	UA_STATUSCODE_BADSESSIONCLOSED = (UA_Int32) 0x80260000, // The session was closed by the client.
+	UA_STATUSCODE_BADSESSIONNOTACTIVATED = (UA_Int32) 0x80270000, // The session cannot be used because ActivateSession has not been called.
+	UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID = (UA_Int32) 0x80280000, // The subscription id is not valid.
+	UA_STATUSCODE_BADREQUESTHEADERINVALID = (UA_Int32) 0x802a0000, // The header for the request is missing or invalid.
+	UA_STATUSCODE_BADTIMESTAMPSTORETURNINVALID = (UA_Int32) 0x802b0000, // The timestamps to return parameter is invalid.
+	UA_STATUSCODE_BADREQUESTCANCELLEDBYCLIENT = (UA_Int32) 0x802c0000, // The request was cancelled by the client.
+	UA_STATUSCODE_GOODSUBSCRIPTIONTRANSFERRED = (UA_Int32) 0x002d0000, // The subscription was transferred to another session.
+	UA_STATUSCODE_GOODCOMPLETESASYNCHRONOUSLY = (UA_Int32) 0x002e0000, // The processing will complete asynchronously.
+	UA_STATUSCODE_GOODOVERLOAD = (UA_Int32) 0x002f0000, // Sampling has slowed down due to resource limitations.
+	UA_STATUSCODE_GOODCLAMPED = (UA_Int32) 0x00300000, // The value written was accepted but was clamped.
+	UA_STATUSCODE_BADNOCOMMUNICATION = (UA_Int32) 0x80310000, // Communication with the data source is defined, but not established, and there is no last known value available.
+	UA_STATUSCODE_BADWAITINGFORINITIALDATA = (UA_Int32) 0x80320000, // Waiting for the server to obtain values from the underlying data source.
+	UA_STATUSCODE_BADNODEIDINVALID = (UA_Int32) 0x80330000, // The syntax of the node id is not valid.
+	UA_STATUSCODE_BADNODEIDUNKNOWN = (UA_Int32) 0x80340000, // The node id refers to a node that does not exist in the server address space.
+	UA_STATUSCODE_BADATTRIBUTEIDINVALID = (UA_Int32) 0x80350000, // The attribute is not supported for the specified Node.
+	UA_STATUSCODE_BADINDEXRANGEINVALID = (UA_Int32) 0x80360000, // The syntax of the index range parameter is invalid.
+	UA_STATUSCODE_BADINDEXRANGENODATA = (UA_Int32) 0x80370000, // No data exists within the range of indexes specified.
+	UA_STATUSCODE_BADDATAENCODINGINVALID = (UA_Int32) 0x80380000, // The data encoding is invalid.
+	UA_STATUSCODE_BADDATAENCODINGUNSUPPORTED = (UA_Int32) 0x80390000, // The server does not support the requested data encoding for the node.
+	UA_STATUSCODE_BADNOTREADABLE = (UA_Int32) 0x803a0000, // The access level does not allow reading or subscribing to the Node.
+	UA_STATUSCODE_BADNOTWRITABLE = (UA_Int32) 0x803b0000, // The access level does not allow writing to the Node.
+	UA_STATUSCODE_BADOUTOFRANGE = (UA_Int32) 0x803c0000, // The value was out of range.
+	UA_STATUSCODE_BADNOTSUPPORTED = (UA_Int32) 0x803d0000, // The requested operation is not supported.
+	UA_STATUSCODE_BADNOTFOUND = (UA_Int32) 0x803e0000, // A requested item was not found or a search operation ended without success.
+	UA_STATUSCODE_BADOBJECTDELETED = (UA_Int32) 0x803f0000, // The object cannot be used because it has been deleted.
+	UA_STATUSCODE_BADNOTIMPLEMENTED = (UA_Int32) 0x80400000, // Requested operation is not implemented.
+	UA_STATUSCODE_BADMONITORINGMODEINVALID = (UA_Int32) 0x80410000, // The monitoring mode is invalid.
+	UA_STATUSCODE_BADMONITOREDITEMIDINVALID = (UA_Int32) 0x80420000, // The monitoring item id does not refer to a valid monitored item.
+	UA_STATUSCODE_BADMONITOREDITEMFILTERINVALID = (UA_Int32) 0x80430000, // The monitored item filter parameter is not valid.
+	UA_STATUSCODE_BADMONITOREDITEMFILTERUNSUPPORTED = (UA_Int32) 0x80440000, // The server does not support the requested monitored item filter.
+	UA_STATUSCODE_BADFILTERNOTALLOWED = (UA_Int32) 0x80450000, // A monitoring filter cannot be used in combination with the attribute specified.
+	UA_STATUSCODE_BADSTRUCTUREMISSING = (UA_Int32) 0x80460000, // A mandatory structured parameter was missing or null.
+	UA_STATUSCODE_BADEVENTFILTERINVALID = (UA_Int32) 0x80470000, // The event filter is not valid.
+	UA_STATUSCODE_BADCONTENTFILTERINVALID = (UA_Int32) 0x80480000, // The content filter is not valid.
+	UA_STATUSCODE_BADFILTEROPERATORINVALID = (UA_Int32) 0x80c10000, // An unregognized operator was provided in a filter.
+	UA_STATUSCODE_BADFILTEROPERATORUNSUPPORTED = (UA_Int32) 0x80c20000, // A valid operator was provided, but the server does not provide support for this filter operator.
+	UA_STATUSCODE_BADFILTEROPERANDCOUNTMISMATCH = (UA_Int32) 0x80c30000, // The number of operands provided for the filter operator was less then expected for the operand provided.
+	UA_STATUSCODE_BADFILTEROPERANDINVALID = (UA_Int32) 0x80490000, // The operand used in a content filter is not valid.
+	UA_STATUSCODE_BADFILTERELEMENTINVALID = (UA_Int32) 0x80c40000, // The referenced element is not a valid element in the content filter.
+	UA_STATUSCODE_BADFILTERLITERALINVALID = (UA_Int32) 0x80c50000, // The referenced literal is not a valid value.
+	UA_STATUSCODE_BADCONTINUATIONPOINTINVALID = (UA_Int32) 0x804a0000, // The continuation point provide is longer valid.
+	UA_STATUSCODE_BADNOCONTINUATIONPOINTS = (UA_Int32) 0x804b0000, // The operation could not be processed because all continuation points have been allocated.
+	UA_STATUSCODE_BADREFERENCETYPEIDINVALID = (UA_Int32) 0x804c0000, // The operation could not be processed because all continuation points have been allocated.
+	UA_STATUSCODE_BADBROWSEDIRECTIONINVALID = (UA_Int32) 0x804d0000, // The browse direction is not valid.
+	UA_STATUSCODE_BADNODENOTINVIEW = (UA_Int32) 0x804e0000, // The node is not part of the view.
+	UA_STATUSCODE_BADSERVERURIINVALID = (UA_Int32) 0x804f0000, // The ServerUri is not a valid URI.
+	UA_STATUSCODE_BADSERVERNAMEMISSING = (UA_Int32) 0x80500000, // No ServerName was specified.
+	UA_STATUSCODE_BADDISCOVERYURLMISSING = (UA_Int32) 0x80510000, // No DiscoveryUrl was specified.
+	UA_STATUSCODE_BADSEMPAHOREFILEMISSING = (UA_Int32) 0x80520000, // The semaphore file specified by the client is not valid.
+	UA_STATUSCODE_BADREQUESTTYPEINVALID = (UA_Int32) 0x80530000, // The security token request type is not valid.
+	UA_STATUSCODE_BADSECURITYMODEREJECTED = (UA_Int32) 0x80540000, // The security mode does not meet the requirements set by the Server.
+	UA_STATUSCODE_BADSECURITYPOLICYREJECTED = (UA_Int32) 0x80550000, // The security policy does not meet the requirements set by the Server.
+	UA_STATUSCODE_BADTOOMANYSESSIONS = (UA_Int32) 0x80560000, // The server has reached its maximum number of sessions.
+	UA_STATUSCODE_BADUSERSIGNATUREINVALID = (UA_Int32) 0x80570000, // The user token signature is missing or invalid.
+	UA_STATUSCODE_BADAPPLICATIONSIGNATUREINVALID = (UA_Int32) 0x80580000, // The signature generated with the client certificate is missing or invalid.
+	UA_STATUSCODE_BADNOVALIDCERTIFICATES = (UA_Int32) 0x80590000, // The client did not provide at least one software certificate that is valid and meets the profile requirements for the server.
+	UA_STATUSCODE_BADIDENTITYCHANGENOTSUPPORTED = (UA_Int32) 0x80c60000, // The Server does not support changing the user identity assigned to the session.
+	UA_STATUSCODE_BADREQUESTCANCELLEDBYREQUEST = (UA_Int32) 0x805a0000, // The request was cancelled by the client with the Cancel service.
+	UA_STATUSCODE_BADPARENTNODEIDINVALID = (UA_Int32) 0x805b0000, // The parent node id does not to refer to a valid node.
+	UA_STATUSCODE_BADREFERENCENOTALLOWED = (UA_Int32) 0x805c0000, // The reference could not be created because it violates constraints imposed by the data model.
+	UA_STATUSCODE_BADNODEIDREJECTED = (UA_Int32) 0x805d0000, // The requested node id was reject because it was either invalid or server does not allow node ids to be specified by the client.
+	UA_STATUSCODE_BADNODEIDEXISTS = (UA_Int32) 0x805e0000, // The requested node id is already used by another node.
+	UA_STATUSCODE_BADNODECLASSINVALID = (UA_Int32) 0x805f0000, // The node class is not valid.
+	UA_STATUSCODE_BADBROWSENAMEINVALID = (UA_Int32) 0x80600000, // The browse name is invalid.
+	UA_STATUSCODE_BADBROWSENAMEDUPLICATED = (UA_Int32) 0x80610000, // The browse name is not unique among nodes that share the same relationship with the parent.
+	UA_STATUSCODE_BADNODEATTRIBUTESINVALID = (UA_Int32) 0x80620000, // The node attributes are not valid for the node class.
+	UA_STATUSCODE_BADTYPEDEFINITIONINVALID = (UA_Int32) 0x80630000, // The type definition node id does not reference an appropriate type node.
+	UA_STATUSCODE_BADSOURCENODEIDINVALID = (UA_Int32) 0x80640000, // The source node id does not reference a valid node.
+	UA_STATUSCODE_BADTARGETNODEIDINVALID = (UA_Int32) 0x80650000, // The target node id does not reference a valid node.
+	UA_STATUSCODE_BADDUPLICATEREFERENCENOTALLOWED = (UA_Int32) 0x80660000, // The reference type between the nodes is already defined.
+	UA_STATUSCODE_BADINVALIDSELFREFERENCE = (UA_Int32) 0x80670000, // The server does not allow this type of self reference on this node.
+	UA_STATUSCODE_BADREFERENCELOCALONLY = (UA_Int32) 0x80680000, // The reference type is not valid for a reference to a remote server.
+	UA_STATUSCODE_BADNODELETERIGHTS = (UA_Int32) 0x80690000, // The server will not allow the node to be deleted.
+	UA_STATUSCODE_UNCERTAINREFERENCENOTDELETED = (UA_Int32) 0x40bc0000, // The server was not able to delete all target references.
+	UA_STATUSCODE_BADSERVERINDEXINVALID = (UA_Int32) 0x806a0000, // The server index is not valid.
+	UA_STATUSCODE_BADVIEWIDUNKNOWN = (UA_Int32) 0x806b0000, // The view id does not refer to a valid view node.
+	UA_STATUSCODE_BADVIEWTIMESTAMPINVALID = (UA_Int32) 0x80c90000, // The view timestamp is not available or not supported.
+	UA_STATUSCODE_BADVIEWPARAMETERMISMATCH = (UA_Int32) 0x80ca0000, // The view parameters are not consistent with each other.
+	UA_STATUSCODE_BADVIEWVERSIONINVALID = (UA_Int32) 0x80cb0000, // The view version is not available or not supported.
+	UA_STATUSCODE_UNCERTAINNOTALLNODESAVAILABLE = (UA_Int32) 0x40c00000, // The list of references may not be complete because the underlying system is not available.
+	UA_STATUSCODE_GOODRESULTSMAYBEINCOMPLETE = (UA_Int32) 0x00ba0000, // The server should have followed a reference to a node in a remote server but did not. The result set may be incomplete.
+	UA_STATUSCODE_BADNOTTYPEDEFINITION = (UA_Int32) 0x80c80000, // The provided Nodeid was not a type definition nodeid.
+	UA_STATUSCODE_UNCERTAINREFERENCEOUTOFSERVER = (UA_Int32) 0x406c0000, // One of the references to follow in the relative path references to a node in the address space in another server.
+	UA_STATUSCODE_BADTOOMANYMATCHES = (UA_Int32) 0x806d0000, // The requested operation has too many matches to return.
+	UA_STATUSCODE_BADQUERYTOOCOMPLEX = (UA_Int32) 0x806e0000, // The requested operation requires too many resources in the server.
+	UA_STATUSCODE_BADNOMATCH = (UA_Int32) 0x806f0000, // The requested operation has no match to return.
+	UA_STATUSCODE_BADMAXAGEINVALID = (UA_Int32) 0x80700000, // The max age parameter is invalid.
+	UA_STATUSCODE_BADHISTORYOPERATIONINVALID = (UA_Int32) 0x80710000, // The history details parameter is not valid.
+	UA_STATUSCODE_BADHISTORYOPERATIONUNSUPPORTED = (UA_Int32) 0x80720000, // The server does not support the requested operation.
+	UA_STATUSCODE_BADINVALIDTIMESTAMPARGUMENT = (UA_Int32) 0x80bd0000, // The defined timestamp to return was invalid.
+	UA_STATUSCODE_BADWRITENOTSUPPORTED = (UA_Int32) 0x80730000, // The server not does support writing the combination of value, status and timestamps provided.
+	UA_STATUSCODE_BADTYPEMISMATCH = (UA_Int32) 0x80740000, // The value supplied for the attribute is not of the same type as the attribute's value.
+	UA_STATUSCODE_BADMETHODINVALID = (UA_Int32) 0x80750000, // The method id does not refer to a method for the specified object.
+	UA_STATUSCODE_BADARGUMENTSMISSING = (UA_Int32) 0x80760000, // The client did not specify all of the input arguments for the method.
+	UA_STATUSCODE_BADTOOMANYSUBSCRIPTIONS = (UA_Int32) 0x80770000, // The server has reached its  maximum number of subscriptions.
+	UA_STATUSCODE_BADTOOMANYPUBLISHREQUESTS = (UA_Int32) 0x80780000, // The server has reached the maximum number of queued publish requests.
+	UA_STATUSCODE_BADNOSUBSCRIPTION = (UA_Int32) 0x80790000, // There is no subscription available for this session.
+	UA_STATUSCODE_BADSEQUENCENUMBERUNKNOWN = (UA_Int32) 0x807a0000, // The sequence number is unknown to the server.
+	UA_STATUSCODE_BADMESSAGENOTAVAILABLE = (UA_Int32) 0x807b0000, // The requested notification message is no longer available.
+	UA_STATUSCODE_BADINSUFFICIENTCLIENTPROFILE = (UA_Int32) 0x807c0000, // The Client of the current Session does not support one or more Profiles that are necessary for the Subscription.
+	UA_STATUSCODE_BADSTATENOTACTIVE = (UA_Int32) 0x80bf0000, // The sub-state machine is not currently active.
+	UA_STATUSCODE_BADTCPSERVERTOOBUSY = (UA_Int32) 0x807d0000, // The server cannot process the request because it is too busy.
+	UA_STATUSCODE_BADTCPMESSAGETYPEINVALID = (UA_Int32) 0x807e0000, // The type of the message specified in the header invalid.
+	UA_STATUSCODE_BADTCPSECURECHANNELUNKNOWN = (UA_Int32) 0x807f0000, // The SecureChannelId and/or TokenId are not currently in use.
+	UA_STATUSCODE_BADTCPMESSAGETOOLARGE = (UA_Int32) 0x80800000, // The size of the message specified in the header is too large.
+	UA_STATUSCODE_BADTCPNOTENOUGHRESOURCES = (UA_Int32) 0x80810000, // There are not enough resources to process the request.
+	UA_STATUSCODE_BADTCPINTERNALERROR = (UA_Int32) 0x80820000, // An internal error occurred.
+	UA_STATUSCODE_BADTCPENDPOINTURLINVALID = (UA_Int32) 0x80830000, // The Server does not recognize the QueryString specified.
+	UA_STATUSCODE_BADREQUESTINTERRUPTED = (UA_Int32) 0x80840000, // The request could not be sent because of a network interruption.
+	UA_STATUSCODE_BADREQUESTTIMEOUT = (UA_Int32) 0x80850000, // Timeout occurred while processing the request.
+	UA_STATUSCODE_BADSECURECHANNELCLOSED = (UA_Int32) 0x80860000, // The secure channel has been closed.
+	UA_STATUSCODE_BADSECURECHANNELTOKENUNKNOWN = (UA_Int32) 0x80870000, // The token has expired or is not recognized.
+	UA_STATUSCODE_BADSEQUENCENUMBERINVALID = (UA_Int32) 0x80880000, // The sequence number is not valid.
+	UA_STATUSCODE_BADPROTOCOLVERSIONUNSUPPORTED = (UA_Int32) 0x80be0000, // The applications do not have compatible protocol versions.
+	UA_STATUSCODE_BADCONFIGURATIONERROR = (UA_Int32) 0x80890000, // There is a problem with the configuration that affects the usefulness of the value.
+	UA_STATUSCODE_BADNOTCONNECTED = (UA_Int32) 0x808a0000, // The variable should receive its value from another variable, but has never been configured to do so.
+	UA_STATUSCODE_BADDEVICEFAILURE = (UA_Int32) 0x808b0000, // There has been a failure in the device/data source that generates the value that has affected the value.
+	UA_STATUSCODE_BADSENSORFAILURE = (UA_Int32) 0x808c0000, // There has been a failure in the sensor from which the value is derived by the device/data source.
+	UA_STATUSCODE_BADOUTOFSERVICE = (UA_Int32) 0x808d0000, // The source of the data is not operational.
+	UA_STATUSCODE_BADDEADBANDFILTERINVALID = (UA_Int32) 0x808e0000, // The deadband filter is not valid.
+	UA_STATUSCODE_UNCERTAINNOCOMMUNICATIONLASTUSABLEVALUE = (UA_Int32) 0x408f0000, // Communication to the data source has failed. The variable value is the last value that had a good quality.
+	UA_STATUSCODE_UNCERTAINLASTUSABLEVALUE = (UA_Int32) 0x40900000, // Whatever was updating this value has stopped doing so.
+	UA_STATUSCODE_UNCERTAINSUBSTITUTEVALUE = (UA_Int32) 0x40910000, // The value is an operational value that was manually overwritten.
+	UA_STATUSCODE_UNCERTAININITIALVALUE = (UA_Int32) 0x40920000, // The value is an initial value for a variable that normally receives its value from another variable.
+	UA_STATUSCODE_UNCERTAINSENSORNOTACCURATE = (UA_Int32) 0x40930000, // The value is at one of the sensor limits.
+	UA_STATUSCODE_UNCERTAINENGINEERINGUNITSEXCEEDED = (UA_Int32) 0x40940000, // The value is outside of the range of values defined for this parameter.
+	UA_STATUSCODE_UNCERTAINSUBNORMAL = (UA_Int32) 0x40950000, // The value is derived from multiple sources and has less than the required number of Good sources.
+	UA_STATUSCODE_GOODLOCALOVERRIDE = (UA_Int32) 0x00960000, // The value has been overridden.
+	UA_STATUSCODE_BADREFRESHINPROGRESS = (UA_Int32) 0x80970000, // This Condition refresh failed, a Condition refresh operation is already in progress.
+	UA_STATUSCODE_BADCONDITIONALREADYDISABLED = (UA_Int32) 0x80980000, // This condition has already been disabled.
+	UA_STATUSCODE_BADCONDITIONALREADYENABLED = (UA_Int32) 0x80cc0000, // This condition has already been enabled.
+	UA_STATUSCODE_BADCONDITIONDISABLED = (UA_Int32) 0x80990000, // Property not available, this condition is disabled.
+	UA_STATUSCODE_BADEVENTIDUNKNOWN = (UA_Int32) 0x809a0000, // The specified event id is not recognized.
+	UA_STATUSCODE_BADEVENTNOTACKNOWLEDGEABLE = (UA_Int32) 0x80bb0000, // The event cannot be acknowledged.
+	UA_STATUSCODE_BADDIALOGNOTACTIVE = (UA_Int32) 0x80cd0000, // The dialog condition is not active.
+	UA_STATUSCODE_BADDIALOGRESPONSEINVALID = (UA_Int32) 0x80ce0000, // The response is not valid for the dialog.
+	UA_STATUSCODE_BADCONDITIONBRANCHALREADYACKED = (UA_Int32) 0x80cf0000, // The condition branch has already been acknowledged.
+	UA_STATUSCODE_BADCONDITIONBRANCHALREADYCONFIRMED = (UA_Int32) 0x80d00000, // The condition branch has already been confirmed.
+	UA_STATUSCODE_BADCONDITIONALREADYSHELVED = (UA_Int32) 0x80d10000, // The condition has already been shelved.
+	UA_STATUSCODE_BADCONDITIONNOTSHELVED = (UA_Int32) 0x80d20000, // The condition is not currently shelved.
+	UA_STATUSCODE_BADSHELVINGTIMEOUTOFRANGE = (UA_Int32) 0x80d30000, // The shelving time not within an acceptable range.
+	UA_STATUSCODE_BADNODATA = (UA_Int32) 0x809b0000, // No data exists for the requested time range or event filter.
+	UA_STATUSCODE_BADBOUNDNOTFOUND = (UA_Int32) 0x80d70000, // No data found to provide upper or lower bound value.
+	UA_STATUSCODE_BADBOUNDNOTSUPPORTED = (UA_Int32) 0x80d80000, // The server cannot retrieve a bound for the variable.
+	UA_STATUSCODE_BADDATALOST = (UA_Int32) 0x809d0000, // Data is missing due to collection started/stopped/lost.
+	UA_STATUSCODE_BADDATAUNAVAILABLE = (UA_Int32) 0x809e0000, // Expected data is unavailable for the requested time range due to an un-mounted volume, an off-line archive or tape, or similar reason for temporary unavailability.
+	UA_STATUSCODE_BADENTRYEXISTS = (UA_Int32) 0x809f0000, // The data or event was not successfully inserted because a matching entry exists.
+	UA_STATUSCODE_BADNOENTRYEXISTS = (UA_Int32) 0x80a00000, // The data or event was not successfully updated because no matching entry exists.
+	UA_STATUSCODE_BADTIMESTAMPNOTSUPPORTED = (UA_Int32) 0x80a10000, // The client requested history using a timestamp format the server does not support (i.e requested ServerTimestamp when server only supports SourceTimestamp).
+	UA_STATUSCODE_GOODENTRYINSERTED = (UA_Int32) 0x00a20000, // The data or event was successfully inserted into the historical database.
+	UA_STATUSCODE_GOODENTRYREPLACED = (UA_Int32) 0x00a30000, // The data or event field was successfully replaced in the historical database.
+	UA_STATUSCODE_UNCERTAINDATASUBNORMAL = (UA_Int32) 0x40a40000, // The value is derived from multiple values and has less than the required number of Good values.
+	UA_STATUSCODE_GOODNODATA = (UA_Int32) 0x00a50000, // No data exists for the requested time range or event filter.
+	UA_STATUSCODE_GOODMOREDATA = (UA_Int32) 0x00a60000, // The data or event field was successfully replaced in the historical database.
+	UA_STATUSCODE_BADAGGREGATELISTMISMATCH = (UA_Int32) 0x80d40000, // The requested number of Aggregates does not match the requested number of NodeIds.
+	UA_STATUSCODE_BADAGGREGATENOTSUPPORTED = (UA_Int32) 0x80d50000, // The requested Aggregate is not support by the server.
+	UA_STATUSCODE_BADAGGREGATEINVALIDINPUTS = (UA_Int32) 0x80d60000, // The aggregate value could not be derived due to invalid data inputs.
+	UA_STATUSCODE_BADAGGREGATECONFIGURATIONREJECTED = (UA_Int32) 0x80da0000, // The aggregate configuration is not valid for specified node.
+	UA_STATUSCODE_GOODDATAIGNORED = (UA_Int32) 0x00d90000, // The request pecifies fields which are not valid for the EventType or cannot be saved by the historian.
+	UA_STATUSCODE_GOODCOMMUNICATIONEVENT = (UA_Int32) 0x00a70000, // The communication layer has raised an event.
+	UA_STATUSCODE_GOODSHUTDOWNEVENT = (UA_Int32) 0x00a80000, // The system is shutting down.
+	UA_STATUSCODE_GOODCALLAGAIN = (UA_Int32) 0x00a90000, // The operation is not finished and needs to be called again.
+	UA_STATUSCODE_GOODNONCRITICALTIMEOUT = (UA_Int32) 0x00aa0000, // A non-critical timeout occurred.
+	UA_STATUSCODE_BADINVALIDARGUMENT = (UA_Int32) 0x80ab0000, // One or more arguments are invalid.
+	UA_STATUSCODE_BADCONNECTIONREJECTED = (UA_Int32) 0x80ac0000, // Could not establish a network connection to remote server.
+	UA_STATUSCODE_BADDISCONNECT = (UA_Int32) 0x80ad0000, // The server has disconnected from the client.
+	UA_STATUSCODE_BADCONNECTIONCLOSED = (UA_Int32) 0x80ae0000, // The network connection has been closed.
+	UA_STATUSCODE_BADINVALIDSTATE = (UA_Int32) 0x80af0000, // The operation cannot be completed because the object is closed, uninitialized or in some other invalid state.
+	UA_STATUSCODE_BADENDOFSTREAM = (UA_Int32) 0x80b00000, // Cannot move beyond end of the stream.
+	UA_STATUSCODE_BADNODATAAVAILABLE = (UA_Int32) 0x80b10000, // No data is currently available for reading from a non-blocking stream.
+	UA_STATUSCODE_BADWAITINGFORRESPONSE = (UA_Int32) 0x80b20000, // The asynchronous operation is waiting for a response.
+	UA_STATUSCODE_BADOPERATIONABANDONED = (UA_Int32) 0x80b30000, // The asynchronous operation was abandoned by the caller.
+	UA_STATUSCODE_BADEXPECTEDSTREAMTOBLOCK = (UA_Int32) 0x80b40000, // The stream did not return all data requested (possibly because it is a non-blocking stream).
+	UA_STATUSCODE_BADWOULDBLOCK = (UA_Int32) 0x80b50000, // Non blocking behaviour is required and the operation would block.
+	UA_STATUSCODE_BADSYNTAXERROR = (UA_Int32) 0x80b60000, // A value had an invalid syntax.
+	UA_STATUSCODE_BADMAXCONNECTIONSREACHED = (UA_Int32) 0x80b70000 // The operation could not be finished because all available connections are in use.
+};
+
+#endif /* UA_STATUSCODES_H_ */
+#endif /* UA_TYPES_H_ */

+ 3 - 2
include/ua_types.h

@@ -176,8 +176,9 @@ typedef struct UA_ExpandedNodeId {
     UA_UInt32 serverIndex;  // not encoded if 0
 } UA_ExpandedNodeId;
 
+#include "ua_statuscodes.h"
 /** @brief A numeric identifier for a error or condition that is associated with a value or an operation. */
-typedef UA_UInt32 UA_StatusCode; // StatusCodes aren't an enum(=int) since 32 unsigned bits are needed. See also ua_statuscodes.h */
+typedef enum UA_StatusCode UA_StatusCode; // StatusCodes aren't an enum(=int) since 32 unsigned bits are needed. See also ua_statuscodes.h */
 
 /** @brief A name qualified by a namespace. */
 typedef struct UA_QualifiedName {
@@ -489,7 +490,7 @@ struct UA_VTable_Entry {
 
 #define UA_TYPE_NEW_DEFAULT(TYPE)                            \
     UA_Int32 TYPE##_new(TYPE **p) {                          \
-        if(UA_alloc((void **)p, sizeof(TYPE)) != UA_SUCCESS) \
+        if(!(*p = UA_alloc(sizeof(TYPE))))                    \
             return UA_ERROR;                                 \
         TYPE##_init(*p);                                     \
         return UA_SUCCESS;                                   \

+ 7 - 6
src/server/ua_nodestore.c

@@ -1,5 +1,6 @@
 #include "ua_nodestore.h"
 #include "ua_util.h"
+#include "ua_statuscodes.h"
 
 struct UA_NodeStore {
     const UA_Node **entries;
@@ -223,8 +224,8 @@ static UA_Int32 expand(UA_NodeStore *ns) {
     nindex = higher_prime_index(count * 2);
     nsize  = primes[nindex];
 
-    if(UA_alloc((void **)&nentries, sizeof(UA_Node *) * nsize) != UA_SUCCESS)
-        return UA_ERR_NO_MEMORY;
+    if(!(nentries = UA_alloc(sizeof(UA_Node *) * nsize)))
+        return UA_STATUSCODE_BADOUTOFMEMORY;
 
     memset(nentries, 0, nsize * sizeof(UA_Node *));
     ns->entries = nentries;
@@ -252,14 +253,14 @@ static UA_Int32 expand(UA_NodeStore *ns) {
 UA_Int32 UA_NodeStore_new(UA_NodeStore **result) {
     UA_NodeStore *ns;
     UA_UInt32     sizePrimeIndex, size;
-    if(UA_alloc((void **)&ns, sizeof(UA_NodeStore)) != UA_SUCCESS)
-        return UA_ERR_NO_MEMORY;
+    if(!(ns = UA_alloc(sizeof(UA_NodeStore))))
+        return UA_STATUSCODE_BADOUTOFMEMORY;
 
     sizePrimeIndex = higher_prime_index(32);
     size = primes[sizePrimeIndex];
-    if(UA_alloc((void **)&ns->entries, sizeof(UA_Node *) * size) != UA_SUCCESS) {
+    if(!(ns->entries = UA_alloc(sizeof(UA_Node *) * size))) {
         UA_free(ns);
-        return UA_ERR_NO_MEMORY;
+        return UA_STATUSCODE_BADOUTOFMEMORY;
     }
 
     /* set entries to zero */

+ 4 - 3
src/server/ua_securechannel_manager.c

@@ -1,6 +1,7 @@
 #include "ua_securechannel_manager.h"
 #include "ua_session.h"
 #include "ua_util.h"
+#include "ua_statuscodes.h"
 
 struct channel_list_entry {
     UA_SecureChannel channel;
@@ -21,7 +22,8 @@ struct UA_SecureChannelManager {
 UA_Int32 UA_SecureChannelManager_new(UA_SecureChannelManager **cm, UA_UInt32 maxChannelCount,
                                      UA_UInt32 tokenLifetime, UA_UInt32 startChannelId,
                                      UA_UInt32 startTokenId, UA_String *endpointUrl) {
-    UA_alloc((void **)cm, sizeof(UA_SecureChannelManager));
+    if(!(*cm = UA_alloc(sizeof(UA_SecureChannelManager))))
+        return UA_STATUSCODE_BADOUTOFMEMORY;
     UA_SecureChannelManager *channelManager = *cm;
     LIST_INIT(&channelManager->channels);
     channelManager->lastChannelId      = startChannelId;
@@ -53,8 +55,7 @@ UA_Int32 UA_SecureChannelManager_open(UA_SecureChannelManager           *cm,
                                       UA_Connection                     *conn,
                                       const UA_OpenSecureChannelRequest *request,
                                       UA_OpenSecureChannelResponse      *response) {
-    struct channel_list_entry *entry;
-    UA_alloc((void **)&entry, sizeof(struct channel_list_entry));
+    struct channel_list_entry *entry = UA_alloc(sizeof(struct channel_list_entry));
     UA_SecureChannel_init(&entry->channel);
 
     entry->channel.connection = conn;

+ 1 - 1
src/server/ua_server.c

@@ -475,7 +475,7 @@ void UA_Server_init(UA_Server *server, UA_String *endpointUrl) {
     UA_String_copycstring("http://localhost:16664/open62541/", &((UA_String *)(namespaceArray->value.storage.data.dataPtr))[1]);
     namespaceArray->arrayDimensionsSize = 1;
     UA_UInt32 *dimensions = UA_NULL;
-    UA_alloc((void **)&dimensions, sizeof(UA_UInt32));
+    dimensions = UA_alloc(sizeof(UA_UInt32));
     *dimensions = 2;
     namespaceArray->arrayDimensions = dimensions;
     namespaceArray->dataType = NS0NODEID(UA_STRING_NS0);

+ 7 - 9
src/server/ua_services_nodemanagement.c

@@ -202,27 +202,25 @@ void Service_AddNodes(UA_Server *server, UA_Session *session,
 
 static UA_Int32 AddSingleReference(UA_Node *node, UA_ReferenceNode *reference) {
     // TODO: Check if reference already exists
-    UA_Int32 retval;
     UA_Int32 count = node->referencesSize;
     UA_ReferenceNode *old_refs = node->references;
     UA_ReferenceNode *new_refs;
+
     if(count < 0) count = 0;
 
-    retval = UA_alloc((void **)&new_refs, sizeof(UA_ReferenceNode)*(count+1));
-    if(retval != UA_SUCCESS)
-        return UA_ERROR;
-    UA_memcpy(new_refs, old_refs, sizeof(UA_ReferenceNode)*count);
-    retval |= UA_ReferenceNode_copy(reference, &new_refs[count]);
+    if(!(new_refs = UA_alloc(sizeof(UA_ReferenceNode)*(count+1))))
+        return UA_STATUSCODE_BADOUTOFMEMORY;
 
-    if(retval != UA_SUCCESS) {
+    UA_memcpy(new_refs, old_refs, sizeof(UA_ReferenceNode)*count);
+    if(UA_ReferenceNode_copy(reference, &new_refs[count]) != UA_SUCCESS) {
         UA_free(new_refs);
-        return retval;
+        return UA_STATUSCODE_BADOUTOFMEMORY;
     }
 
     node->references     = new_refs;
     node->referencesSize = count+1;
     UA_free(old_refs);
-    return retval;
+    return UA_SUCCESS;
 }
 
 UA_Int32 AddReference(UA_NodeStore *nodestore, UA_Node *node, UA_ReferenceNode *reference) {

+ 3 - 5
src/server/ua_services_view.c

@@ -69,8 +69,7 @@ SLIST_HEAD(SubRefTypeIdList, SubRefTypeId);
 static UA_UInt32 walkReferenceTree(UA_NodeStore *ns, const UA_ReferenceTypeNode *current,
                                    struct SubRefTypeIdList *list) {
     // insert the current referencetype
-    struct SubRefTypeId *element;
-    UA_alloc((void **)&element, sizeof(struct SubRefTypeId));
+    struct SubRefTypeId *element = UA_alloc(sizeof(struct SubRefTypeId));
     element->id = current->nodeId;
     SLIST_INSERT_HEAD(list, element, next);
 
@@ -107,7 +106,7 @@ static UA_Int32 findSubReferenceTypes(UA_NodeStore *ns, UA_NodeId *rootReference
     UA_NodeStore_releaseManagedNode((const UA_Node *)root);
 
     // copy results into an array
-    UA_alloc((void **)ids, sizeof(UA_NodeId)*count);
+    *ids = UA_alloc(sizeof(UA_NodeId)*count);
     for(UA_UInt32 i = 0;i < count;i++) {
         struct SubRefTypeId *element = SLIST_FIRST(&list);
         UA_NodeId_copy(&element->id, &(*ids)[i]);
@@ -158,8 +157,7 @@ static void Service_Browse_getBrowseResult(UA_NodeStore         *ns,
     if(!browseDescription->includeSubtypes ||
        findSubReferenceTypes(ns, &browseDescription->referenceTypeId, &relevantReferenceTypes,
                              &relevantReferenceTypesCount) != UA_SUCCESS) {
-        if(UA_alloc((void **)&relevantReferenceTypes, sizeof(UA_NodeId)) != UA_SUCCESS) {
-
+        if(!(relevantReferenceTypes = UA_alloc(sizeof(UA_NodeId)))) {
             return;
         }
         UA_NodeId_copy(&browseDescription->referenceTypeId, relevantReferenceTypes);

+ 4 - 5
src/server/ua_session_manager.c

@@ -25,9 +25,8 @@ struct UA_SessionManager {
 UA_Int32 UA_SessionManager_new(UA_SessionManager **sessionManager, UA_UInt32 maxSessionCount,
                                UA_UInt32 sessionTimeout, UA_UInt32 startSessionId) {
     UA_Int32 retval = UA_SUCCESS;
-    retval |= UA_alloc((void **)sessionManager, sizeof(UA_SessionManager));
-    if(retval != UA_SUCCESS)
-        return UA_ERROR;
+    if(!(*sessionManager = UA_alloc(sizeof(UA_SessionManager))))
+        return UA_STATUSCODE_BADOUTOFMEMORY;
     LIST_INIT(&(*sessionManager)->sessions);
     (*sessionManager)->maxSessionCount = maxSessionCount;
     (*sessionManager)->lastSessionId   = startSessionId;
@@ -102,8 +101,8 @@ UA_StatusCode UA_SessionManager_createSession(UA_SessionManager *sessionManager,
     if(sessionManager->currentSessionCount >= sessionManager->maxSessionCount)
         return UA_STATUSCODE_BADTOOMANYSESSIONS;
 
-    struct session_list_entry *newentry;
-    if(UA_alloc((void **)&newentry, sizeof(struct session_list_entry)) != UA_SUCCESS)
+    struct session_list_entry *newentry = UA_alloc(sizeof(struct session_list_entry));
+    if(!newentry)
         return UA_STATUSCODE_BADOUTOFMEMORY;
 
     UA_Session_init(&newentry->session);

+ 3 - 2
src/ua_securechannel.c

@@ -2,6 +2,7 @@
 #include <stdlib.h>
 #include "ua_securechannel.h"
 #include "ua_util.h"
+#include "ua_statuscodes.h"
 
 void UA_SecureChannel_init(UA_SecureChannel *channel) {
     UA_AsymmetricAlgorithmSecurityHeader_init(&channel->clientAsymAlgSettings);
@@ -32,8 +33,8 @@ UA_Boolean UA_SecureChannel_compare(UA_SecureChannel *sc1, UA_SecureChannel *sc2
 
 //TODO implement real nonce generator - DUMMY function
 UA_Int32 UA_SecureChannel_generateNonce(UA_ByteString *nonce) {
-    //UA_ByteString_new(&nonce);
-    UA_alloc((void ** )&nonce->data, 1);
+    if(!(nonce->data = UA_alloc(1)))
+        return UA_STATUSCODE_BADOUTOFMEMORY;
     nonce->length  = 1;
     nonce->data[0] = 'a';
     return UA_SUCCESS;

+ 5 - 5
src/ua_session.c

@@ -3,6 +3,7 @@
 
 #include "ua_session.h"
 #include "ua_util.h"
+#include "ua_statuscodes.h"
 
 UA_Session anonymousSession = {
     .clientDescription =  {.applicationUri = {-1, UA_NULL},
@@ -41,11 +42,10 @@ UA_Session adminSession = {
     .channel = UA_NULL};
 
 UA_Int32 UA_Session_new(UA_Session **session) {
-    UA_Int32 retval = UA_SUCCESS;
-    retval |= UA_alloc((void **)session, sizeof(UA_Session));
-    if(retval == UA_SUCCESS)
-        UA_Session_init(*session);
-    return retval;
+    if(!(*session = UA_alloc(sizeof(UA_Session))))
+        return UA_STATUSCODE_BADOUTOFMEMORY;
+    UA_Session_init(*session);
+    return UA_SUCCESS;
 }
 
 /* mock up function to generate tokens for authentication */

+ 0 - 224
src/ua_statuscodes.h

@@ -1,224 +0,0 @@
-#ifndef OPCUA_STATUSCODES_H_
-#define OPCUA_STATUSCODES_H_
-
-#include "ua_types.h"
-
-static const UA_StatusCode UA_STATUSCODE_GOOD = 0x00;
-static const UA_StatusCode UA_STATUSCODE_BADUNEXPECTEDERROR = 0x80010000; // An unexpected error occurred.
-static const UA_StatusCode UA_STATUSCODE_BADINTERNALERROR = 0x80020000; // An internal error occurred as a result of a programming or configuration error.
-static const UA_StatusCode UA_STATUSCODE_BADOUTOFMEMORY = 0x80030000; // Not enough memory to complete the operation.
-static const UA_StatusCode UA_STATUSCODE_BADRESOURCEUNAVAILABLE = 0x80040000; // An operating system resource is not available.
-static const UA_StatusCode UA_STATUSCODE_BADCOMMUNICATIONERROR = 0x80050000; // A low level communication error occurred.
-static const UA_StatusCode UA_STATUSCODE_BADENCODINGERROR = 0x80060000; // Encoding halted because of invalid data in the objects being serialized.
-static const UA_StatusCode UA_STATUSCODE_BADDECODINGERROR = 0x80070000; // Decoding halted because of invalid data in the stream.
-static const UA_StatusCode UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED = 0x80080000; // The message encoding/decoding limits imposed by the stack have been exceeded.
-static const UA_StatusCode UA_STATUSCODE_BADREQUESTTOOLARGE = 0x80b80000; // The request message size exceeds limits set by the server.
-static const UA_StatusCode UA_STATUSCODE_BADRESPONSETOOLARGE = 0x80b90000; // The response message size exceeds limits set by the client.
-static const UA_StatusCode UA_STATUSCODE_BADUNKNOWNRESPONSE = 0x80090000; // An unrecognized response was received from the server.
-static const UA_StatusCode UA_STATUSCODE_BADTIMEOUT = 0x800a0000; // The operation timed out.
-static const UA_StatusCode UA_STATUSCODE_BADSERVICEUNSUPPORTED = 0x800b0000; // The server does not support the requested service.
-static const UA_StatusCode UA_STATUSCODE_BADSHUTDOWN = 0x800c0000; // The operation was cancelled because the application is shutting down.
-static const UA_StatusCode UA_STATUSCODE_BADSERVERNOTCONNECTED = 0x800d0000; // The operation could not complete because the client is not connected to the server.
-static const UA_StatusCode UA_STATUSCODE_BADSERVERHALTED = 0x800e0000; // The server has stopped and cannot process any requests.
-static const UA_StatusCode UA_STATUSCODE_BADNOTHINGTODO = 0x800f0000; // There was nothing to do because the client passed a list of operations with no elements.
-static const UA_StatusCode UA_STATUSCODE_BADTOOMANYOPERATIONS = 0x80100000; // The request could not be processed because it specified too many operations.
-static const UA_StatusCode UA_STATUSCODE_BADTOOMANYMONITOREDITEMS = 0x80db0000; // The request could not be processed because there are too many monitored items in the subscription.
-static const UA_StatusCode UA_STATUSCODE_BADDATATYPEIDUNKNOWN = 0x80110000; // The extension object cannot be (de)serialized because the data type id is not recognized.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATEINVALID = 0x80120000; // The certificate provided as a parameter is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADSECURITYCHECKSFAILED = 0x80130000; // An error occurred verifying security.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATETIMEINVALID = 0x80140000; // The Certificate has expired or is not yet valid.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATEISSUERTIMEINVALID = 0x80150000; // An Issuer Certificate has expired or is not yet valid.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATEHOSTNAMEINVALID = 0x80160000; // The HostName used to connect to a Server does not match a HostName in the Certificate.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATEURIINVALID = 0x80170000; // The URI specified in the ApplicationDescription does not match the URI in the Certificate.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATEUSENOTALLOWED = 0x80180000; // The Certificate may not be used for the requested operation.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATEISSUERUSENOTALLOWED = 0x80190000; // The Issuer Certificate may not be used for the requested operation.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATEUNTRUSTED = 0x801a0000; // The Certificate is not trusted.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATEREVOCATIONUNKNOWN = 0x801b0000; // It was not possible to determine if the Certificate has been revoked.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATEISSUERREVOCATIONUNKNOWN = 0x801c0000; // It was not possible to determine if the Issuer Certificate has been revoked.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATEREVOKED = 0x801d0000; // The Certificate has been revoked.
-static const UA_StatusCode UA_STATUSCODE_BADCERTIFICATEISSUERREVOKED = 0x801e0000; // The Issuer Certificate has been revoked.
-static const UA_StatusCode UA_STATUSCODE_BADUSERACCESSDENIED = 0x801f0000; // User does not have permission to perform the requested operation.
-static const UA_StatusCode UA_STATUSCODE_BADIDENTITYTOKENINVALID = 0x80200000; // The user identity token is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADIDENTITYTOKENREJECTED = 0x80210000; // The user identity token is valid but the server has rejected it.
-static const UA_StatusCode UA_STATUSCODE_BADSECURECHANNELIDINVALID = 0x80220000; // The specified secure channel is no longer valid.
-static const UA_StatusCode UA_STATUSCODE_BADINVALIDTIMESTAMP = 0x80230000; // The timestamp is outside the range allowed by the server.
-static const UA_StatusCode UA_STATUSCODE_BADNONCEINVALID = 0x80240000; // The nonce does appear to be not a random value or it is not the correct length.
-static const UA_StatusCode UA_STATUSCODE_BADSESSIONIDINVALID = 0x80250000; // The session id is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADSESSIONCLOSED = 0x80260000; // The session was closed by the client.
-static const UA_StatusCode UA_STATUSCODE_BADSESSIONNOTACTIVATED = 0x80270000; // The session cannot be used because ActivateSession has not been called.
-static const UA_StatusCode UA_STATUSCODE_BADSUBSCRIPTIONIDINVALID = 0x80280000; // The subscription id is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADREQUESTHEADERINVALID = 0x802a0000; // The header for the request is missing or invalid.
-static const UA_StatusCode UA_STATUSCODE_BADTIMESTAMPSTORETURNINVALID = 0x802b0000; // The timestamps to return parameter is invalid.
-static const UA_StatusCode UA_STATUSCODE_BADREQUESTCANCELLEDBYCLIENT = 0x802c0000; // The request was cancelled by the client.
-static const UA_StatusCode UA_STATUSCODE_GOODSUBSCRIPTIONTRANSFERRED = 0x002d0000; // The subscription was transferred to another session.
-static const UA_StatusCode UA_STATUSCODE_GOODCOMPLETESASYNCHRONOUSLY = 0x002e0000; // The processing will complete asynchronously.
-static const UA_StatusCode UA_STATUSCODE_GOODOVERLOAD = 0x002f0000; // Sampling has slowed down due to resource limitations.
-static const UA_StatusCode UA_STATUSCODE_GOODCLAMPED = 0x00300000; // The value written was accepted but was clamped.
-static const UA_StatusCode UA_STATUSCODE_BADNOCOMMUNICATION = 0x80310000; // Communication with the data source is defined, but not established, and there is no last known value available.
-static const UA_StatusCode UA_STATUSCODE_BADWAITINGFORINITIALDATA = 0x80320000; // Waiting for the server to obtain values from the underlying data source.
-static const UA_StatusCode UA_STATUSCODE_BADNODEIDINVALID = 0x80330000; // The syntax of the node id is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADNODEIDUNKNOWN = 0x80340000; // The node id refers to a node that does not exist in the server address space.
-static const UA_StatusCode UA_STATUSCODE_BADATTRIBUTEIDINVALID = 0x80350000; // The attribute is not supported for the specified Node.
-static const UA_StatusCode UA_STATUSCODE_BADINDEXRANGEINVALID = 0x80360000; // The syntax of the index range parameter is invalid.
-static const UA_StatusCode UA_STATUSCODE_BADINDEXRANGENODATA = 0x80370000; // No data exists within the range of indexes specified.
-static const UA_StatusCode UA_STATUSCODE_BADDATAENCODINGINVALID = 0x80380000; // The data encoding is invalid.
-static const UA_StatusCode UA_STATUSCODE_BADDATAENCODINGUNSUPPORTED = 0x80390000; // The server does not support the requested data encoding for the node.
-static const UA_StatusCode UA_STATUSCODE_BADNOTREADABLE = 0x803a0000; // The access level does not allow reading or subscribing to the Node.
-static const UA_StatusCode UA_STATUSCODE_BADNOTWRITABLE = 0x803b0000; // The access level does not allow writing to the Node.
-static const UA_StatusCode UA_STATUSCODE_BADOUTOFRANGE = 0x803c0000; // The value was out of range.
-static const UA_StatusCode UA_STATUSCODE_BADNOTSUPPORTED = 0x803d0000; // The requested operation is not supported.
-static const UA_StatusCode UA_STATUSCODE_BADNOTFOUND = 0x803e0000; // A requested item was not found or a search operation ended without success.
-static const UA_StatusCode UA_STATUSCODE_BADOBJECTDELETED = 0x803f0000; // The object cannot be used because it has been deleted.
-static const UA_StatusCode UA_STATUSCODE_BADNOTIMPLEMENTED = 0x80400000; // Requested operation is not implemented.
-static const UA_StatusCode UA_STATUSCODE_BADMONITORINGMODEINVALID = 0x80410000; // The monitoring mode is invalid.
-static const UA_StatusCode UA_STATUSCODE_BADMONITOREDITEMIDINVALID = 0x80420000; // The monitoring item id does not refer to a valid monitored item.
-static const UA_StatusCode UA_STATUSCODE_BADMONITOREDITEMFILTERINVALID = 0x80430000; // The monitored item filter parameter is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADMONITOREDITEMFILTERUNSUPPORTED = 0x80440000; // The server does not support the requested monitored item filter.
-static const UA_StatusCode UA_STATUSCODE_BADFILTERNOTALLOWED = 0x80450000; // A monitoring filter cannot be used in combination with the attribute specified.
-static const UA_StatusCode UA_STATUSCODE_BADSTRUCTUREMISSING = 0x80460000; // A mandatory structured parameter was missing or null.
-static const UA_StatusCode UA_STATUSCODE_BADEVENTFILTERINVALID = 0x80470000; // The event filter is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADCONTENTFILTERINVALID = 0x80480000; // The content filter is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADFILTEROPERATORINVALID = 0x80c10000; // An unregognized operator was provided in a filter.
-static const UA_StatusCode UA_STATUSCODE_BADFILTEROPERATORUNSUPPORTED = 0x80c20000; // A valid operator was provided, but the server does not provide support for this filter operator.
-static const UA_StatusCode UA_STATUSCODE_BADFILTEROPERANDCOUNTMISMATCH = 0x80c30000; // The number of operands provided for the filter operator was less then expected for the operand provided.
-static const UA_StatusCode UA_STATUSCODE_BADFILTEROPERANDINVALID = 0x80490000; // The operand used in a content filter is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADFILTERELEMENTINVALID = 0x80c40000; // The referenced element is not a valid element in the content filter.
-static const UA_StatusCode UA_STATUSCODE_BADFILTERLITERALINVALID = 0x80c50000; // The referenced literal is not a valid value.
-static const UA_StatusCode UA_STATUSCODE_BADCONTINUATIONPOINTINVALID = 0x804a0000; // The continuation point provide is longer valid.
-static const UA_StatusCode UA_STATUSCODE_BADNOCONTINUATIONPOINTS = 0x804b0000; // The operation could not be processed because all continuation points have been allocated.
-static const UA_StatusCode UA_STATUSCODE_BADREFERENCETYPEIDINVALID = 0x804c0000; // The operation could not be processed because all continuation points have been allocated.
-static const UA_StatusCode UA_STATUSCODE_BADBROWSEDIRECTIONINVALID = 0x804d0000; // The browse direction is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADNODENOTINVIEW = 0x804e0000; // The node is not part of the view.
-static const UA_StatusCode UA_STATUSCODE_BADSERVERURIINVALID = 0x804f0000; // The ServerUri is not a valid URI.
-static const UA_StatusCode UA_STATUSCODE_BADSERVERNAMEMISSING = 0x80500000; // No ServerName was specified.
-static const UA_StatusCode UA_STATUSCODE_BADDISCOVERYURLMISSING = 0x80510000; // No DiscoveryUrl was specified.
-static const UA_StatusCode UA_STATUSCODE_BADSEMPAHOREFILEMISSING = 0x80520000; // The semaphore file specified by the client is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADREQUESTTYPEINVALID = 0x80530000; // The security token request type is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADSECURITYMODEREJECTED = 0x80540000; // The security mode does not meet the requirements set by the Server.
-static const UA_StatusCode UA_STATUSCODE_BADSECURITYPOLICYREJECTED = 0x80550000; // The security policy does not meet the requirements set by the Server.
-static const UA_StatusCode UA_STATUSCODE_BADTOOMANYSESSIONS = 0x80560000; // The server has reached its maximum number of sessions.
-static const UA_StatusCode UA_STATUSCODE_BADUSERSIGNATUREINVALID = 0x80570000; // The user token signature is missing or invalid.
-static const UA_StatusCode UA_STATUSCODE_BADAPPLICATIONSIGNATUREINVALID = 0x80580000; // The signature generated with the client certificate is missing or invalid.
-static const UA_StatusCode UA_STATUSCODE_BADNOVALIDCERTIFICATES = 0x80590000; // The client did not provide at least one software certificate that is valid and meets the profile requirements for the server.
-static const UA_StatusCode UA_STATUSCODE_BADIDENTITYCHANGENOTSUPPORTED = 0x80c60000; // The Server does not support changing the user identity assigned to the session.
-static const UA_StatusCode UA_STATUSCODE_BADREQUESTCANCELLEDBYREQUEST = 0x805a0000; // The request was cancelled by the client with the Cancel service.
-static const UA_StatusCode UA_STATUSCODE_BADPARENTNODEIDINVALID = 0x805b0000; // The parent node id does not to refer to a valid node.
-static const UA_StatusCode UA_STATUSCODE_BADREFERENCENOTALLOWED = 0x805c0000; // The reference could not be created because it violates constraints imposed by the data model.
-static const UA_StatusCode UA_STATUSCODE_BADNODEIDREJECTED = 0x805d0000; // The requested node id was reject because it was either invalid or server does not allow node ids to be specified by the client.
-static const UA_StatusCode UA_STATUSCODE_BADNODEIDEXISTS = 0x805e0000; // The requested node id is already used by another node.
-static const UA_StatusCode UA_STATUSCODE_BADNODECLASSINVALID = 0x805f0000; // The node class is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADBROWSENAMEINVALID = 0x80600000; // The browse name is invalid.
-static const UA_StatusCode UA_STATUSCODE_BADBROWSENAMEDUPLICATED = 0x80610000; // The browse name is not unique among nodes that share the same relationship with the parent.
-static const UA_StatusCode UA_STATUSCODE_BADNODEATTRIBUTESINVALID = 0x80620000; // The node attributes are not valid for the node class.
-static const UA_StatusCode UA_STATUSCODE_BADTYPEDEFINITIONINVALID = 0x80630000; // The type definition node id does not reference an appropriate type node.
-static const UA_StatusCode UA_STATUSCODE_BADSOURCENODEIDINVALID = 0x80640000; // The source node id does not reference a valid node.
-static const UA_StatusCode UA_STATUSCODE_BADTARGETNODEIDINVALID = 0x80650000; // The target node id does not reference a valid node.
-static const UA_StatusCode UA_STATUSCODE_BADDUPLICATEREFERENCENOTALLOWED = 0x80660000; // The reference type between the nodes is already defined.
-static const UA_StatusCode UA_STATUSCODE_BADINVALIDSELFREFERENCE = 0x80670000; // The server does not allow this type of self reference on this node.
-static const UA_StatusCode UA_STATUSCODE_BADREFERENCELOCALONLY = 0x80680000; // The reference type is not valid for a reference to a remote server.
-static const UA_StatusCode UA_STATUSCODE_BADNODELETERIGHTS = 0x80690000; // The server will not allow the node to be deleted.
-static const UA_StatusCode UA_STATUSCODE_UNCERTAINREFERENCENOTDELETED = 0x40bc0000; // The server was not able to delete all target references.
-static const UA_StatusCode UA_STATUSCODE_BADSERVERINDEXINVALID = 0x806a0000; // The server index is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADVIEWIDUNKNOWN = 0x806b0000; // The view id does not refer to a valid view node.
-static const UA_StatusCode UA_STATUSCODE_BADVIEWTIMESTAMPINVALID = 0x80c90000; // The view timestamp is not available or not supported.
-static const UA_StatusCode UA_STATUSCODE_BADVIEWPARAMETERMISMATCH = 0x80ca0000; // The view parameters are not consistent with each other.
-static const UA_StatusCode UA_STATUSCODE_BADVIEWVERSIONINVALID = 0x80cb0000; // The view version is not available or not supported.
-static const UA_StatusCode UA_STATUSCODE_UNCERTAINNOTALLNODESAVAILABLE = 0x40c00000; // The list of references may not be complete because the underlying system is not available.
-static const UA_StatusCode UA_STATUSCODE_GOODRESULTSMAYBEINCOMPLETE = 0x00ba0000; // The server should have followed a reference to a node in a remote server but did not. The result set may be incomplete.
-static const UA_StatusCode UA_STATUSCODE_BADNOTTYPEDEFINITION = 0x80c80000; // The provided Nodeid was not a type definition nodeid.
-static const UA_StatusCode UA_STATUSCODE_UNCERTAINREFERENCEOUTOFSERVER = 0x406c0000; // One of the references to follow in the relative path references to a node in the address space in another server.
-static const UA_StatusCode UA_STATUSCODE_BADTOOMANYMATCHES = 0x806d0000; // The requested operation has too many matches to return.
-static const UA_StatusCode UA_STATUSCODE_BADQUERYTOOCOMPLEX = 0x806e0000; // The requested operation requires too many resources in the server.
-static const UA_StatusCode UA_STATUSCODE_BADNOMATCH = 0x806f0000; // The requested operation has no match to return.
-static const UA_StatusCode UA_STATUSCODE_BADMAXAGEINVALID = 0x80700000; // The max age parameter is invalid.
-static const UA_StatusCode UA_STATUSCODE_BADHISTORYOPERATIONINVALID = 0x80710000; // The history details parameter is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADHISTORYOPERATIONUNSUPPORTED = 0x80720000; // The server does not support the requested operation.
-static const UA_StatusCode UA_STATUSCODE_BADINVALIDTIMESTAMPARGUMENT = 0x80bd0000; // The defined timestamp to return was invalid.
-static const UA_StatusCode UA_STATUSCODE_BADWRITENOTSUPPORTED = 0x80730000; // The server not does support writing the combination of value, status and timestamps provided.
-static const UA_StatusCode UA_STATUSCODE_BADTYPEMISMATCH = 0x80740000; // The value supplied for the attribute is not of the same type as the attribute's value.
-static const UA_StatusCode UA_STATUSCODE_BADMETHODINVALID = 0x80750000; // The method id does not refer to a method for the specified object.
-static const UA_StatusCode UA_STATUSCODE_BADARGUMENTSMISSING = 0x80760000; // The client did not specify all of the input arguments for the method.
-static const UA_StatusCode UA_STATUSCODE_BADTOOMANYSUBSCRIPTIONS = 0x80770000; // The server has reached its  maximum number of subscriptions.
-static const UA_StatusCode UA_STATUSCODE_BADTOOMANYPUBLISHREQUESTS = 0x80780000; // The server has reached the maximum number of queued publish requests.
-static const UA_StatusCode UA_STATUSCODE_BADNOSUBSCRIPTION = 0x80790000; // There is no subscription available for this session.
-static const UA_StatusCode UA_STATUSCODE_BADSEQUENCENUMBERUNKNOWN = 0x807a0000; // The sequence number is unknown to the server.
-static const UA_StatusCode UA_STATUSCODE_BADMESSAGENOTAVAILABLE = 0x807b0000; // The requested notification message is no longer available.
-static const UA_StatusCode UA_STATUSCODE_BADINSUFFICIENTCLIENTPROFILE = 0x807c0000; // The Client of the current Session does not support one or more Profiles that are necessary for the Subscription.
-static const UA_StatusCode UA_STATUSCODE_BADSTATENOTACTIVE = 0x80bf0000; // The sub-state machine is not currently active.
-static const UA_StatusCode UA_STATUSCODE_BADTCPSERVERTOOBUSY = 0x807d0000; // The server cannot process the request because it is too busy.
-static const UA_StatusCode UA_STATUSCODE_BADTCPMESSAGETYPEINVALID = 0x807e0000; // The type of the message specified in the header invalid.
-static const UA_StatusCode UA_STATUSCODE_BADTCPSECURECHANNELUNKNOWN = 0x807f0000; // The SecureChannelId and/or TokenId are not currently in use.
-static const UA_StatusCode UA_STATUSCODE_BADTCPMESSAGETOOLARGE = 0x80800000; // The size of the message specified in the header is too large.
-static const UA_StatusCode UA_STATUSCODE_BADTCPNOTENOUGHRESOURCES = 0x80810000; // There are not enough resources to process the request.
-static const UA_StatusCode UA_STATUSCODE_BADTCPINTERNALERROR = 0x80820000; // An internal error occurred.
-static const UA_StatusCode UA_STATUSCODE_BADTCPENDPOINTURLINVALID = 0x80830000; // The Server does not recognize the QueryString specified.
-static const UA_StatusCode UA_STATUSCODE_BADREQUESTINTERRUPTED = 0x80840000; // The request could not be sent because of a network interruption.
-static const UA_StatusCode UA_STATUSCODE_BADREQUESTTIMEOUT = 0x80850000; // Timeout occurred while processing the request.
-static const UA_StatusCode UA_STATUSCODE_BADSECURECHANNELCLOSED = 0x80860000; // The secure channel has been closed.
-static const UA_StatusCode UA_STATUSCODE_BADSECURECHANNELTOKENUNKNOWN = 0x80870000; // The token has expired or is not recognized.
-static const UA_StatusCode UA_STATUSCODE_BADSEQUENCENUMBERINVALID = 0x80880000; // The sequence number is not valid.
-static const UA_StatusCode UA_STATUSCODE_BADPROTOCOLVERSIONUNSUPPORTED = 0x80be0000; // The applications do not have compatible protocol versions.
-static const UA_StatusCode UA_STATUSCODE_BADCONFIGURATIONERROR = 0x80890000; // There is a problem with the configuration that affects the usefulness of the value.
-static const UA_StatusCode UA_STATUSCODE_BADNOTCONNECTED = 0x808a0000; // The variable should receive its value from another variable, but has never been configured to do so.
-static const UA_StatusCode UA_STATUSCODE_BADDEVICEFAILURE = 0x808b0000; // There has been a failure in the device/data source that generates the value that has affected the value.
-static const UA_StatusCode UA_STATUSCODE_BADSENSORFAILURE = 0x808c0000; // There has been a failure in the sensor from which the value is derived by the device/data source.
-static const UA_StatusCode UA_STATUSCODE_BADOUTOFSERVICE = 0x808d0000; // The source of the data is not operational.
-static const UA_StatusCode UA_STATUSCODE_BADDEADBANDFILTERINVALID = 0x808e0000; // The deadband filter is not valid.
-static const UA_StatusCode UA_STATUSCODE_UNCERTAINNOCOMMUNICATIONLASTUSABLEVALUE = 0x408f0000; // Communication to the data source has failed. The variable value is the last value that had a good quality.
-static const UA_StatusCode UA_STATUSCODE_UNCERTAINLASTUSABLEVALUE = 0x40900000; // Whatever was updating this value has stopped doing so.
-static const UA_StatusCode UA_STATUSCODE_UNCERTAINSUBSTITUTEVALUE = 0x40910000; // The value is an operational value that was manually overwritten.
-static const UA_StatusCode UA_STATUSCODE_UNCERTAININITIALVALUE = 0x40920000; // The value is an initial value for a variable that normally receives its value from another variable.
-static const UA_StatusCode UA_STATUSCODE_UNCERTAINSENSORNOTACCURATE = 0x40930000; // The value is at one of the sensor limits.
-static const UA_StatusCode UA_STATUSCODE_UNCERTAINENGINEERINGUNITSEXCEEDED = 0x40940000; // The value is outside of the range of values defined for this parameter.
-static const UA_StatusCode UA_STATUSCODE_UNCERTAINSUBNORMAL = 0x40950000; // The value is derived from multiple sources and has less than the required number of Good sources.
-static const UA_StatusCode UA_STATUSCODE_GOODLOCALOVERRIDE = 0x00960000; // The value has been overridden.
-static const UA_StatusCode UA_STATUSCODE_BADREFRESHINPROGRESS = 0x80970000; // This Condition refresh failed, a Condition refresh operation is already in progress.
-static const UA_StatusCode UA_STATUSCODE_BADCONDITIONALREADYDISABLED = 0x80980000; // This condition has already been disabled.
-static const UA_StatusCode UA_STATUSCODE_BADCONDITIONALREADYENABLED = 0x80cc0000; // This condition has already been enabled.
-static const UA_StatusCode UA_STATUSCODE_BADCONDITIONDISABLED = 0x80990000; // Property not available, this condition is disabled.
-static const UA_StatusCode UA_STATUSCODE_BADEVENTIDUNKNOWN = 0x809a0000; // The specified event id is not recognized.
-static const UA_StatusCode UA_STATUSCODE_BADEVENTNOTACKNOWLEDGEABLE = 0x80bb0000; // The event cannot be acknowledged.
-static const UA_StatusCode UA_STATUSCODE_BADDIALOGNOTACTIVE = 0x80cd0000; // The dialog condition is not active.
-static const UA_StatusCode UA_STATUSCODE_BADDIALOGRESPONSEINVALID = 0x80ce0000; // The response is not valid for the dialog.
-static const UA_StatusCode UA_STATUSCODE_BADCONDITIONBRANCHALREADYACKED = 0x80cf0000; // The condition branch has already been acknowledged.
-static const UA_StatusCode UA_STATUSCODE_BADCONDITIONBRANCHALREADYCONFIRMED = 0x80d00000; // The condition branch has already been confirmed.
-static const UA_StatusCode UA_STATUSCODE_BADCONDITIONALREADYSHELVED = 0x80d10000; // The condition has already been shelved.
-static const UA_StatusCode UA_STATUSCODE_BADCONDITIONNOTSHELVED = 0x80d20000; // The condition is not currently shelved.
-static const UA_StatusCode UA_STATUSCODE_BADSHELVINGTIMEOUTOFRANGE = 0x80d30000; // The shelving time not within an acceptable range.
-static const UA_StatusCode UA_STATUSCODE_BADNODATA = 0x809b0000; // No data exists for the requested time range or event filter.
-static const UA_StatusCode UA_STATUSCODE_BADBOUNDNOTFOUND = 0x80d70000; // No data found to provide upper or lower bound value.
-static const UA_StatusCode UA_STATUSCODE_BADBOUNDNOTSUPPORTED = 0x80d80000; // The server cannot retrieve a bound for the variable.
-static const UA_StatusCode UA_STATUSCODE_BADDATALOST = 0x809d0000; // Data is missing due to collection started/stopped/lost.
-static const UA_StatusCode UA_STATUSCODE_BADDATAUNAVAILABLE = 0x809e0000; // Expected data is unavailable for the requested time range due to an un-mounted volume, an off-line archive or tape, or similar reason for temporary unavailability.
-static const UA_StatusCode UA_STATUSCODE_BADENTRYEXISTS = 0x809f0000; // The data or event was not successfully inserted because a matching entry exists.
-static const UA_StatusCode UA_STATUSCODE_BADNOENTRYEXISTS = 0x80a00000; // The data or event was not successfully updated because no matching entry exists.
-static const UA_StatusCode UA_STATUSCODE_BADTIMESTAMPNOTSUPPORTED = 0x80a10000; // The client requested history using a timestamp format the server does not support (i.e requested ServerTimestamp when server only supports SourceTimestamp).
-static const UA_StatusCode UA_STATUSCODE_GOODENTRYINSERTED = 0x00a20000; // The data or event was successfully inserted into the historical database.
-static const UA_StatusCode UA_STATUSCODE_GOODENTRYREPLACED = 0x00a30000; // The data or event field was successfully replaced in the historical database.
-static const UA_StatusCode UA_STATUSCODE_UNCERTAINDATASUBNORMAL = 0x40a40000; // The value is derived from multiple values and has less than the required number of Good values.
-static const UA_StatusCode UA_STATUSCODE_GOODNODATA = 0x00a50000; // No data exists for the requested time range or event filter.
-static const UA_StatusCode UA_STATUSCODE_GOODMOREDATA = 0x00a60000; // The data or event field was successfully replaced in the historical database.
-static const UA_StatusCode UA_STATUSCODE_BADAGGREGATELISTMISMATCH = 0x80d40000; // The requested number of Aggregates does not match the requested number of NodeIds.
-static const UA_StatusCode UA_STATUSCODE_BADAGGREGATENOTSUPPORTED = 0x80d50000; // The requested Aggregate is not support by the server.
-static const UA_StatusCode UA_STATUSCODE_BADAGGREGATEINVALIDINPUTS = 0x80d60000; // The aggregate value could not be derived due to invalid data inputs.
-static const UA_StatusCode UA_STATUSCODE_BADAGGREGATECONFIGURATIONREJECTED = 0x80da0000; // The aggregate configuration is not valid for specified node.
-static const UA_StatusCode UA_STATUSCODE_GOODDATAIGNORED = 0x00d90000; // The request pecifies fields which are not valid for the EventType or cannot be saved by the historian.
-static const UA_StatusCode UA_STATUSCODE_GOODCOMMUNICATIONEVENT = 0x00a70000; // The communication layer has raised an event.
-static const UA_StatusCode UA_STATUSCODE_GOODSHUTDOWNEVENT = 0x00a80000; // The system is shutting down.
-static const UA_StatusCode UA_STATUSCODE_GOODCALLAGAIN = 0x00a90000; // The operation is not finished and needs to be called again.
-static const UA_StatusCode UA_STATUSCODE_GOODNONCRITICALTIMEOUT = 0x00aa0000; // A non-critical timeout occurred.
-static const UA_StatusCode UA_STATUSCODE_BADINVALIDARGUMENT = 0x80ab0000; // One or more arguments are invalid.
-static const UA_StatusCode UA_STATUSCODE_BADCONNECTIONREJECTED = 0x80ac0000; // Could not establish a network connection to remote server.
-static const UA_StatusCode UA_STATUSCODE_BADDISCONNECT = 0x80ad0000; // The server has disconnected from the client.
-static const UA_StatusCode UA_STATUSCODE_BADCONNECTIONCLOSED = 0x80ae0000; // The network connection has been closed.
-static const UA_StatusCode UA_STATUSCODE_BADINVALIDSTATE = 0x80af0000; // The operation cannot be completed because the object is closed, uninitialized or in some other invalid state.
-static const UA_StatusCode UA_STATUSCODE_BADENDOFSTREAM = 0x80b00000; // Cannot move beyond end of the stream.
-static const UA_StatusCode UA_STATUSCODE_BADNODATAAVAILABLE = 0x80b10000; // No data is currently available for reading from a non-blocking stream.
-static const UA_StatusCode UA_STATUSCODE_BADWAITINGFORRESPONSE = 0x80b20000; // The asynchronous operation is waiting for a response.
-static const UA_StatusCode UA_STATUSCODE_BADOPERATIONABANDONED = 0x80b30000; // The asynchronous operation was abandoned by the caller.
-static const UA_StatusCode UA_STATUSCODE_BADEXPECTEDSTREAMTOBLOCK = 0x80b40000; // The stream did not return all data requested (possibly because it is a non-blocking stream).
-static const UA_StatusCode UA_STATUSCODE_BADWOULDBLOCK = 0x80b50000; // Non blocking behaviour is required and the operation would block.
-static const UA_StatusCode UA_STATUSCODE_BADSYNTAXERROR = 0x80b60000; // A value had an invalid syntax.
-static const UA_StatusCode UA_STATUSCODE_BADMAXCONNECTIONSREACHED = 0x80b70000; // The operation could not be finished because all available connections are in use.
-
-#endif /* OPCUA_STATUSCODES_H_ */

+ 27 - 26
src/ua_types.c

@@ -15,6 +15,7 @@
 #include "ua_types.h"
 #include "ua_types_encoding_binary.h"
 #include "ua_namespace_0.h"
+#include "ua_statuscodes.h"
 
 /* Boolean */
 void UA_Boolean_init(UA_Boolean *p) {
@@ -143,16 +144,14 @@ void UA_String_deleteMembers(UA_String *p) {
 }
 
 UA_Int32 UA_String_copy(UA_String const *src, UA_String *dst) {
-    UA_Int32 retval = UA_SUCCESS;
     if(!src || !dst) return UA_ERROR;
     if(src->length > 0) {
-        retval |= UA_alloc((void **)&dst->data, src->length);
-        if(retval != UA_SUCCESS)
-            return retval;
+        if(!(dst->data = UA_alloc(src->length)))
+            return UA_STATUSCODE_BADOUTOFMEMORY;
         UA_memcpy((void *)dst->data, src->data, src->length);
     }
     dst->length = src->length;
-    return retval;
+    return UA_SUCCESS;
 }
 
 #ifdef DEBUG
@@ -167,15 +166,14 @@ void UA_String_print(const UA_String *p, FILE *stream) {
 #endif
 
 UA_Int32 UA_String_copycstring(char const *src, UA_String *dst) {
-    UA_Int32 retval = UA_SUCCESS;
-    dst->length = strlen(src);
     dst->data   = UA_NULL;
+    dst->length = strlen(src);
     if(dst->length > 0) {
-        retval |= UA_alloc((void **)&dst->data, dst->length);
-        if(retval == UA_SUCCESS)
-            UA_memcpy((void *)dst->data, src, dst->length);
+        if(!(dst->data = UA_alloc(dst->length)))
+            return UA_STATUSCODE_BADOUTOFMEMORY;
+        UA_memcpy((void *)dst->data, src, dst->length);
     }
-    return retval;
+    return UA_SUCCESS;
 }
 
 #define UA_STRING_COPYPRINTF_BUFSIZE 1024
@@ -198,9 +196,10 @@ UA_Int32 UA_String_copyprintf(char const *fmt, UA_String *dst, ...) {
     } else {
         // since glibc 2.1 vsnprintf returns len that would have resulted if buf were large enough
         dst->length = ( len > UA_STRING_COPYPRINTF_BUFSIZE ? UA_STRING_COPYPRINTF_BUFSIZE : len );
-        retval     |= UA_alloc((void **)&dst->data, dst->length);
-        if(retval == UA_SUCCESS)
+        if((dst->data = UA_alloc(dst->length)))
             UA_memcpy((void *)dst->data, src, dst->length);
+        else
+            retval = UA_STATUSCODE_BADOUTOFMEMORY;
     }
     return retval;
 }
@@ -315,8 +314,8 @@ UA_DateTimeStruct UA_DateTime_toStruct(UA_DateTime time) {
 
 UA_Int32 UA_DateTime_toString(UA_DateTime time, UA_String *timeString) {
     // length of the string is 31 (incl. \0 at the end)
-    if(UA_alloc((void**)&timeString->data, 31) != UA_SUCCESS)
-        return UA_ERROR;
+    if(!(timeString->data = UA_alloc(31)))
+        return UA_STATUSCODE_BADOUTOFMEMORY;
     timeString->length = 30;
 
     UA_DateTimeStruct tSt = UA_DateTime_toStruct(time);
@@ -390,12 +389,15 @@ UA_ByteString UA_ByteString_securityPoliceNone =
 
 UA_Int32 UA_ByteString_newMembers(UA_ByteString *p, UA_Int32 length) {
     UA_Int32 retval = UA_SUCCESS;
-    if(length > 0 && (retval |= UA_alloc((void **)&p->data, length)) == UA_SUCCESS)
-        p->length = length;
-    else {
-        p->length = -1;
-        p->data   = UA_NULL;
+    if(length > 0) {
+        if((p->data = UA_alloc(length))) {
+            p->length = length;
+            return retval;
+        }
+        retval = UA_STATUSCODE_BADOUTOFMEMORY;
     }
+    p->length = -1;
+    p->data   = UA_NULL;
     return retval;
 }
 
@@ -961,9 +963,10 @@ UA_Int32 UA_DiagnosticInfo_copy(UA_DiagnosticInfo const *src, UA_DiagnosticInfo
     retval |= UA_Byte_copy(&src->encodingMask, &dst->encodingMask);
     retval |= UA_StatusCode_copy(&src->innerStatusCode, &dst->innerStatusCode);
     if(src->innerDiagnosticInfo) {
-        retval |= UA_alloc((void **)&dst->innerDiagnosticInfo, sizeof(UA_DiagnosticInfo));
-        if(retval == UA_SUCCESS)
+        if((dst->innerDiagnosticInfo = UA_alloc(sizeof(UA_DiagnosticInfo))))
             retval |= UA_DiagnosticInfo_copy(src->innerDiagnosticInfo, dst->innerDiagnosticInfo);
+        else
+            retval |= UA_STATUSCODE_BADOUTOFMEMORY;
     } else
         dst->innerDiagnosticInfo = UA_NULL;
     retval |= UA_Int32_copy(&src->locale, &dst->locale);
@@ -1049,10 +1052,8 @@ UA_Int32 UA_Array_new(void **p, UA_Int32 noElements, const UA_VTable_Entry *vt)
         return UA_ERROR;
     }
 
-    UA_Int32 retval = UA_SUCCESS;
-    retval = UA_alloc(p, vt->memSize * noElements);
-    if(retval != UA_SUCCESS)
-        return retval;
+    if(!(*p = UA_alloc(vt->memSize * noElements)))
+        return UA_STATUSCODE_BADOUTOFMEMORY;
 
     UA_Array_init(*p, noElements, vt);
     return UA_SUCCESS;

+ 24 - 19
src/ua_types_encoding_binary.c

@@ -1,6 +1,7 @@
 #include "ua_types_encoding_binary.h"
 #include "ua_util.h"
 #include "ua_namespace_0.h"
+#include "ua_statuscodes.h"
 
 static INLINE UA_Boolean is_builtin(const UA_NodeId *typeid ) {
     return typeid ->namespaceIndex == 0 && 1 <= typeid ->identifier.numeric && typeid ->identifier.numeric <=
@@ -341,22 +342,24 @@ UA_Int32 UA_String_encodeBinary(UA_String const *src, UA_ByteString *dst, UA_UIn
     return retval;
 }
 UA_Int32 UA_String_decodeBinary(UA_ByteString const *src, UA_UInt32 *offset, UA_String *dst) {
-    UA_Int32 retval = UA_SUCCESS;
     UA_String_init(dst);
-    retval |= UA_Int32_decodeBinary(src, offset, &dst->length);
+    UA_Int32 length;
+    if(UA_Int32_decodeBinary(src, offset, &length) != UA_SUCCESS)
+        return UA_ERROR;
 
-    if(dst->length > (UA_Int32)(src->length - *offset))
-        retval = UA_ERR_INVALID_VALUE;
+    if(length <= 0)
+        return UA_SUCCESS;
+        
+    if(length > (UA_Int32)(src->length - *offset))
+        return UA_ERR_INVALID_VALUE;
+    
+    if(!(dst->data = UA_alloc(length)))
+        return UA_STATUSCODE_BADOUTOFMEMORY;
 
-    if(retval != UA_SUCCESS || dst->length <= 0) {
-        dst->length = -1;
-        dst->data   = UA_NULL;
-    } else {
-        CHECKED_DECODE(UA_alloc((void **)&dst->data, dst->length), dst->length = -1);
-        UA_memcpy(dst->data, &src->data[*offset], dst->length);
-        *offset += dst->length;
-    }
-    return retval;
+    UA_memcpy(dst->data, &src->data[*offset], length);
+    dst->length = length;
+    *offset += length;
+    return UA_SUCCESS;
 }
 
 /* DateTime */
@@ -922,7 +925,7 @@ UA_TYPE_ENCODEBINARY(UA_Variant,
                      
                      )
 
-/* For decoding, we read extensionobects as is. The resulting variant always has the storagetype UA_VARIANT_DATA. */
+/* For decoding, we read extensionobjects as is. The resulting variant always has the storagetype UA_VARIANT_DATA. */
 UA_Int32 UA_Variant_decodeBinary(UA_ByteString const *src, UA_UInt32 *offset, UA_Variant *dst) {
     UA_Int32 retval = UA_SUCCESS;
     UA_Variant_init(dst);
@@ -941,7 +944,8 @@ UA_Int32 UA_Variant_decodeBinary(UA_ByteString const *src, UA_UInt32 *offset, UA
     dst->vt = &UA_[typeNs0Id];
 
     if(!isArray) {
-        if(UA_alloc(&data->dataPtr, dst->vt->memSize) != UA_SUCCESS) return UA_ERROR;
+        if(!(data->dataPtr = UA_alloc(dst->vt->memSize)))
+            return UA_STATUSCODE_BADOUTOFMEMORY;
         retval |= dst->vt->encodings[UA_ENCODING_BINARY].decode(src, offset, data->dataPtr);
         if(retval != UA_SUCCESS) {
             UA_free(data->dataPtr);
@@ -1051,10 +1055,11 @@ UA_Int32 UA_DiagnosticInfo_decodeBinary(UA_ByteString const *src, UA_UInt32 *off
 
         case UA_DIAGNOSTICINFO_ENCODINGMASK_INNERDIAGNOSTICINFO:
             // innerDiagnosticInfo is a pointer to struct, therefore allocate
-            CHECKED_DECODE(UA_alloc((void **)&dst->innerDiagnosticInfo,
-                                    UA_DiagnosticInfo_calcSizeBinary(UA_NULL)),; );
-            CHECKED_DECODE(UA_DiagnosticInfo_decodeBinary(src, offset,
-                                                          dst->innerDiagnosticInfo),
+            if(!(dst->innerDiagnosticInfo = UA_alloc(sizeof(UA_DiagnosticInfo)))) {
+                retval |= UA_STATUSCODE_BADOUTOFMEMORY;
+                return retval;
+            }
+            CHECKED_DECODE(UA_DiagnosticInfo_decodeBinary(src, offset, dst->innerDiagnosticInfo),
                            UA_DiagnosticInfo_deleteMembers(dst));
             break;
         }

+ 6 - 2
src/ua_util.c

@@ -3,6 +3,10 @@
 /* the extern inline in a *.c-file is required for other compilation units to
    see the inline function. */
 extern INLINE UA_Int32 _UA_free(void *ptr, char *pname, char *f, UA_Int32 l);
-extern INLINE UA_Int32 _UA_alloc(void **ptr, UA_Int32 size, char *pname, char *sname, char *f, UA_Int32 l);
-extern INLINE UA_Int32 _UA_alloca(void **ptr, UA_Int32 size, char *pname, char *sname, char *f, UA_Int32 l);
 extern INLINE void UA_memcpy(void *dst, void const *src, UA_Int32 size);
+
+#ifdef DEBUG
+extern INLINE void * _UA_alloc(UA_Int32 size, char *file, UA_Int32 line);
+#else
+extern INLINE void * _UA_alloc(UA_Int32 size);
+#endif

+ 10 - 35
src/ua_util.h

@@ -7,13 +7,6 @@
 #include <assert.h> // assert
 
 #include "ua_config.h"
-#ifndef MSVC
-#ifndef WIN32
-#include <alloca.h> // alloca
-#else
-#include <malloc.h> // MinGW alloca
-#endif
-#endif
 
 #include <stddef.h> /* Needed for sys/queue.h */
 #ifndef MSVC
@@ -46,47 +39,29 @@
 #endif
 
 /* Heap memory functions */
+#define UA_free(ptr) _UA_free(ptr, # ptr, __FILE__, __LINE__)
 INLINE UA_Int32 _UA_free(void *ptr, char *pname, char *f, UA_Int32 l) {
     DBG_VERBOSE(printf("UA_free;%p;;%s;;%s;%d\n", ptr, pname, f, l); fflush(stdout));
     free(ptr); // checks if ptr != NULL in the background
     return UA_SUCCESS;
 }
 
-INLINE UA_Int32 _UA_alloc(void **ptr, UA_Int32 size, char *pname, char *sname, char *f, UA_Int32 l) {
-    if(ptr == UA_NULL)
-        return UA_ERR_INVALID_VALUE;
-    *ptr = malloc(size);
-    DBG_VERBOSE(printf("UA_alloc - %p;%d;%s;%s;%s;%d\n", *ptr, size, pname, sname, f, l); fflush(stdout));
-    if(*ptr == UA_NULL)
-        return UA_ERR_NO_MEMORY;
-    return UA_SUCCESS;
+#ifdef DEBUG
+#define UA_alloc(size) _UA_alloc(size, __FILE__, __LINE__) 
+INLINE void * _UA_alloc(UA_Int32 size, char *file, UA_Int32 line) {
+    DBG_VERBOSE(printf("UA_alloc - %d;%s;%d\n", size, file, line); fflush(stdout));
+    return malloc(size);
 }
-
-INLINE UA_Int32 _UA_alloca(void **ptr, UA_Int32 size, char *pname, char *sname, char *f, UA_Int32 l) {
-    if(ptr == UA_NULL)
-        return UA_ERR_INVALID_VALUE;
-#ifdef MSVC
-    *ptr = _alloca(size);
 #else
-    *ptr = alloca(size);
-#endif
-    DBG_VERBOSE(printf("UA_alloca - %p;%d;%s;%s;%s;%d\n", *ptr, size, pname, sname, f, l); fflush(stdout));
-    return UA_SUCCESS;
+#define UA_alloc(size) _UA_alloc(size) 
+INLINE void * _UA_alloc(UA_Int32 size) {
+    return malloc(size);
 }
+#endif
 
 INLINE void UA_memcpy(void *dst, void const *src, UA_Int32 size) {
     DBG_VERBOSE(printf("UA_memcpy - %p;%p;%d\n", dst, src, size));
     memcpy(dst, src, size);
 }
 
-#define UA_free(ptr) _UA_free(ptr, # ptr, __FILE__, __LINE__)
-#define UA_alloc(ptr, size) _UA_alloc(ptr, size, # ptr, # size, __FILE__, __LINE__)
-
-/** @brief UA_alloca assigns memory on the stack instead of the heap. It is a
-    very fast alternative to standard malloc. The memory is automatically
-    returned ('freed') when the current function returns. Use this only for
-    small temporary values. For more than 100Byte, it is more reasonable to use
-    proper UA_alloc. */
-#define UA_alloca(ptr, size) _UA_alloca(ptr, size, # ptr, # size, __FILE__, __LINE__)
-
 #endif /* UA_UTIL_H_ */

+ 6 - 6
tests/check_builtin.c

@@ -121,7 +121,7 @@ START_TEST(UA_String_calcSizeWithNullArgumentShallReturnStorageSize) {
 	UA_UInt32  storageSize = UA_String_calcSizeBinary(arg);
 	// then
 	ck_assert_int_eq(storageSize, sizeof(UA_String));
-	ck_assert_int_ge(storageSize, UA_Int32_calcSizeBinary(UA_NULL) + sizeof(UA_NULL));
+	ck_assert_int_ge(storageSize, sizeof(UA_Int32) + sizeof(UA_NULL));
 }
 END_TEST
 START_TEST(UA_DateTime_calcSizeWithNullArgumentShallReturnStorageSize) {
@@ -149,7 +149,7 @@ START_TEST(UA_ByteString_calcSizeWithNullArgumentShallReturnStorageSize) {
 	UA_UInt32 storageSize = UA_ByteString_calcSizeBinary(arg);
 	// then
 	ck_assert_int_eq(storageSize, sizeof(UA_ByteString));
-	ck_assert_int_ge(storageSize, UA_Int32_calcSizeBinary(UA_NULL)+sizeof(UA_NULL));
+	ck_assert_int_ge(storageSize, sizeof(UA_Int32)+sizeof(UA_NULL));
 }
 END_TEST
 START_TEST(UA_XmlElement_calcSizeWithNullArgumentShallReturnStorageSize) {
@@ -159,7 +159,7 @@ START_TEST(UA_XmlElement_calcSizeWithNullArgumentShallReturnStorageSize) {
 	UA_UInt32 storageSize = UA_XmlElement_calcSizeBinary(arg);
 	// then
 	ck_assert_int_eq(storageSize, sizeof(UA_XmlElement));
-	ck_assert_int_ge(storageSize, UA_Int32_calcSizeBinary(UA_NULL)+sizeof(UA_NULL));
+	ck_assert_int_ge(storageSize, sizeof(UA_Int32)+sizeof(UA_NULL));
 }
 END_TEST
 START_TEST(UA_NodeId_calcSizeWithNullArgumentShallReturnStorageSize) {
@@ -1414,7 +1414,7 @@ START_TEST(UA_Array_copyByteArrayShallWorkOnExample) {
 	UA_Byte  *dstArray;
 	UA_Int32  size = 5;
 	UA_Int32  i    = 0;
-	UA_alloc((void **)&testString.data, size);
+	testString.data = UA_alloc(size);
 	testString.data[0] = 'O';
 	testString.data[1] = 'P';
 	testString.data[2] = 'C';
@@ -1670,7 +1670,7 @@ START_TEST(UA_Variant_copyShallWorkOnSingleValueExample) {
 	UA_Variant value, copiedValue;
 	UA_Variant_init(&value);
 	UA_Variant_init(&copiedValue);
-	UA_alloc((void**)&value.storage.data.dataPtr, sizeof(UA_String));
+	value.storage.data.dataPtr = UA_alloc(sizeof(UA_String));
 	*((UA_String*)value.storage.data.dataPtr) = testString;
 	value.vt = &UA_[UA_STRING];
 	value.storage.data.arrayLength = 1;
@@ -1702,7 +1702,7 @@ START_TEST(UA_Variant_copyShallWorkOn1DArrayExample) {
 	UA_String_copycstring("opc ua", &srcArray[2]);
 
 	UA_Int32 *dimensions;
-	UA_alloc((void **)&dimensions, UA_Int32_calcSizeBinary(UA_NULL));
+	dimensions = UA_alloc(sizeof(UA_Int32));
 	dimensions[0] = 3;
 
 	UA_Variant value, copiedValue;