00001 #ifndef UA_SECURECHANNEL_H_ 00002 #define UA_SECURECHANNEL_H_ 00003 00004 #include "queue.h" 00005 #include "ua_types_generated.h" 00006 #include "ua_transport_generated.h" 00007 #include "ua_connection.h" 00008 00015 struct UA_Session; 00016 typedef struct UA_Session UA_Session; 00017 00018 struct SessionEntry { 00019 LIST_ENTRY(SessionEntry) pointers; 00020 UA_Session *session; // Just a pointer. The session is held in the session manager or the client 00021 }; 00022 00023 struct UA_SecureChannel { 00024 UA_MessageSecurityMode securityMode; 00025 UA_ChannelSecurityToken securityToken; // the channelId is contained in the securityToken 00026 UA_AsymmetricAlgorithmSecurityHeader clientAsymAlgSettings; 00027 UA_AsymmetricAlgorithmSecurityHeader serverAsymAlgSettings; 00028 UA_ByteString clientNonce; 00029 UA_ByteString serverNonce; 00030 UA_UInt32 requestId; 00031 UA_UInt32 sequenceNumber; 00032 UA_Connection *connection; 00033 LIST_HEAD(session_pointerlist, SessionEntry) sessions; 00034 }; 00035 00036 void UA_SecureChannel_init(UA_SecureChannel *channel); 00037 void UA_SecureChannel_deleteMembersCleanup(UA_SecureChannel *channel); 00038 00039 UA_StatusCode UA_SecureChannel_generateNonce(UA_ByteString *nonce); 00040 UA_StatusCode UA_SecureChannel_updateRequestId(UA_SecureChannel *channel, UA_UInt32 requestId); 00041 UA_StatusCode UA_SecureChannel_updateSequenceNumber(UA_SecureChannel *channel, UA_UInt32 sequenceNumber); 00042 00043 void UA_SecureChannel_attachSession(UA_SecureChannel *channel, UA_Session *session); 00044 void UA_SecureChannel_detachSession(UA_SecureChannel *channel, UA_Session *session); 00045 UA_Session * UA_SecureChannel_getSession(UA_SecureChannel *channel, UA_NodeId *token); 00046 00049 #endif /* UA_SECURECHANNEL_H_ */