CmpTlsClose (FUN) ¶ FUNCTION CmpTlsClose : RTS_IEC_RESULT lose the TLS connection. All data will be cleand up. The handle used for creating the connection will be closed too. No shutdown is done here. This is allowed by the TLS protocol. InOut: Scope Name Type Comment Return CmpTlsClose RTS_IEC_RESULT Result of this operation. May be one of these values: ERR_OK: No error. Everything worked as expected. ERR_FAILED: Unknown error. Input hTlsConn RTS_IEC_HANDLE Handle of the TLS connection, created with one of the TLSxxxOpen functions
CmpTlsConnect (FUN) ¶ FUNCTION CmpTlsConnect : RTS_IEC_RESULT Starts handshaking on the client side. This data is likley to read and write data. InOut: Scope Name Type Comment Return CmpTlsConnect RTS_IEC_RESULT Result of this operation. May be one of these values: ERR_OK: No error. Everything worked as expected. ERR_NOTINITIALIZED: The TLS component was not initialized proberly. ERR_TLS_CONNECTION_CLOSED: The TLS connection is closed. Use TlsShutdown to shutdown locally. ERR_TLS_WANT_READ: The operation needs TO read data FROM the IO system. There is no data available. ERR_TLS_WANT_WRITE: The operation needs to write data to the IO system. This is not possible. ERR_TLS_RETRY_OPERATION: Something went wrong. Try the same function call again ERR_TLS_IO_SYSTEM: An error in the unterlaying IO system. ERR_TLS_INTERNAL: An internal Error of the TLS Component ERR_FAILED: Unknown error. Input hTlsConn RTS_IEC_HANDLE Handle of the TLS connection, created with one of the TLSNewConn functions
CmpTlsCreateContext (FUN) ¶ FUNCTION CmpTlsCreateContext : RTS_IEC_HANDLE This function create a TLS context. This context is needed to perform TLS communication using the SysSocket2 library. The context contains all informaiton how to handle this TLS connection. InOut: Scope Name Type Initial Comment Return CmpTlsCreateContext RTS_IEC_HANDLE Handle to the new accepted socket or RTS_INVALID_HANDLE if failed. Input hCert RTS_IEC_HANDLE RTS_INVALID_HANDLE Handle to a certificate. The private key of this certificate has to be available. Can be RTS_INVALID_HANDLE for client connections. If the server requires a client certificate the connection will fail in these case. tlsMethod CmpTls_Interfaces.CmpTlsMethod Protocol version and role in the communication. TLS1.2 is suggested for new implementations. Default will be TLS1.2 client. cipherList POINTER TO STRING 0 Allowed chipers used by this connection. Leave 0 to get default. Default will result in ciphers with HIGH encryption strength and Diffie Hellman key exchange. verifyMode DWORD Set up how to verify the peer. The settings differ between client and server. See CmpTlsVerifyMode for details. Default results in: Client -> Verify the peer. Server -> Do not Verify Peer The options of CmpTlsConstans can be combined by adding them. pResult POINTER TO RTS_IEC_RESULT Operations Result
CmpTlsCreateContext2 (FUN) ¶ FUNCTION CmpTlsCreateContext2 : RTS_IEC_HANDLE This function create a TLS context. This context is needed to perform TLS communication using the SysSocket2 library. The context contains all informaiton how to handle this TLS connection. InOut: Scope Name Type Initial Comment Return CmpTlsCreateContext2 RTS_IEC_HANDLE Handle to the new accepted socket or RTS_INVALID_HANDLE if failed. Input hCert RTS_IEC_HANDLE RTS_INVALID_HANDLE Handle to a certificate. The private key of this certificate has to be available. Can be RTS_INVALID_HANDLE for client connections. If the server requires a client certificate the connection will fail in these case. tlsMethod CmpTls_Interfaces.CmpTlsMethod Protocol version and role in the communication. TLS1.2 is suggested for new implementations. Default will be TLS1.2 client. cipherList POINTER TO STRING 0 Allowed chipers used by this connection. Leave 0 to get default. Default will result in ciphers with HIGH encryption strength and Diffie Hellman key exchange. verifyMode DWORD Set up how to verify the peer. The settings differ between client and server. See CmpTlsVerifyMode for details. Default results in: Client -> Verify the peer. Server -> Do not Verify Peer The options of CmpTlsConstans can be combined by adding them. verifyCallback CmpTls_Interfaces.IVerifyCertCallback This callback is called after the pre verification of the peers certificate. All possible checks (validity, trust chain, etc.) have been done already. The result of this check is passed to the callback. The callback allows to do futher checks (e.g. check the certificate host name, key usage etc.) depending on the use case of the connection. pResult POINTER TO RTS_IEC_RESULT Operations Result
CmpTlsFreeContext (FUN) ¶ FUNCTION CmpTlsFreeContext : RTS_IEC_RESULT This function cleans up the TLS context created with CmpTlsCreateContext. InOut: Scope Name Type Comment Return CmpTlsFreeContext RTS_IEC_RESULT Input hTlsContext RTS_IEC_HANDLE Handle to the context to clean up
CmpSrv Library Documentation ¶ Company System Title CmpSrv Version 3.5.17.0 Categories System|SysLibs Author 3S - Smart Software Solutions GmbH Placeholder CmpSrv Description 1 ¶ This library provides access to level 7 services from IEC. Contents: ¶ ComponentId (GVL) EventParameter EVTPARAM_CmpSrv (Struct) EventIDs (GVL) Structs HEADER_TAG (Struct) PROTOCOL_DATA_UNIT (Struct) SERVICEHANDLER_PARAMETER (Struct) Indices and tables ¶ 1 Based on CmpSrv.library, last modified 20.04.2021, 15:56:12. LibDoc 4.4.0.0-b.27 The content file CmpSrv.clean.json was generated with CODESYS V3.5 SP16 Patch 3 on 20.04.2021, 15:56:12.
ComponentId (GVL) ¶ InOut: Scope Name Type Initial Constant CMPID_CmpSrv UDINT 16#1C
EventParameter ¶ EVTPARAM_CmpSrv (Struct) EventIDs (GVL)
EVTPARAM_CmpSrv (STRUCT) ¶ TYPE EVTPARAM_CmpSrv : STRUCT <category>Event parameter</category> <element name=”pServiceHandlerParameter” type=”IN”>Pointer to service handler structure</element> InOut: Name Type pServiceHandlerParameter POINTER TO SERVICEHANDLER_PARAMETER
Structs ¶ HEADER_TAG (Struct) PROTOCOL_DATA_UNIT (Struct) SERVICEHANDLER_PARAMETER (Struct)