1
|
1 /*****************************************************************************/
|
|
2 /* options.h - the global variables for the program */
|
|
3 /* Copyright (C) 1998-2002 Brian Masney <masneyb@gftp.org> */
|
|
4 /* */
|
|
5 /* This program is free software; you can redistribute it and/or modify */
|
|
6 /* it under the terms of the GNU General Public License as published by */
|
|
7 /* the Free Software Foundation; either version 2 of the License, or */
|
|
8 /* (at your option) any later version. */
|
|
9 /* */
|
|
10 /* This program is distributed in the hope that it will be useful, */
|
|
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
|
13 /* GNU General Public License for more details. */
|
|
14 /* */
|
|
15 /* You should have received a copy of the GNU General Public License */
|
|
16 /* along with this program; if not, write to the Free Software */
|
|
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA */
|
|
18 /*****************************************************************************/
|
|
19
|
|
20 #include "gftp.h"
|
|
21
|
|
22 supported_gftp_protocols gftp_protocols[] =
|
|
23 {
|
|
24 {"FTP", rfc959_init, "ftp", 1},
|
|
25 {"HTTP", rfc2068_init, "http", 1},
|
|
26 {"Local", local_init, "file", 1},
|
|
27 {"SSH2", sshv2_init, "ssh2", 1},
|
|
28 {"Bookmark", bookmark_init, "bookmark", 0},
|
|
29 {"SSH", ssh_init, "ssh", 1},
|
|
30 {NULL, NULL, NULL, 0}
|
|
31 };
|
|
32
|
|
33 gftp_proxy_type proxy_type[] = {
|
|
34 {N_("none"), ""},
|
|
35 {N_("SITE command"), "USER %pu\nPASS %pp\nSITE %hh\nUSER %hu\nPASS %hp\n"},
|
|
36 {N_("user@host"), "USER %pu\nPASS %pp\nUSER %hu@%hh\nPASS %hp\n"},
|
|
37 {N_("user@host:port"), "USER %hu@%hh:%ho\nPASS %hp\n"},
|
|
38 {N_("AUTHENTICATE"), "USER %hu@%hh\nPASS %hp\nSITE AUTHENTICATE %pu\nSITE RESPONSE %pp\n"},
|
|
39 {N_("user@host port"), "USER %hu@%hh %ho\nPASS %hp\n"},
|
|
40 {N_("user@host NOAUTH"), "USER %hu@%hh\nPASS %hp\n"},
|
|
41 {N_("HTTP Proxy"), "http"},
|
|
42 {N_("Custom"), ""},
|
|
43 {NULL, NULL}
|
|
44 };
|
|
45
|
|
46 /* Most of these should be self explanatory */
|
|
47 char version[] = "gFTP " VERSION,
|
|
48 *emailaddr = NULL, /* Email address for logging in
|
|
49 anonymously */
|
|
50 *default_protocol = NULL,
|
|
51 *edit_program = NULL,
|
|
52 *view_program = NULL,
|
|
53 *firewall_host = NULL,
|
|
54 *firewall_username = NULL,
|
|
55 *firewall_password = NULL,
|
|
56 *firewall_account = NULL,
|
|
57 *proxy_config = NULL, /* The way to log into the proxy */
|
|
58 *http_proxy_host = NULL,
|
|
59 *http_proxy_username = NULL,
|
|
60 *http_proxy_password = NULL,
|
|
61 *tmp_directory = NULL,
|
|
62 *startup_directory = NULL,
|
|
63 *ssh_prog_name = NULL,
|
|
64 *ssh_extra_params = NULL,
|
|
65 **ssh_extra_params_list = NULL,
|
|
66 *ssh1_sftp_path = NULL,
|
|
67 *ssh2_sftp_path = NULL;
|
|
68 int num_ssh_extra_params;
|
|
69
|
|
70 FILE * logfd = NULL; /* Our fd to write logs to */
|
|
71
|
|
72 double maxkbs = 0.00; /* Bandwidth throttling */
|
|
73 GList * proxy_hosts = NULL, /* Our local hosts that won't need to
|
|
74 use the proxy */
|
|
75 * registered_exts = NULL, /* Registered file extensions */
|
|
76 * viewedit_processes = NULL, /* View/Edit processes that are
|
|
77 running */
|
|
78 * file_transfers = NULL, /* File transfers in progress */
|
|
79 * file_transfer_logs = NULL; /* Logs generated by other threads */
|
|
80
|
|
81 gftp_bookmarks * bookmarks = NULL;
|
|
82 GHashTable * bookmarks_htable = NULL,
|
|
83 * config_htable = NULL;
|
|
84
|
|
85 int do_one_transfer_at_a_time = 1, /* Only allow one transfer at a time.
|
|
86 The other transfers will be queued */
|
|
87 start_file_transfers = 1, /* Shall we start the file transfers? */
|
|
88 transfer_in_progress = 0, /* Any transfers transferring files? */
|
|
89 passive_transfer = 1, /* Are we sending PASV or PORT to the
|
|
90 server */
|
|
91 sort_dirs_first = 1, /* Put the dirs first when sorting */
|
|
92 use_default_dl_types = 1, /* If this is set, then files will use
|
|
93 their default dl type. For example,
|
|
94 if you set in the config file .txt
|
|
95 files to have a default option of
|
|
96 ASCII, and if this setting is set,
|
|
97 it will use ASCII. Otherwise, it
|
|
98 would use the setting in the FTP
|
|
99 menu */
|
|
100 show_hidden_files = 1, /* Show hidden files */
|
|
101 refresh_files = 0, /* Refresh the listbox after each file
|
|
102 is done */
|
|
103 listbox_local_width = 302, /* Width of the local listbox */
|
|
104 listbox_remote_width = 302, /* Width of the remote listbox */
|
|
105 listbox_file_height = 265, /* Height of the local/remote listbox */
|
|
106 transfer_height = 80, /* Height of the transfer window */
|
|
107 log_height = 105, /* Height of the logging window */
|
|
108 retries = 3, /* Number of auto-retries */
|
|
109 sleep_time = 30, /* Number of seconds to wait between
|
|
110 retries */
|
|
111 network_timeout = 120, /* Timeout on the read()s and write()s */
|
|
112 use_http11 = 1, /* Use HTTP/1.1 or HTTP/1.0 */
|
|
113 listbox_dblclick_action = 0, /* What happens when you double click in the
|
|
114 file listboxes. 0 = View, 1 = Edit,
|
|
115 2 = Download */
|
|
116 file_trans_column = 100, /* The width of the File column in the
|
|
117 listbox */
|
|
118 local_columns[6] = {0, 85, 75, 76, 120, 75}, /* The width of the local
|
|
119 file, size, user, group, date and attribs column */
|
|
120 remote_columns[6] = {0, 85, 75, 76, 120, 75}, /* The width of the remote
|
|
121 file, size, user, group, date and attribs column */
|
|
122 resolve_symlinks = 1, /* Send LIST -L or LIST to the remote ftp
|
|
123 server */
|
|
124 firewall_port = 21, /* What port to connect to for ftp? */
|
|
125 http_proxy_port = 80, /* What port to connect to for http? */
|
|
126 overwrite_by_default = 0, /* Resume file transfers or set to
|
|
127 overwrite by default */
|
|
128 append_file_transfers = 1, /* Append new file transfers onto
|
|
129 existing ones for the same
|
|
130 hostname */
|
|
131 enable_old_ssh = 0, /* Enable older SSH protocol */
|
|
132 ssh_need_userpass = 0, /* Require a user/pass for SSH
|
|
133 connections */
|
|
134 ssh_use_askpass = 0, /* Use the ssh-askpass tool to
|
|
135 grab the password. I personally
|
|
136 don't like this, but some people
|
|
137 do */
|
|
138 sshv2_use_sftp_subsys = 0; /* Call ssh -s sftp. If you set this
|
|
139 it'll automatically use the askpass
|
|
140 utility above */
|
|
141
|
|
142 guint max_log_window_size = 5000; /* Max size of the log window for the
|
|
143 GTK port */
|
|
144
|
|
145 GList * host_history = NULL,
|
|
146 * port_history = NULL,
|
|
147 * user_history = NULL,
|
|
148 * localhistory = NULL,
|
|
149 * remotehistory = NULL;
|
|
150
|
|
151 unsigned int host_len = 0,
|
|
152 port_len = 0,
|
|
153 user_len = 0,
|
|
154 localhistlen = 0,
|
|
155 remotehistlen = 0;
|
|
156
|
|
157 volatile sig_atomic_t viewedit_process_done = 0;
|
|
158
|
|
159 gftp_color send_color, recv_color, error_color, misc_color;
|
|
160
|