aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libtls/tls_socket.c7
-rw-r--r--src/libtls/tls_socket.h7
2 files changed, 14 insertions, 0 deletions
diff --git a/src/libtls/tls_socket.c b/src/libtls/tls_socket.c
index 691a8e79f..59fa309d2 100644
--- a/src/libtls/tls_socket.c
+++ b/src/libtls/tls_socket.c
@@ -175,6 +175,12 @@ METHOD(tls_socket_t, write_, bool,
return FALSE;
}
+METHOD(tls_socket_t, get_fd, int,
+ private_tls_socket_t *this)
+{
+ return this->fd;
+}
+
METHOD(tls_socket_t, destroy, void,
private_tls_socket_t *this)
{
@@ -195,6 +201,7 @@ tls_socket_t *tls_socket_create(bool is_server, identification_t *server,
.public = {
.read = _read_,
.write = _write_,
+ .get_fd = _get_fd,
.destroy = _destroy,
},
.app = {
diff --git a/src/libtls/tls_socket.h b/src/libtls/tls_socket.h
index ac714a385..413380716 100644
--- a/src/libtls/tls_socket.h
+++ b/src/libtls/tls_socket.h
@@ -55,6 +55,13 @@ struct tls_socket_t {
bool (*write)(tls_socket_t *this, chunk_t data);
/**
+ * Get the underlying file descriptor passed to the constructor.
+ *
+ * @return file descriptor
+ */
+ int (*get_fd)(tls_socket_t *this);
+
+ /**
* Destroy a tls_socket_t.
*/
void (*destroy)(tls_socket_t *this);