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
|
33
|
20 /* $Id$ */
|
|
21
|
1
|
22 #include "gftp.h"
|
|
23
|
|
24 supported_gftp_protocols gftp_protocols[] =
|
|
25 {
|
|
26 {"FTP", rfc959_init, "ftp", 1},
|
|
27 {"HTTP", rfc2068_init, "http", 1},
|
|
28 {"Local", local_init, "file", 1},
|
|
29 {"SSH2", sshv2_init, "ssh2", 1},
|
|
30 {"Bookmark", bookmark_init, "bookmark", 0},
|
|
31 {NULL, NULL, NULL, 0}
|
|
32 };
|
|
33
|
|
34 gftp_proxy_type proxy_type[] = {
|
|
35 {N_("none"), ""},
|
|
36 {N_("SITE command"), "USER %pu\nPASS %pp\nSITE %hh\nUSER %hu\nPASS %hp\n"},
|
|
37 {N_("user@host"), "USER %pu\nPASS %pp\nUSER %hu@%hh\nPASS %hp\n"},
|
|
38 {N_("user@host:port"), "USER %hu@%hh:%ho\nPASS %hp\n"},
|
|
39 {N_("AUTHENTICATE"), "USER %hu@%hh\nPASS %hp\nSITE AUTHENTICATE %pu\nSITE RESPONSE %pp\n"},
|
|
40 {N_("user@host port"), "USER %hu@%hh %ho\nPASS %hp\n"},
|
|
41 {N_("user@host NOAUTH"), "USER %hu@%hh\nPASS %hp\n"},
|
|
42 {N_("HTTP Proxy"), "http"},
|
|
43 {N_("Custom"), ""},
|
|
44 {NULL, NULL}
|
|
45 };
|
|
46
|
|
47 /* Most of these should be self explanatory */
|
|
48 char version[] = "gFTP " VERSION,
|
|
49 *emailaddr = NULL, /* Email address for logging in
|
|
50 anonymously */
|
|
51 *default_protocol = NULL,
|
|
52 *edit_program = NULL,
|
|
53 *view_program = NULL,
|
|
54 *firewall_host = NULL,
|
|
55 *firewall_username = NULL,
|
|
56 *firewall_password = NULL,
|
|
57 *firewall_account = NULL,
|
|
58 *proxy_config = NULL, /* The way to log into the proxy */
|
|
59 *http_proxy_host = NULL,
|
|
60 *http_proxy_username = NULL,
|
|
61 *http_proxy_password = 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 show_hidden_files = 1, /* Show hidden files */
|
|
93 refresh_files = 0, /* Refresh the listbox after each file
|
|
94 is done */
|
|
95 listbox_local_width = 302, /* Width of the local listbox */
|
|
96 listbox_remote_width = 302, /* Width of the remote listbox */
|
|
97 listbox_file_height = 265, /* Height of the local/remote listbox */
|
|
98 transfer_height = 80, /* Height of the transfer window */
|
|
99 log_height = 105, /* Height of the logging window */
|
|
100 retries = 3, /* Number of auto-retries */
|
|
101 sleep_time = 30, /* Number of seconds to wait between
|
|
102 retries */
|
|
103 network_timeout = 120, /* Timeout on the read()s and write()s */
|
|
104 use_http11 = 1, /* Use HTTP/1.1 or HTTP/1.0 */
|
|
105 listbox_dblclick_action = 0, /* What happens when you double click in the
|
|
106 file listboxes. 0 = View, 1 = Edit,
|
|
107 2 = Download */
|
|
108 file_trans_column = 100, /* The width of the File column in the
|
|
109 listbox */
|
|
110 local_columns[6] = {0, 85, 75, 76, 120, 75}, /* The width of the local
|
|
111 file, size, user, group, date and attribs column */
|
|
112 remote_columns[6] = {0, 85, 75, 76, 120, 75}, /* The width of the remote
|
|
113 file, size, user, group, date and attribs column */
|
|
114 resolve_symlinks = 1, /* Send LIST -L or LIST to the remote ftp
|
|
115 server */
|
|
116 firewall_port = 21, /* What port to connect to for ftp? */
|
|
117 http_proxy_port = 80, /* What port to connect to for http? */
|
|
118 overwrite_by_default = 0, /* Resume file transfers or set to
|
|
119 overwrite by default */
|
|
120 append_file_transfers = 1, /* Append new file transfers onto
|
|
121 existing ones for the same
|
|
122 hostname */
|
|
123 ssh_need_userpass = 0, /* Require a user/pass for SSH
|
|
124 connections */
|
|
125 ssh_use_askpass = 0, /* Use the ssh-askpass tool to
|
|
126 grab the password. I personally
|
|
127 don't like this, but some people
|
|
128 do */
|
37
|
129 sshv2_use_sftp_subsys = 0, /* Call ssh -s sftp. If you set this
|
1
|
130 it'll automatically use the askpass
|
|
131 utility above */
|
37
|
132 local_sortcol = 1,
|
|
133 local_sortasds = 1,
|
|
134 remote_sortcol = 1,
|
|
135 remote_sortasds = 1;
|
|
136
|
1
|
137
|
|
138 guint max_log_window_size = 5000; /* Max size of the log window for the
|
|
139 GTK port */
|
|
140
|
|
141 GList * host_history = NULL,
|
|
142 * port_history = NULL,
|
|
143 * user_history = NULL,
|
|
144 * localhistory = NULL,
|
|
145 * remotehistory = NULL;
|
|
146
|
|
147 unsigned int host_len = 0,
|
|
148 port_len = 0,
|
|
149 user_len = 0,
|
|
150 localhistlen = 0,
|
|
151 remotehistlen = 0;
|
|
152
|
|
153 volatile sig_atomic_t viewedit_process_done = 0;
|
|
154
|
|
155 gftp_color send_color, recv_color, error_color, misc_color;
|
|
156
|