Browse Source

make tests working

Julius Pfrommer 10 years ago
parent
commit
3360b79322

+ 8 - 8
examples/src/generateSam.c

@@ -9,20 +9,20 @@ static Namespace* theNamespace;
 
 UA_Int32 UA_Node_getParent(const UA_Node* node, const UA_Node** parent) {
 	UA_Int32 i = 0;
-	DBG(printf("// UA_Node_getParent - node={i=%d}",UA_NodeId_getIdentifier(&(node->nodeId))));
+	DBG(printf("// UA_Node_getParent - node={i=%d}",node->nodeId.identifier.numeric));
 	// FIXME: the data model is crap! we should have a single memory location which holds the parent NodeId
 	for (; i < node->referencesSize; i++ ) {
-		UA_Int32 refId = UA_NodeId_getIdentifier(&(node->references[i]->referenceTypeId));
-		UA_Int32 isInverse = node->references[i]->isInverse;
+		UA_Int32 refId = node->references[i].referenceTypeId.identifier.numeric;
+		UA_Int32 isInverse = node->references[i].isInverse;
 		if (isInverse && (refId == 47 || refId == 46)) {
 			Namespace_Entry_Lock* lock = UA_NULL;
 			UA_Int32 retval;
 			retval = Namespace_get(theNamespace, &(node->references[i].targetId.nodeId),parent,&lock);
 			Namespace_Entry_Lock_release(lock);
 			if (retval == UA_SUCCESS) {
-				DBG(printf(" has parent={i=%d}\n",UA_NodeId_getIdentifier(&((*parent)->nodeId))));
+				DBG(printf(" has parent={i=%d}\n",(*parent)->nodeId.identifier.numeric));
 			} else {
-				DBG(printf(" has non-existing parent={i=%d}\n",UA_NodeId_getIdentifier(&(node->references[i]->targetId.nodeId))));
+				DBG(printf(" has non-existing parent={i=%d}\n", node->references[i].targetId.nodeId.identifier.numeric));
 			}
 			return retval;
 		}
@@ -76,13 +76,13 @@ UA_Int32 UA_Node_getPath(const UA_Node* node, UA_list_List* list) {
 			// and add our own name when we come back
 			if (retval == UA_SUCCESS) {
 				UA_list_addPayloadToBack(list,(void*)&(node->browseName.name));
-				DBG(printf("// UA_Node_getPath - add id={i=%d},class=%d",UA_NodeId_getIdentifier(&(node->nodeId)),node->nodeClass));
+				DBG(printf("// UA_Node_getPath - add id={i=%d},class=%d",node->nodeId.identifier.numeric,node->nodeClass));
 				DBG(UA_String_printf(",name=",&(node->browseName.name)));
 			}
 		} else {
 			// node is root, terminate recursion by adding own name
 			UA_list_addPayloadToBack(list,(void*)&node->browseName.name);
-			DBG(printf("// UA_Node_getPath - add id={i=%d},class=%d",UA_NodeId_getIdentifier(&(node->nodeId)),node->nodeClass));
+			DBG(printf("// UA_Node_getPath - add id={i=%d},class=%d",node->nodeId.identifier.numeric,node->nodeClass));
 			DBG(UA_String_printf(",name=",&(node->browseName.name)));
 		}
 	}
@@ -108,7 +108,7 @@ void sam_declareAttribute(UA_Node const * node) {
 		UA_Int32 retval = UA_Node_getPath(node,&list);
 		if (retval == UA_SUCCESS) {
 			UA_VariableNode* vn = (UA_VariableNode*) node;
-			printf("\t%s ", UA_.types[UA_ns0ToVTableIndex(vn->typeId)].name);
+			printf("\t%s ", UA_.types[UA_ns0ToVTableIndex(&vn->nodeId)].name);
 			UA_list_iteratePayload(&list,listPrintName);
 			printf("; // i=%d\n", node->nodeId.identifier.numeric);
 		} else {

+ 1 - 1
examples/src/networklayer.h

@@ -4,7 +4,7 @@
 #include "ua_types.h"
 #include "ua_transport.h"
 #include "ua_transport_binary.h"
-#include "ua_list.h"
+#include "util/ua_list.h"
 
 #ifdef MULTITHREADING
 #include <pthread.h> // pthreadcreate, pthread_t

+ 1 - 84
examples/src/xml2ns0.c

@@ -5,90 +5,7 @@
 #include "ua_xml.h"
 #include "ua_namespace_xml.h"
 #include "ua_types_encoding_xml.h"
-#include "ua_util.h"
-
-typedef UA_Int32 (*XML_Stack_Loader) (char* buf, int len);
-
-#define XML_BUFFER_LEN 1024
-UA_Int32 Namespace_loadXml(Namespace **ns,UA_UInt32 nsid,const char* rootName, XML_Stack_Loader getNextBufferFull) {
-	UA_Int32 retval = UA_SUCCESS;
-	char buf[XML_BUFFER_LEN];
-	int len; /* len is the number of bytes in the current bufferful of data */
-
-	XML_Stack s;
-	XML_Stack_init(&s, rootName);
-
-	UA_NodeSet n;
-	UA_NodeSet_init(&n, 0);
-	*ns = n.ns;
-
-	XML_Stack_addChildHandler(&s, "UANodeSet", strlen("UANodeSet"), (XML_decoder) UA_NodeSet_decodeXmlFromStack, UA_INVALIDTYPE, &n);
-	XML_Parser parser = XML_ParserCreate(NULL);
-	XML_SetUserData(parser, &s);
-	XML_SetElementHandler(parser, XML_Stack_startElement, XML_Stack_endElement);
-	XML_SetCharacterDataHandler(parser, XML_Stack_handleText);
-	while ((len = getNextBufferFull(buf, XML_BUFFER_LEN)) > 0) {
-		if (XML_Parse(parser, buf, len, (len < XML_BUFFER_LEN)) == XML_STATUS_ERROR) {
-			retval = UA_ERR_INVALID_VALUE;
-			break;
-		}
-	}
-	XML_ParserFree(parser);
-
-	DBG_VERBOSE(printf("Namespace_loadXml - aliases addr=%p, size=%d\n", (void*) &(n.aliases), n.aliases.size));
-	DBG_VERBOSE(UA_NodeSetAliases_println("Namespace_loadXml - elements=", &n.aliases));
-
-	return retval;
-}
-
-static int theFile = 0;
-UA_Int32 readFromTheFile(char*buf,int len) {
-	return read(theFile,buf,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] 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 nsid,const char* rootName,const char* fileName) {
-	if (fileName == UA_NULL)
-		theFile = 0; // stdin
-	else if ((theFile = open(fileName, O_RDONLY)) == -1)
-		return UA_ERR_INVALID_VALUE;
-
-	UA_Int32 retval = Namespace_loadXml(ns,nsid,rootName,readFromTheFile);
-	close(theFile);
-	return retval;
-}
-
-static const char* theBuffer = UA_NULL;
-static const char* theBufferEnd = UA_NULL;
-UA_Int32 readFromTheBuffer(char*buf,int len) {
-	if (len == 0) return 0;
-	if (theBuffer + XML_BUFFER_LEN > theBufferEnd)
-		len = theBufferEnd - theBuffer + 1;
-	else
-		len = XML_BUFFER_LEN;
-	memcpy(buf,theBuffer,len);
-	theBuffer = theBuffer + len;
-	return 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] rootName the name of the root element of the hierarchy (not used?)
- * @param[in] buffer the xml string
- */
-UA_Int32 Namespace_loadFromString(Namespace **ns,UA_UInt32 nsid,const char* rootName,const char* buffer) {
-	theBuffer = buffer;
-	theBufferEnd = buffer + strlen(buffer) - 1;
-	return Namespace_loadXml(ns,nsid,rootName,readFromTheBuffer);
-}
+#include "util/ua_util.h"
 
 // FIXME: most of the following code should be generated as a template from the ns0-defining xml-files
 /** @brief sam (abbr. for server_application_memory) is a flattened memory structure of the UAVariables in ns0 */

+ 9 - 6
src/Makefile.am

@@ -1,15 +1,15 @@
 AM_CFLAGS = $(GLOBAL_AM_CFLAGS) -I$(top_builddir)/src -I. -I$(top_builddir)/src/util
-TOOL_DIR = ../tools
-SCHEMA_DIR = ../schema
+TOOL_DIR = $(top_builddir)/tools
+SCHEMA_DIR = $(top_builddir)/schema
 lib_LTLIBRARIES = libopen62541.la
 lib_LTLIBRARIES: generate_types generate_namespace_0
 libopen62541_la_LDFLAGS = -avoid-version -no-undefined
 libopen62541_la_SOURCES = ua_types.c \
-						  ua_util.c \
 						  ua_types_encoding_binary.c \
 						  ua_types_generated.c \
 						  ua_types_encoding_xml.c \
 						  ua_namespace_0.c \
+						  util/ua_util.c \
 						  util/ua_list.c \
 						  util/ua_indexedList.c \
 						  util/ua_base64.c \
@@ -17,6 +17,7 @@ libopen62541_la_SOURCES = ua_types.c \
 						  ua_transport_binary.c \
 						  ua_transport_binary_secure.c \
 						  ua_namespace.c \
+						  ua_namespace_xml.c \
 						  ua_services_attribute.c \
 						  ua_services_session.c \
 						  ua_services_discovery.c \
@@ -26,13 +27,13 @@ libopen62541_la_SOURCES = ua_types.c \
 						  ua_application.c \
 						  ua_xml.c
 
-generate_types: $(SCHEMA_DIR)/Opc.Ua.Types.bsd $(TOOL_DIR)/generate_builtin.py
+ua_types_generated.c ua_types_generated.h: $(SCHEMA_DIR)/Opc.Ua.Types.bsd $(TOOL_DIR)/generate_builtin.py
 	python $(TOOL_DIR)/generate_builtin.py $(SCHEMA_DIR)/Opc.Ua.Types.bsd ua_types_generated
 
-generate_namespace_0: $(SCHEMA_DIR)/NodeIds.csv $(TOOL_DIR)/generate_namespace.py
+ua_namespace_0.c ua_namespace_0.h: $(SCHEMA_DIR)/NodeIds.csv $(TOOL_DIR)/generate_namespace.py
 	python $(TOOL_DIR)/generate_namespace.py $(SCHEMA_DIR)/NodeIds.csv ua_namespace_0
 
-.PHONY: convenience-link clean-convenience-link generate_types generate_namespace_0
+.PHONY: convenience-link clean-convenience-link
 
 convenience-link: $(lib_LTLIBRARIES)
 	@test -e "$(top_builddir)/lib" || mkdir "$(top_builddir)/lib"
@@ -57,3 +58,5 @@ clean-convenience-link:
 all-local: convenience-link
 
 clean-local: clean-convenience-link
+	rm -rf ua_types_generated.c ua_types_generated.h || true;
+	rm -rf ua_namespace_0.c ua_namespace_0.h || true;

+ 1 - 1
src/ua_application.h

@@ -3,7 +3,7 @@
 
 #include "ua_types.h"
 #include "ua_namespace.h"
-#include "ua_indexedList.h"
+#include "util/ua_indexedList.h"
 
 typedef struct Application {
 	UA_ApplicationDescription *description;

+ 1 - 1
src/ua_namespace.h

@@ -3,7 +3,7 @@
 
 #include "ua_types.h"
 #include "ua_types_generated.h"
-#include "ua_list.h"
+#include "util/ua_list.h"
 
 #ifdef MULTITHREADING
 #define _XOPEN_SOURCE 500

+ 85 - 0
src/ua_namespace_xml.c

@@ -0,0 +1,85 @@
+#include "ua_namespace_xml.h"
+#include <fcntl.h> // open, O_RDONLY
+
+typedef UA_Int32 (*XML_Stack_Loader) (char* buf, int len);
+
+#define XML_BUFFER_LEN 1024
+UA_Int32 Namespace_loadXml(Namespace **ns,UA_UInt32 nsid,const char* rootName, XML_Stack_Loader getNextBufferFull) {
+	UA_Int32 retval = UA_SUCCESS;
+	char buf[XML_BUFFER_LEN];
+	int len; /* len is the number of bytes in the current bufferful of data */
+
+	XML_Stack s;
+	XML_Stack_init(&s, 0, rootName);
+
+	UA_NodeSet n;
+	UA_NodeSet_init(&n, 0);
+	*ns = n.ns;
+
+	XML_Stack_addChildHandler(&s, "UANodeSet", strlen("UANodeSet"), (XML_decoder) UA_NodeSet_decodeXmlFromStack, UA_INVALIDTYPE, &n);
+	XML_Parser parser = XML_ParserCreate(NULL);
+	XML_SetUserData(parser, &s);
+	XML_SetElementHandler(parser, XML_Stack_startElement, XML_Stack_endElement);
+	XML_SetCharacterDataHandler(parser, XML_Stack_handleText);
+	while ((len = getNextBufferFull(buf, XML_BUFFER_LEN)) > 0) {
+		if (XML_Parse(parser, buf, len, (len < XML_BUFFER_LEN)) == XML_STATUS_ERROR) {
+			retval = UA_ERR_INVALID_VALUE;
+			break;
+		}
+	}
+	XML_ParserFree(parser);
+
+	DBG_VERBOSE(printf("Namespace_loadXml - aliases addr=%p, size=%d\n", (void*) &(n.aliases), n.aliases.size));
+	DBG_VERBOSE(UA_NodeSetAliases_println("Namespace_loadXml - elements=", &n.aliases));
+
+	return retval;
+}
+
+static int theFile = 0;
+UA_Int32 readFromTheFile(char*buf,int len) {
+	return read(theFile,buf,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] 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 nsid,const char* rootName,const char* fileName) {
+	if (fileName == UA_NULL)
+		theFile = 0; // stdin
+	else if ((theFile = open(fileName, O_RDONLY)) == -1)
+		return UA_ERR_INVALID_VALUE;
+
+	UA_Int32 retval = Namespace_loadXml(ns,nsid,rootName,readFromTheFile);
+	close(theFile);
+	return retval;
+}
+
+static const char* theBuffer = UA_NULL;
+static const char* theBufferEnd = UA_NULL;
+UA_Int32 readFromTheBuffer(char*buf,int len) {
+	if (len == 0) return 0;
+	if (theBuffer + XML_BUFFER_LEN > theBufferEnd)
+		len = theBufferEnd - theBuffer + 1;
+	else
+		len = XML_BUFFER_LEN;
+	memcpy(buf,theBuffer,len);
+	theBuffer = theBuffer + len;
+	return 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] rootName the name of the root element of the hierarchy (not used?)
+ * @param[in] buffer the xml string
+ */
+UA_Int32 Namespace_loadFromString(Namespace **ns,UA_UInt32 nsid,const char* rootName,const char* buffer) {
+	theBuffer = buffer;
+	theBufferEnd = buffer + strlen(buffer) - 1;
+	return Namespace_loadXml(ns,nsid,rootName,readFromTheBuffer);
+}

+ 1 - 0
src/ua_namespace_xml.h

@@ -36,5 +36,6 @@ UA_Int32 UA_ExpandedNodeId_copycstring(cstring src, UA_ExpandedNodeId* dst, UA_N
  * @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_loadFromString(Namespace **ns,UA_UInt32 nsid,const char* rootName,const char* buffer);
 
 #endif /* __UA_NAMESPACE_XML_H */

+ 1 - 1
src/ua_types.c

@@ -4,7 +4,7 @@
 #include <stdarg.h> // va_start, va_end
 #include <time.h>
 #include <sys/time.h>
-#include "ua_util.h"
+#include "util/ua_util.h"
 #include "ua_types.h"
 #include "ua_types_encoding_binary.h"
 #include "ua_namespace_0.h"

+ 1 - 1
src/ua_types_encoding_binary.h

@@ -1,7 +1,7 @@
 #ifndef UA_TYPES_ENCODING_BINARY_H_
 #define UA_TYPES_ENCODING_BINARY_H_
 
-#include "ua_util.h"
+#include "util/ua_util.h"
 #include "ua_types.h"
 
 /**

File diff suppressed because it is too large
+ 462 - 591
src/ua_xml.c


+ 0 - 15
src/ua_xml.h

@@ -54,9 +54,6 @@ typedef struct XML_Stack {
 	UA_NodeSetAliases *aliases;  // shall point to the aliases of the NodeSet after reading
 } XML_Stack;
 
-void XML_Stack_init(XML_Stack *p, cstring name);
-void XML_Stack_print(XML_Stack *s);
-
 UA_Int32 UA_Boolean_copycstring(cstring src, UA_Boolean *dst);
 UA_Int32 UA_Int16_copycstring(cstring src, UA_Int16 *dst);
 UA_Int32 UA_UInt16_copycstring(cstring src, UA_UInt16 *dst);
@@ -86,22 +83,10 @@ UA_Int32 UA_NodeSetAliases_new(UA_NodeSetAliases** p);
 UA_Int32 UA_NodeSetAliases_println(cstring label, UA_NodeSetAliases *p);
 UA_Int32 UA_NodeSetAliases_decodeXML(XML_Stack* s, XML_Attr* attr, UA_NodeSetAliases* dst, _Bool isStart);
 
-typedef struct UA_NodeSet {
-	Namespace* ns;
-	UA_NodeSetAliases aliases;
-} UA_NodeSet;
-
-/** @brief init typed array with size=-1 and an UA_INVALIDTYPE */
-UA_Int32 UA_NodeSet_init(UA_NodeSet* p, UA_UInt32 nsid);
-UA_Int32 UA_NodeSet_new(UA_NodeSet** p, UA_UInt32 nsid);
-UA_Int32 UA_NodeId_copycstring(cstring src, UA_NodeId* dst, UA_NodeSetAliases* aliases);
-UA_Int32 UA_NodeSet_decodeXML(XML_Stack* s, XML_Attr* attr, UA_NodeSet* dst, _Bool isStart);
-
 UA_Int32 UA_ExpandedNodeId_copycstring(cstring src, UA_ExpandedNodeId* dst, UA_NodeSetAliases* aliases);
 
 void XML_Stack_init(XML_Stack* p, UA_UInt32 nsid, cstring name);
 void XML_Stack_print(XML_Stack* s);
->>>>>>> 1c491aac41da6e3cbd906b5bb0b0905a0e66431c
 
 /** @brief add a reference to a handler (@see XML_Stack_addChildHandler) for text data
  *

+ 2 - 1
src/ua_base64.h

@@ -8,7 +8,8 @@
 #ifndef UA_BASE64_H_
 #define UA_BASE64_H_
 
-#include "ua_basictypes.h"
+#include "ua_types.h"
+#include "ua_util.h"
 
 /** @brief calculates the exact size for the binary data that is encoded in base64 encoded string */
 UA_Int32 UA_base64_getDecodedSize(UA_String* const base64EncodedData);

src/ua_indexedList.h → src/util/ua_indexedList.h


src/ua_list.h → src/util/ua_list.h


src/ua_util.c → src/util/ua_util.c


src/ua_util.h → src/util/ua_util.h


+ 1 - 4
tests/check_base64.c

@@ -1,12 +1,9 @@
 #include <stdlib.h> // EXIT_SUCCESS
-#include "ua_base64.h"
-
+#include "util/ua_base64.h"
 #include "check.h"
 
-
 START_TEST(base64_test_2padding)
 {
-
 	//this is base64'd ASCII string "open62541!"
 	UA_String encodedString = {16, (UA_Byte*)"b3BlbjYyNTQxIQ=="};
 

+ 2 - 2
tests/check_indexedList.c

@@ -1,6 +1,6 @@
 #include <stdlib.h> // EXIT_SUCCESS
-#include "ua_indexedList.h"
-#include "ua_util.h"
+#include "util/ua_indexedList.h"
+#include "util/ua_util.h"
 #include "check.h"
 
 /* global test counters */

+ 2 - 2
tests/check_list.c

@@ -1,6 +1,6 @@
 #include <stdlib.h> // EXIT_SUCCESS
-#include "ua_util.h"
-#include "ua_list.h"
+#include "util/ua_util.h"
+#include "util/ua_list.h"
 #include "check.h"
 
 /* global test counters */

+ 1 - 8
tests/check_memory.c

@@ -1,16 +1,9 @@
-/*
- * check_memory.c
- *
- *  Created on: 10.04.2014
- *      Author: mrt
- */
-
 #define _XOPEN_SOURCE 500
 #include <stdio.h>
 #include <stdlib.h>
 
 #include "ua_types.h"
-#include "ua_util.h"
+#include "util/ua_util.h"
 #include "ua_namespace_0.h"
 #include "check.h"
 

+ 8 - 17
tests/check_xml.c

@@ -1,19 +1,10 @@
-/****************************************************************************
- Name        : check_xml.c
- Author      : uleon @ open62541
- Version     : 0.1
- Copyright   : Your copyright notice
- Description : test cases to check different aspects of the
- xml-processing
-
-
-*****************************************************************************/
-
 #include <stdio.h>
 #include <stdlib.h>
-
 #include "ua_xml.h"
-
+#include "util/ua_util.h"
+#include "ua_types_generated.h"
+#include "ua_namespace.h"
+#include "ua_namespace_xml.h"
 #include "check.h"
 
 START_TEST(parseNumericNodeIdWithoutNsIdShallYieldNs0NodeId)
@@ -86,8 +77,8 @@ START_TEST(loadUserNamespaceWithSingleProcessVariableShallSucceed)
 	retval = Namespace_get(ns,&nodeId,&nr,&nl);
 	ck_assert_int_eq(retval,UA_SUCCESS);
 	ck_assert_ptr_ne(nr,UA_NULL);
-	ck_assert_int_eq(nr->references[0]->referenceTypeId.identifier.numeric,40);
-	ck_assert_int_eq(nr->references[0]->targetId.nodeId.identifier.numeric,63);
+	ck_assert_int_eq(nr->references[0].referenceTypeId.identifier.numeric,40);
+	ck_assert_int_eq(nr->references[0].targetId.nodeId.identifier.numeric,63);
 
 
 	UA_NodeId_copycstring("i=2",&nodeId,UA_NULL);
@@ -134,8 +125,8 @@ START_TEST(loadUserNamespaceWithSingleProcessVariableAndAliasesShallSucceed)
 	retval = Namespace_get(ns,&nodeId,&nr,&nl);
 	ck_assert_int_eq(retval,UA_SUCCESS);
 	ck_assert_ptr_ne(nr,UA_NULL);
-	ck_assert_int_eq(nr->references[0]->referenceTypeId.identifier.numeric,40);
-	ck_assert_int_eq(nr->references[0]->targetId.nodeId.identifier.numeric,63);
+	ck_assert_int_eq(nr->references[0].referenceTypeId.identifier.numeric,40);
+	ck_assert_int_eq(nr->references[0].targetId.nodeId.identifier.numeric,63);
 
 	UA_NodeId_copycstring("ns=1;i=2",&nodeId,UA_NULL);
 	ck_assert_int_eq(Namespace_contains(ns,&nodeId),UA_FALSE);

+ 1 - 1
tools/generate_builtin.py

@@ -266,7 +266,7 @@ printc('''/**
  
 #include "''' + sys.argv[2] + '.h"\n')
 #include "ua_types_encoding_binary.h"
-#include "ua_util.h"
+#include "util/ua_util.h"
 
 # types for which we create a vector type
 arraytypes = set()

+ 1 - 1
tools/generate_namespace.py

@@ -67,7 +67,7 @@ printh('''/**********************************************************
  **********************************************************/\n 
 #ifndef ''' + sys.argv[2].upper() + '''_H_
 #define ''' + sys.argv[2].upper() + '''_H_\n
-#include "ua_util.h"
+#include "util/ua_util.h"
 #include "ua_types.h"  // definition of UA_VTable and basic UA_Types
 #include "ua_types_generated.h"\n
 /**