70
70
#define LATTR_TOP 0x00000002UL
71
71
#define LATTR_BOT 0x00000003UL
72
72
#define LATTR_MODE 0x00000003UL
73
#define LATTR_WRAPPED 0x00000010UL
74
#define LATTR_WRAPPED2 0x00000020UL
73
#define LATTR_WRAPPED 0x00000010UL /* this line wraps to next */
74
#define LATTR_WRAPPED2 0x00000020UL /* with WRAPPED: CJK wide character
75
wrapped to next line, so last
76
single-width cell is empty */
76
78
#define ATTR_INVALID 0x03FFFFU
161
163
#define LGTYP_ASCII 1 /* logmode: pure ascii */
162
164
#define LGTYP_DEBUG 2 /* logmode: all chars of traffic */
163
165
#define LGTYP_PACKETS 3 /* logmode: SSH data packets */
166
#define LGTYP_SSHRAW 4 /* logmode: SSH raw data */
166
169
/* Actual special commands. Originally Telnet, but some codes have
301
/* Actions on remote window title query */
302
TITLE_NONE, TITLE_EMPTY, TITLE_REAL
297
306
/* Protocol back ends. (cfg.protocol) */
298
PROT_RAW, PROT_TELNET, PROT_RLOGIN, PROT_SSH
307
PROT_RAW, PROT_TELNET, PROT_RLOGIN, PROT_SSH,
308
/* PROT_SERIAL is supported on a subset of platforms, but it doesn't
309
* hurt to define it globally. */
339
FQ_DEFAULT, FQ_ANTIALIASED, FQ_NONANTIALIASED, FQ_CLEARTYPE
343
SER_PAR_NONE, SER_PAR_ODD, SER_PAR_EVEN, SER_PAR_MARK, SER_PAR_SPACE
347
SER_FLOW_NONE, SER_FLOW_XONXOFF, SER_FLOW_RTSCTS, SER_FLOW_DSRDTR
350
extern const char *const ttymodes[];
328
354
* Network address types. Used for specifying choice of IPv4/v6
329
355
* in config; also used in proxy.c to indicate whether a given
348
374
void (*size) (void *handle, int width, int height);
349
375
void (*special) (void *handle, Telnet_Special code);
350
376
const struct telnet_special *(*get_specials) (void *handle);
351
Socket(*socket) (void *handle);
377
int (*connected) (void *handle);
352
378
int (*exitcode) (void *handle);
379
/* If back->sendok() returns FALSE, data sent to it from the frontend
353
381
int (*sendok) (void *handle);
354
382
int (*ldisc) (void *handle, int);
355
383
void (*provide_ldisc) (void *handle, void *ldisc);
412
440
char proxy_telnet_command[512];
413
441
/* SSH options */
414
442
char remote_cmd[512];
415
char remote_cmd2[512]; /* fallback if the first fails
416
* (used internally for scp) */
417
443
char *remote_cmd_ptr; /* might point to a larger command
418
444
* but never for loading/saving */
419
445
char *remote_cmd_ptr2; /* might point to a larger command
423
449
int ssh_kexlist[KEX_MAX];
424
450
int ssh_rekey_time; /* in minutes */
425
451
char ssh_rekey_data[16];
427
454
int change_username; /* allow username switching in SSH-2 */
428
455
int ssh_cipherlist[CIPHER_MAX];
429
456
Filename keyfile;
430
457
int sshprot; /* use v1 or v2 when both available */
431
458
int ssh2_des_cbc; /* "des-cbc" unrecommended SSH-2 cipher */
459
int ssh_no_userauth; /* bypass "ssh-userauth" (SSH-2 only) */
432
460
int try_tis_auth;
434
462
int ssh_subsys; /* run a subsystem rather than a command */
435
int ssh_subsys2; /* fallback to go with remote_cmd2 */
463
int ssh_subsys2; /* fallback to go with remote_cmd_ptr2 */
436
464
int ssh_no_shell; /* avoid running a shell */
465
char ssh_nc_host[512]; /* host to connect to in `nc' mode */
466
int ssh_nc_port; /* port to connect to in `nc' mode */
437
467
/* Telnet options */
438
468
char termtype[32];
439
469
char termspeed[32];
470
char ttymodes[768]; /* MODE\tVvalue\0MODE\tA\0\0 */
440
471
char environmt[1024]; /* VAR\tvalue\0VAR\tvalue\0\0 */
441
472
char username[100];
442
473
char localusername[100];
444
475
int passive_telnet;
476
/* Serial port options */
479
int serdatabits, serstopbits;
445
482
/* Keyboard options */
446
483
int bksp_is_delete;
447
484
int rxvt_homeend;
454
491
int no_remote_wintitle; /* disable remote retitling */
455
492
int no_dbackspace; /* disable destructive backspace */
456
493
int no_remote_charset; /* disable remote charset config */
457
int no_remote_qtitle; /* disable remote win title query */
494
int remote_qtitle_action; /* remote win title query action */
460
497
int nethack_keypad;
605
643
struct RSAKey; /* be a little careful of scope */
608
* Exports from window.c.
646
* Mechanism for getting text strings such as usernames and passwords
647
* from the front-end.
648
* The fields are mostly modelled after SSH's keyboard-interactive auth.
649
* FIXME We should probably mandate a character set/encoding (probably UTF-8).
651
* Since many of the pieces of text involved may be chosen by the server,
652
* the caller must take care to ensure that the server can't spoof locally-
653
* generated prompts such as key passphrase prompts. Some ground rules:
654
* - If the front-end needs to truncate a string, it should lop off the
656
* - The front-end should filter out any dangerous characters and
657
* generally not trust the strings. (But \n is required to behave
658
* vaguely sensibly, at least in `instruction', and ideally in
664
char *result; /* allocated/freed by caller */
669
* Indicates whether the information entered is to be used locally
670
* (for instance a key passphrase prompt), or is destined for the wire.
671
* This is a hint only; the front-end is at liberty not to use this
672
* information (so the caller should ensure that the supplied text is
676
char *name; /* Short description, perhaps for dialog box title */
677
int name_reqd; /* Display of `name' required or optional? */
678
char *instruction; /* Long description, maybe with embedded newlines */
679
int instr_reqd; /* Display of `instruction' required or optional? */
683
void *data; /* slot for housekeeping data, managed by
684
* get_userpass_input(); initially NULL */
686
prompts_t *new_prompts(void *frontend);
687
void add_prompt(prompts_t *p, char *promptstr, int echo, size_t len);
688
/* Burn the evidence. (Assumes _all_ strings want free()ing.) */
689
void free_prompts(prompts_t *p);
692
* Exports from the front end.
610
694
void request_resize(void *frontend, int, int);
611
695
void do_text(Context, int, int, wchar_t *, int, unsigned long, int);
622
706
void palette_set(void *frontend, int, int, int, int);
623
707
void palette_reset(void *frontend);
624
708
void write_aclip(void *frontend, char *, int, int);
625
void write_clip(void *frontend, wchar_t *, int, int);
709
void write_clip(void *frontend, wchar_t *, int *, int, int);
626
710
void get_clip(void *frontend, wchar_t **, int *);
627
711
void optimised_move(void *frontend, int, int, int);
628
712
void set_raw_mouse_mode(void *frontend, int);
633
717
#pragma noreturn(fatalbox)
634
718
#pragma noreturn(modalfatalbox)
636
void beep(void *frontend, int);
720
void do_beep(void *frontend, int);
637
721
void begin_session(void *frontend);
638
722
void sys_cursor(void *frontend, int x, int y);
639
723
void request_paste(void *frontend);
646
730
void update_specials_menu(void *frontend);
647
731
int from_backend(void *frontend, int is_stderr, const char *data, int len);
732
int from_backend_untrusted(void *frontend, const char *data, int len);
648
733
void notify_remote_exit(void *frontend);
734
/* Get a sensible value for a tty mode. NULL return = don't set.
735
* Otherwise, returned value should be freed by caller. */
736
char *get_ttymode(void *frontend, const char *mode);
738
* >0 = `got all results, carry on'
739
* 0 = `user cancelled' (FIXME distinguish "give up entirely" and "next auth"?)
740
* <0 = `please call back later with more in/inlen'
742
int get_userpass_input(prompts_t *p, unsigned char *in, int inlen);
649
743
#define OPTIMISE_IS_SCROLL 1
651
745
void set_iconic(void *frontend, int iconic);
684
778
* Exports from settings.c.
686
char *save_settings(char *section, int do_host, Config * cfg);
687
void save_open_settings(void *sesskey, int do_host, Config *cfg);
688
void load_settings(char *section, int do_host, Config * cfg);
689
void load_open_settings(void *sesskey, int do_host, Config *cfg);
780
char *save_settings(char *section, Config * cfg);
781
void save_open_settings(void *sesskey, Config *cfg);
782
void load_settings(char *section, Config * cfg);
783
void load_open_settings(void *sesskey, Config *cfg);
690
784
void get_sesslist(struct sesslist *, int allocate);
691
785
void do_defaults(char *, Config *);
692
786
void registry_cleanup(void);
716
810
void term_size(Terminal *, int, int, int);
717
811
void term_paint(Terminal *, Context, int, int, int, int, int);
718
812
void term_scroll(Terminal *, int, int);
719
void term_pwron(Terminal *);
813
void term_pwron(Terminal *, int);
720
814
void term_clrsb(Terminal *);
721
815
void term_mouse(Terminal *, Mouse_Button, Mouse_Button, Mouse_Action,
722
816
int,int,int,int,int);
735
829
void term_reconfig(Terminal *, Config *);
736
830
void term_seen_key_event(Terminal *);
737
831
int term_data(Terminal *, int is_stderr, const char *data, int len);
832
int term_data_untrusted(Terminal *, const char *data, int len);
738
833
void term_provide_resize_fn(Terminal *term,
739
834
void (*resize_fn)(void *, int, int),
740
835
void *resize_ctx);
741
836
void term_provide_logctx(Terminal *term, void *logctx);
742
837
void term_set_focus(Terminal *term, int has_focus);
838
char *term_get_ttymode(Terminal *term, const char *mode);
839
int term_get_userpass_input(Terminal *term, prompts_t *p,
840
unsigned char *in, int inlen);
745
843
* Exports from logging.c.
789
887
extern Backend telnet_backend;
792
* Exports from ssh.c. (NB the getline variables have to be GLOBAL
793
* so that PuTTYtel will still compile - otherwise it would depend
890
* Exports from ssh.c.
797
GLOBAL int (*ssh_get_line) (const char *prompt, char *str, int maxlen,
799
GLOBAL int ssh_getline_pw_only;
800
892
extern Backend ssh_backend;
841
933
#include "misc.h"
934
int cfg_launchable(const Config *cfg);
935
char const *cfg_dest(const Config *cfg);
938
* Exports from sercfg.c.
940
void ser_setup_config_box(struct controlbox *b, int midsession,
941
int parity_mask, int flow_mask);
844
944
* Exports from version.c.
941
1041
void (*callback)(void *ctx, int result), void *ctx);
944
* Exports from console.c (that aren't equivalents to things in
1044
* Exports from console frontends (wincons.c, uxcons.c)
1045
* that aren't equivalents to things in windlg.c et al.
947
1047
extern int console_batch_mode;
948
int console_get_line(const char *prompt, char *str, int maxlen, int is_pw);
1048
int console_get_userpass_input(prompts_t *p, unsigned char *in, int inlen);
949
1049
void console_provide_logctx(void *logctx);
950
1050
int is_interactive(void);
969
1069
int cmdline_process_param(char *, char *, int, Config *);
970
1070
void cmdline_run_saved(Config *);
971
1071
void cmdline_cleanup(void);
972
extern char *cmdline_password;
1072
int cmdline_get_passwd_input(prompts_t *p, unsigned char *in, int inlen);
973
1073
#define TOOLTYPE_FILETRANSFER 1
974
1074
#define TOOLTYPE_NONNETWORK 2
975
1075
extern int cmdline_tooltype;
980
1080
* Exports from config.c.
982
1082
struct controlbox;
983
void setup_config_box(struct controlbox *b, struct sesslist *sesslist,
984
int midsession, int protocol, int protcfginfo);
1083
void setup_config_box(struct controlbox *b, int midsession,
1084
int protocol, int protcfginfo);
987
1087
* Exports from minibidi.c.