Module: TinyDTLS::Wrapper
- Extended by:
- FFI::Library
- Defined in:
- lib/tinydtls/wrapper.rb
Overview
This module provides a low level FFI wrapper for the relevant tinydtls functions. It might be subject to change thus it is highly recommended to use the high level abstraction layer instead.
Defined Under Namespace
Classes: DTLSContextStruct, DTLSHandlerStruct, SocklenPtr
Constant Summary collapse
- DTLS_COOKIE_SECRET_LENGTH =
Constants defined as macros in the tinydtls header files
12- DTLS_MAX_BUF =
1400- Alert =
enum( :DTLS_ALERT_CLOSE_NOTIFY, 0, :DTLS_ALERT_UNEXPECTED_MESSAGE, 10, :DTLS_ALERT_BAD_RECORD_MAC, 20, :DTLS_ALERT_RECORD_OVERFLOW, 22, :DTLS_ALERT_DECOMPRESSION_FAILURE, 30, :DTLS_ALERT_HANDSHAKE_FAILURE, 40, :DTLS_ALERT_BAD_CERTIFICATE, 42, :DTLS_ALERT_UNSUPPORTED_CERTIFICATE, 43, :DTLS_ALERT_CERTIFICATE_REVOKED, 44, :DTLS_ALERT_CERTIFICATE_EXPIRED, 45, :DTLS_ALERT_CERTIFICATE_UNKNOWN, 46, :DTLS_ALERT_ILLEGAL_PARAMETER, 47, :DTLS_ALERT_UNKNOWN_CA, 48, :DTLS_ALERT_ACCESS_DENIED, 49, :DTLS_ALERT_DECODE_ERROR, 50, :DTLS_ALERT_DECRYPT_ERROR, 51, :DTLS_ALERT_PROTOCOL_VERSION, 70, :DTLS_ALERT_INSUFFICIENT_SECURITY, 71, :DTLS_ALERT_INTERNAL_ERROR, 80, :DTLS_ALERT_USER_CANCELED, 90, :DTLS_ALERT_NO_RENEGOTIATION, 100, :DTLS_ALERT_UNSUPPORTED_EXTENSION, 110 )
- LogLevel =
enum( :DTLS_LOG_EMERG, 0, :DTLS_LOG_ALERT, :DTLS_LOG_CRIT, :DTLS_LOG_WARN, :DTLS_LOG_NOTICE, :DTLS_LOG_INFO, :DTLS_LOG_DEBUG )
Class Method Summary collapse
- .dtls_alert_fatal_create(desc) ⇒ Object
- .dtls_get_app_data(ctx) ⇒ Object
- .dtls_set_handler(ctx, handler) ⇒ Object
Class Method Details
.dtls_alert_fatal_create(desc) ⇒ Object
99 100 101 |
# File 'lib/tinydtls/wrapper.rb', line 99 def self.dtls_alert_fatal_create(desc) return -((2 << 8) | desc) end |
.dtls_get_app_data(ctx) ⇒ Object
117 118 119 |
# File 'lib/tinydtls/wrapper.rb', line 117 def self.dtls_get_app_data(ctx) return ctx[:app] end |
.dtls_set_handler(ctx, handler) ⇒ Object
121 122 123 |
# File 'lib/tinydtls/wrapper.rb', line 121 def self.dtls_set_handler(ctx, handler) ctx[:h] = handler end |