1 /* Declarations for FTP support.
2 Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
4 This file is part of GNU Wget.
6 GNU Wget is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 GNU Wget is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Wget; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 In addition, as a special exception, the Free Software Foundation
21 gives permission to link the code of its release of Wget with the
22 OpenSSL project's "OpenSSL" library (or with modified versions of it
23 that use the same license as the "OpenSSL" library), and distribute
24 the linked executables. You must obey the GNU General Public License
25 in all respects for all of the code used other than "OpenSSL". If you
26 modify this file, you may extend this exception to your version of the
27 file, but you are not obligated to do so. If you do not wish to do
28 so, delete this exception statement from your version. */
46 uerr_t ftp_response (int, char **);
47 uerr_t ftp_login (int, const char *, const char *);
48 uerr_t ftp_port (int, int *);
49 uerr_t ftp_pasv (int, ip_address *, int *);
51 uerr_t ftp_lprt (int, int *);
52 uerr_t ftp_lpsv (int, ip_address *, int *);
53 uerr_t ftp_eprt (int, int *);
54 uerr_t ftp_epsv (int, ip_address *, int *);
56 uerr_t ftp_type (int, int);
57 uerr_t ftp_cwd (int, const char *);
58 uerr_t ftp_retr (int, const char *);
59 uerr_t ftp_rest (int, wgint);
60 uerr_t ftp_list (int, const char *);
61 uerr_t ftp_syst (int, enum stype *);
62 uerr_t ftp_pwd (int, char **);
63 uerr_t ftp_size (int, const char *, wgint *);
66 const char *skey_response (int, const char *, const char *);
81 /* Globbing (used by ftp_retrieve_glob). */
84 GLOB_GLOBALL, GLOB_GETALL, GLOB_GETONE
87 /* Information about one filename in a linked list. */
90 enum ftype type; /* file type */
91 char *name; /* file name */
92 wgint size; /* file size */
93 long tstamp; /* time-stamp */
94 int perms; /* file permissions */
95 char *linkto; /* link to which file points */
96 struct fileinfo *prev; /* previous... */
97 struct fileinfo *next; /* ...and next structure. */
100 /* Commands for FTP functions. */
101 enum wget_ftp_command
103 DO_LOGIN = 0x0001, /* Connect and login to the server. */
104 DO_CWD = 0x0002, /* Change current directory. */
105 DO_RETR = 0x0004, /* Retrieve the file. */
106 DO_LIST = 0x0008, /* Retrieve the directory list. */
107 LEAVE_PENDING = 0x0010 /* Do not close the socket. */
110 enum wget_ftp_fstatus
112 NOTHING = 0x0000, /* Nothing done yet. */
113 ON_YOUR_OWN = 0x0001, /* The ftp_loop_internal sets the
115 DONE_CWD = 0x0002 /* The current working directory is
119 struct fileinfo *ftp_parse_ls (const char *, const enum stype);
120 uerr_t ftp_loop (struct url *, int *, struct url *);
122 uerr_t ftp_index (const char *, struct url *, struct fileinfo *);
124 char ftp_process_type (const char *);