Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/defs.h
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2018-10-11 21:58:42 +0300
committerSimon Tatham <anakin@pobox.com>2018-10-11 21:58:42 +0300
commitb4c8fd9d86fdebac075967aa233128449da7ed57 (patch)
treee9e59bbb022c0ea4c683477f28ae3ca13cad82c9 /defs.h
parent109df9f46b6a0ff19190839d8d62f72f8dedce87 (diff)
New abstraction 'Seat', to pass to backends.
This is a new vtable-based abstraction which is passed to a backend in place of Frontend, and it implements only the subset of the Frontend functions needed by a backend. (Many other Frontend functions still exist, notably the wide range of things called by terminal.c providing platform-independent operations on the GUI terminal window.) The purpose of making it a vtable is that this opens up the possibility of creating a backend as an internal implementation detail of some other activity, by providing just that one backend with a custom Seat that implements the methods differently. For example, this refactoring should make it feasible to directly implement an SSH proxy type, aka the 'jump host' feature supported by OpenSSH, aka 'open a secondary SSH session in MAINCHAN_DIRECT_TCP mode, and then expose the main channel of that as the Socket for the primary connection'. (Which of course you can already do by spawning 'plink -nc' as a separate proxy process, but this would permit it in the _same_ process without anything getting confused.) I've centralised a full set of stub methods in misc.c for the new abstraction, which allows me to get rid of several annoying stubs in the previous code. Also, while I'm here, I've moved a lot of duplicated modalfatalbox() type functions from application main program files into wincons.c / uxcons.c, which I think saves duplication overall. (A minor visible effect is that the prefixes on those console-based fatal error messages will now be more consistent between applications.)
Diffstat (limited to 'defs.h')
-rw-r--r--defs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/defs.h b/defs.h
index f524378e..ec31c246 100644
--- a/defs.h
+++ b/defs.h
@@ -53,6 +53,9 @@ typedef struct LogContext LogContext;
typedef struct LogPolicy LogPolicy;
typedef struct LogPolicyVtable LogPolicyVtable;
+typedef struct Seat Seat;
+typedef struct SeatVtable SeatVtable;
+
typedef struct Frontend Frontend;
typedef struct Ssh Ssh;