summaryrefslogtreecommitdiff
path: root/src/libpttls/pt_tls.h
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-11-01 13:32:07 +0100
committerYves-Alexis Perez <corsac@debian.org>2013-11-01 13:32:07 +0100
commit5313d2d78ca150515f7f5eb39801c100690b6b29 (patch)
treec78e420367283bb1b16f14210b12687cdfbd26eb /src/libpttls/pt_tls.h
parent6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349 (diff)
downloadvyos-strongswan-5313d2d78ca150515f7f5eb39801c100690b6b29.tar.gz
vyos-strongswan-5313d2d78ca150515f7f5eb39801c100690b6b29.zip
Imported Upstream version 5.1.1
Diffstat (limited to 'src/libpttls/pt_tls.h')
-rw-r--r--src/libpttls/pt_tls.h25
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_ @}*/