Sfoglia il codice sorgente

improve build script, naming changes

Julius Pfrommer 9 anni fa
parent
commit
6aaac99420

+ 4 - 4
CMakeLists.txt

@@ -110,11 +110,11 @@ else()
     list(APPEND lib_sources src/server/ua_namespace.c)
 endif(MULTITHREADING)
 
-set(generate_src_options "")
+set(generate_src_options)
 
 #types
 if(TYPES_ONLY_NEEDED)
-    set(generate_src_options "${generate_src_options}--only-needed")
+    list(APPEND generate_src_options "--only-needed")
 endif(TYPES_ONLY_NEEDED)
 
 
@@ -122,12 +122,12 @@ if(UA_ENCODING_XML)
     list(APPEND lib_sources src/ua_types_encoding_xml.c
                             src/server/ua_namespace_xml.c
                             src/ua_xml.c)
-    set(generate_src_options "${generate_src_options}--with-xml")
+    list(APPEND generate_src_options "--with-xml")
 endif(UA_ENCODING_XML)
 
 if(UA_ENCODING_JSON)
     list(APPEND lib_sources src/ua_types_encoding_json.c)
-    set(generate_src_options "${generate_src_options}--with-json")
+    list(APPEND generate_src_options "--with-json")
 endif(UA_ENCODING_JSON)
 
 add_library(open62541 ${lib_sources})

+ 1 - 1
examples/xml2ns0.c

@@ -26,7 +26,7 @@ char* buildNumber = "999-" __DATE__ "-001" ;
 
 void sam_attach(Namespace *ns,UA_UInt32 ns0id,UA_Int32 type, void* p) {
 	UA_NodeId nodeid;
-	nodeid.namespace = 0; // we cannot access ns->namespaceId;
+	nodeid.namespace = 0; // we cannot access ns->namespaceIndex;
 	nodeid.identifier.numeric = ns0id;
 	nodeid.encodingByte = UA_NODEIDTYPE_FOURBYTE;
 	const UA_Node* result;

+ 3 - 3
src/server/ua_application.c

@@ -13,8 +13,8 @@ Application appMockup = {
 
 UA_Node* create_node_ns0(UA_Int32 class, UA_Int32 nodeClass, UA_Int32 const id, char const * qn, char const * dn, char const * desc) {
 	UA_Node* n; UA_.types[class].new((void **)&n);
-	n->nodeId.nodeIdType = UA_NODEIDTYPE_NUMERIC;
-	n->nodeId.namespaceId = 0;
+	n->nodeId.identifierType = UA_NODEIDTYPE_NUMERIC;
+	n->nodeId.namespaceIndex = 0;
 	n->nodeId.identifier.numeric = id;
 	UA_String_copycstring(qn,&(n->browseName.name));
 	UA_String_copycstring(dn,&n->displayName.text);
@@ -545,7 +545,7 @@ void appMockup_init() {
 	/* v->value.arrayLength = 2; */
 	/* UA_String_copycstring("http://opcfoundation.org/UA/",&((UA_String *)((v->value).data))[0]); */
 	/* UA_String_copycstring("http://localhost:16664/open62541/",&((UA_String *)(((v)->value).data))[1]); */
-	/* v->dataType.nodeIdType = UA_NODEIDTYPE_FOURBYTE; */
+	/* v->dataType.identifierType = UA_NODEIDTYPE_FOURBYTE; */
 	/* v->dataType.identifier.numeric = UA_STRING_NS0; */
 	/* v->valueRank = 1; */
 	/* v->minimumSamplingInterval = 1.0; */

+ 4 - 4
src/server/ua_namespace.c

@@ -3,7 +3,7 @@
 #include <stdio.h>
 
 struct Namespace {
-	UA_UInt32 namespaceId;
+	UA_UInt32 namespaceIndex;
 	const UA_Node ** entries;
 	UA_UInt32 size;
 	UA_UInt32 count;
@@ -90,7 +90,7 @@ static INLINE hash_t hash_array(const UA_Byte *data, UA_UInt32 len) {
 }
 
 static INLINE hash_t hash(const UA_NodeId *n) {
-	switch(n->nodeIdType) {
+	switch(n->identifierType) {
 	case UA_NODEIDTYPE_NUMERIC:
 		/*  Knuth's multiplicative hashing */
 		return n->identifier.numeric * 2654435761;   // mod(2^32) is implicit
@@ -232,7 +232,7 @@ static UA_Int32 expand(Namespace * ns) {
 /* Exported functions */
 /**********************/
 
-UA_Int32 Namespace_new(Namespace ** result, UA_UInt32 namespaceId) {
+UA_Int32 Namespace_new(Namespace ** result, UA_UInt32 namespaceIndex) {
 	Namespace *ns;
 	UA_UInt32 sizePrimeIndex, size;
 	if(UA_alloc((void **)&ns, sizeof(Namespace)) != UA_SUCCESS)
@@ -248,7 +248,7 @@ UA_Int32 Namespace_new(Namespace ** result, UA_UInt32 namespaceId) {
 	/* set entries to zero */
 	memset(ns->entries, 0, size * sizeof(UA_Node *));
 
-	*ns = (Namespace) {namespaceId, ns->entries, size, 0, sizePrimeIndex};
+	*ns = (Namespace) {namespaceIndex, ns->entries, size, 0, sizePrimeIndex};
 	*result = ns;
 	return UA_SUCCESS;
 }

+ 1 - 1
src/server/ua_namespace.h

@@ -26,7 +26,7 @@ struct Namespace;
 typedef struct Namespace Namespace;
 
 /** @brief Create a new namespace */
-UA_Int32 Namespace_new(Namespace **result, UA_UInt32 namespaceId);
+UA_Int32 Namespace_new(Namespace **result, UA_UInt32 namespaceIndex);
 
 /** @brief Delete the namespace and all nodes in it */
 UA_Int32 Namespace_delete(Namespace *ns);

+ 5 - 5
src/server/ua_namespace_concurrent.c

@@ -15,7 +15,7 @@ typedef struct Namespace_Entry {
 } Namespace_Entry;
 
 struct Namespace {
-	UA_UInt32       namespaceId;
+	UA_UInt32       namespaceIndex;
 	struct cds_lfht *ht; /* Hash table */
 };
 
@@ -77,7 +77,7 @@ static inline hash_t hash_array(const UA_Byte *data, UA_UInt32 len) {
 }
 
 static inline hash_t hash(const UA_NodeId *n) {
-	switch(n->nodeIdType) {
+	switch(n->identifierType) {
 	case UA_NODEIDTYPE_NUMERIC:
 		/*  Knuth's multiplicative hashing */
 		return n->identifier.numeric * 2654435761;   // mod(2^32) is implicit
@@ -175,7 +175,7 @@ void Namespace_releaseManagedNode(const UA_Node *managed) {
 	return;
 }
 
-UA_Int32 Namespace_new(Namespace **result, UA_UInt32 namespaceId) {
+UA_Int32 Namespace_new(Namespace **result, UA_UInt32 namespaceIndex) {
 	Namespace *ns;
 	if(UA_alloc((void **)&ns, sizeof(Namespace)) != UA_SUCCESS)
 		return UA_ERR_NO_MEMORY;
@@ -187,7 +187,7 @@ UA_Int32 Namespace_new(Namespace **result, UA_UInt32 namespaceId) {
 		return UA_ERR_NO_MEMORY;
 	}
 
-	ns->namespaceId = namespaceId;
+	ns->namespaceIndex = namespaceIndex;
 	*result = ns;
 	return UA_SUCCESS;
 }
@@ -221,7 +221,7 @@ UA_Int32 Namespace_delete(Namespace *ns) {
 }
 
 UA_Int32 Namespace_insert(Namespace *ns, UA_Node **node, UA_Byte flags) {
-	if(ns == UA_NULL || node == UA_NULL || *node == UA_NULL || (*node)->nodeId.namespaceId != ns->namespaceId)
+	if(ns == UA_NULL || node == UA_NULL || *node == UA_NULL || (*node)->nodeId.namespaceIndex != ns->namespaceIndex)
 		return UA_ERROR;
 
 	UA_UInt32 nodesize;

+ 2 - 2
src/server/ua_namespace_xml.c

@@ -43,7 +43,7 @@ UA_Int32 readFromTheFile(char*buf,int len) {
 /** @brief load a namespace from an XML-File
  *
  * @param[in/out] ns the address of the namespace ptr
- * @param[in] namespaceId the numeric id of the namespace
+ * @param[in] namespaceIndex the numeric id of the namespace
  * @param[in] rootName the name of the root element of the hierarchy (not used?)
  * @param[in] fileName the name of an existing file, e.g. Opc.Ua.NodeSet2.xml
  */
@@ -74,7 +74,7 @@ UA_Int32 readFromTheBuffer(char*buf,int len) {
 /** @brief load a namespace from a string
  *
  * @param[in/out] ns the address of the namespace ptr
- * @param[in] namespaceId the numeric id of the namespace
+ * @param[in] namespaceIndex the numeric id of the namespace
  * @param[in] rootName the name of the root element of the hierarchy (not used?)
  * @param[in] buffer the xml string
  */

+ 2 - 2
src/server/ua_namespace_xml.h

@@ -31,11 +31,11 @@ UA_Int32 UA_ExpandedNodeId_copycstring(cstring src, UA_ExpandedNodeId* dst, UA_N
 /** @brief load a namespace from an XML-File
  *
  * @param[in/out] ns the address of the namespace ptr
- * @param[in] namespaceId the numeric id of the namespace
+ * @param[in] namespaceIndex the numeric id of the namespace
  * @param[in] rootName the name of the root element of the hierarchy (not used?)
  * @param[in] fileName the name of an existing file, e.g. Opc.Ua.NodeSet2.xml
  */
-UA_Int32 Namespace_loadFromFile(Namespace **ns,UA_UInt32 namespaceId,const char* rootName,const char* fileName);
+UA_Int32 Namespace_loadFromFile(Namespace **ns,UA_UInt32 namespaceIndex,const char* rootName,const char* fileName);
 UA_Int32 Namespace_loadFromString(Namespace **ns,UA_UInt32 nsid,const char* rootName,const char* buffer);
 
 #endif /* __UA_NAMESPACE_XML_H */

+ 4 - 4
src/server/ua_services_attribute.c

@@ -37,12 +37,12 @@ static UA_DataValue service_read_node(Application *app, const UA_ReadValueId *id
 	UA_DataValue v;
 	UA_DataValue_init(&v);
 
-	DBG(printf("service_read_node - entered with ns=%d,id=%d,attr=%i\n", id->nodeId.namespaceId,
+	DBG(printf("service_read_node - entered with ns=%d,id=%d,attr=%i\n", id->nodeId.namespaceIndex,
 	           id->nodeId.identifier.numeric, id->attributeId));
-	Namespace *ns = UA_indexedList_findValue(app->namespaces, id->nodeId.namespaceId);
+	Namespace *ns = UA_indexedList_findValue(app->namespaces, id->nodeId.namespaceIndex);
 
 	if(ns == UA_NULL) {
-		DBG_VERBOSE(printf("service_read_node - unknown namespace %d\n", id->nodeId.namespaceId));
+		DBG_VERBOSE(printf("service_read_node - unknown namespace %d\n", id->nodeId.namespaceIndex));
 		v.encodingMask = UA_DATAVALUE_ENCODINGMASK_STATUSCODE;
 		v.status       = UA_STATUSCODE_BADNODEIDUNKNOWN;
 		return v;
@@ -257,7 +257,7 @@ UA_Int32 Service_Read(UA_Session *session, const UA_ReadRequest *request,
 UA_Int32 Service_Write_writeNode(Application *app, UA_WriteValue *writeValue, UA_StatusCode *result)
 {
 	UA_Int32 retval = UA_SUCCESS;
-	Namespace *ns = UA_indexedList_findValue(app->namespaces, writeValue->nodeId.namespaceId);
+	Namespace *ns = UA_indexedList_findValue(app->namespaces, writeValue->nodeId.namespaceIndex);
 	if(ns==UA_NULL) {
 		*result = UA_STATUSCODE_BADNODEIDINVALID;
 		return UA_ERROR;

+ 3 - 3
src/server/ua_services_nodemanagement.c

@@ -15,7 +15,7 @@ static UA_AddNodesResult addSingleNode(Application *app, UA_AddNodesItem *item)
 	UA_AddNodesResult result;
 	UA_AddNodesResult_init(&result);
 
-	Namespace *parent_ns = UA_indexedList_findValue(app->namespaces, item->parentNodeId.nodeId.namespaceId);
+	Namespace *parent_ns = UA_indexedList_findValue(app->namespaces, item->parentNodeId.nodeId.namespaceIndex);
 	// TODO: search for namespaceUris and not only ns-ids.
 	if(parent_ns == UA_NULL) {
 		result.statusCode = UA_STATUSCODE_BADPARENTNODEIDINVALID;
@@ -26,9 +26,9 @@ static UA_AddNodesResult addSingleNode(Application *app, UA_AddNodesItem *item)
 	UA_Boolean nodeid_isnull = UA_NodeId_isNull(&item->requestedNewNodeId.nodeId);
 
 	if(nodeid_isnull) ns = parent_ns;
-	else ns = UA_indexedList_findValue(app->namespaces, item->requestedNewNodeId.nodeId.namespaceId);
+	else ns = UA_indexedList_findValue(app->namespaces, item->requestedNewNodeId.nodeId.namespaceIndex);
 
-	if(ns == UA_NULL || item->requestedNewNodeId.nodeId.namespaceId == 0) {
+	if(ns == UA_NULL || item->requestedNewNodeId.nodeId.namespaceIndex == 0) {
 		result.statusCode = UA_STATUSCODE_BADNODEIDREJECTED;
 		return result;
 	}

+ 1 - 2
src/server/ua_services_view.c

@@ -203,8 +203,7 @@ UA_Int32 Service_Browse(UA_Session *session, const UA_BrowseRequest *request, UA
 	response->resultsSize = request->nodesToBrowseSize;
 
 	for(UA_Int32 i=0; i < request->nodesToBrowseSize; i++) {
-		Namespace *ns = UA_indexedList_findValue(application->namespaces,
-												 request->nodesToBrowse[i].nodeId.namespaceId);
+		Namespace *ns = UA_indexedList_findValue(application->namespaces, request->nodesToBrowse[i].nodeId.namespaceIndex);
 		if(ns == UA_NULL) {
 			response->results[i].statusCode = UA_STATUSCODE_BADNODEIDUNKNOWN;
 			continue;

+ 2 - 2
src/server/ua_session_manager.c

@@ -12,8 +12,8 @@ struct UA_SessionManager {
 static UA_SessionManager *sessionManager;
 
 UA_Int32 UA_SessionManager_generateSessionId(UA_NodeId *sessionId) {
-	sessionId->nodeIdType = UA_NODEIDTYPE_NUMERIC;
-	sessionId->namespaceId = 0;
+	sessionId->namespaceIndex = 0;
+	sessionId->identifierType = UA_NODEIDTYPE_NUMERIC;
 	sessionId->identifier.numeric = sessionManager->lastSessionId++;
 	return UA_SUCCESS;
 }

+ 2 - 2
src/ua_session.c

@@ -26,8 +26,8 @@ UA_Int32 UA_Session_generateToken(UA_NodeId *newToken) {
 	UA_Int32 r = 0;
 	//retval |= UA_NodeId_new(newToken);
 
-	newToken->nodeIdType = UA_NODEIDTYPE_GUID;
-	newToken->namespaceId = 0; // where else?
+	newToken->namespaceIndex = 0; // where else?
+	newToken->identifierType = UA_NODEIDTYPE_GUID;
 	newToken->identifier.guid.data1 = rand();
 	r = rand();
 	newToken->identifier.guid.data2 = (UA_UInt16)((r>>16) );

+ 3 - 3
src/ua_transport_binary_secure.c

@@ -22,8 +22,8 @@ static UA_Int32 SL_Send(SL_Channel *channel, const UA_ByteString * responseMessa
 	UA_TL_Connection *connection;
 	UA_AsymmetricAlgorithmSecurityHeader *asymAlgSettings = UA_NULL;
 
-	resp_nodeid.nodeIdType = UA_NODEIDTYPE_NUMERIC;
-	resp_nodeid.namespaceId = 0;
+	resp_nodeid.namespaceIndex = 0;
+	resp_nodeid.identifierType = UA_NODEIDTYPE_NUMERIC;
 	resp_nodeid.identifier.numeric = type + 2; // binary encoding
 
 	const UA_ByteString *response_gather[2]; // securechannel_header, seq_header, security_encryption_header, message_length (eventually + padding + size_signature);
@@ -299,7 +299,7 @@ UA_Int32 SL_handleRequest(SL_Channel *channel, const UA_ByteString* msg, UA_UInt
 		responsetype = UA_SETPUBLISHINGMODERESPONSE_NS0;
 	} else {
 		printf("SL_processMessage - unknown request, namespace=%d, request=%d\n",
-			   serviceRequestType.namespaceId, serviceRequestType.identifier.numeric);
+			   serviceRequestType.namespaceIndex, serviceRequestType.identifier.numeric);
 		retval = UA_ERROR;
 		UA_RequestHeader p;
 		UA_ResponseHeader r;

+ 17 - 17
src/ua_types.c

@@ -418,8 +418,8 @@ UA_TYPE_AS(UA_XmlElement, UA_ByteString)
 /* NodeId */
 UA_Int32 UA_NodeId_init(UA_NodeId *p) {
 	if(p == UA_NULL) return UA_ERROR;
-	p->nodeIdType = UA_NODEIDTYPE_NUMERIC;
-	p->namespaceId = 0;
+	p->identifierType = UA_NODEIDTYPE_NUMERIC;
+	p->namespaceIndex = 0;
 	memset(&p->identifier, 0, sizeof(p->identifier));
 	return UA_SUCCESS;
 }
@@ -430,7 +430,7 @@ UA_Int32 UA_NodeId_copy(UA_NodeId const *src, UA_NodeId *dst) {
 	if(src == UA_NULL || dst == UA_NULL)
 		return UA_ERROR;
 
-	switch(src->nodeIdType) {
+	switch(src->identifierType) {
 	case UA_NODEIDTYPE_NUMERIC:
 		*dst = *src;
 		return UA_SUCCESS;
@@ -448,13 +448,13 @@ UA_Int32 UA_NodeId_copy(UA_NodeId const *src, UA_NodeId *dst) {
 		retval |= UA_ByteString_copy(&src->identifier.byteString, &dst->identifier.byteString);
 		break;
 	}
-	dst->nodeIdType = src->nodeIdType;
+	dst->identifierType = src->identifierType;
 	return retval;
 }
 
 UA_Boolean UA_NodeId_isBasicType(UA_NodeId const *id) {
-	return (id->namespaceId == 0 &&
-			id->nodeIdType == UA_NODEIDTYPE_NUMERIC &&
+	return (id->namespaceIndex == 0 &&
+			id->identifierType == UA_NODEIDTYPE_NUMERIC &&
 			id->identifier.numeric <= UA_DIAGNOSTICINFO);
 }
 
@@ -463,7 +463,7 @@ UA_Int32 UA_NodeId_deleteMembers(UA_NodeId *p) {
 	UA_Int32 retval = UA_SUCCESS;
 	if(p == UA_NULL) return retval;
 
-	switch(p->nodeIdType) {
+	switch(p->identifierType) {
 	case UA_NODEIDTYPE_NUMERIC:
 		// nothing to do
 		break;
@@ -489,7 +489,7 @@ void UA_NodeId_print(const UA_NodeId *p, FILE *stream) {
 		return;
 
 	fprintf(stream, "(UA_NodeId){");
-	switch(p->nodeIdType) {
+	switch(p->identifierType) {
 	case UA_NODEIDTYPE_NUMERIC:
 		fprintf(stream, "UA_NODEIDTYPE_NUMERIC");
 		break;
@@ -510,8 +510,8 @@ void UA_NodeId_print(const UA_NodeId *p, FILE *stream) {
 		fprintf(stream, "ERROR");
 		break;
 	}
-	fprintf(stream,",%u,", p->namespaceId);
-	switch(p->nodeIdType & UA_NODEIDTYPE_MASK) {
+	fprintf(stream,",%u,", p->namespaceIndex);
+	switch(p->identifierType & UA_NODEIDTYPE_MASK) {
 	case UA_NODEIDTYPE_NUMERIC:
 		fprintf(stream, ".identifier.numeric=%u", p->identifier.numeric);
 		break;
@@ -538,10 +538,10 @@ void UA_NodeId_print(const UA_NodeId *p, FILE *stream) {
 #endif
 
 UA_Int32 UA_NodeId_equal(const UA_NodeId *n1, const UA_NodeId *n2) {
-	if(n1 == UA_NULL || n2 == UA_NULL || n1->namespaceId != n2->namespaceId)
+	if(n1 == UA_NULL || n2 == UA_NULL || n1->namespaceIndex != n2->namespaceIndex)
 		return UA_NOT_EQUAL;
 
-	switch(n1->nodeIdType) {
+	switch(n1->identifierType) {
 	case UA_NODEIDTYPE_NUMERIC:
 		if(n1->identifier.numeric == n2->identifier.numeric)
 			return UA_EQUAL;
@@ -561,22 +561,22 @@ UA_Int32 UA_NodeId_equal(const UA_NodeId *n1, const UA_NodeId *n2) {
 }
 
 UA_Boolean UA_NodeId_isNull(const UA_NodeId *p) {
-	switch(p->nodeIdType) {
+	switch(p->identifierType) {
 	case UA_NODEIDTYPE_NUMERIC:
-		if(p->namespaceId != 0 || p->identifier.numeric != 0) return UA_FALSE;
+		if(p->namespaceIndex != 0 || p->identifier.numeric != 0) return UA_FALSE;
 		break;
 
 	case UA_NODEIDTYPE_STRING:
-		if(p->namespaceId != 0 || p->identifier.string.length != 0) return UA_FALSE;
+		if(p->namespaceIndex != 0 || p->identifier.string.length != 0) return UA_FALSE;
 		break;
 
 	case UA_NODEIDTYPE_GUID:
-		if(p->namespaceId != 0 ||
+		if(p->namespaceIndex != 0 ||
 		   memcmp(&p->identifier.guid, (char[sizeof(UA_Guid)]) { 0 }, sizeof(UA_Guid)) != 0) return UA_FALSE;
 		break;
 
 	case UA_NODEIDTYPE_BYTESTRING:
-		if(p->namespaceId != 0 || p->identifier.byteString.length != 0) return UA_FALSE;
+		if(p->namespaceIndex != 0 || p->identifier.byteString.length != 0) return UA_FALSE;
 		break;
 
 	default:

+ 3 - 3
src/ua_types.h

@@ -126,7 +126,7 @@ typedef struct UA_String UA_XmlElement;
 
 /** @brief An identifier for a node in the address space of an OPC UA Server. */
 typedef struct UA_NodeId {
-	UA_UInt16 namespaceId;
+	UA_UInt16 namespaceIndex;
 	enum {
 		/* The shortened numeric types are introduced during encoding.
 		   UA_NODEIDTYPE_TWOBYTE = 0,
@@ -135,7 +135,7 @@ typedef struct UA_NodeId {
 		UA_NODEIDTYPE_STRING = 3,
 		UA_NODEIDTYPE_GUID = 4,
 		UA_NODEIDTYPE_BYTESTRING = 5
-	} nodeIdType;
+	} identifierType;
 	union {
 		UA_UInt32     numeric;
 		UA_String     string;
@@ -343,7 +343,7 @@ UA_Boolean UA_NodeId_isNull(const UA_NodeId *p);
 UA_Boolean UA_NodeId_isBasicType(UA_NodeId const *id);
 
 #define NS0NODEID(NUMERIC_ID) \
-	(UA_NodeId){ .namespaceId = 0, .nodeIdType = UA_NODEIDTYPE_NUMERIC, .identifier.numeric = NUMERIC_ID }
+	(UA_NodeId){ .namespaceIndex = 0, .identifierType = UA_NODEIDTYPE_NUMERIC, .identifier.numeric = NUMERIC_ID }
 
 /* ExpandedNodeId */
 UA_Boolean UA_ExpandedNodeId_isNull(const UA_ExpandedNodeId *p);

+ 27 - 27
src/ua_types_encoding_binary.c

@@ -2,7 +2,7 @@
 #include "ua_namespace_0.h"
 
 static INLINE UA_Boolean is_builtin(UA_NodeId *typeid) {
-	return (typeid->namespaceId == 0 && 1 <= typeid->identifier.numeric && typeid->identifier.numeric <= 25);
+	return (typeid->namespaceIndex == 0 && 1 <= typeid->identifier.numeric && typeid->identifier.numeric <= 25);
 }
 
 /*********/
@@ -387,11 +387,11 @@ UA_Int32 UA_NodeId_calcSizeBinary(UA_NodeId const *p) {
 	if(p == UA_NULL)
 		length = sizeof(UA_NodeId);
 	else {
-		switch(p->nodeIdType) {
+		switch(p->identifierType) {
 		case UA_NODEIDTYPE_NUMERIC:
-			if(p->identifier.numeric > UA_UINT16_MAX || p->namespaceId > UA_BYTE_MAX)
+			if(p->identifier.numeric > UA_UINT16_MAX || p->namespaceIndex > UA_BYTE_MAX)
 				length = sizeof(UA_Byte) + sizeof(UA_UInt16) + sizeof(UA_UInt32);
-			else if(p->identifier.numeric > UA_BYTE_MAX || p->namespaceId > 0)
+			else if(p->identifier.numeric > UA_BYTE_MAX || p->namespaceIndex > 0)
 				length = 4; /* UA_NODEIDTYPE_FOURBYTE */
 			else
 				length = 2; /* UA_NODEIDTYPE_TWOBYTE*/
@@ -422,17 +422,17 @@ UA_TYPE_ENCODEBINARY(UA_NodeId,
                      UA_UInt16 srcUInt16;
 
                      UA_Int32 retval = UA_SUCCESS;
-                     switch(src->nodeIdType) {
+                     switch(src->identifierType) {
 					 case UA_NODEIDTYPE_NUMERIC:
-						 if(src->identifier.numeric > UA_UINT16_MAX || src->namespaceId > UA_BYTE_MAX) {
+						 if(src->identifier.numeric > UA_UINT16_MAX || src->namespaceIndex > UA_BYTE_MAX) {
 							 srcByte = UA_NODEIDTYPE_NUMERIC;
 							 retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
-							 retval |= UA_UInt16_encodeBinary(&src->namespaceId, dst, offset);
+							 retval |= UA_UInt16_encodeBinary(&src->namespaceIndex, dst, offset);
 							 retval |= UA_UInt32_encodeBinary(&src->identifier.numeric, dst, offset);
-						 } else if(src->identifier.numeric > UA_BYTE_MAX || src->namespaceId > 0) { /* UA_NODEIDTYPE_FOURBYTE */
+						 } else if(src->identifier.numeric > UA_BYTE_MAX || src->namespaceIndex > 0) { /* UA_NODEIDTYPE_FOURBYTE */
 							 srcByte = UA_NODEIDTYPE_FOURBYTE;
 							 retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
-							 srcByte = src->namespaceId;
+							 srcByte = src->namespaceIndex;
 							 srcUInt16 = src->identifier.numeric;
 							 retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
 							 retval |= UA_UInt16_encodeBinary(&srcUInt16, dst, offset);
@@ -447,21 +447,21 @@ UA_TYPE_ENCODEBINARY(UA_NodeId,
 					 case UA_NODEIDTYPE_STRING:
 						 srcByte = UA_NODEIDTYPE_STRING;
 						 retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
-						 retval |= UA_UInt16_encodeBinary(&src->namespaceId, dst, offset);
+						 retval |= UA_UInt16_encodeBinary(&src->namespaceIndex, dst, offset);
 						 retval |= UA_String_encodeBinary(&src->identifier.string, dst, offset);
 						 break;
 
 					 case UA_NODEIDTYPE_GUID:
 						 srcByte = UA_NODEIDTYPE_GUID;
 						 retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
-						 retval |= UA_UInt16_encodeBinary(&src->namespaceId, dst, offset);
+						 retval |= UA_UInt16_encodeBinary(&src->namespaceIndex, dst, offset);
 						 retval |= UA_Guid_encodeBinary(&src->identifier.guid, dst, offset);
 						 break;
 
 					 case UA_NODEIDTYPE_BYTESTRING:
 						 srcByte = UA_NODEIDTYPE_BYTESTRING;
 						 retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
-						 retval |= UA_UInt16_encodeBinary(&src->namespaceId, dst, offset);
+						 retval |= UA_UInt16_encodeBinary(&src->namespaceIndex, dst, offset);
 						 retval |= UA_ByteString_encodeBinary(&src->identifier.byteString, dst, offset);
 						 break;
 
@@ -482,41 +482,41 @@ UA_Int32 UA_NodeId_decodeBinary(UA_ByteString const *src, UA_UInt32 *offset, UA_
 	CHECKED_DECODE(UA_Byte_decodeBinary(src, offset, &encodingByte),; );
 	switch(encodingByte) {
 	case UA_NODEIDTYPE_TWOBYTE: // Table 7
-		dst->nodeIdType = UA_NODEIDTYPE_NUMERIC;
+		dst->identifierType = UA_NODEIDTYPE_NUMERIC;
 		CHECKED_DECODE(UA_Byte_decodeBinary(src, offset, &dstByte),; );
 		dst->identifier.numeric = dstByte;
-		dst->namespaceId = 0; // default namespace
+		dst->namespaceIndex = 0; // default namespace
 		break;
 
 	case UA_NODEIDTYPE_FOURBYTE: // Table 8
-		dst->nodeIdType = UA_NODEIDTYPE_NUMERIC;
+		dst->identifierType = UA_NODEIDTYPE_NUMERIC;
 		CHECKED_DECODE(UA_Byte_decodeBinary(src, offset, &dstByte),; );
-		dst->namespaceId = dstByte;
+		dst->namespaceIndex = dstByte;
 		CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dstUInt16),; );
 		dst->identifier.numeric = dstUInt16;
 		break;
 
 	case UA_NODEIDTYPE_NUMERIC: // Table 6, first entry
-		dst->nodeIdType = UA_NODEIDTYPE_NUMERIC;
-		CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceId),; );
+		dst->identifierType = UA_NODEIDTYPE_NUMERIC;
+		CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceIndex),; );
 		CHECKED_DECODE(UA_UInt32_decodeBinary(src, offset, &dst->identifier.numeric),; );
 		break;
 
 	case UA_NODEIDTYPE_STRING: // Table 6, second entry
-		dst->nodeIdType = UA_NODEIDTYPE_STRING;
-		CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceId),; );
+		dst->identifierType = UA_NODEIDTYPE_STRING;
+		CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceIndex),; );
 		CHECKED_DECODE(UA_String_decodeBinary(src, offset, &dst->identifier.string),; );
 		break;
 
 	case UA_NODEIDTYPE_GUID: // Table 6, third entry
-		dst->nodeIdType = UA_NODEIDTYPE_GUID;
-		CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceId),; );
+		dst->identifierType = UA_NODEIDTYPE_GUID;
+		CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceIndex),; );
 		CHECKED_DECODE(UA_Guid_decodeBinary(src, offset, &dst->identifier.guid),; );
 		break;
 
 	case UA_NODEIDTYPE_BYTESTRING: // Table 6, "OPAQUE"
-		dst->nodeIdType = UA_NODEIDTYPE_BYTESTRING;
-		CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceId),; );
+		dst->identifierType = UA_NODEIDTYPE_BYTESTRING;
+		CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceIndex),; );
 		CHECKED_DECODE(UA_ByteString_decodeBinary(src, offset, &dst->identifier.byteString),; );
 		break;
 
@@ -573,7 +573,7 @@ UA_Int32 UA_ExpandedNodeId_decodeBinary(UA_ByteString const *src, UA_UInt32 *off
 	
 	CHECKED_DECODE(UA_NodeId_decodeBinary(src, offset, &dst->nodeId), UA_ExpandedNodeId_deleteMembers(dst));
 	if(encodingByte & UA_EXPANDEDNODEID_NAMESPACEURI_FLAG) {
-		dst->nodeId.namespaceId = 0;
+		dst->nodeId.namespaceIndex = 0;
 		CHECKED_DECODE(UA_String_decodeBinary(src, offset, &dst->namespaceUri), UA_ExpandedNodeId_deleteMembers(dst));
 	}
 	if(encodingByte & UA_EXPANDEDNODEID_SERVERINDEX_FLAG)
@@ -831,7 +831,7 @@ UA_TYPE_ENCODEBINARY(UA_Variant,
 					 UA_Boolean hasDimensions;
 					 UA_Boolean isBuiltin;
 
-                     if(src == UA_NULL || src->vt == UA_NULL || src->vt->typeId.namespaceId != 0)
+                     if(src == UA_NULL || src->vt == UA_NULL || src->vt->typeId.namespaceIndex != 0)
 						 return UA_ERROR;
 
                      isArray       = src->arrayLength != 1;  // a single element is not an array
@@ -889,7 +889,7 @@ UA_Int32 UA_Variant_decodeBinary(UA_ByteString const *src, UA_UInt32 *offset, UA
 	UA_Boolean isArray = encodingByte & UA_VARIANT_ENCODINGMASKTYPE_ARRAY;
 	UA_Boolean hasDimensions = isArray && (encodingByte & UA_VARIANT_ENCODINGMASKTYPE_DIMENSIONS);
 
-	UA_NodeId typeid = { .namespaceId= 0, .nodeIdType = UA_NODEIDTYPE_NUMERIC,
+	UA_NodeId typeid = { .namespaceIndex= 0, .identifierType = UA_NODEIDTYPE_NUMERIC,
 						 .identifier.numeric = encodingByte & UA_VARIANT_ENCODINGMASKTYPE_TYPEID_MASK };
 	UA_Int32 typeNs0Id = UA_ns0ToVTableIndex(&typeid );
 	dst->vt = &UA_.types[typeNs0Id];

+ 6 - 6
src/ua_types_encoding_xml.c

@@ -186,7 +186,7 @@ UA_Int32 UA_NodeId_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_NodeId *d
 		s->parent[s->depth].len = 0;
 		XML_Stack_addChildHandler(s, "Namespace", strlen(
 		                              "Namespace"), (XML_decoder)UA_Int16_decodeXmlFromStack, UA_INT16,
-		                          &(dst->namespaceId));
+		                          &(dst->namespaceIndex));
 		XML_Stack_addChildHandler(s, "Numeric", strlen(
 		                              "Numeric"), (XML_decoder)UA_Int32_decodeXmlFromStack, UA_INT32,
 		                          &(dst->identifier.numeric));
@@ -197,10 +197,10 @@ UA_Int32 UA_NodeId_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_NodeId *d
 		// set attributes
 		for(i = 0; attr[i]; i += 2) {
 		if(0 == strncmp("Namespace", attr[i], strlen("Namespace")))
-			dst->namespaceId = atoi(attr[i + 1]);
+			dst->namespaceIndex = atoi(attr[i + 1]);
 		else if(0 == strncmp("Numeric", attr[i], strlen("Numeric"))) {
-		dst->identifier.numeric = atoi(attr[i + 1]);
-		dst->nodeIdType = UA_NODEIDTYPE_NUMERIC;
+			dst->identifierType = UA_NODEIDTYPE_NUMERIC;
+			dst->identifier.numeric = atoi(attr[i + 1]);
 		} else
 			printf("UA_NodeId_decodeXml - Unknown attribute name=%s, value=%s\n", attr[i], attr[i+1]);
 		}
@@ -230,7 +230,7 @@ UA_Int32 UA_ExpandedNodeId_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_E
 		                              "NodeId"), (XML_decoder)UA_NodeId_decodeXmlFromStack, UA_NODEID, &(dst->nodeId));
 		XML_Stack_addChildHandler(s, "Namespace", strlen("Namespace"),
 								  (XML_decoder)UA_Int16_decodeXmlFromStack, UA_INT16,
-		                          &(dst->nodeId.namespaceId));
+		                          &(dst->nodeId.namespaceIndex));
 		XML_Stack_addChildHandler(s, "Numeric", strlen("Numeric"), (XML_decoder)UA_Int32_decodeXmlFromStack, UA_INT32,
 		                          &(dst->nodeId.identifier.numeric));
 		XML_Stack_addChildHandler(s, "Id", strlen("Id"), (XML_decoder)UA_String_decodeXmlFromStack, UA_STRING, UA_NULL);
@@ -239,7 +239,7 @@ UA_Int32 UA_ExpandedNodeId_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_E
 		// set attributes
 		for(i = 0; attr[i]; i += 2) {
 		if(0 == strncmp("Namespace", attr[i], strlen("Namespace")))
-			UA_UInt16_copycstring((cstring)attr[i + 1], &(dst->nodeId.namespaceId));
+			UA_UInt16_copycstring((cstring)attr[i + 1], &(dst->nodeId.namespaceIndex));
 		else if(0 == strncmp("Numeric", attr[i], strlen("Numeric"))) {
 		UA_NodeId_copycstring((cstring)attr[i + 1], &(dst->nodeId), s->aliases);
 		} else if(0 == strncmp("NodeId", attr[i], strlen("NodeId")))

+ 6 - 6
src/ua_xml.c

@@ -85,7 +85,7 @@ UA_Int32 _UA_NodeId_copycstring(cstring src, UA_NodeId* dst, UA_NodeSetAliases*
 		if (src[0] == 'i' && src[1] == '=') { // namespace zero numeric identifier
 			dst->identifier.numeric = atoi(&src[2]);
 		} else if (src[0] == 'n' && src[1] == 's' && src[2] == '=') { // namespace
-			dst->namespaceId = atoi(&src[3]);
+			dst->namespaceIndex = atoi(&src[3]);
 			src = strchr(&src[3],';');
 			if (src != UA_NULL)
 				retval = _UA_NodeId_copycstring(src+1,dst,aliases);  // +1 to start beyond ;
@@ -110,8 +110,8 @@ UA_Int32 _UA_NodeId_copycstring(cstring src, UA_NodeId* dst, UA_NodeSetAliases*
 }
 
 UA_Int32 UA_NodeId_copycstring(cstring src, UA_NodeId* dst, UA_NodeSetAliases* aliases) {
-	dst->nodeIdType = UA_NODEIDTYPE_NUMERIC;
-	dst->namespaceId = 0;
+	dst->identifierType = UA_NODEIDTYPE_NUMERIC;
+	dst->namespaceIndex = 0;
 	dst->identifier.numeric = 0;
 	return _UA_NodeId_copycstring(src,dst,aliases);
 }
@@ -126,8 +126,8 @@ UA_Int32 UA_ReferenceNode_println(cstring label, UA_ReferenceNode *a) {
 }
 
 UA_Int32 UA_ExpandedNodeId_copycstring(cstring src, UA_ExpandedNodeId *dst, UA_NodeSetAliases *aliases) {
-	dst->nodeId.nodeIdType         = UA_NODEIDTYPE_NUMERIC;
-	dst->nodeId.namespaceId        = 0;
+	dst->nodeId.namespaceIndex     = 0;
+	dst->nodeId.identifierType     = UA_NODEIDTYPE_NUMERIC;
 	dst->nodeId.identifier.numeric = 0;
 	UA_NodeId_copycstring(src, &(dst->nodeId), aliases);
 	DBG_VERBOSE(printf("UA_ExpandedNodeId_copycstring src=%s,id=%d\n", src, dst->nodeId.identifier.numeric));
@@ -593,7 +593,7 @@ UA_Int32 UA_TypedArray_decodeXmlFromStack(XML_Stack* s, XML_Attr* attr, UA_Typed
 /* } */
 
 _Bool UA_NodeId_isBuiltinType(UA_NodeId* nodeid) {
-	return (nodeid->namespaceId == 0 && nodeid->identifier.numeric >= UA_BOOLEAN_NS0 &&
+	return (nodeid->namespaceIndex == 0 && nodeid->identifier.numeric >= UA_BOOLEAN_NS0 &&
 			nodeid->identifier.numeric <= UA_DIAGNOSTICINFO_NS0
 			);
 }

+ 18 - 18
tests/check_builtin.c

@@ -215,7 +215,7 @@ START_TEST(UA_ExtensionObject_calcSizeShallWorkOnExample) {
 	// empty ExtensionObject, handcoded
 	// when
 	UA_ExtensionObject_init(&extensionObject);
-	extensionObject.typeId.nodeIdType = UA_NODEIDTYPE_NUMERIC;
+	extensionObject.typeId.identifierType = UA_NODEIDTYPE_NUMERIC;
 	extensionObject.typeId.identifier.numeric = 0;
 	extensionObject.encoding = UA_EXTENSIONOBJECT_ENCODINGMASK_NOBODYISENCODED;
 	// then
@@ -338,8 +338,8 @@ END_TEST
 START_TEST(UA_NodeId_calcSizeEncodingTwoByteShallReturnEncodingSize) {
 	// given
 	UA_NodeId arg;
-	arg.nodeIdType = UA_NODEIDTYPE_NUMERIC;
-	arg.namespaceId = 0;
+	arg.identifierType = UA_NODEIDTYPE_NUMERIC;
+	arg.namespaceIndex = 0;
 	arg.identifier.numeric = 1;
 	// when
 	UA_UInt32 encodingSize = UA_NodeId_calcSizeBinary(&arg);
@@ -350,8 +350,8 @@ END_TEST
 START_TEST(UA_NodeId_calcSizeEncodingFourByteShallReturnEncodingSize) {
 	// given
 	UA_NodeId arg;
-	arg.nodeIdType = UA_NODEIDTYPE_NUMERIC;
-	arg.namespaceId = 1;
+	arg.identifierType = UA_NODEIDTYPE_NUMERIC;
+	arg.namespaceIndex = 1;
 	arg.identifier.numeric = 1;
 	// when
 	UA_UInt32 encodingSize = UA_NodeId_calcSizeBinary(&arg);
@@ -362,7 +362,7 @@ END_TEST
 START_TEST(UA_NodeId_calcSizeEncodingStringShallReturnEncodingSize) {
 	// given
 	UA_NodeId arg;
-	arg.nodeIdType = UA_NODEIDTYPE_STRING;
+	arg.identifierType = UA_NODEIDTYPE_STRING;
 	arg.identifier.string.length = 3;
 	arg.identifier.string.data   = (UA_Byte *)"PLT";
 	// when
@@ -374,7 +374,7 @@ END_TEST
 START_TEST(UA_NodeId_calcSizeEncodingStringNegativLengthShallReturnEncodingSize) {
 	// given
 	UA_NodeId arg;
-	arg.nodeIdType = UA_NODEIDTYPE_STRING;
+	arg.identifierType = UA_NODEIDTYPE_STRING;
 	arg.identifier.string.length = -1;
 	// when
 	UA_UInt32 encodingSize = UA_NodeId_calcSizeBinary(&arg);
@@ -385,7 +385,7 @@ END_TEST
 START_TEST(UA_NodeId_calcSizeEncodingStringZeroLengthShallReturnEncodingSize) {
 	// given
 	UA_NodeId arg;
-	arg.nodeIdType = UA_NODEIDTYPE_STRING;
+	arg.identifierType = UA_NODEIDTYPE_STRING;
 	arg.identifier.string.length = 0;
 	// when
 	UA_UInt32 encodingSize = UA_NodeId_calcSizeBinary(&arg);
@@ -397,7 +397,7 @@ START_TEST(UA_ExpandedNodeId_calcSizeEncodingStringAndServerIndexShallReturnEnco
 	// given
 	UA_ExpandedNodeId arg;
 	UA_ExpandedNodeId_init(&arg);
-	arg.nodeId.nodeIdType = UA_NODEIDTYPE_STRING;
+	arg.nodeId.identifierType = UA_NODEIDTYPE_STRING;
 	arg.serverIndex = 1;
 	arg.nodeId.identifier.string.length = 3;
 	// when
@@ -410,7 +410,7 @@ START_TEST(UA_ExpandedNodeId_calcSizeEncodingStringAndNamespaceUriShallReturnEnc
 	// given
 	UA_ExpandedNodeId arg;
 	UA_ExpandedNodeId_init(&arg);
-	arg.nodeId.nodeIdType = UA_NODEIDTYPE_STRING;
+	arg.nodeId.identifierType = UA_NODEIDTYPE_STRING;
 	arg.nodeId.identifier.string.length = 3;
 	arg.namespaceUri.length = 7;
 	// when
@@ -810,9 +810,9 @@ START_TEST(UA_NodeId_decodeTwoByteShallReadTwoBytesAndSetNamespaceToZero) {
 	// then
 	ck_assert_int_eq(retval, UA_SUCCESS);
 	ck_assert_int_eq(pos, 2);
-	ck_assert_int_eq(dst.nodeIdType, UA_NODEIDTYPE_NUMERIC);
+	ck_assert_int_eq(dst.identifierType, UA_NODEIDTYPE_NUMERIC);
 	ck_assert_int_eq(dst.identifier.numeric, 16);
-	ck_assert_int_eq(dst.namespaceId, 0);
+	ck_assert_int_eq(dst.namespaceIndex, 0);
 }
 END_TEST
 START_TEST(UA_NodeId_decodeFourByteShallReadFourBytesAndRespectNamespace) {
@@ -827,9 +827,9 @@ START_TEST(UA_NodeId_decodeFourByteShallReadFourBytesAndRespectNamespace) {
 	// then
 	ck_assert_int_eq(retval, UA_SUCCESS);
 	ck_assert_int_eq(pos, 4);
-	ck_assert_int_eq(dst.nodeIdType, UA_NODEIDTYPE_NUMERIC);
+	ck_assert_int_eq(dst.identifierType, UA_NODEIDTYPE_NUMERIC);
 	ck_assert_int_eq(dst.identifier.numeric, 256);
-	ck_assert_int_eq(dst.namespaceId, 1);
+	ck_assert_int_eq(dst.namespaceIndex, 1);
 }
 END_TEST
 START_TEST(UA_NodeId_decodeStringShallAllocateMemory) {
@@ -844,8 +844,8 @@ START_TEST(UA_NodeId_decodeStringShallAllocateMemory) {
 	// then
 	ck_assert_int_eq(retval, UA_SUCCESS);
 	ck_assert_int_eq(pos, 10);
-	ck_assert_int_eq(dst.nodeIdType, UA_NODEIDTYPE_STRING);
-	ck_assert_int_eq(dst.namespaceId, 1);
+	ck_assert_int_eq(dst.identifierType, UA_NODEIDTYPE_STRING);
+	ck_assert_int_eq(dst.namespaceIndex, 1);
 	ck_assert_int_eq(dst.identifier.string.length, 3);
 	ck_assert_ptr_eq(dst.identifier.string.data, UA_alloc_lastptr);
 	ck_assert_int_eq(dst.identifier.string.data[1], 'L');
@@ -1391,7 +1391,7 @@ START_TEST(UA_ExtensionObject_copyShallWorkOnExample) {
 	UA_ExtensionObject_init(&value);
 	UA_ExtensionObject_init(&valueCopied);
 
-	value.typeId.nodeIdType = UA_NODEIDTYPE_NUMERIC;
+	value.typeId.identifierType = UA_NODEIDTYPE_NUMERIC;
 	value.typeId.identifier.numeric = UA_BYTE;
 	value.encoding    = UA_EXTENSIONOBJECT_ENCODINGMASK_NOBODYISENCODED;
 	value.encoding    = UA_EXTENSIONOBJECT_ENCODINGMASK_BODYISBYTESTRING;
@@ -1405,7 +1405,7 @@ START_TEST(UA_ExtensionObject_copyShallWorkOnExample) {
 		ck_assert_int_eq(valueCopied.body.data[i], value.body.data[i]);
 
 	ck_assert_int_eq(valueCopied.encoding, value.encoding);
-	ck_assert_int_eq(valueCopied.typeId.nodeIdType, value.typeId.nodeIdType);
+	ck_assert_int_eq(valueCopied.typeId.identifierType, value.typeId.identifierType);
 	ck_assert_int_eq(valueCopied.typeId.identifier.numeric, value.typeId.identifier.numeric);
 
 	//finally

+ 2 - 2
tests/check_namespace.c

@@ -31,8 +31,8 @@ END_TEST
 
 UA_Int32 createNode(UA_Node** p, UA_Int16 nsid, UA_Int32 id) {
 	UA_VariableNode_new((UA_VariableNode **)p);
-	(*p)->nodeId.nodeIdType = UA_NODEIDTYPE_NUMERIC;
-	(*p)->nodeId.namespaceId = nsid;
+	(*p)->nodeId.identifierType = UA_NODEIDTYPE_NUMERIC;
+	(*p)->nodeId.namespaceIndex = nsid;
 	(*p)->nodeId.identifier.numeric = id;
 	(*p)->nodeClass = UA_NODECLASS_VARIABLE;
 	return UA_SUCCESS;

+ 2 - 2
tools/generate_namespace.py

@@ -126,7 +126,7 @@ printc('''/**********************************************************
 #include "''' + args.outfile.split("/")[-1] + '''.h"\n
 UA_Int32 UA_ns0ToVTableIndex(const UA_NodeId *id) {
 	UA_Int32 retval = 0; // InvalidType
-        if(id->namespaceId != 0) return retval;
+        if(id->namespaceIndex != 0) return retval;
 	switch (id->identifier.numeric) {''')
 
 i = 0
@@ -164,7 +164,7 @@ for row in rows:
 	i=i+1
     printh('#define '+name.upper()+'_NS0 '+row[1])
 
-    printc("\t{.typeId={.namespaceId = 0, .nodeIdType = UA_NODEIDTYPE_NUMERIC, .identifier.numeric=" + row[1] + "}" + 
+    printc("\t{.typeId={.namespaceIndex = 0, .identifierType = UA_NODEIDTYPE_NUMERIC, .identifier.numeric=" + row[1] + "}" + 
           ",\n.name=(UA_Byte*)&\"%(name)s\"" +
           ",\n.new=(UA_Int32(*)(void **))%(name)s_new" +
           ",\n.init=(UA_Int32(*)(void *))%(name)s_init"+