}
void setup_config_box(struct controlbox *b, struct sesslist *sesslist,
- int midsession, int protocol)
+ int midsession, int protocol, int protcfginfo)
{
struct controlset *s;
struct sessionsaver_data *ssd;
/*
* The Connection/SSH/Kex panel. (Owing to repeat key
- * exchange, this is all meaningful in mid-session.)
+ * exchange, this is all meaningful in mid-session _if_
+ * we're using SSH2 or haven't decided yet.)
*/
- ctrl_settitle(b, "Connection/SSH/Kex",
- "Options controlling SSH key exchange");
-
- s = ctrl_getset(b, "Connection/SSH/Kex", "main",
- "Key exchange algorithm options");
- c = ctrl_draglist(s, "Algorithm selection policy", 's',
- HELPCTX(ssh_kexlist),
- kexlist_handler, P(NULL));
- c->listbox.height = 5;
-
- s = ctrl_getset(b, "Connection/SSH/Kex", "repeat",
- "Options controlling key re-exchange");
-
- ctrl_editbox(s, "Max minutes before rekey (0 for no limit)", 't', 20,
- HELPCTX(ssh_kex_repeat),
- dlg_stdeditbox_handler,
- I(offsetof(Config,ssh_rekey_time)),
- I(-1));
- ctrl_editbox(s, "Max data before rekey (0 for no limit)", 'x', 20,
- HELPCTX(ssh_kex_repeat),
- dlg_stdeditbox_handler,
- I(offsetof(Config,ssh_rekey_data)),
- I(16));
- ctrl_text(s, "(Use 1M for 1 megabyte, 1G for 1 gigabyte etc)",
- HELPCTX(ssh_kex_repeat));
+ if (protcfginfo != 1) {
+ ctrl_settitle(b, "Connection/SSH/Kex",
+ "Options controlling SSH key exchange");
+
+ s = ctrl_getset(b, "Connection/SSH/Kex", "main",
+ "Key exchange algorithm options");
+ c = ctrl_draglist(s, "Algorithm selection policy", 's',
+ HELPCTX(ssh_kexlist),
+ kexlist_handler, P(NULL));
+ c->listbox.height = 5;
+
+ s = ctrl_getset(b, "Connection/SSH/Kex", "repeat",
+ "Options controlling key re-exchange");
+
+ ctrl_editbox(s, "Max minutes before rekey (0 for no limit)", 't', 20,
+ HELPCTX(ssh_kex_repeat),
+ dlg_stdeditbox_handler,
+ I(offsetof(Config,ssh_rekey_time)),
+ I(-1));
+ ctrl_editbox(s, "Max data before rekey (0 for no limit)", 'x', 20,
+ HELPCTX(ssh_kex_repeat),
+ dlg_stdeditbox_handler,
+ I(offsetof(Config,ssh_rekey_data)),
+ I(16));
+ ctrl_text(s, "(Use 1M for 1 megabyte, 1G for 1 gigabyte etc)",
+ HELPCTX(ssh_kex_repeat));
+ }
if (!midsession) {
-/* $Id: macdlg.c,v 1.18 2003/04/05 15:01:16 ben Exp $ */
+/* $Id$ */
/*
* Copyright (c) 2002 Ben Harris
* All rights reserved.
get_sesslist(&sesslist, TRUE);
s->ctrlbox = ctrl_new_box();
- setup_config_box(s->ctrlbox, &sesslist, FALSE, 0);
+ setup_config_box(s->ctrlbox, &sesslist, FALSE, 0, 0);
s->settings_ctrls.data = &s->cfg;
s->settings_ctrls.end = &mac_enddlg;
* buffer is clearing.
*/
void (*unthrottle) (void *handle, int);
+ int (*cfg_info) (void *handle);
int default_port;
};
*/
struct controlbox;
void setup_config_box(struct controlbox *b, struct sesslist *sesslist,
- int midsession, int protocol);
+ int midsession, int protocol, int protcfginfo);
/*
* Exports from minibidi.c.
return 0;
}
+/*
+ * cfg_info for Raw does nothing at all.
+ */
+static int raw_cfg_info(void *handle)
+{
+ return 0;
+}
+
Backend raw_backend = {
raw_init,
raw_free,
raw_provide_ldisc,
raw_provide_logctx,
raw_unthrottle,
+ raw_cfg_info,
1
};
return 0;
}
+/*
+ * cfg_info for rlogin does nothing at all.
+ */
+static int rlogin_cfg_info(void *handle)
+{
+ return 0;
+}
+
Backend rlogin_backend = {
rlogin_init,
rlogin_free,
rlogin_provide_ldisc,
rlogin_provide_logctx,
rlogin_unthrottle,
+ rlogin_cfg_info,
1
};
}
/*
+ * cfg_info for SSH is the currently running version of the
+ * protocol. (1 for 1; 2 for 2; 0 for not-decided-yet.)
+ */
+static int ssh_cfg_info(void *handle)
+{
+ Ssh ssh = (Ssh) handle;
+ return ssh->version;
+}
+
+/*
* Gross hack: pscp will try to start SFTP but fall back to scp1 if
* that fails. This variable is the means by which scp.c can reach
* into the SSH code and find out which one it got.
ssh_provide_ldisc,
ssh_provide_logctx,
ssh_unthrottle,
+ ssh_cfg_info,
22
};
return 0;
}
+/*
+ * cfg_info for Telnet does nothing at all.
+ */
+static int telnet_cfg_info(void *handle)
+{
+ return 0;
+}
+
Backend telnet_backend = {
telnet_init,
telnet_free,
telnet_provide_ldisc,
telnet_provide_logctx,
telnet_unthrottle,
+ telnet_cfg_info,
23
};
-/* $Id: testback.c,v 1.10 2004/06/20 17:07:32 jacob Exp $ */
+/* $Id$ */
/*
* Copyright (c) 1999 Simon Tatham
* Copyright (c) 1999 Ben Harris
Backend null_backend = {
null_init, null_free, null_reconfig, null_send, null_sendbuffer, null_size,
null_special, null_get_specials, null_socket, null_exitcode, null_sendok,
- null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle, 0
+ null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
+ null_cfg_info, 0
};
Backend loop_backend = {
loop_init, loop_free, null_reconfig, loop_send, null_sendbuffer, null_size,
null_special, null_get_specials, null_socket, null_exitcode, null_sendok,
- null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle, 0
+ null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
+ null_cfg_info, 0
};
struct loop_state {
}
+static int null_cfg_info(void *handle)
+{
+ return 0;
+}
+
+
/*
* Emacs magic:
* Local Variables:
return req.height;
}
-int do_config_box(const char *title, Config *cfg, int midsession)
+int do_config_box(const char *title, Config *cfg, int midsession,
+ int protcfginfo)
{
GtkWidget *window, *hbox, *vbox, *cols, *label,
*tree, *treescroll, *panels, *panelvbox;
window = gtk_dialog_new();
ctrlbox = ctrl_new_box();
- setup_config_box(ctrlbox, &sl, midsession, cfg->protocol);
+ setup_config_box(ctrlbox, &sl, midsession, cfg->protocol, protcfginfo);
unix_setup_config_box(ctrlbox, midsession, window);
gtk_window_set_title(GTK_WINDOW(window), title);
cfg2 = inst->cfg; /* structure copy */
- if (do_config_box(title, &cfg2, 1)) {
+ if (do_config_box(title, &cfg2, 1,
+ inst->back?inst->back->cfg_info(inst->backhandle):0)) {
oldcfg = inst->cfg; /* structure copy */
inst->cfg = cfg2; /* structure copy */
return pty_exit_code;
}
+static int pty_cfg_info(void *handle)
+{
+ return 0;
+}
+
Backend pty_backend = {
pty_init,
pty_free,
pty_provide_ldisc,
pty_provide_logctx,
pty_unthrottle,
+ pty_cfg_info,
1
};
void *get_window(void *frontend); /* void * to avoid depending on gtk.h */
/* Things pterm.c needs from gtkdlg.c */
-int do_config_box(const char *title, Config *cfg, int midsession);
+int do_config_box(const char *title, Config *cfg,
+ int midsession, int protcfginfo);
void fatal_message_box(void *window, char *msg);
void about_box(void *window);
void *eventlogstuff_new(void);
int cfgbox(Config *cfg)
{
- return do_config_box("PuTTY Configuration", cfg, 0);
+ return do_config_box("PuTTY Configuration", cfg, 0, 0);
}
static int got_host = 0;
int ret;
ctrlbox = ctrl_new_box();
- setup_config_box(ctrlbox, &sesslist, FALSE, 0);
+ setup_config_box(ctrlbox, &sesslist, FALSE, 0, 0);
win_setup_config_box(ctrlbox, &dp.hwnd, (help_path != NULL), FALSE);
dp_init(&dp);
winctrl_init(&ctrls_base);
return ret;
}
-int do_reconfig(HWND hwnd)
+int do_reconfig(HWND hwnd, int protcfginfo)
{
Config backup_cfg;
int ret;
backup_cfg = cfg; /* structure copy */
ctrlbox = ctrl_new_box();
- setup_config_box(ctrlbox, &sesslist, TRUE, cfg.protocol);
+ setup_config_box(ctrlbox, &sesslist, TRUE, cfg.protocol, protcfginfo);
win_setup_config_box(ctrlbox, &dp.hwnd, (help_path != NULL), TRUE);
dp_init(&dp);
winctrl_init(&ctrls_base);
GetWindowText(hwnd, cfg.wintitle, sizeof(cfg.wintitle));
prev_cfg = cfg;
- if (!do_reconfig(hwnd))
+ if (!do_reconfig(hwnd, back ? back->cfg_info(backhandle) : 0))
break;
{
*/
void defuse_showwindow(void);
int do_config(void);
-int do_reconfig(HWND);
+int do_reconfig(HWND, int);
void showeventlog(HWND);
void showabout(HWND);
void force_normal(HWND hwnd);