projects
/
libradsec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0fc1290
)
Add two helper functions to conn.[ch].
author
Linus Nordberg
<linus@nordberg.se>
Thu, 24 Jan 2013 16:31:49 +0000
(17:31 +0100)
committer
Linus Nordberg
<linus@nordberg.se>
Thu, 24 Jan 2013 16:31:49 +0000
(17:31 +0100)
lib/conn.c
patch
|
blob
|
history
lib/conn.h
patch
|
blob
|
history
diff --git
a/lib/conn.c
b/lib/conn.c
index
64c2344
..
7522782
100644
(file)
--- a/
lib/conn.c
+++ b/
lib/conn.c
@@
-61,6
+61,21
@@
conn_activate_timeout (struct rs_connection *conn)
return RSE_OK;
}
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,
/* Public functions. */
int
rs_conn_create (struct rs_context *ctx,
diff --git
a/lib/conn.h
b/lib/conn.h
index
cf15b80
..
c538a8c
100644
(file)
--- a/
lib/conn.h
+++ b/
lib/conn.h
@@
-4,3
+4,5
@@
int conn_close (struct rs_connection **connp);
int conn_user_dispatch_p (const struct rs_connection *conn);
int conn_activate_timeout (struct rs_connection *conn);
int conn_close (struct rs_connection **connp);
int conn_user_dispatch_p (const struct rs_connection *conn);
int conn_activate_timeout (struct rs_connection *conn);
+int conn_type_tls (const struct rs_connection *conn);
+int conn_cred_psk (const struct rs_connection *conn);