summaryrefslogtreecommitdiff
path: root/lib/conn.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2013-01-24 17:31:49 +0100
committerLinus Nordberg <linus@nordberg.se>2013-01-24 17:31:49 +0100
commitabd279561b8fc63e9a8ae7c8cab5135df77bb816 (patch)
tree0e8660567e7a12d4caf0dd54e7e47d29ef1edb12 /lib/conn.c
parent0fc12902522123ec85913beac30349925b9deed8 (diff)
Add two helper functions to conn.[ch].
Diffstat (limited to 'lib/conn.c')
-rw-r--r--lib/conn.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/conn.c b/lib/conn.c
index 64c2344..7522782 100644
--- a/lib/conn.c
+++ b/lib/conn.c
@@ -61,6 +61,21 @@ conn_activate_timeout (struct rs_connection *conn)
return RSE_OK;
}
+int
+conn_type_tls (const struct rs_connection *conn)
+{
+ return conn->realm->type == RS_CONN_TYPE_TLS
+ || conn->realm->type == RS_CONN_TYPE_DTLS;
+}
+
+int
+conn_cred_psk (const struct rs_connection *conn)
+{
+ return conn->realm->transport_cred &&
+ conn->realm->transport_cred->type == RS_CRED_TLS_PSK;
+}
+
+
/* Public functions. */
int
rs_conn_create (struct rs_context *ctx,