acplt/open62541 — pull request #124 by jpfr (2014-09-11 14:41:29+00:00)
Title: Refactoring without global variables

Hey guys,

as discussed before, here is a big refactoring up for discussion.
Just compile and run it locally. Its all in the noglobal branch.
Works fine for me and my UAExpert.

**To get a feel for the refactoring, have a look at /examples/opcuaServer.c**
And have a look at networklayer_tcp.h and ua_connection.h if you feel adventurous. :-)

What was changed?
- No more global variables and "god-objects".
- 1.5k less lines of codes and a lot less dependencies between header files. No functionality was removed!
- The UA_Server now contains both secureChannelManager and sessionManager
- UA_SecureChannel and UA_Session are invisible from the user perspective (in opcuaServer.c)
- The server certificate is stored in the server object and loaded once in the beginning
- The UA_Connection struct is agnostic of the network layer (tcp, webservices, ...). It contains callbacks to get back into the network layer that created the connection
- Pointers from connection -> securechannel -> session, so we don't have to do lookups all the time

@FlorianPalm The session handling has some loose ends. Can we do a skype/telephone session to get your opinion on that?

@Stasik0 I moved loading the certificate to opcuaServer.c You ok with that?