diff options
Diffstat (limited to 'src/libpttls/pt_tls.h')
-rw-r--r-- | src/libpttls/pt_tls.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/libpttls/pt_tls.h b/src/libpttls/pt_tls.h index 92a040f3f..275dc89e9 100644 --- a/src/libpttls/pt_tls.h +++ b/src/libpttls/pt_tls.h @@ -37,6 +37,16 @@ */ #define PT_TLS_HEADER_LEN 16 +/** + * Maximum size of a PT-TLS message + */ +#define PT_TLS_MAX_MESSAGE_LEN 8 * TLS_MAX_FRAGMENT_LEN - PT_TLS_HEADER_LEN + +/** + * Default PT-TLS port + */ +#define PT_TLS_PORT 271 + typedef enum pt_tls_message_type_t pt_tls_message_type_t; typedef enum pt_tls_sasl_result_t pt_tls_sasl_result_t; typedef enum pt_tls_auth_t pt_tls_auth_t; @@ -56,6 +66,8 @@ enum pt_tls_message_type_t { PT_TLS_ERROR = 8, }; +extern enum_name_t *pt_tls_message_type_names; + /** * Result code for a single SASL mechansim, as sent in PT_TLS_SASL_RESULT */ @@ -66,6 +78,8 @@ enum pt_tls_sasl_result_t { PT_TLS_SASL_RESULT_MECH_FAILURE = 3, }; +extern enum_name_t *pt_tls_sasl_result_names; + /** * Client authentication to require as PT-TLS server. */ @@ -98,12 +112,17 @@ bio_reader_t* pt_tls_read(tls_socket_t *tls, u_int32_t *vendor, * Prepend a PT-TLS header to a writer, send data, destroy writer. * * @param tls TLS socket to write to - * @param writer prepared Message value to write * @param type Message Type to write * @param identifier Message Identifier to write + * @param data Message value to write * @return TRUE if data written successfully */ -bool pt_tls_write(tls_socket_t *tls, bio_writer_t *writer, - pt_tls_message_type_t type, u_int32_t identifier); +bool pt_tls_write(tls_socket_t *tls, pt_tls_message_type_t type, + u_int32_t identifier, chunk_t data); + +/** + * Dummy libpttls initialization function needed for integrity test + */ +void libpttls_init(void); #endif /** PT_TLS_H_ @}*/ |