![]() |
![]() |
![]() |
MateVFS - Filesystem Abstraction library | ![]() |
---|---|---|---|---|
Top | Description |
SSL support functionsSSL support functions — Functions to send and receive encrypted data over a socket. |
typedef MateVFSSSL; gboolean mate_vfs_ssl_enabled (void
); MateVFSResult mate_vfs_ssl_create (MateVFSSSL **handle_return
,const char *host
,unsigned int port
,MateVFSCancellation *cancellation
); MateVFSResult mate_vfs_ssl_create_from_fd (MateVFSSSL **handle_return
,gint fd
,MateVFSCancellation *cancellation
); MateVFSResult mate_vfs_ssl_read (MateVFSSSL *ssl
,gpointer buffer
,MateVFSFileSize bytes
,MateVFSFileSize *bytes_read
,MateVFSCancellation *cancellation
); MateVFSResult mate_vfs_ssl_write (MateVFSSSL *ssl
,gconstpointer buffer
,MateVFSFileSize bytes
,MateVFSFileSize *bytes_written
,MateVFSCancellation *cancellation
); void mate_vfs_ssl_destroy (MateVFSSSL *ssl
,MateVFSCancellation *cancellation
); MateVFSSocket * mate_vfs_ssl_to_socket (MateVFSSSL *ssl
); MateVFSResult mate_vfs_ssl_set_timeout (MateVFSSSL *ssl
,GTimeVal *timeout
,MateVFSCancellation *cancellation
);
gboolean mate_vfs_ssl_enabled (void
);
Checks whether mate-vfs was compiled with SSL support.
Returns : |
TRUE if mate-vfs was compiled with SSL support,
otherwise FALSE . |
MateVFSResult mate_vfs_ssl_create (MateVFSSSL **handle_return
,const char *host
,unsigned int port
,MateVFSCancellation *cancellation
);
Creates an SSL socket connection at handle_return
to host
using
port port
.
|
pointer to a MateVFSSSL struct, which will contain an allocated MateVFSSSL object on return. |
|
string indicating the hostname to establish an SSL connection with. |
|
port number to connect to. |
|
handle allowing cancellation of the operation. |
Returns : |
MateVFSResult indicating the success of the operation. |
MateVFSResult mate_vfs_ssl_create_from_fd (MateVFSSSL **handle_return
,gint fd
,MateVFSCancellation *cancellation
);
Try to establish an SSL connection over the file descriptor fd
.
|
pointer to a MateVFSSSL struct, which will contain an allocated MateVFSSSL object on return. |
|
file descriptior to try and establish an SSL connection over. |
|
handle allowing cancellation of the operation. |
Returns : |
a MateVFSResult indicating the success of the operation. |
MateVFSResult mate_vfs_ssl_read (MateVFSSSL *ssl
,gpointer buffer
,MateVFSFileSize bytes
,MateVFSFileSize *bytes_read
,MateVFSCancellation *cancellation
);
Read bytes
bytes of data from the SSL socket ssl
into buffer
.
|
SSL socket to read data from. |
|
allocated buffer of at least bytes bytes to write into. |
|
number of bytes to read from ssl into buffer . |
|
pointer to a MateVFSFileSize, will contain
the number of bytes actually read from the socket ssl on return. |
|
handle allowing cancellation of the operation. |
Returns : |
MateVFSResult indicating the success of the operation. |
MateVFSResult mate_vfs_ssl_write (MateVFSSSL *ssl
,gconstpointer buffer
,MateVFSFileSize bytes
,MateVFSFileSize *bytes_written
,MateVFSCancellation *cancellation
);
Write bytes
bytes of data from buffer
to ssl
.
|
SSL socket to write data to. |
|
data to write to the socket. |
|
number of bytes to write from buffer to ssl . |
|
pointer to a MateVFSFileSize, will contain the number of bytes actually written to the socket on return. |
|
handle allowing cancellation of the operation. |
Returns : |
MateVFSResult indicating the success of the operation. |
void mate_vfs_ssl_destroy (MateVFSSSL *ssl
,MateVFSCancellation *cancellation
);
Free resources used by ssl
and close the connection.
|
SSL socket to be closed and destroyed. |
|
handle allowing cancellation of the operation. |
MateVFSSocket * mate_vfs_ssl_to_socket (MateVFSSSL *ssl
);
Wrap an SSL socket inside a standard MateVFSSocket.
|
SSL socket to convert into a standard socket. |
Returns : |
a newly allocated MateVFSSocket corresponding to ssl . |
MateVFSResult mate_vfs_ssl_set_timeout (MateVFSSSL *ssl
,GTimeVal *timeout
,MateVFSCancellation *cancellation
);
Set a timeout of timeout
. If timeout
is NULL
following operations
will block indefinitely).
Note if you set timeout
to 0 (means tv_sec and tv_usec are both 0)
every following operation will return immediately. (This can be used
for polling.)
|
SSL socket to set the timeout of. |
|
the timeout. |
|
optional cancellation object. |
Returns : |
MateVFSResult indicating the success of the operation. |
Since 2.8