Browse Source

Merge branch 'master' of https://github.com/Stasik0/Open62541.git

Conflicts:
	OPCUAServer/src/opcua_binaryEncDec.c
	OPCUAServer/src/opcua_encodingLayer.c
MaximilianBauer 11 years ago
parent
commit
e43ef2ce59

+ 19 - 19
OPCUAServer/autom4te.cache/requests

@@ -64,8 +64,8 @@
                         'AM_SET_LEADING_DOT' => 1,
                         'AM_SET_LEADING_DOT' => 1,
                         'AM_SET_DEPDIR' => 1,
                         'AM_SET_DEPDIR' => 1,
                         '_AM_DEPENDENCIES' => 1,
                         '_AM_DEPENDENCIES' => 1,
-                        'AM_PROG_INSTALL_SH' => 1,
                         'm4_include' => 1,
                         'm4_include' => 1,
+                        'AM_PROG_INSTALL_SH' => 1,
                         '_AC_AM_CONFIG_HEADER_HOOK' => 1,
                         '_AC_AM_CONFIG_HEADER_HOOK' => 1,
                         'AU_DEFUN' => 1,
                         'AU_DEFUN' => 1,
                         'AM_MAKE_INCLUDE' => 1
                         'AM_MAKE_INCLUDE' => 1
@@ -83,55 +83,55 @@
                         'configure.ac'
                         'configure.ac'
                       ],
                       ],
                       {
                       {
-                        '_LT_AC_TAGCONFIG' => 1,
                         'AM_PROG_F77_C_O' => 1,
                         'AM_PROG_F77_C_O' => 1,
-                        'm4_pattern_forbid' => 1,
+                        '_LT_AC_TAGCONFIG' => 1,
                         'AC_INIT' => 1,
                         'AC_INIT' => 1,
-                        '_AM_COND_IF' => 1,
+                        'm4_pattern_forbid' => 1,
                         'AC_CANONICAL_TARGET' => 1,
                         'AC_CANONICAL_TARGET' => 1,
-                        'AC_SUBST' => 1,
+                        '_AM_COND_IF' => 1,
                         'AC_CONFIG_LIBOBJ_DIR' => 1,
                         'AC_CONFIG_LIBOBJ_DIR' => 1,
-                        'AC_FC_SRCEXT' => 1,
+                        'AC_SUBST' => 1,
                         'AC_CANONICAL_HOST' => 1,
                         'AC_CANONICAL_HOST' => 1,
+                        'AC_FC_SRCEXT' => 1,
                         'AC_PROG_LIBTOOL' => 1,
                         'AC_PROG_LIBTOOL' => 1,
                         'AM_INIT_AUTOMAKE' => 1,
                         'AM_INIT_AUTOMAKE' => 1,
-                        'AM_PATH_GUILE' => 1,
                         'AC_CONFIG_SUBDIRS' => 1,
                         'AC_CONFIG_SUBDIRS' => 1,
+                        'AM_PATH_GUILE' => 1,
                         'AM_AUTOMAKE_VERSION' => 1,
                         'AM_AUTOMAKE_VERSION' => 1,
                         'LT_CONFIG_LTDL_DIR' => 1,
                         'LT_CONFIG_LTDL_DIR' => 1,
-                        'AC_REQUIRE_AUX_FILE' => 1,
                         'AC_CONFIG_LINKS' => 1,
                         'AC_CONFIG_LINKS' => 1,
-                        'm4_sinclude' => 1,
+                        'AC_REQUIRE_AUX_FILE' => 1,
                         'LT_SUPPORTED_TAG' => 1,
                         'LT_SUPPORTED_TAG' => 1,
+                        'm4_sinclude' => 1,
                         'AM_MAINTAINER_MODE' => 1,
                         'AM_MAINTAINER_MODE' => 1,
                         'AM_NLS' => 1,
                         'AM_NLS' => 1,
                         'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
                         'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
-                        'AM_MAKEFILE_INCLUDE' => 1,
                         '_m4_warn' => 1,
                         '_m4_warn' => 1,
+                        'AM_MAKEFILE_INCLUDE' => 1,
                         'AM_PROG_CXX_C_O' => 1,
                         'AM_PROG_CXX_C_O' => 1,
-                        '_AM_COND_ENDIF' => 1,
                         '_AM_MAKEFILE_INCLUDE' => 1,
                         '_AM_MAKEFILE_INCLUDE' => 1,
+                        '_AM_COND_ENDIF' => 1,
                         'AM_ENABLE_MULTILIB' => 1,
                         'AM_ENABLE_MULTILIB' => 1,
                         'AM_SILENT_RULES' => 1,
                         'AM_SILENT_RULES' => 1,
                         'AM_PROG_MOC' => 1,
                         'AM_PROG_MOC' => 1,
                         'AC_CONFIG_FILES' => 1,
                         'AC_CONFIG_FILES' => 1,
-                        'LT_INIT' => 1,
                         'include' => 1,
                         'include' => 1,
-                        'AM_PROG_AR' => 1,
+                        'LT_INIT' => 1,
                         'AM_GNU_GETTEXT' => 1,
                         'AM_GNU_GETTEXT' => 1,
+                        'AM_PROG_AR' => 1,
                         'AC_LIBSOURCE' => 1,
                         'AC_LIBSOURCE' => 1,
-                        'AM_PROG_FC_C_O' => 1,
                         'AC_CANONICAL_BUILD' => 1,
                         'AC_CANONICAL_BUILD' => 1,
+                        'AM_PROG_FC_C_O' => 1,
                         'AC_FC_FREEFORM' => 1,
                         'AC_FC_FREEFORM' => 1,
                         'AH_OUTPUT' => 1,
                         'AH_OUTPUT' => 1,
-                        '_AM_SUBST_NOTMAKE' => 1,
                         'AC_CONFIG_AUX_DIR' => 1,
                         'AC_CONFIG_AUX_DIR' => 1,
-                        'sinclude' => 1,
-                        'AM_PROG_CC_C_O' => 1,
+                        '_AM_SUBST_NOTMAKE' => 1,
                         'm4_pattern_allow' => 1,
                         'm4_pattern_allow' => 1,
-                        'AM_XGETTEXT_OPTION' => 1,
-                        'AC_CANONICAL_SYSTEM' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        'sinclude' => 1,
                         'AM_CONDITIONAL' => 1,
                         'AM_CONDITIONAL' => 1,
+                        'AC_CANONICAL_SYSTEM' => 1,
+                        'AM_XGETTEXT_OPTION' => 1,
                         'AC_CONFIG_HEADERS' => 1,
                         'AC_CONFIG_HEADERS' => 1,
                         'AC_DEFINE_TRACE_LITERAL' => 1,
                         'AC_DEFINE_TRACE_LITERAL' => 1,
                         'AM_POT_TOOLS' => 1,
                         'AM_POT_TOOLS' => 1,

+ 2 - 2
OPCUAServer/config.log

@@ -4,7 +4,7 @@ running configure, to aid debugging if configure makes a mistake.
 It was created by OPCUAServer configure 1.0, which was
 It was created by OPCUAServer configure 1.0, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
 
-  $ /home/opcua/git/opcUaStack/OPCUAServer/configure 
+  $ ./configure 
 
 
 ## --------- ##
 ## --------- ##
 ## Platform. ##
 ## Platform. ##
@@ -126,7 +126,7 @@ configure:3195: checking for style of include used by make
 configure:3223: result: GNU
 configure:3223: result: GNU
 configure:3249: checking dependency style of gcc
 configure:3249: checking dependency style of gcc
 configure:3360: result: gcc3
 configure:3360: result: gcc3
-configure:3545: creating ./config.status
+configure:3544: creating ./config.status
 
 
 ## ---------------------- ##
 ## ---------------------- ##
 ## Running config.status. ##
 ## Running config.status. ##

+ 9 - 9
OPCUAServer/config.status

@@ -436,14 +436,14 @@ Report bugs to the package provider."
 ac_cs_config=""
 ac_cs_config=""
 ac_cs_version="\
 ac_cs_version="\
 OPCUAServer config.status 1.0
 OPCUAServer config.status 1.0
-configured by /home/opcua/git/OPCUAStack/OPCUAServer/configure, generated by GNU Autoconf 2.68,
+configured by ./configure, generated by GNU Autoconf 2.68,
   with options \"$ac_cs_config\"
   with options \"$ac_cs_config\"
 
 
 Copyright (C) 2010 Free Software Foundation, Inc.
 Copyright (C) 2010 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 gives unlimited permission to copy, distribute and modify it."
 
 
-ac_pwd='/home/opcua/git/OPCUAStack/OPCUAServer'
+ac_pwd='/home/opcua/git/opcUaStack/OPCUAServer'
 srcdir='.'
 srcdir='.'
 INSTALL='/usr/bin/install -c'
 INSTALL='/usr/bin/install -c'
 MKDIR_P='/bin/mkdir -p'
 MKDIR_P='/bin/mkdir -p'
@@ -514,7 +514,7 @@ if $ac_cs_silent; then
 fi
 fi
 
 
 if $ac_cs_recheck; then
 if $ac_cs_recheck; then
-  set X '/bin/bash' '/home/opcua/git/OPCUAStack/OPCUAServer/configure'  $ac_configure_extra_args --no-create --no-recursion
+  set X '/bin/bash' './configure'  $ac_configure_extra_args --no-create --no-recursion
   shift
   shift
   $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6
   $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6
   CONFIG_SHELL='/bin/bash'
   CONFIG_SHELL='/bin/bash'
@@ -639,12 +639,12 @@ S["mkdir_p"]="/bin/mkdir -p"
 S["MKDIR_P"]="/bin/mkdir -p"
 S["MKDIR_P"]="/bin/mkdir -p"
 S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s"
 S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s"
 S["STRIP"]=""
 S["STRIP"]=""
-S["install_sh"]="${SHELL} /home/opcua/git/OPCUAStack/OPCUAServer/install-sh"
-S["MAKEINFO"]="${SHELL} /home/opcua/git/OPCUAStack/OPCUAServer/missing --run makeinfo"
-S["AUTOHEADER"]="${SHELL} /home/opcua/git/OPCUAStack/OPCUAServer/missing --run autoheader"
-S["AUTOMAKE"]="${SHELL} /home/opcua/git/OPCUAStack/OPCUAServer/missing --run automake-1.11"
-S["AUTOCONF"]="${SHELL} /home/opcua/git/OPCUAStack/OPCUAServer/missing --run autoconf"
-S["ACLOCAL"]="${SHELL} /home/opcua/git/OPCUAStack/OPCUAServer/missing --run aclocal-1.11"
+S["install_sh"]="${SHELL} /home/opcua/git/opcUaStack/OPCUAServer/install-sh"
+S["MAKEINFO"]="${SHELL} /home/opcua/git/opcUaStack/OPCUAServer/missing --run makeinfo"
+S["AUTOHEADER"]="${SHELL} /home/opcua/git/opcUaStack/OPCUAServer/missing --run autoheader"
+S["AUTOMAKE"]="${SHELL} /home/opcua/git/opcUaStack/OPCUAServer/missing --run automake-1.11"
+S["AUTOCONF"]="${SHELL} /home/opcua/git/opcUaStack/OPCUAServer/missing --run autoconf"
+S["ACLOCAL"]="${SHELL} /home/opcua/git/opcUaStack/OPCUAServer/missing --run aclocal-1.11"
 S["VERSION"]="1.0"
 S["VERSION"]="1.0"
 S["PACKAGE"]="opcuaserver"
 S["PACKAGE"]="opcuaserver"
 S["CYGPATH_W"]="echo"
 S["CYGPATH_W"]="echo"

File diff suppressed because it is too large
+ 0 - 9661
OPCUAServer/ltmain.sh


+ 1 - 0
OPCUAServer/ltmain.sh

@@ -0,0 +1 @@
+/usr/share/libtool/config/ltmain.sh

+ 48 - 5
OPCUAServer/src/.deps/opcuaServer.Po

@@ -25,13 +25,24 @@ opcuaServer.o: opcuaServer.c /usr/include/stdio.h /usr/include/features.h \
  /usr/include/i386-linux-gnu/bits/select2.h \
  /usr/include/i386-linux-gnu/bits/select2.h \
  /usr/include/i386-linux-gnu/sys/sysmacros.h \
  /usr/include/i386-linux-gnu/sys/sysmacros.h \
  /usr/include/i386-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
  /usr/include/i386-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
- /usr/include/i386-linux-gnu/bits/stdlib.h opcua_binaryEncDec.h \
- opcua_builtInDatatypes.h \
+ /usr/include/i386-linux-gnu/bits/stdlib.h opcua_builtInDatatypes.h \
  /usr/lib/gcc/i686-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \
  /usr/lib/gcc/i686-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \
  /usr/include/i386-linux-gnu/bits/wchar.h /usr/include/string.h \
  /usr/include/i386-linux-gnu/bits/wchar.h /usr/include/string.h \
  /usr/include/xlocale.h /usr/include/i386-linux-gnu/bits/string.h \
  /usr/include/xlocale.h /usr/include/i386-linux-gnu/bits/string.h \
  /usr/include/i386-linux-gnu/bits/string2.h \
  /usr/include/i386-linux-gnu/bits/string2.h \
- /usr/include/i386-linux-gnu/bits/string3.h opcua_types.h
+ /usr/include/i386-linux-gnu/bits/string3.h opcua_transportLayer.h \
+ opcua_binaryEncDec.h opcua_advancedDatatypes.h opcua_connectionHelper.h \
+ opcua_types.h tcp_layer.h /usr/include/i386-linux-gnu/sys/socket.h \
+ /usr/include/i386-linux-gnu/sys/uio.h \
+ /usr/include/i386-linux-gnu/bits/uio.h \
+ /usr/include/i386-linux-gnu/bits/socket.h \
+ /usr/include/i386-linux-gnu/bits/sockaddr.h \
+ /usr/include/i386-linux-gnu/asm/socket.h \
+ /usr/include/asm-generic/socket.h \
+ /usr/include/i386-linux-gnu/asm/sockios.h \
+ /usr/include/asm-generic/sockios.h \
+ /usr/include/i386-linux-gnu/bits/socket2.h /usr/include/netinet/in.h \
+ /usr/include/i386-linux-gnu/bits/in.h
 
 
 /usr/include/stdio.h:
 /usr/include/stdio.h:
 
 
@@ -103,8 +114,6 @@ opcuaServer.o: opcuaServer.c /usr/include/stdio.h /usr/include/features.h \
 
 
 /usr/include/i386-linux-gnu/bits/stdlib.h:
 /usr/include/i386-linux-gnu/bits/stdlib.h:
 
 
-opcua_binaryEncDec.h:
-
 opcua_builtInDatatypes.h:
 opcua_builtInDatatypes.h:
 
 
 /usr/lib/gcc/i686-linux-gnu/4.6/include/stdint.h:
 /usr/lib/gcc/i686-linux-gnu/4.6/include/stdint.h:
@@ -123,4 +132,38 @@ opcua_builtInDatatypes.h:
 
 
 /usr/include/i386-linux-gnu/bits/string3.h:
 /usr/include/i386-linux-gnu/bits/string3.h:
 
 
+opcua_transportLayer.h:
+
+opcua_binaryEncDec.h:
+
+opcua_advancedDatatypes.h:
+
+opcua_connectionHelper.h:
+
 opcua_types.h:
 opcua_types.h:
+
+tcp_layer.h:
+
+/usr/include/i386-linux-gnu/sys/socket.h:
+
+/usr/include/i386-linux-gnu/sys/uio.h:
+
+/usr/include/i386-linux-gnu/bits/uio.h:
+
+/usr/include/i386-linux-gnu/bits/socket.h:
+
+/usr/include/i386-linux-gnu/bits/sockaddr.h:
+
+/usr/include/i386-linux-gnu/asm/socket.h:
+
+/usr/include/asm-generic/socket.h:
+
+/usr/include/i386-linux-gnu/asm/sockios.h:
+
+/usr/include/asm-generic/sockios.h:
+
+/usr/include/i386-linux-gnu/bits/socket2.h:
+
+/usr/include/netinet/in.h:
+
+/usr/include/i386-linux-gnu/bits/in.h:

+ 10 - 7
OPCUAServer/src/Makefile

@@ -48,9 +48,8 @@ CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
 am__installdirs = "$(DESTDIR)$(bindir)"
 PROGRAMS = $(bin_PROGRAMS)
 PROGRAMS = $(bin_PROGRAMS)
 am___top_builddir__bin_stackTest_out_OBJECTS = opcuaServer.$(OBJEXT) \
 am___top_builddir__bin_stackTest_out_OBJECTS = opcuaServer.$(OBJEXT) \
-	opcua_builtInDatatypes.$(OBJEXT) \
-	opcua_transportLayer.$(OBJEXT) \
-	opcua_byteArrayConverter.$(OBJEXT)
+	opcua_builtInDatatypes.$(OBJEXT) opcua_binaryEncDec.$(OBJEXT) \
+	opcua_transportLayer.$(OBJEXT)
 __top_builddir__bin_stackTest_out_OBJECTS =  \
 __top_builddir__bin_stackTest_out_OBJECTS =  \
 	$(am___top_builddir__bin_stackTest_out_OBJECTS)
 	$(am___top_builddir__bin_stackTest_out_OBJECTS)
 __top_builddir__bin_stackTest_out_LDADD = $(LDADD)
 __top_builddir__bin_stackTest_out_LDADD = $(LDADD)
@@ -76,7 +75,7 @@ AUTOMAKE = ${SHELL} /home/opcua/git/opcUaStack/OPCUAServer/missing --run automak
 AWK = mawk
 AWK = mawk
 CC = gcc
 CC = gcc
 CCDEPMODE = depmode=gcc3
 CCDEPMODE = depmode=gcc3
-CFLAGS = -g -O0
+CFLAGS = -g -O2
 CPPFLAGS = 
 CPPFLAGS = 
 CYGPATH_W = echo
 CYGPATH_W = echo
 DEFS = -DPACKAGE_NAME=\"OPCUAServer\" -DPACKAGE_TARNAME=\"opcuaserver\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"OPCUAServer\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"opcuaserver\" -DVERSION=\"1.0\"
 DEFS = -DPACKAGE_NAME=\"OPCUAServer\" -DPACKAGE_TARNAME=\"opcuaserver\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"OPCUAServer\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"opcuaserver\" -DVERSION=\"1.0\"
@@ -165,11 +164,15 @@ top_builddir = ..
 top_srcdir = ..
 top_srcdir = ..
 __top_builddir__bin_stackTest_out_SOURCES = opcuaServer.c\
 __top_builddir__bin_stackTest_out_SOURCES = opcuaServer.c\
 											opcua_builtInDatatypes.c\
 											opcua_builtInDatatypes.c\
+											opcua_binaryEncDec.c\
 											opcua_transportLayer.c\
 											opcua_transportLayer.c\
-											opcua_byteArrayConverter.c\
 											opcua_builtInDatatypes.h\
 											opcua_builtInDatatypes.h\
+											opcua_binaryEncDec.h\
 											opcua_transportLayer.h\
 											opcua_transportLayer.h\
-											opcua_byteArrayConverter.h
+											opcua_advancedDatatypes.h\
+											opcua_types.h\
+											opcua_connectionHelper.h\
+											tcp_layer.h
 
 
 all: all-am
 all: all-am
 
 
@@ -256,8 +259,8 @@ distclean-compile:
 	-rm -f *.tab.c
 	-rm -f *.tab.c
 
 
 include ./$(DEPDIR)/opcuaServer.Po
 include ./$(DEPDIR)/opcuaServer.Po
+include ./$(DEPDIR)/opcua_binaryEncDec.Po
 include ./$(DEPDIR)/opcua_builtInDatatypes.Po
 include ./$(DEPDIR)/opcua_builtInDatatypes.Po
-include ./$(DEPDIR)/opcua_byteArrayConverter.Po
 include ./$(DEPDIR)/opcua_transportLayer.Po
 include ./$(DEPDIR)/opcua_transportLayer.Po
 
 
 .c.o:
 .c.o:

+ 7 - 1
OPCUAServer/src/Makefile.am

@@ -4,5 +4,11 @@ bin_PROGRAMS= $(top_builddir)/bin/stackTest.out
 __top_builddir__bin_stackTest_out_SOURCES=	opcuaServer.c\
 __top_builddir__bin_stackTest_out_SOURCES=	opcuaServer.c\
 											opcua_builtInDatatypes.c\
 											opcua_builtInDatatypes.c\
 											opcua_binaryEncDec.c\
 											opcua_binaryEncDec.c\
+											opcua_transportLayer.c\
 											opcua_builtInDatatypes.h\
 											opcua_builtInDatatypes.h\
-											opcua_binaryEncDec.h
+											opcua_binaryEncDec.h\
+											opcua_transportLayer.h\
+											opcua_advancedDatatypes.h\
+											opcua_types.h\
+											opcua_connectionHelper.h\
+											tcp_layer.h

+ 10 - 2
OPCUAServer/src/Makefile.in

@@ -48,7 +48,8 @@ CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
 am__installdirs = "$(DESTDIR)$(bindir)"
 PROGRAMS = $(bin_PROGRAMS)
 PROGRAMS = $(bin_PROGRAMS)
 am___top_builddir__bin_stackTest_out_OBJECTS = opcuaServer.$(OBJEXT) \
 am___top_builddir__bin_stackTest_out_OBJECTS = opcuaServer.$(OBJEXT) \
-	opcua_builtInDatatypes.$(OBJEXT) opcua_binaryEncDec.$(OBJEXT)
+	opcua_builtInDatatypes.$(OBJEXT) opcua_binaryEncDec.$(OBJEXT) \
+	opcua_transportLayer.$(OBJEXT)
 __top_builddir__bin_stackTest_out_OBJECTS =  \
 __top_builddir__bin_stackTest_out_OBJECTS =  \
 	$(am___top_builddir__bin_stackTest_out_OBJECTS)
 	$(am___top_builddir__bin_stackTest_out_OBJECTS)
 __top_builddir__bin_stackTest_out_LDADD = $(LDADD)
 __top_builddir__bin_stackTest_out_LDADD = $(LDADD)
@@ -164,8 +165,14 @@ top_srcdir = @top_srcdir@
 __top_builddir__bin_stackTest_out_SOURCES = opcuaServer.c\
 __top_builddir__bin_stackTest_out_SOURCES = opcuaServer.c\
 											opcua_builtInDatatypes.c\
 											opcua_builtInDatatypes.c\
 											opcua_binaryEncDec.c\
 											opcua_binaryEncDec.c\
+											opcua_transportLayer.c\
 											opcua_builtInDatatypes.h\
 											opcua_builtInDatatypes.h\
-											opcua_binaryEncDec.h
+											opcua_binaryEncDec.h\
+											opcua_transportLayer.h\
+											opcua_advancedDatatypes.h\
+											opcua_types.h\
+											opcua_connectionHelper.h\
+											tcp_layer.h
 
 
 all: all-am
 all: all-am
 
 
@@ -254,6 +261,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opcuaServer.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opcuaServer.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opcua_binaryEncDec.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opcua_binaryEncDec.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opcua_builtInDatatypes.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opcua_builtInDatatypes.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opcua_transportLayer.Po@am__quote@
 
 
 .c.o:
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<

+ 4 - 4
OPCUAServer/src/opcuaServer.c

@@ -17,9 +17,9 @@
 #include "opcua_transportLayer.h"
 #include "opcua_transportLayer.h"
 #include "opcua_types.h"
 #include "opcua_types.h"
 
 
-/*#include <sys/socket.h>
+#include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/in.h>
-*/
+
 
 
 int main(void)
 int main(void)
 {
 {
@@ -28,7 +28,7 @@ int main(void)
 	//UA_String s;
 	//UA_String s;
 	puts("running tests...");
 	puts("running tests...");
 	TL_getMessageHeader_test();
 	TL_getMessageHeader_test();
-	TL_getHELMessage_test();
+	//TL_getHELMessage_test();
 	puts("...done");
 	puts("...done");
 
 
 	server_init();
 	server_init();
@@ -78,7 +78,7 @@ void server_run()
 			}
 			}
 			new_client :
 			new_client :
 			{
 			{
-				if(connection->transportLayer.connectionState != connectionState_ESTABLISHED)
+				if(connection.transportLayer.connectionState != connectionState_ESTABLISHED)
 				{
 				{
 					TL_open(connection,rawMessage);
 					TL_open(connection,rawMessage);
 				}
 				}

+ 0 - 110
OPCUAServer/src/opcuaServer.c.orig

@@ -1,110 +0,0 @@
-/*
- ============================================================================
- Name        : opcuaServer.c
- Author      :
- Version     :
- Copyright   : Your copyright notice
- Description :
- ============================================================================
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-
-//#include "opcua_binaryEncDec.h"
-#include "opcua_builtInDatatypes.h"
-#include "opcua_transportLayer.h"
-#include "opcua_types.h"
-
-/*#include <sys/socket.h>
-#include <netinet/in.h>
-*/
-
-int main(void)
-{
-	puts("OPC ua Stack");
-	//struct BED_ApplicationDescription nStruct;
-	//UA_String s;
-	puts("running tests...");
-	TL_getMessageHeader_test();
-	TL_getHELMessage_test();
-	puts("...done");
-
-	server_init();
-	server_run();
-
-	return EXIT_SUCCESS;
-
-}
-
-void server_init()
-{
-	puts("starting demo Server");
-	//call listen
-
-}
-void server_run()
-{
-	int server_state = 0;
-	int recv_data = 0;
-	int send_data = 1;
-	int new_client = 2;
-	int new_request = 3;
-
-	while(1)
-	{
-		//call recv (nonblocking)
-
-		//call TL_getPacketType
-
-		//if newData
-		//
-		UA_connection connection;
-		AD_RawMessage *rawMessage;
-		switch(server_state)
-		{
-
-			recv_data :
-			{
-				//call receive function
-
-				break;
-			}
-			send_data :
-			{
-				//call send function
-				break;
-			}
-			new_client :
-			{
-				if(connection->transportLayer.connectionState != connectionState_ESTABLISHED)
-				{
-					TL_open(connection,rawMessage);
-				}
-/*				else
-				{
-					SL_open(connection,rawMessage);
-
-				}
-*/
-			}
-			new_request :
-			{
-
-
-				break;
-			}
-
-		}
-		//if newClient
-
-
-		//TL_processHELMessage(&connection,);
-
-		//--------
-		//call listen
-	}
-
-}
-

+ 1 - 3
OPCUAServer/src/opcua_advancedDatatypes.h

@@ -129,9 +129,7 @@ struct BED_DataValue
 /**
 /**
 * DiagnosticInfo
 * DiagnosticInfo
 * Part: 4
 * Part: 4
-* Chapter: 7.9
-* Page: 116
-*/
+* Chapter: 7.9*/
 struct BED_DiagnosticInfo
 struct BED_DiagnosticInfo
 {
 {
 //ToDo	struct ???? identifier;				//ToDo: what kind of strcuture?
 //ToDo	struct ???? identifier;				//ToDo: what kind of strcuture?

+ 63 - 10
OPCUAServer/src/opcua_binaryEncDec.c

@@ -79,6 +79,7 @@ Int64 convertToInt64(char* buf, int pos)
 	return t1 + t2 + t3 + t4 + t5 + t6 + t7 + t8;
 	return t1 + t2 + t3 + t4 + t5 + t6 + t7 + t8;
 }
 }
 
 
+<<<<<<< HEAD
 Int64 convertToInt64_test(char* buf, int pos)
 Int64 convertToInt64_test(char* buf, int pos)
 {
 {
 
 
@@ -86,41 +87,67 @@ Int64 convertToInt64_test(char* buf, int pos)
 }
 }
 
 
 UA_String convertToUAString(char* buf, int pos)
 UA_String convertToUAString(char* buf, int pos)
+=======
+convertToUAString(char* buf, int pos,UA_String *dstUAString)
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 {
 {
-	UA_String tmpUAString;
-	tmpUAString.Length = convertToInt32(buf,pos);
-	tmpUAString.Data = &(buf[sizeof(UInt32)]);
-	return tmpUAString;
+
+	dstUAString->Length = convertToInt32(buf,pos);
+	if(dstUAString->Length > 0)
+	{
+		dstUAString->Data = &(buf[sizeof(UInt32)]);
+	}
+	else
+	{
+		dstUAString->Length = 0;
+		dstUAString->Data = NULL;
+	}
 }
 }
 
 
-UA_Guid convertToUAGuid(char* buf, int pos)
+convertToUAGuid(char* buf, int pos,UA_Guid* dstGUID)
 {
 {
-	UA_Guid tmpUAGuid;
+
 	int counter = 0;
 	int counter = 0;
 	UInt32 i = 0;
 	UInt32 i = 0;
 	for(i = 1; i <= 4; i++)
 	for(i = 1; i <= 4; i++)
 	{
 	{
+<<<<<<< HEAD
 		tmpUAGuid.Data1[i] = convertToUInt32(buf, pos+counter);
 		tmpUAGuid.Data1[i] = convertToUInt32(buf, pos+counter);
+=======
+		dstGUID->Data1[i] = convertToUInt32(*buf, pos+counter);
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 		counter += sizeof(UInt32);
 		counter += sizeof(UInt32);
 	}
 	}
 	for(i = 1; i <= 2; i++)
 	for(i = 1; i <= 2; i++)
 	{
 	{
+<<<<<<< HEAD
 		tmpUAGuid.Data2[i] = convertToUInt16(buf, pos+counter);
 		tmpUAGuid.Data2[i] = convertToUInt16(buf, pos+counter);
+=======
+		dstGUID->Data2[i] = convertToUInt16(*buf, pos+counter);
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 		counter += sizeof(UInt16);
 		counter += sizeof(UInt16);
 	}
 	}
 	for(i = 1; i <= 2; i++)
 	for(i = 1; i <= 2; i++)
 	{
 	{
+<<<<<<< HEAD
 		tmpUAGuid.Data3[i] = convertToUInt16(buf, pos+counter);
 		tmpUAGuid.Data3[i] = convertToUInt16(buf, pos+counter);
+=======
+		dstGUID->Data3[i] = convertToUInt16(*buf, pos+counter);
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 		counter += sizeof(UInt16);
 		counter += sizeof(UInt16);
 	}
 	}
 	for(i = 1; i <= 8; i++)
 	for(i = 1; i <= 8; i++)
 	{
 	{
+<<<<<<< HEAD
 		tmpUAGuid.Data4[i] = convertToByte(buf, pos+counter);
 		tmpUAGuid.Data4[i] = convertToByte(buf, pos+counter);
+=======
+		dstGUID->Data4[i] = convertToByte(*buf, pos+counter);
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 		counter += sizeof(Byte);
 		counter += sizeof(Byte);
 	}
 	}
-	return tmpUAGuid;
 }
 }
 
 
+<<<<<<< HEAD
 UA_ByteString convertToUAByteString(char* buf, int pos){
 UA_ByteString convertToUAByteString(char* buf, int pos){
 	UA_ByteString tmpUAByteString;
 	UA_ByteString tmpUAByteString;
 	int counter = sizeof(Int32);
 	int counter = sizeof(Int32);
@@ -157,39 +184,67 @@ UA_StatusCode convertToUAStatusCode(char* buf, int pos){
 UA_NodeId convertToUANodeId(char* buf, int pos){
 UA_NodeId convertToUANodeId(char* buf, int pos){
 	UA_NodeId tmpUANodeId;
 	UA_NodeId tmpUANodeId;
 	tmpUANodeId.EncodingByte = convertToInt32(buf, 0);
 	tmpUANodeId.EncodingByte = convertToInt32(buf, 0);
+=======
+void convertToUANodeId(char* buf, int pos, UA_NodeId* dstNodeId){
+
+	dstNodeId->EncodingByte = convertToInt32(buf, 0);
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 	int counter = sizeof(UInt32);
 	int counter = sizeof(UInt32);
 
 
-	UA_NodeIdEncodingValuesType encodingType = tmpUANodeId.EncodingByte;
+	UA_NodeIdEncodingValuesType encodingType = dstNodeId->EncodingByte;
 
 
 	switch(encodingType)
 	switch(encodingType)
 	{
 	{
 		case NIEVT_TWO_BYTE:
 		case NIEVT_TWO_BYTE:
 		{
 		{
+<<<<<<< HEAD
 			tmpUANodeId.Identifier.Numeric = convertToInt32(buf, counter);
 			tmpUANodeId.Identifier.Numeric = convertToInt32(buf, counter);
+=======
+			dstNodeId->Identifier.Numeric = convertToInt32(buf, counter);
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 			counter += sizeof(UInt16);
 			counter += sizeof(UInt16);
 			break;
 			break;
 		}
 		}
 		case NIEVT_FOUR_BYTE:
 		case NIEVT_FOUR_BYTE:
 		{
 		{
+<<<<<<< HEAD
 			tmpUANodeId.Identifier.Numeric = convertToInt32(buf, counter);
 			tmpUANodeId.Identifier.Numeric = convertToInt32(buf, counter);
+=======
+			dstNodeId->Identifier.Numeric = convertToInt32(buf, counter);
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 			counter += sizeof(Int64);
 			counter += sizeof(Int64);
 			break;
 			break;
 		}
 		}
 		case NIEVT_NUMERIC:
 		case NIEVT_NUMERIC:
 		{
 		{
+<<<<<<< HEAD
 			tmpUANodeId.Identifier.Numeric = convertToInt32(buf, counter);
 			tmpUANodeId.Identifier.Numeric = convertToInt32(buf, counter);
+=======
+			dstNodeId->Identifier.Numeric = convertToInt32(buf, counter);
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 			counter += sizeof(UInt32);
 			counter += sizeof(UInt32);
 			break;
 			break;
 		}
 		}
 		case NIEVT_STRING:
 		case NIEVT_STRING:
 		{
 		{
+<<<<<<< HEAD
 			tmpUANodeId.Identifier.String = convertToUAString(buf, counter);
 			tmpUANodeId.Identifier.String = convertToUAString(buf, counter);
 			counter += sizeof(sizeof(UInt32) + tmpUANodeId.Identifier.String.Length*sizeof(char));
 			counter += sizeof(sizeof(UInt32) + tmpUANodeId.Identifier.String.Length*sizeof(char));
+=======
+
+			convertToUAString(buf, counter,&dstNodeId->Identifier.String);
+			counter += sizeof(sizeof(UInt32) + dstNodeId->Identifier.String.Length);
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 			break;
 			break;
 		}
 		}
 		case NIEVT_GUID:
 		case NIEVT_GUID:
 		{
 		{
+<<<<<<< HEAD
 			tmpUANodeId.Identifier.Guid = convertToUAGuid(buf, counter);
 			tmpUANodeId.Identifier.Guid = convertToUAGuid(buf, counter);
+=======
+
+			convertToUAGuid(buf, counter,&dstNodeId->Identifier.Guid);
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 			counter += sizeof(UA_Guid);
 			counter += sizeof(UA_Guid);
 			break;
 			break;
 		}
 		}
@@ -208,8 +263,6 @@ UA_NodeId convertToUANodeId(char* buf, int pos){
 		default:
 		default:
 			break;
 			break;
 	}
 	}
-
-	return tmpUANodeId;
 }
 }
 
 
 
 

+ 0 - 20
OPCUAServer/src/opcua_binaryEncDec.h.orig

@@ -1,20 +0,0 @@
-/*
- * opcua_BinaryEncDec.h
- *
- *  Created on: Dec 18, 2013
- *      Author: opcua
- */
-
-#ifndef OPCUA_BINARYENCDEC_NEU_H_
-#define OPCUA_BINARYENCDEC_NEU_H_
-
-#include "opcua_builtInDatatypes.h"
-
-
-
-//functions
-Byte convertToByte(char* buf, int pos);
-Int32 convertToInt32(char* buf,int pos);
-UInt32 convertToUInt32(char* buf, int pos);
-
-#endif /* OPCUA_BINARYENCDEC_NEU_H_ */

+ 8 - 1
OPCUAServer/src/opcua_connectionHelper.h

@@ -8,6 +8,7 @@
 #ifndef OPCUA_CONNECTIONHELPER_H_
 #ifndef OPCUA_CONNECTIONHELPER_H_
 #define OPCUA_CONNECTIONHELPER_H_
 #define OPCUA_CONNECTIONHELPER_H_
 #include "opcua_builtInDatatypes.h"
 #include "opcua_builtInDatatypes.h"
+#include "opcua_types.h"
 
 
 enum packetType
 enum packetType
 {
 {
@@ -47,7 +48,13 @@ struct TL_connection
 
 
 struct SL_connection
 struct SL_connection
 {
 {
-	UInt32 secureChannelId;
+
+	T_ApplicationInstanceCertificate clientCertificate;
+	UInt32 requestType;
+	UA_String secureChannelId;
+	UInt32 securityMode;
+	UA_String clientNonce;
+	UA_Duration requestedLifetime;
 	UInt32 connectionState;
 	UInt32 connectionState;
 
 
 };
 };

+ 43 - 1
OPCUAServer/src/opcua_encodingLayer.c

@@ -7,7 +7,9 @@
 #include "opcua_encodingLayer.h"
 #include "opcua_encodingLayer.h"
 #include "opcua_binaryEncDec.h"
 #include "opcua_binaryEncDec.h"
 #include "opcua_types.h"
 #include "opcua_types.h"
+#include "opcua_builtInDatatypes.h"
 
 
+<<<<<<< HEAD
 /**
 /**
 * IntegerId
 * IntegerId
 * Part: 4
 * Part: 4
@@ -55,10 +57,15 @@ T_DiagnosticInfo convertToTDiagnosticInfo(char* buf, int pos){
 * Page: 132
 * Page: 132
 */
 */
 T_RequestHeader encodeTRequestHeader(char* buf){
 T_RequestHeader encodeTRequestHeader(char* buf){
+=======
+T_RequestHeader encodeRequestHeader(char* buf)
+{
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 	T_RequestHeader tmpRequestHeader;
 	T_RequestHeader tmpRequestHeader;
-	int counter = 0 ;
+	int counter = 0;
 	//ToDo: counter needs the length of the buffer,
 	//ToDo: counter needs the length of the buffer,
 	//		strings have in this type just the size of the pointer not of the content
 	//		strings have in this type just the size of the pointer not of the content
+<<<<<<< HEAD
 	tmpRequestHeader.authenticationToken = convertToUANodeId(buf, counter);
 	tmpRequestHeader.authenticationToken = convertToUANodeId(buf, counter);
 	if(tmpRequestHeader.authenticationToken.EncodingByte ==  NIEVT_STRING){
 	if(tmpRequestHeader.authenticationToken.EncodingByte ==  NIEVT_STRING){
 		counter = sizeof(tmpRequestHeader.authenticationToken.EncodingByte) +
 		counter = sizeof(tmpRequestHeader.authenticationToken.EncodingByte) +
@@ -66,6 +73,19 @@ T_RequestHeader encodeTRequestHeader(char* buf){
 				sizeof(tmpRequestHeader.authenticationToken.Identifier.String.Length) +
 				sizeof(tmpRequestHeader.authenticationToken.Identifier.String.Length) +
 				sizeof(tmpRequestHeader.authenticationToken.Identifier.String.Data);
 				sizeof(tmpRequestHeader.authenticationToken.Identifier.String.Data);
 	}else{
 	}else{
+=======
+	tmpRequestHeader.authenticationToken = convertToUANodeId(*buf, counter);
+	if (tmpRequestHeader.authenticationToken.EncodingByte == NIEVT_STRING)
+	{
+		counter =
+				sizeof(tmpRequestHeader.authenticationToken.EncodingByte)
+						+ sizeof(tmpRequestHeader.authenticationToken.Namespace)
+						+ sizeof(tmpRequestHeader.authenticationToken.Identifier.String.Length)
+						+ sizeof(tmpRequestHeader.authenticationToken.Identifier.String.Data);
+	}
+	else
+	{
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 		counter = sizeof(tmpRequestHeader.authenticationToken);
 		counter = sizeof(tmpRequestHeader.authenticationToken);
 	}
 	}
 	tmpRequestHeader.timestamp = convertToUADateTime(buf, counter);
 	tmpRequestHeader.timestamp = convertToUADateTime(buf, counter);
@@ -83,6 +103,7 @@ T_RequestHeader encodeTRequestHeader(char* buf){
 	return tmpRequestHeader;
 	return tmpRequestHeader;
 }
 }
 
 
+<<<<<<< HEAD
 /**
 /**
 * ResponseHeader
 * ResponseHeader
 * Part: 4
 * Part: 4
@@ -102,4 +123,25 @@ T_ResponseHeader encodeTResponseHeader(char* buf){
 
 
 
 
 	return tmpResponseHeader;
 	return tmpResponseHeader;
+=======
+void decodeMessage_test()
+{
+
+	char testMessage = {01,0x20,0xbe,0x01,0x20,0x20,0xf2,0xd6,0xd6,0xc9,0x01,0x00,0xbe,0x01,0x00,0x00,0xf2,0xd6,0xd6,0xc9,0x87,0x0b,0xcf,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0xe0,0x93,0x04,0x00,0x,0x};
+	AD_RawMessage rawMessage;
+	rawMessage.message = testMessage;
+	rawMessage.length = 64;
+	decodeMessage(testMessage);
+}
+/*
+ * builds a message structure by decoding a byte stream
+ */
+UA_ExtensionObject processMessage(AD_RawMessage *rawMessage)
+{
+	UA_NodeId tmpNodeId = convertToUANodeId(rawMessage,0);
+
+
+	//callServiceHandler(tmpNodeId,rawMessage);
+
+>>>>>>> branch 'master' of https://github.com/Stasik0/Open62541.git
 }
 }

+ 117 - 48
OPCUAServer/src/opcua_secureChannelLayer.c

@@ -6,79 +6,148 @@
  */
  */
 #include "opcua_secureChannelLayer.h"
 #include "opcua_secureChannelLayer.h"
 
 
-void SL_open(UA_connection *connection,AD_RawMessage *rawMessage)
+SL_getRequestHeader()
 {
 {
-	switch(connection->secureLayer.connectionState)
-	{
-		connectionState_OPENING :
-		{
-
-			break;
-		}
 
 
-		connectionState_ESTABLISHED :
-		{
-			break;
-		}
-
-		connectionState_CLOSED :
-		{
-			//open the connection on transport layer
-			if(connection->transportLayer.connectionState == connectionState_ESTABLISHED)
-			{
-				if (TL_getPacketType(rawMessage) == packetType_OPN)
-				{
-					SL_openSecureChannel(connection, rawMessage);
-				}
-
-			}
-			break;
-		}
+}
+/*
+ * opens a secureChannel (server side)
+ */
+void SL_secureChannel_open(UA_connection     *connection,
+		AD_RawMessage                        *secureChannelMessage,
+		SL_SecureConversationMessageHeader   *SCM_Header,
+		SL_AsymmetricAlgorithmSecurityHeader *AAS_Header)
+{
 
 
-	}
+	TL_send();
+	//connection->secureLayer.
 }
 }
-void SL_openSecureChannel(UA_connection *connection)
+/*
+void SL_secureChannel_Request_get(AD_RawMessage        *secureChannelMessage,
+		                          secureChannelRequest *SC_request)
 {
 {
 
 
+}
+*/
+/*
+ * closes a secureChannel (server side)
+ */
+void SL_secureChannel_close(UA_connection *connection)
+{
 
 
-	TL_send();
 }
 }
 /*
 /*
-void SL_receive(UA_connection *connection, AD_RawMessage *serviceMessage)
+ * receive and process data from underlying layer
+ */
+void SL_receive(UA_connection *connection,
+		        AD_RawMessage *serviceMessage)
 {
 {
 	AD_RawMessage* secureChannelMessage;
 	AD_RawMessage* secureChannelMessage;
+	SL_SecureConversationMessageHeader SCM_Header;
+	SL_AsymmetricAlgorithmSecurityHeader AAS_Header;
 
 
+	//get data from transport layer
 	TL_receive(UA_connection, secureChannelMessage);
 	TL_receive(UA_connection, secureChannelMessage);
 
 
-	switch (SL_getMessageType(secureChannelMessage))
+	//get the Secure Channel Message Header
+	UInt32 readPosition = SL_secureChannel_SCMHeader_get(connection,secureChannelMessage,&SCM_Header);
+
+	//get the Secure Channel Asymmetric Algorithm Security Header
+	readPosition = SL_secureChannel_AASHeader_get(connection,secureChannelMessage,readPosition,&AAS_Header);
+
+	//get Secure Channel Message
+	SL_secureChannel_Message_get(connection,secureChannelMessage,readPosition,serviceMessage);
+
+
+	if (secureChannelMessage.length > 0)
 	{
 	{
-		case SL_messageType_MSG:
+		switch (SCM_Header.MessageType)
 		{
 		{
-			serviceMessage = secureChannelMessage;
+		case packetType_MSG:
+			if (connection->secureLayer.connectionState
+					== connectionState_ESTABLISHED)
+			{
+
+			}
+			else //receiving message, without secure channel
+			{
+				//TODO send back Error Message
+			}
+			break;
+		case packetType_OPN:
+			if (openSecureChannelHeader_check(connection, secureChannelMessage))
+			{
+				SL_secureChannel_open(connection, serviceMessage);
+			}
+			else
+			{
+				//TODO send back Error Message
+			}
+			//TODO free memory for secureChannelMessage
+			break;
+		case packetType_CLO:
+			SL_secureChannel_close(connection, secureChannelMessage);
+
+			//TODO free memory for secureChannelMessage
 			break;
 			break;
-		}
 	}
 	}
 
 
 }
 }
-*/
-UInt32 SL_getMessageType(UA_connection *connection, AD_RawMessage *rawMessage)
+UInt32 SL_secureChannel_SCMHeader_get(UA_connection *connection, AD_RawMessage *rawMessage, SL_SecureConversationMessageHeader* SC_Header)
+{
+	Int32 pos = 0;
+	SC_Header->MessageType = TL_getPacketType(rawMessage);
+	pos += TL_MESSAGE_TYPE_LEN;
+	SC_Header->IsFinal = rawMessage[pos];
+	pos += sizeof(Byte);
+	SC_Header->MessageSize = convertToUInt32(rawMessage,pos);
+	pos += sizeof(UInt32);
+	SC_Header->SecureChannelId = convertToUInt32(rawMessage,pos);
+	pos += sizeof(UInt32);
+	return pos;
+
+}
+UInt32 SL_secureChannel_AASHeader_get(UA_connection *connection, AD_RawMessage *rawMessage,UInt32 pos, SL_AsymmetricAlgorithmSecurityHeader* AAS_Header)
 {
 {
-	if(rawMessage->message[0] == 'O' &&
-	   rawMessage->message[1] == 'P' &&
-	   rawMessage->message[2] == 'N')
+	AAS_Header->SecurityPolicyUri.Length = convertToInt32(rawMessage,pos);
+
+	pos += sizeof(Int32);
+	AAS_Header->SecurityPolicyUri.Data = rawMessage[pos];
+
+	if(AAS_Header->SecurityPolicyUri.Length < 0)
 	{
 	{
-		return SL_messageType_OPN;
+		AAS_Header->SecurityPolicyUri.Length = 0;
 	}
 	}
-	else if(rawMessage->message[0] == 'C' &&
-	        rawMessage->message[1] == 'L' &&
-	        rawMessage->message[2] == 'O')
+	pos +=  AAS_Header->SecurityPolicyUri.Length;
+
+	AAS_Header->SenderCertificate.Length = convertToInt32(rawMessage,pos);
+	pos += sizeof(Int32);
+	if(AAS_Header->SenderCertificate.Length < 0)
 	{
 	{
-		return SL_messageType_CLO;
+		AAS_Header->SenderCertificate.Length = 0;
 	}
 	}
-	else if(rawMessage->message[0] == 'M' &&
-			rawMessage->message[1] == 'S' &&
-			rawMessage->message[2] == 'G')
+	AAS_Header->SenderCertificate.Data = rawMessage[pos];
+
+	pos += AAS_Header->SenderCertificate.Length;
+
+	AAS_Header->ReceiverThumbprint.Length = convertToInt32(rawMessage,pos);
+	pos += sizeof(Int32);
+
+	if(AAS_Header->ReceiverThumbprint.Length < 0)
 	{
 	{
-		return SL_messageType_MSG;
+		AAS_Header->ReceiverThumbprint.Length = 0;
 	}
 	}
+	AAS_Header->ReceiverThumbprint.Data = rawMessage[pos];
+
+	pos += AAS_Header->ReceiverThumbprint.Length;
+	return pos;
+}
+void SL_secureChannel_Footer_get()
+{
+
+
+}
+void SL_secureChannel_Message_get(UA_connection *connection, AD_RawMessage *rawMessage,UInt32 pos, AD_RawMessage *message)
+{
+
 }
 }

+ 39 - 0
OPCUAServer/src/opcua_secureChannelLayer.h

@@ -8,6 +8,45 @@
 #ifndef OPCUA_SECURECHANNELLAYER_H_
 #ifndef OPCUA_SECURECHANNELLAYER_H_
 #define OPCUA_SECURECHANNELLAYER_H_
 #define OPCUA_SECURECHANNELLAYER_H_
 
 
+static const Int32 SL_HEADER_LENGTH = 0;
+typedef struct _SL_OpenSecureChannelResponse
+{
+
+};
+typedef struct _SL_SecureConversationMessageHeader
+{
+	UInt32 MessageType;
+	Byte   IsFinal;
+	UInt32 MessageSize;
+	UInt32 SecureChannelId;
+}SL_SecureConversationMessageHeader;
+typedef struct _SL_AsymmetricAlgorithmSecurityHeader
+{
+	UA_String SecurityPolicyUri;
+	UA_String SenderCertificate;
+	UA_String ReceiverThumbprint;
+}SL_AsymmetricAlgorithmSecurityHeader;
+
+typedef struct _SL_SequenceHeader
+{
+	UInt32 SequenceNumber;
+	UInt32 RequestId;
+}SL_SequenceHeader;
+
+/*
+ * optional, only if there is encryption present
+ */
+typedef struct _SL_AsymmetricAlgorithmSecurityFooter
+{
+	Byte PaddingSize;
+	Byte *Padding;
+
+	UInt32 SignatureSize;
+	Byte *Signature;
+}SL_AsymmetricAlgorithmSecurityFooter;
+
+
+
 
 
 
 
 #endif /* OPCUA_SECURECHANNELLAYER_H_ */
 #endif /* OPCUA_SECURECHANNELLAYER_H_ */

+ 1 - 1
OPCUAServer/src/opcua_serverAPI.h

@@ -15,7 +15,7 @@
 
 
 
 
 
 
-
+// registerServiceCallback(NodeTypeIde,)
 // sessionId = AcceptSecureChannel()
 // sessionId = AcceptSecureChannel()
 
 
 // serviceRequest = receiveServiceRequest(sessionId)
 // serviceRequest = receiveServiceRequest(sessionId)

+ 44 - 23
OPCUAServer/src/opcua_transportLayer.c

@@ -19,16 +19,30 @@ void TL_sendACK(UA_connection *connection)
 	//call send function
 	//call send function
 
 
 }
 }
-
+/*
+ * server answer to open message
+ */
 void TL_open(UA_connection *connection, AD_RawMessage *rawMessage)
 void TL_open(UA_connection *connection, AD_RawMessage *rawMessage)
 {
 {
+	UA_connection tmpConnection;
 	switch(connection->transportLayer.connectionState)
 	switch(connection->transportLayer.connectionState)
 	{
 	{
 		connectionState_CLOSED :
 		connectionState_CLOSED :
 		{
 		{
+			//process the connection values received by the client
+			TL_processHELMessage(&tmpConnection,rawMessage);
+			connection->transportLayer.serverBuffers.protocolVersion = TL_SERVER_PROTOCOL_VERSION;
+
+			connection->transportLayer.serverBuffers.recvBufferSize =
+					tmpConnection.transportLayer.serverBuffers.recvBufferSize;
+
+			connection->transportLayer.serverBuffers.sendBufferSize =
+					tmpConnection.transportLayer.serverBuffers.sendBufferSize;
 
 
-			TL_processHELMessage(connection,rawMessage);
-			TL_sendACK(connection);
+			connection->transportLayer.serverBuffers.maxMessageSize = TL_SERVER_MAX_MESSAGE_SIZE;
+			connection->transportLayer.serverBuffers.maxChunkCount = TL_SERVER_MAX_CHUNK_COUNT;
+
+		    TL_sendACK(connection);
 			connection->transportLayer.connectionState = connectionState_ESTABLISHED;
 			connection->transportLayer.connectionState = connectionState_ESTABLISHED;
 			break;
 			break;
 		}
 		}
@@ -45,7 +59,7 @@ void TL_open(UA_connection *connection, AD_RawMessage *rawMessage)
 		}
 		}
 	}
 	}
 }
 }
-/*
+
 void TL_receive(UA_connection *connection, AD_RawMessage *TL_message)
 void TL_receive(UA_connection *connection, AD_RawMessage *TL_message)
 {
 {
 	UInt32 bufferSize = connection->transportLayer.serverBuffers.recvBufferSize = 8192;
 	UInt32 bufferSize = connection->transportLayer.serverBuffers.recvBufferSize = 8192;
@@ -60,36 +74,43 @@ void TL_receive(UA_connection *connection, AD_RawMessage *TL_message)
 
 
 	if (tmpRawMessage.message != NULL)
 	if (tmpRawMessage.message != NULL)
 	{
 	{
-		length = tcp_recv(connection, tmpRawMessage.message, bufferSize);
+		//length = tcp_recv(connection, tmpRawMessage.message, bufferSize);
 	}
 	}
+
+
 	tmpRawMessage.length = length;
 	tmpRawMessage.length = length;
 	if(tmpRawMessage.length > 0)
 	if(tmpRawMessage.length > 0)
 	{
 	{
-		TL_getMessageHeader(connection, &tmpHeader);
-		switch(tmpHeader->MessageType)
+		switch(TL_getPacketType(tmpRawMessage))
 		{
 		{
-			TL_OPN,TL_MSG,TL_CLO :
-			{
-
-				break;
-			}
-			TL_HEL :
-			{
-				break;
-			}
-			TL_ACK :
-			{
-				break;
-			}
-
-
+		packetType_MSG:
+		packetType_OPN:
+		packetType_CLO:
+			TL_message->length = tmpRawMessage.length;
+			TL_message->message = tmpRawMessage.message;
+			break;
+		packetType_HEL:
+			TL_message->length = 0;
+			TL_message->message = NULL;
+			TL_open(connection, &tmpRawMessage);
+			break;
+		packetType_ACK:
+			TL_message->length = 0;
+			TL_message->message = NULL;
+			break;
+		packetType_ERR:
+			TL_message->length = 0;
+			TL_message->message = NULL;
+			//TODO ERROR HANDLING
+			break;
+			//TODO ERROR HANDLING
 		}
 		}
 		//check in which state the connection is
 		//check in which state the connection is
 
 
 	}
 	}
 
 
 }
 }
-*/
+
 void TL_getMessageHeader_test()
 void TL_getMessageHeader_test()
 {
 {
 
 

+ 3 - 1
OPCUAServer/src/opcua_transportLayer.h

@@ -23,7 +23,9 @@ static const UInt32 TL_MESSAGE_TYPE_LEN = 3;
 static const UInt32 TL_RESERVED_LEN = 1;
 static const UInt32 TL_RESERVED_LEN = 1;
 
 
 //variables which belong to layer
 //variables which belong to layer
-
+static const TL_SERVER_PROTOCOL_VERSION = 0;
+static const TL_SERVER_MAX_CHUNK_COUNT = 1;
+static const TL_SERVER_MAX_MESSAGE_SIZE = 8192;
 
 
 enum TL_messageType_td
 enum TL_messageType_td
 {
 {

+ 61 - 61
OPCUAServer/src/opcua_types.h

@@ -12,10 +12,10 @@
 
 
 typedef enum _T_ApplicationType
 typedef enum _T_ApplicationType
 {
 {
-	SERVER_0,
-	CLIENT_1,
-	CLIENTANDSERVER_2,
-	DISCOVERYSERVER_3
+	ApplicationType_SERVER_0,
+	ApplicationType_CLIENT_1,
+	ApplicationType_CLIENTANDSERVER_2,
+	ApplicationType_DISCOVERYSERVER_3
 }
 }
 T_ApplicationType;
 T_ApplicationType;
 
 
@@ -185,9 +185,9 @@ T_DiagnosticInfo;
 */
 */
 typedef enum _T_MessageSecurityMode
 typedef enum _T_MessageSecurityMode
 {
 {
-	INVALID_0 = 0,
-	SIGN_1 = 1,
-	SIGNANDENCRYPT_2 = 2
+	MessageSecurityMode_INVALID_0 = 0,
+	MessageSecurityMode_SIGN_1 = 1,
+	MessageSecurityMode_SIGNANDENCRYPT_2 = 2
 }
 }
 T_MessageSecurityMode;
 T_MessageSecurityMode;
 
 
@@ -376,9 +376,9 @@ T_ExtensibleParameterMonitoringFilter;
 */
 */
 typedef enum _T_MonitoringFilter
 typedef enum _T_MonitoringFilter
 {
 {
-	DATA_CHANGE_FILTER = 1,
-	EVENT_FILTER = 2,
-	AGGREGATE_FILTER = 3
+	MonitoringFilter_DATA_CHANGE_FILTER = 1,
+	MonitoringFilter_EVENT_FILTER = 2,
+	MonitoringFilter_AGGREGATE_FILTER = 3
 }
 }
 T_MonitoringFilter;
 T_MonitoringFilter;
 
 
@@ -393,9 +393,9 @@ T_MonitoringFilter;
 */
 */
 typedef enum _T_MonitoringModeValues
 typedef enum _T_MonitoringModeValues
 {
 {
-	DISABLED_0 = 0,	//The item being monitored is not sampled or evaluated, and Notifications are not generated or queued. Notification reporting is disabled.
-	SAMPLING_1 = 1,	//The item being monitored is sampled and evaluated, and Notifications are generated and queued. Notification reporting is disabled.
-	REPORTING_2 = 2	//The item being monitored is sampled and evaluated, and Notifications are generated and queued. Notification reporting is enabled.
+	MonitoringModeValues_DISABLED_0 = 0,	//The item being monitored is not sampled or evaluated, and Notifications are not generated or queued. Notification reporting is disabled.
+	MonitoringModeValues_SAMPLING_1 = 1,	//The item being monitored is sampled and evaluated, and Notifications are generated and queued. Notification reporting is disabled.
+	MonitoringModeValues_REPORTING_2 = 2	//The item being monitored is sampled and evaluated, and Notifications are generated and queued. Notification reporting is enabled.
 }
 }
 T_MonitoringModeValues;
 T_MonitoringModeValues;
 
 
@@ -408,41 +408,41 @@ T_MonitoringModeValues;
 */
 */
 typedef enum _T_NodeAttributesParamterTypeIds
 typedef enum _T_NodeAttributesParamterTypeIds
 {
 {
-	ObjectAttributes,	//Defines the Attributes for the Object NodeClass.
-	VariableAttributes,	//Defines the Attributes for the Variable NodeClass.
-	MethodAttributes,	//Defines the Attributes for the Method NodeClass.
-	ObjectTypeAttributes,	//Defines the Attributes for the ObjectType NodeClass.
-	VariableTypeAttributes,	//Defines the Attributes for the VariableType NodeClass.
-	ReferenceTypeAttributes,//Defines the Attributes for the ReferenceType NodeClass.
-	DataTypeAttributes,	//Defines the Attributes for the DataType NodeClass.
-	ViewAttributes		//Defines the Attributes for the View NodeClass.
+	NodeAttributesParamterTypeIds_ObjectAttributes,	//Defines the Attributes for the Object NodeClass.
+	NodeAttributesParamterTypeIds_VariableAttributes,	//Defines the Attributes for the Variable NodeClass.
+	NodeAttributesParamterTypeIds_MethodAttributes,	//Defines the Attributes for the Method NodeClass.
+	NodeAttributesParamterTypeIds_ObjectTypeAttributes,	//Defines the Attributes for the ObjectType NodeClass.
+	NodeAttributesParamterTypeIds_VariableTypeAttributes,	//Defines the Attributes for the VariableType NodeClass.
+	NodeAttributesParamterTypeIds_ReferenceTypeAttributes,//Defines the Attributes for the ReferenceType NodeClass.
+	NodeAttributesParamterTypeIds_DataTypeAttributes,	//Defines the Attributes for the DataType NodeClass.
+	NodeAttributesParamterTypeIds_ViewAttributes		//Defines the Attributes for the View NodeClass.
 }
 }
 T_NodeAttributesParamterTypeIds;
 T_NodeAttributesParamterTypeIds;
 
 
 typedef enum _T_NodeAttributesBitMask
 typedef enum _T_NodeAttributesBitMask
 {
 {
-	AccessLevel = 1, 	//Bit: 0 Indicates if the AccessLevel Attribute is set.
-	ArrayDimensions = 2,	//Bit: 1 Indicates if the ArrayDimensions Attribute is set.
+	NodeAttributesBitMask_AccessLevel = 1, 	//Bit: 0 Indicates if the AccessLevel Attribute is set.
+	NodeAttributesBitMask_ArrayDimensions = 2,	//Bit: 1 Indicates if the ArrayDimensions Attribute is set.
 	//Reserved = 4, 	//Bit: 2 Reserved to be consistent with WriteMask defined in IEC 62541-3.
 	//Reserved = 4, 	//Bit: 2 Reserved to be consistent with WriteMask defined in IEC 62541-3.
-	ContainsNoLoops = 8,	//Bit: 3 Indicates if the ContainsNoLoops Attribute is set.
-	DataType = 16,		//Bit: 4 Indicates if the DataType Attribute is set.
-	Description = 32,	//Bit: 5 Indicates if the Description Attribute is set.
-	DisplayName = 64,	//Bit: 6 Indicates if the DisplayName Attribute is set.
-	EventNotifier = 128,	//Bit: 7 Indicates if the EventNotifier Attribute is set.
-	Executable = 256,	//Bit: 8 Indicates if the Executable Attribute is set.
-	Historizing = 512,	//Bit: 9 Indicates if the Historizing Attribute is set.
-	InverseName = 1024,	//Bit:10 Indicates if the InverseName Attribute is set.
-	IsAbstract = 2048,	//Bit:11 Indicates if the IsAbstract Attribute is set.
-	MinimumSamplingInterval = 4096, //Bit:12 Indicates if the MinimumSamplingInterval Attribute is set.
+	NodeAttributesBitMask_ContainsNoLoops = 8,	//Bit: 3 Indicates if the ContainsNoLoops Attribute is set.
+	NodeAttributesBitMask_DataType = 16,		//Bit: 4 Indicates if the DataType Attribute is set.
+	NodeAttributesBitMask_Description = 32,	//Bit: 5 Indicates if the Description Attribute is set.
+	NodeAttributesBitMask_DisplayName = 64,	//Bit: 6 Indicates if the DisplayName Attribute is set.
+	NodeAttributesBitMask_EventNotifier = 128,	//Bit: 7 Indicates if the EventNotifier Attribute is set.
+	NodeAttributesBitMask_Executable = 256,	//Bit: 8 Indicates if the Executable Attribute is set.
+	NodeAttributesBitMask_Historizing = 512,	//Bit: 9 Indicates if the Historizing Attribute is set.
+	NodeAttributesBitMask_InverseName = 1024,	//Bit:10 Indicates if the InverseName Attribute is set.
+	NodeAttributesBitMask_IsAbstract = 2048,	//Bit:11 Indicates if the IsAbstract Attribute is set.
+	NodeAttributesBitMask_MinimumSamplingInterval = 4096, //Bit:12 Indicates if the MinimumSamplingInterval Attribute is set.
 	//Reserved = 8192,	//Bit:13 Reserved to be consistent with WriteMask defined in IEC 62541-3.
 	//Reserved = 8192,	//Bit:13 Reserved to be consistent with WriteMask defined in IEC 62541-3.
 	//Reserved = 16384,	//Bit:14 Reserved to be consistent with WriteMask defined in IEC 62541-3.
 	//Reserved = 16384,	//Bit:14 Reserved to be consistent with WriteMask defined in IEC 62541-3.
-	Symmetric = 32768,	//Bit:15 Indicates if the Symmetric Attribute is set.
-	UserAccessLevel = 65536,//Bit:16 Indicates if the UserAccessLevel Attribute is set.
-	UserExecutable = 131072,//Bit:17 Indicates if the UserExecutable Attribute is set.
-	UserWriteMask = 262144, //Bit:18 Indicates if the UserWriteMask Attribute is set.
-	ValueRank = 524288,	//Bit:19 Indicates if the ValueRank Attribute is set.
-	WriteMask = 1048576,	//Bit:20 Indicates if the WriteMask Attribute is set.
-	Value = 2097152		//Bit:21 Indicates if the Value Attribute is set.
+	NodeAttributesBitMask_Symmetric = 32768,	//Bit:15 Indicates if the Symmetric Attribute is set.
+	NodeAttributesBitMask_UserAccessLevel = 65536,//Bit:16 Indicates if the UserAccessLevel Attribute is set.
+	NodeAttributesBitMask_UserExecutable = 131072,//Bit:17 Indicates if the UserExecutable Attribute is set.
+	NodeAttributesBitMask_UserWriteMask = 262144, //Bit:18 Indicates if the UserWriteMask Attribute is set.
+	NodeAttributesBitMask_ValueRank = 524288,	//Bit:19 Indicates if the ValueRank Attribute is set.
+	NodeAttributesBitMask_WriteMask = 1048576,	//Bit:20 Indicates if the WriteMask Attribute is set.
+	NodeAttributesBitMask_Value = 2097152		//Bit:21 Indicates if the Value Attribute is set.
 	//Reserved		//Bit:22:32 Reserved for future use. Shall always be zero.
 	//Reserved		//Bit:22:32 Reserved for future use. Shall always be zero.
 }
 }
 T_NodeAttributesBitMask;
 T_NodeAttributesBitMask;
@@ -619,9 +619,9 @@ T_ViewAttributes;
 */
 */
 typedef enum _T_NotificationDataParameterTypeIds
 typedef enum _T_NotificationDataParameterTypeIds
 {
 {
-	DATA_CHANGE = 1,
-	EVENT = 2,
-	STATUS_CHANGE = 3
+	NotificationDataParameterTypeIds_DATA_CHANGE = 1,
+	NotificationDataParameterTypeIds_EVENT = 2,
+	NotificationDataParameterTypeIds_STATUS_CHANGE = 3
 }
 }
 T_NotificationDataParameterTypeIds;
 T_NotificationDataParameterTypeIds;
 
 
@@ -780,16 +780,16 @@ T_RequestHeader;
 
 
 typedef enum _T_RequestReturnDiagnositcs
 typedef enum _T_RequestReturnDiagnositcs
 {
 {
-	SERVICE_LEVEL_SYMBOLIC_ID = 1,				//Hex 0x01
-	SERVICE_LEVEL_LOCALIZED_TEXT= 2,			//Hex 0x02
-	SERVICE_LEVEL_ADDITIONAL_INFO = 4,			//Hex 0x04
-	SERVICE_LEVEL_INNER_STATUS_CODE = 8,		//Hex 0x08
-	SERVICE_LEVEL_INNER_DIAGNOSTICS = 16,		//Hex 0x10
-	OPERATION_LEVEL_SYMBOLIC_ID = 32,			//Hex 0x20
-	OPERATION_LEVEL_LOCALIZED_TEXT= 64,			//Hex 0x40
-	OPERATION_LEVEL_ADDITIONAL_INFO = 128,		//Hex 0x80
-	OPERATION_LEVEL_INNER_STATUS_CODE = 256,	//Hex 0x100
-	OPERATION_LEVEL_INNER_DIAGNOSTICS = 512		//Hex 0x200
+	RequestReturnDiagnositcs_SERVICE_LEVEL_SYMBOLIC_ID = 1,				//Hex 0x01
+	RequestReturnDiagnositcs_SERVICE_LEVEL_LOCALIZED_TEXT= 2,			//Hex 0x02
+	RequestReturnDiagnositcs_SERVICE_LEVEL_ADDITIONAL_INFO = 4,			//Hex 0x04
+	RequestReturnDiagnositcs_SERVICE_LEVEL_INNER_STATUS_CODE = 8,		//Hex 0x08
+	RequestReturnDiagnositcs_SERVICE_LEVEL_INNER_DIAGNOSTICS = 16,		//Hex 0x10
+	RequestReturnDiagnositcs_OPERATION_LEVEL_SYMBOLIC_ID = 32,			//Hex 0x20
+	RequestReturnDiagnositcs_OPERATION_LEVEL_LOCALIZED_TEXT= 64,			//Hex 0x40
+	RequestReturnDiagnositcs_OPERATION_LEVEL_ADDITIONAL_INFO = 128,		//Hex 0x80
+	RequestReturnDiagnositcs_OPERATION_LEVEL_INNER_STATUS_CODE = 256,	//Hex 0x100
+	RequestReturnDiagnositcs_OPERATION_LEVEL_INNER_DIAGNOSTICS = 512		//Hex 0x200
 }
 }
 T_RequestReturnDiagnositcs;
 T_RequestReturnDiagnositcs;
 
 
@@ -883,12 +883,12 @@ T_SignedSoftwareCertificate;
 */
 */
 typedef enum _T_ComplianceLevel
 typedef enum _T_ComplianceLevel
 {
 {
-	UNTESTED_0 = 0,		//the profiled capability has not been tested successfully.
-	PARTIAL_1 = 1,		//the profiled capability has been partially tested and has
+	ComplianceLevel_UNTESTED_0 = 0,		//the profiled capability has not been tested successfully.
+	ComplianceLevel_PARTIAL_1 = 1,		//the profiled capability has been partially tested and has
 				//passed critical tests, as defined by the certifying authority.
 				//passed critical tests, as defined by the certifying authority.
-	SELFTESTED_2 = 2,	//the profiled capability has been successfully tested using a
+	ComplianceLevel_SELFTESTED_2 = 2,	//the profiled capability has been successfully tested using a
 				//self-test system authorized by the certifying authority.
 				//self-test system authorized by the certifying authority.
-	CERTIFIED_3 = 3		//the profiled capability has been successfully tested by a
+	ComplianceLevel_CERTIFIED_3 = 3		//the profiled capability has been successfully tested by a
 				//testing organisation authorized by the certifying authority.
 				//testing organisation authorized by the certifying authority.
 }
 }
 T_ComplianceLevel;
 T_ComplianceLevel;
@@ -938,13 +938,13 @@ T_SoftwareCertificate;
 */
 */
 typedef enum _T_TimestampsToReturn
 typedef enum _T_TimestampsToReturn
 {
 {
-	SOURCE_0 = 1,	//Return the source timestamp.
+	TimestampsToReturn_SOURCE_0 = 1,	//Return the source timestamp.
 			//If used in HistoryRead the source timestamp is used to determine which historical data values are returned.
 			//If used in HistoryRead the source timestamp is used to determine which historical data values are returned.
-	SERVER_1 = 1,	//Return the Server timestamp.
+	TimestampsToReturn_SERVER_1 = 1,	//Return the Server timestamp.
 			//If used in HistoryRead the Server timestamp is used to determine which historical data values are returned.
 			//If used in HistoryRead the Server timestamp is used to determine which historical data values are returned.
-	BOTH_2 = 2,	//Return both the source and Server timestamps.
+	TimestampsToReturn_BOTH_2 = 2,	//Return both the source and Server timestamps.
 			//If used in HistoryRead the source timestamp is used to determine which historical data values are returned.
 			//If used in HistoryRead the source timestamp is used to determine which historical data values are returned.
-	NEITHER_3 = 3	//Return neither timestamp.
+	TimestampsToReturn_NEITHER_3 = 3	//Return neither timestamp.
 			//This is the default value for MonitoredItems if a Variable value is not being accessed.
 			//This is the default value for MonitoredItems if a Variable value is not being accessed.
 			//For HistoryRead this is not a valid setting.
 			//For HistoryRead this is not a valid setting.
 }
 }