summaryrefslogtreecommitdiff
path: root/daemon/gvfsftpconnection.h
blob: f1ddab34ff41b5764edab5feb43554d08c7a547f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/* GIO - GLib Input, Output and Streaming Library
 *
 * Copyright (C) 2009 Benjamin Otte <otte@gnome.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 * Author: Benjamin Otte <otte@gnome.org>
 */

#ifndef __G_VFS_FTP_CONNECTION_H__
#define __G_VFS_FTP_CONNECTION_H__

#include <gio/gio.h>

G_BEGIN_DECLS


typedef struct _GVfsFtpConnection GVfsFtpConnection;

typedef gboolean      (*CertificateCallback)                  (GTlsConnection *         conn,
                                                               GTlsCertificate *        peer_cert,
                                                               GTlsCertificateFlags     errors,
                                                               gpointer                 user_data);

GVfsFtpConnection *     g_vfs_ftp_connection_new              (GSocketConnectable *     addr,
                                                               GCancellable *           cancellable,
                                                               GError **                error);
void                    g_vfs_ftp_connection_free             (GVfsFtpConnection *      conn);

gboolean                g_vfs_ftp_connection_send             (GVfsFtpConnection *      conn,
                                                               const char *             command,
                                                               int                      len,
                                                               GCancellable *           cancellable,
                                                               GError **                error);
guint                   g_vfs_ftp_connection_receive          (GVfsFtpConnection *      conn,
                                                               char ***                 reply,
                                                               GCancellable *           cancellable,
                                                               GError **                error);

gboolean                g_vfs_ftp_connection_is_usable        (GVfsFtpConnection *      conn);
GSocketAddress *        g_vfs_ftp_connection_get_address      (GVfsFtpConnection *      conn,
                                                               GError **                error);
guint                   g_vfs_ftp_connection_get_debug_id     (GVfsFtpConnection *      conn);

gboolean                g_vfs_ftp_connection_open_data_connection
                                                              (GVfsFtpConnection *      conn,
                                                               GSocketAddress *         addr,
                                                               GCancellable *           cancellable,
                                                               GError **                error);
GSocketAddress *        g_vfs_ftp_connection_listen_data_connection
                                                              (GVfsFtpConnection *      conn,
                                                               GError **                error);
gboolean                g_vfs_ftp_connection_accept_data_connection
                                                              (GVfsFtpConnection *      conn,
                                                               GCancellable *           cancellable,
                                                               GError **                error);
void                    g_vfs_ftp_connection_close_data_connection
                                                              (GVfsFtpConnection *      conn);
GIOStream *             g_vfs_ftp_connection_get_data_stream  (GVfsFtpConnection *      conn);

gboolean                g_vfs_ftp_connection_enable_tls       (GVfsFtpConnection *      conn,
                                                               GSocketConnectable *     server_identity,
                                                               CertificateCallback      cb,
                                                               gpointer                 user_data,
                                                               GCancellable *           cancellable,
                                                               GError **                error);
gboolean                g_vfs_ftp_connection_data_connection_enable_tls (GVfsFtpConnection  *conn,
                                                                         GSocketConnectable *server_identity,
                                                                         CertificateCallback cb,
                                                                         gpointer            user_data,
                                                                         GCancellable *      cancellable,
                                                                         GError **           error);



G_END_DECLS

#endif /* __G_VFS_FTP_CONNECTION_H__ */