summaryrefslogtreecommitdiff
path: root/lib/conn.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/conn.c')
-rw-r--r--lib/conn.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/conn.c b/lib/conn.c
index 90f1e61..815784f 100644
--- a/lib/conn.c
+++ b/lib/conn.c
@@ -61,6 +61,23 @@ conn_activate_timeout (struct rs_connection *conn)
return RSE_OK;
}
+int
+conn_type_tls (const struct rs_connection *conn)
+{
+ assert (conn->active_peer);
+ return conn->realm->type == RS_CONN_TYPE_TLS
+ || conn->realm->type == RS_CONN_TYPE_DTLS;
+}
+
+int
+conn_cred_psk (const struct rs_connection *conn)
+{
+ assert (conn->active_peer);
+ return conn->active_peer->transport_cred &&
+ conn->active_peer->transport_cred->type == RS_CRED_TLS_PSK;
+}
+
+
/* Public functions. */
int
rs_conn_create (struct rs_context *ctx,