瀏覽代碼

service_browse returns values. ua_application bug

apparently we must not allocate the references array statically
Julius Pfrommer 10 年之前
父節點
當前提交
7ee57126e9

+ 4 - 1
src/ua_application.c

@@ -90,13 +90,16 @@ void appMockup_init() {
 	root->displayName = (UA_LocalizedText){{2,"EN"},{4, "Root"}};
 	root->description = (UA_LocalizedText){{2,"EN"},{4, "Root"}};
 	root->referencesSize = 4;
-	root->references = (UA_ReferenceNode[4]){
+	UA_alloc((void**) &root->references, sizeof(UA_ReferenceNode)*4);
+	UA_ReferenceNode *static_nodes = (UA_ReferenceNode[4]){
 		{RefTypeId_HasTypeDefinition, UA_FALSE, ObjTypeId_FolderType},
 		{RefTypeId_Organizes, UA_FALSE, ObjId_ObjectsFolder},
 		{RefTypeId_Organizes, UA_FALSE, ObjId_TypesFolder},
 		{RefTypeId_Organizes, UA_FALSE, ObjId_ViewsFolder}};
+	UA_memcpy(root->references, static_nodes, sizeof(UA_ReferenceNode)*4);
 
 	Namespace_insert(ns0,(UA_Node*)root);
+	
 	// Objects
 	UA_ObjectNode *objects;
 	UA_ObjectNode_new(&objects);

+ 81 - 80
src/ua_services_view.c

@@ -1,36 +1,30 @@
 #include "ua_services.h"
 #include "ua_statuscodes.h"
 
-UA_Int32 Service_Browse_getReferenceDescription(Namespace *ns,UA_ReferenceNode* reference, UA_UInt32 nodeClassMask,
+UA_Int32 Service_Browse_getReferenceDescription(Namespace *ns, UA_ReferenceNode* reference, UA_UInt32 nodeClassMask,
 												UA_UInt32 resultMask, UA_ReferenceDescription* referenceDescription) {
 	const UA_Node* foundNode;
 	Namespace_Entry_Lock *lock;
-	if(Namespace_get(ns,&reference->targetId.nodeId,&foundNode, &lock) != UA_SUCCESS )
+	if(Namespace_get(ns,&reference->targetId.nodeId,&foundNode, &lock) != UA_SUCCESS)
 		return UA_ERROR;
 
 	UA_UInt32 mask = 0;
-	referenceDescription->resultMask = 0;
 	for (mask = 0x01; mask <= 0x40; mask *= 2) {
 		switch (mask & (resultMask)) {
 		case UA_BROWSERESULTMASK_REFERENCETYPEID:
 			UA_NodeId_copy(&reference->referenceTypeId, &referenceDescription->referenceTypeId);
-			referenceDescription->resultMask |= UA_BROWSERESULTMASK_REFERENCETYPEID;
 			break;
 		case UA_BROWSERESULTMASK_ISFORWARD:
 			referenceDescription->isForward = !reference->isInverse;
-			referenceDescription->resultMask |= UA_BROWSERESULTMASK_ISFORWARD;
 			break;
 		case UA_BROWSERESULTMASK_NODECLASS:
 			UA_NodeClass_copy(&foundNode->nodeClass, &referenceDescription->nodeClass);
-			referenceDescription->resultMask |= UA_BROWSERESULTMASK_NODECLASS;
 			break;
 		case UA_BROWSERESULTMASK_BROWSENAME:
 			UA_QualifiedName_copy(&foundNode->browseName, &referenceDescription->browseName);
-			referenceDescription->resultMask |= UA_BROWSERESULTMASK_BROWSENAME;
 			break;
 		case UA_BROWSERESULTMASK_DISPLAYNAME:
 			UA_LocalizedText_copy(&foundNode->displayName, &referenceDescription->displayName);
-			referenceDescription->resultMask |= UA_BROWSERESULTMASK_DISPLAYNAME;
 			break;
 		case UA_BROWSERESULTMASK_TYPEDEFINITION:
 			if (referenceDescription->nodeClass == UA_NODECLASS_OBJECT ||
@@ -39,15 +33,16 @@ UA_Int32 Service_Browse_getReferenceDescription(Namespace *ns,UA_ReferenceNode*
 				//TODO mockup
 				referenceDescription->typeDefinition.serverIndex = 0;
 				referenceDescription->typeDefinition.namespaceUri.length = 0;
-
-				referenceDescription->resultMask |= UA_BROWSERESULTMASK_TYPEDEFINITION;
 			}
 			break;
 		}
 	}
+	
+	Namespace_Entry_Lock_release(lock);
 	return UA_SUCCESS;
 }
-UA_Boolean Service_Browse_returnReference(UA_BrowseDescription *browseDescription, UA_ReferenceNode* reference) {
+
+static inline UA_Boolean Service_Browse_returnReference(UA_BrowseDescription *browseDescription, UA_ReferenceNode* reference) {
 	UA_Boolean c = UA_FALSE;
 
 	c = c || ((reference->isInverse == UA_TRUE) && (browseDescription->browseDirection == UA_BROWSEDIRECTION_INVERSE));
@@ -58,92 +53,98 @@ UA_Boolean Service_Browse_returnReference(UA_BrowseDescription *browseDescriptio
 	//TODO subtypes
 	return c;
 }
-UA_Int32 Service_Browse_getBrowseResult(Namespace *ns,UA_BrowseDescription *browseDescription,UA_UInt32 requestedMaxReferencesPerNode, UA_BrowseResult *browseResult) {
-	UA_Int32 retval = UA_SUCCESS;
-	const UA_Node* foundNode = UA_NULL;
+
+static void Service_Browse_getBrowseResult(Namespace *ns,UA_BrowseDescription *browseDescription,
+										   UA_UInt32 maxReferences, UA_BrowseResult *browseResult) {
+	const UA_Node* node;
 	Namespace_Entry_Lock *lock;
-	if(Namespace_get(ns, &browseDescription->nodeId, &foundNode, &lock) == UA_SUCCESS && foundNode)
-	{
-		UA_Int32 i = 0;
-		UA_list_List referenceDescriptionList;
-		UA_list_init(&referenceDescriptionList);
-		for(i = 0; i < (foundNode->referencesSize) && ((UA_UInt32)referenceDescriptionList.size < requestedMaxReferencesPerNode); i++)
-		{
-			if(Service_Browse_returnReference(browseDescription, &foundNode->references[i]) == UA_TRUE)
-			{
-				UA_ReferenceDescription *referenceDescription = UA_NULL;
-				UA_ReferenceDescription_new(&referenceDescription);
-
-				retval |= Service_Browse_getReferenceDescription(ns, &foundNode->references[i],
-					browseDescription->nodeClassMask,browseDescription->resultMask,referenceDescription);
-				if(retval == UA_SUCCESS){
-					retval |= UA_list_addPayloadToBack(&referenceDescriptionList,referenceDescription);
-				}
-			}
-		}
-		//create result array and copy all data from list into it
-		UA_Array_new((void**) &browseResult->references, referenceDescriptionList.size,
-				&UA_.types[UA_REFERENCEDESCRIPTION]);
-
-		browseResult->referencesSize = referenceDescriptionList.size;
-		UA_list_Element *element = referenceDescriptionList.first;
-		UA_Int32 l = 0;
-
-		for (l = 0; l < referenceDescriptionList.size; l++) {
-			UA_ReferenceDescription_copy(
-					(UA_ReferenceDescription*) element->payload,
-					&browseResult->references[l]);
-			element = element->next;
-		}
-		UA_list_destroy(&referenceDescriptionList,
-				(UA_list_PayloadVisitor) UA_ReferenceDescription_delete);
-		return retval;
+
+	if(Namespace_get(ns, &browseDescription->nodeId, &node, &lock) != UA_SUCCESS) {
+		browseResult->statusCode = UA_STATUSCODE_BADNODEIDUNKNOWN;
+		return;
+	}
+
+	// 0 => unlimited references
+	if(maxReferences == 0)
+		maxReferences = node->referencesSize;
+
+	/* We do not use a linked list but traverse the nodes references list twice
+	 * (once for counting, once for generating the referencedescriptions). That
+	 * is much faster than using a linked list, since the references are
+	 * allocated in a continuous blob and RAM access is predictible/does not
+	 * miss cache lines so often. */
+	UA_UInt32 refs = 0;
+	for(UA_Int32 i=0;i < node->referencesSize && refs <= maxReferences;i++) {
+		if(Service_Browse_returnReference(browseDescription, &node->references[i]))
+			refs++;
 	}
-	return UA_ERROR;
+
+	// can we return all relevant references in one go?
+	UA_Boolean finished = UA_TRUE;
+	if(refs > maxReferences) {
+		refs--;
+		finished = UA_FALSE;
+	}
+	
+	browseResult->referencesSize = refs;
+	UA_Array_new((void**) &browseResult->references, refs, &UA_.types[UA_REFERENCEDESCRIPTION]);
+	
+	for(UA_UInt32 i = 0, j=0; j < refs; i++) {
+		if(!Service_Browse_returnReference(browseDescription, &node->references[i]))
+			continue;
+		
+		if(Service_Browse_getReferenceDescription(ns, &node->references[i], browseDescription->nodeClassMask,
+												  browseDescription->resultMask, &browseResult->references[j]) != UA_SUCCESS)
+			browseResult->statusCode = UA_STATUSCODE_UNCERTAINNOTALLNODESAVAILABLE;
+		j++;
+	}
+
+	if(!finished) {
+		// Todo. Set the Statuscode and the continuation point.
+	}
+	
+	Namespace_Entry_Lock_release(lock);
 }
+
 UA_Int32 Service_Browse(SL_Channel *channel, const UA_BrowseRequest *request, UA_BrowseResponse *response) {
 	UA_Int32 retval = UA_SUCCESS;
 	DBG_VERBOSE(UA_NodeId_printf("BrowseService - view=", &request->view.viewId));
-	UA_Int32 i = 0;
-	Namespace *ns = UA_indexedList_findValue(
-			channel->session->application->namespaces,
-			request->nodesToBrowse[i].nodeId.namespace);
+
 	//TODO request->view not used atm
-	if(ns) {
-		UA_Array_new((void**) &(response->results), request->nodesToBrowseSize,
-				&UA_.types[UA_BROWSERESULT]);
-		response->resultsSize = request->nodesToBrowseSize;
-
-		for(i=0; i < request->nodesToBrowseSize; i++) {
-			retval |= Service_Browse_getBrowseResult(ns,
-					request->nodesToBrowse,
-					request->requestedMaxReferencesPerNode,
-					&response->results[i]);
-		}
+	UA_Array_new((void**) &(response->results), request->nodesToBrowseSize, &UA_.types[UA_BROWSERESULT]);
+	response->resultsSize = request->nodesToBrowseSize;
 
-		response->diagnosticInfosSize = 0;
-		response->diagnosticInfos = UA_NULL;
-		//TODO fill Diagnostic info array
-		return retval;
+	for(UA_Int32 i=0; i < request->nodesToBrowseSize; i++) {
+		Namespace *ns = UA_indexedList_findValue(channel->session->application->namespaces,
+												 request->nodesToBrowse[i].nodeId.namespace);
+		if(ns == UA_NULL) {
+			response->results[i].statusCode = UA_STATUSCODE_BADNODEIDUNKNOWN;
+			continue;
+		}
+		
+		// Service_Browse_getBrowseResult has no return value. All errors are resolved internally.
+		Service_Browse_getBrowseResult(ns, &request->nodesToBrowse[i],
+									   request->requestedMaxReferencesPerNode, &response->results[i]);
 	}
-	return UA_ERROR;
+
+	//TODO fill Diagnostic info array
+	response->diagnosticInfosSize = 0;
+	response->diagnosticInfos = UA_NULL;
+	return retval;
 }
 
-UA_Int32 Service_TranslateBrowsePathsToNodeIds(SL_Channel *channel,
-		const UA_TranslateBrowsePathsToNodeIdsRequest *request,
-		UA_TranslateBrowsePathsToNodeIdsResponse *response) {
+UA_Int32 Service_TranslateBrowsePathsToNodeIds(SL_Channel *channel, const UA_TranslateBrowsePathsToNodeIdsRequest *request,
+											   UA_TranslateBrowsePathsToNodeIdsResponse *response) {
 	UA_Int32 retval = UA_SUCCESS;
-
 	DBG_VERBOSE(printf("TranslateBrowsePathsToNodeIdsService - %i path(s)", request->browsePathsSize));
-//Allocate space for a correct answer
-	UA_Array_new((void**) &response->results, request->browsePathsSize,
-			&UA_.types[UA_BROWSEPATHRESULT]);
 
+	// Allocate space for a correct answer
 	response->resultsSize = request->browsePathsSize;
+	// _init of the elements is done in Array_new
+	UA_Array_new((void**) &response->results, request->browsePathsSize, &UA_.types[UA_BROWSEPATHRESULT]);
 
 	for (UA_Int32 i = 0; i < request->browsePathsSize; i++) {
-		UA_BrowsePathResult_init(&response->results[i]);
-//FIXME: implement
+		//FIXME: implement
 		response->results[i].statusCode = UA_STATUSCODE_BADNOMATCH;
 	}
 

+ 0 - 68
src/ua_types.c

@@ -1005,74 +1005,6 @@ void UA_InvalidType_print(const UA_InvalidType *p, FILE *stream) {
 	fprintf(stream, "(UA_InvalidType){ERROR (invalid type)}");
 }
 
-/* NodeClass */
-UA_TYPE_AS(UA_NodeClass, UA_Int32)
-
-/* ReferenceDescription */
-UA_Int32 UA_ReferenceDescription_delete(UA_ReferenceDescription *p) {
-	UA_Int32 retval = UA_SUCCESS;
-	retval |= UA_ReferenceDescription_deleteMembers(p);
-	retval |= UA_free(p);
-	return retval;
-}
-
-UA_Int32 UA_ReferenceDescription_deleteMembers(UA_ReferenceDescription *p) {
-    UA_Int32 retval = UA_SUCCESS;
-	retval |= UA_NodeId_deleteMembers(&p->referenceTypeId);
-	retval |= UA_ExpandedNodeId_deleteMembers(&p->nodeId);
-	retval |= UA_QualifiedName_deleteMembers(&p->browseName);
-	retval |= UA_LocalizedText_deleteMembers(&p->displayName);
-	retval |= UA_ExpandedNodeId_deleteMembers(&p->typeDefinition);
-	return retval;
-}
-
-UA_Int32 UA_ReferenceDescription_init(UA_ReferenceDescription *p) {
-    UA_Int32 retval = UA_SUCCESS;
-	p->resultMask = 0;
-	retval |= UA_NodeId_init(&p->referenceTypeId);
-	retval |= UA_Boolean_init(&p->isForward);
-	retval |= UA_ExpandedNodeId_init(&p->nodeId);
-	retval |= UA_QualifiedName_init(&p->browseName);
-	retval |= UA_LocalizedText_init(&p->displayName);
-	retval |= UA_NodeClass_init(&p->nodeClass);
-	retval |= UA_ExpandedNodeId_init(&p->typeDefinition);
-	return retval;
-}
-
-UA_TYPE_NEW_DEFAULT(UA_ReferenceDescription)
-UA_Int32 UA_ReferenceDescription_copy(const UA_ReferenceDescription *src,UA_ReferenceDescription *dst) {
-    if(src == UA_NULL || dst == UA_NULL) return UA_ERROR;
-    UA_Int32 retval = UA_SUCCESS;
-	memcpy(dst, src, sizeof(UA_ReferenceDescription));
-	retval |= UA_NodeId_copy(&src->referenceTypeId,&dst->referenceTypeId);
-	retval |= UA_ExpandedNodeId_copy(&src->nodeId,&dst->nodeId);
-	retval |= UA_QualifiedName_copy(&src->browseName,&dst->browseName);
-	retval |= UA_LocalizedText_copy(&src->displayName,&dst->displayName);
-	retval |= UA_ExpandedNodeId_copy(&src->typeDefinition,&dst->typeDefinition);
-	return retval;
-}
-
-void UA_ReferenceDescription_print(const UA_ReferenceDescription *p, FILE *stream) {
-    fprintf(stream, "(UA_ReferenceDescription){");
-	UA_UInt32_print(&p->resultMask,stream);
-	fprintf(stream, ",");
-	UA_NodeId_print(&p->referenceTypeId,stream);
-	fprintf(stream, ",");
-	UA_Boolean_print(&p->isForward,stream);
-	fprintf(stream, ",");
-	UA_ExpandedNodeId_print(&p->nodeId,stream);
-	fprintf(stream, ",");
-	UA_QualifiedName_print(&p->browseName,stream);
-	fprintf(stream, ",");
-	UA_LocalizedText_print(&p->displayName,stream);
-	fprintf(stream, ",");
-	UA_NodeClass_print(&p->nodeClass,stream);
-	fprintf(stream, ",");
-	UA_ExpandedNodeId_print(&p->typeDefinition,stream);
-	fprintf(stream, "}");
-}
-
-
 /*********/
 /* Array */
 /*********/

+ 2 - 31
src/ua_types.h

@@ -237,35 +237,6 @@ enum UA_DIAGNOSTICINFO_ENCODINGMASKTYPE_enum {
 /** @brief Type use internally to denote an invalid datatype. */
 typedef void UA_InvalidType;
 
-/* Not a built-in type. But needed for UA_ReferenceDescription. */
-/** @brief A mask specifying the class of the node. */
-typedef UA_Int32 UA_NodeClass;
-enum UA_NodeClass_enum { 
-	UA_NODECLASS_UNSPECIFIED = 0,
-	UA_NODECLASS_OBJECT = 1,
-	UA_NODECLASS_VARIABLE = 2,
-	UA_NODECLASS_METHOD = 4,
-	UA_NODECLASS_OBJECTTYPE = 8,
-	UA_NODECLASS_VARIABLETYPE = 16,
-	UA_NODECLASS_REFERENCETYPE = 32,
-	UA_NODECLASS_DATATYPE = 64,
-	UA_NODECLASS_VIEW = 128
-};
-
-/* UA_ReferenceDescription is not a built-in type. But we need it here as we add
-   the resultMask field and custom en/decoding. */
-/** @brief The description of a reference. */
-typedef struct UA_ReferenceDescription {
-	UA_UInt32 resultMask; // not present in the encoding
-	UA_NodeId referenceTypeId;
-	UA_Boolean isForward;
-	UA_ExpandedNodeId nodeId;
-	UA_QualifiedName browseName;
-	UA_LocalizedText displayName;
-	UA_NodeClass nodeClass;
-	UA_ExpandedNodeId typeDefinition;
-} UA_ReferenceDescription;
-
 /*************/
 /* Functions */
 /*************/
@@ -307,8 +278,8 @@ UA_TYPE_PROTOTYPES(UA_DiagnosticInfo)
 
 /* Not built-in types */
 UA_TYPE_PROTOTYPES(UA_InvalidType)
-UA_TYPE_PROTOTYPES (UA_NodeClass)
-UA_TYPE_PROTOTYPES(UA_ReferenceDescription)
+/* UA_TYPE_PROTOTYPES (UA_NodeClass) */
+/* UA_TYPE_PROTOTYPES(UA_ReferenceDescription) */
 
 /* String */
 UA_Int32 UA_String_copycstring(char const *src, UA_String *dst);

+ 0 - 70
src/ua_types_encoding_binary.c

@@ -985,73 +985,3 @@ UA_Int32 UA_InvalidType_calcSizeBinary(UA_InvalidType const *p) {
 }
 UA_TYPE_ENCODEBINARY(UA_InvalidType, retval = UA_ERR_INVALID_VALUE; )
 UA_TYPE_DECODEBINARY(UA_InvalidType, retval = UA_ERR_INVALID_VALUE; )
-
-/* NodeClass */
-UA_TYPE_BINARY_ENCODING_AS(UA_NodeClass, UA_Int32)
-
-/* ReferenceDescription */
-UA_Int32 UA_ReferenceDescription_calcSizeBinary(UA_ReferenceDescription const *p) {
-	if(p == UA_NULL) // internal size for UA_memalloc
-		return sizeof(UA_ReferenceDescription);
-	UA_Int32 length = 0;
-	length += UA_ExpandedNodeId_calcSizeBinary(&p->nodeId);
-	if((p->resultMask & 0x01) != 0) // UA_BROWSERESULTMASK_REFERENCETYPEID = 1
-		length += UA_NodeId_calcSizeBinary(&p->referenceTypeId);
-	if((p->resultMask & 0x02) != 0) // UA_BROWSERESULTMASK_ISFORWARD = 2
-		length += UA_Boolean_calcSizeBinary(&p->isForward);
-	if((p->resultMask & 0x04) != 0) // UA_BROWSERESULTMASK_NODECLASS = 4
-		length += UA_NodeClass_calcSizeBinary(&p->nodeClass);
-	if((p->resultMask & 0x08) != 0) // UA_BROWSERESULTMASK_BROWSENAME = 8
-		length += UA_QualifiedName_calcSizeBinary(&p->browseName);
-	if((p->resultMask & 0x10) != 0) // UA_BROWSERESULTMASK_DISPLAYNAME = 16
-		length += UA_LocalizedText_calcSizeBinary(&p->displayName);
-	if((p->resultMask & 0x20) != 0) // UA_BROWSERESULTMASK_TYPEDEFINITION = 32
-		length += UA_ExpandedNodeId_calcSizeBinary(&p->typeDefinition);
-	return length;
-}
-
-UA_Int32 UA_ReferenceDescription_encodeBinary(UA_ReferenceDescription const *src, UA_String *dst, UA_UInt32 *offset) {
-	if(src == UA_NULL) return UA_ERR_INVALID_VALUE;
-	UA_Int32 retval = UA_SUCCESS;
-	if((src->resultMask & 0x01) != 0) // UA_BROWSERESULTMASK_REFERENCETYPEID = 1
-		retval |= UA_NodeId_encodeBinary(&src->referenceTypeId, dst, offset);
-	if((src->resultMask & 0x02) != 0 && retval == UA_SUCCESS) // UA_BROWSERESULTMASK_ISFORWARD = 2
-		retval |= UA_Boolean_encodeBinary(&src->isForward, dst, offset);
-
-	UA_ExpandedNodeId_encodeBinary(&src->nodeId,dst,offset);
-	if((src->resultMask & 0x08) != 0 && retval == UA_SUCCESS) // UA_BROWSERESULTMASK_BROWSENAME = 8
-		retval |= UA_QualifiedName_encodeBinary(&src->browseName, dst, offset);
-	if((src->resultMask & 0x10) != 0 && retval == UA_SUCCESS) // UA_BROWSERESULTMASK_DISPLAYNAME = 16
-		retval |= UA_LocalizedText_encodeBinary(&src->displayName, dst, offset);
-
-	if((src->resultMask & 0x04) != 0 && retval == UA_SUCCESS) // UA_BROWSERESULTMASK_NODECLASS = 4
-		retval |= UA_NodeClass_encodeBinary(&src->nodeClass, dst, offset);
-	if((src->resultMask & 0x20) != 0 && retval == UA_SUCCESS) // UA_BROWSERESULTMASK_TYPEDEFINITION = 32
-		retval |= UA_ExpandedNodeId_encodeBinary(&src->typeDefinition, dst, offset);
-	return retval;
-}
-
-/* Decoding is nonstandard. We assume that the destination object has the
-   resultMask field correctly set and interpret it. */
-UA_Int32 UA_ReferenceDescription_decodeBinary(UA_String const *src, UA_UInt32 *offset, UA_ReferenceDescription *dst) {
-	if(src == UA_NULL || offset == UA_NULL || dst == UA_NULL) return UA_ERR_INVALID_VALUE;
-	UA_Int32 retval = UA_SUCCESS;
-	UA_UInt32 resultMask = dst->resultMask;
-	UA_ReferenceDescription_init(dst);
-	dst->resultMask = resultMask;
-
-	if((resultMask & 0x01) != 0) // UA_BROWSERESULTMASK_REFERENCETYPEID = 1
-		retval |= UA_NodeId_decodeBinary(src, offset, &dst->referenceTypeId);
-	if((resultMask & 0x02) != 0 && retval == UA_SUCCESS) // UA_BROWSERESULTMASK_ISFORWARD = 2
-		retval |= UA_Boolean_decodeBinary(src, offset, &dst->isForward);
-	retval |= UA_ExpandedNodeId_decodeBinary(src,offset,&dst->nodeId);
-	if((resultMask & 0x08) != 0 && retval == UA_SUCCESS) // UA_BROWSERESULTMASK_BROWSENAME = 8
-		retval |= UA_QualifiedName_decodeBinary(src, offset, &dst->browseName);
-	if((resultMask & 0x10) != 0 && retval == UA_SUCCESS) // UA_BROWSERESULTMASK_DISPLAYNAME = 16
-		retval |= UA_LocalizedText_decodeBinary(src, offset, &dst->displayName);
-	if((resultMask & 0x04) != 0 && retval == UA_SUCCESS) // UA_BROWSERESULTMASK_NODECLASS = 4
-		retval |= UA_NodeClass_decodeBinary(src, offset, &dst->nodeClass);
-	if((resultMask & 0x20) != 0 && retval == UA_SUCCESS) // UA_BROWSERESULTMASK_TYPEDEFINITION = 32
-		retval |= UA_ExpandedNodeId_decodeBinary(src, offset, &dst->typeDefinition);
-	return retval;
-}

+ 0 - 2
src/ua_types_encoding_binary.h

@@ -93,8 +93,6 @@ UA_TYPE_BINARY_ENCODING(UA_DiagnosticInfo)
 
 /* Not built-in types */
 UA_TYPE_BINARY_ENCODING(UA_InvalidType)
-UA_TYPE_BINARY_ENCODING(UA_NodeClass)
-UA_TYPE_BINARY_ENCODING(UA_ReferenceDescription)
 
 /*********/
 /* Array */

+ 0 - 10
src/ua_types_encoding_xml.c

@@ -446,13 +446,3 @@ UA_TYPE_METHOD_DECODEXML_NOTIMPL(UA_DiagnosticInfo)
 UA_TYPE_METHOD_CALCSIZEXML_NOTIMPL(UA_InvalidType)
 UA_TYPE_METHOD_ENCODEXML_NOTIMPL(UA_InvalidType)
 UA_TYPE_METHOD_DECODEXML_NOTIMPL(UA_InvalidType)
-
-/* NodeClass */
-UA_TYPE_METHOD_CALCSIZEXML_NOTIMPL(UA_NodeClass)
-UA_TYPE_METHOD_ENCODEXML_NOTIMPL(UA_NodeClass)
-UA_TYPE_METHOD_DECODEXML_NOTIMPL(UA_NodeClass)
-
-/* ReferenceDescription */
-UA_TYPE_METHOD_CALCSIZEXML_NOTIMPL(UA_ReferenceDescription)
-UA_TYPE_METHOD_ENCODEXML_NOTIMPL(UA_ReferenceDescription)
-UA_TYPE_METHOD_DECODEXML_NOTIMPL(UA_ReferenceDescription)

+ 0 - 2
src/ua_types_encoding_xml.h

@@ -73,7 +73,5 @@ UA_TYPE_XML_ENCODING(UA_DiagnosticInfo)
 
 /* Not built-in types */
 UA_TYPE_XML_ENCODING(UA_InvalidType)
-UA_TYPE_XML_ENCODING(UA_ReferenceDescription)
-UA_TYPE_XML_ENCODING(UA_NodeClass)
 
 #endif /* UA_TYPES_ENCODING_XML_H_ */

+ 2 - 2
tools/generate_builtin.py

@@ -32,11 +32,11 @@ existing_types = set(["Boolean", "SByte", "Byte", "Int16", "UInt16", "Int32", "U
                       "Int64", "UInt64", "Float", "Double", "String", "DateTime", "Guid",
                       "ByteString", "XmlElement", "NodeId", "ExpandedNodeId", "StatusCode", 
                       "QualifiedName", "LocalizedText", "ExtensionObject", "DataValue",
-                      "Variant", "DiagnosticInfo", "NodeClass", "ReferenceDescription"])
+                      "Variant", "DiagnosticInfo"])
 
 fixed_size = set(["UA_Boolean", "UA_SByte", "UA_Byte", "UA_Int16", "UA_UInt16",
                   "UA_Int32", "UA_UInt32", "UA_Int64", "UA_UInt64", "UA_Float",
-                  "UA_Double", "UA_DateTime", "UA_Guid", "UA_StatusCode", "NodeClass"])
+                  "UA_Double", "UA_DateTime", "UA_Guid", "UA_StatusCode"])
 
 # types we do not want to autogenerate
 def skipType(name):