]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Added a getter for the tls_socket file descriptor
authorMartin Willi <martin@revosec.ch>
Sat, 24 Dec 2011 10:02:57 +0000 (11:02 +0100)
committerMartin Willi <martin@revosec.ch>
Sat, 24 Dec 2011 11:42:25 +0000 (12:42 +0100)
src/libtls/tls_socket.c
src/libtls/tls_socket.h

index 691a8e79f0428016199e8874292bf7a797642df2..59fa309d2d52f290bcecea446fe125b93fae307f 100644 (file)
@@ -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 = {
index ac714a3853ccdedf6fa4d145c721561739ac22ec..4133807160c919f0c6de550b7a67b02509baddba 100644 (file)
@@ -54,6 +54,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.
         */