зеркало из https://github.com/github/putty.git
Name vtable structure types more consistently.
Now they're all called FooVtable, instead of a mixture of that and Foo_vtable.
This commit is contained in:
Родитель
e0130a48ca
Коммит
b798230844
2
be_all.c
2
be_all.c
|
@ -22,7 +22,7 @@ const int be_default_protocol = PROT_TELNET;
|
||||||
const int be_default_protocol = PROT_SSH;
|
const int be_default_protocol = PROT_SSH;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const struct Backend_vtable *const backends[] = {
|
const struct BackendVtable *const backends[] = {
|
||||||
&ssh_backend,
|
&ssh_backend,
|
||||||
&telnet_backend,
|
&telnet_backend,
|
||||||
&rlogin_backend,
|
&rlogin_backend,
|
||||||
|
|
|
@ -22,7 +22,7 @@ const int be_default_protocol = PROT_TELNET;
|
||||||
const int be_default_protocol = PROT_SSH;
|
const int be_default_protocol = PROT_SSH;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const struct Backend_vtable *const backends[] = {
|
const struct BackendVtable *const backends[] = {
|
||||||
&ssh_backend,
|
&ssh_backend,
|
||||||
&telnet_backend,
|
&telnet_backend,
|
||||||
&rlogin_backend,
|
&rlogin_backend,
|
||||||
|
|
|
@ -6,6 +6,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "putty.h"
|
#include "putty.h"
|
||||||
|
|
||||||
const struct Backend_vtable *const backends[] = {
|
const struct BackendVtable *const backends[] = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,7 +10,7 @@ const int be_default_protocol = PROT_TELNET;
|
||||||
|
|
||||||
const char *const appname = "PuTTYtel";
|
const char *const appname = "PuTTYtel";
|
||||||
|
|
||||||
const struct Backend_vtable *const backends[] = {
|
const struct BackendVtable *const backends[] = {
|
||||||
&telnet_backend,
|
&telnet_backend,
|
||||||
&rlogin_backend,
|
&rlogin_backend,
|
||||||
&raw_backend,
|
&raw_backend,
|
||||||
|
|
|
@ -10,7 +10,7 @@ const int be_default_protocol = PROT_TELNET;
|
||||||
|
|
||||||
const char *const appname = "PuTTYtel";
|
const char *const appname = "PuTTYtel";
|
||||||
|
|
||||||
const struct Backend_vtable *const backends[] = {
|
const struct BackendVtable *const backends[] = {
|
||||||
&telnet_backend,
|
&telnet_backend,
|
||||||
&rlogin_backend,
|
&rlogin_backend,
|
||||||
&raw_backend,
|
&raw_backend,
|
||||||
|
|
2
be_ssh.c
2
be_ssh.c
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
const int be_default_protocol = PROT_SSH;
|
const int be_default_protocol = PROT_SSH;
|
||||||
|
|
||||||
const struct Backend_vtable *const backends[] = {
|
const struct BackendVtable *const backends[] = {
|
||||||
&ssh_backend,
|
&ssh_backend,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
|
@ -275,7 +275,7 @@ int cmdline_process_param(const char *p, char *value,
|
||||||
const char *comma = strchr(p, ',');
|
const char *comma = strchr(p, ',');
|
||||||
if (comma) {
|
if (comma) {
|
||||||
char *prefix = dupprintf("%.*s", (int)(comma - p), p);
|
char *prefix = dupprintf("%.*s", (int)(comma - p), p);
|
||||||
const struct Backend_vtable *vt =
|
const struct BackendVtable *vt =
|
||||||
backend_vt_from_name(prefix);
|
backend_vt_from_name(prefix);
|
||||||
|
|
||||||
if (vt) {
|
if (vt) {
|
||||||
|
|
4
config.c
4
config.c
|
@ -267,8 +267,8 @@ void config_protocolbuttons_handler(union control *ctrl, dlgparam *dlg,
|
||||||
conf_set_int(conf, CONF_protocol, newproto);
|
conf_set_int(conf, CONF_protocol, newproto);
|
||||||
|
|
||||||
if (oldproto != newproto) {
|
if (oldproto != newproto) {
|
||||||
const struct Backend_vtable *ovt = backend_vt_from_proto(oldproto);
|
const struct BackendVtable *ovt = backend_vt_from_proto(oldproto);
|
||||||
const struct Backend_vtable *nvt = backend_vt_from_proto(newproto);
|
const struct BackendVtable *nvt = backend_vt_from_proto(newproto);
|
||||||
assert(ovt);
|
assert(ovt);
|
||||||
assert(nvt);
|
assert(nvt);
|
||||||
/* Iff the user hasn't changed the port from the old protocol's
|
/* Iff the user hasn't changed the port from the old protocol's
|
||||||
|
|
10
defs.h
10
defs.h
|
@ -42,11 +42,11 @@ typedef struct IdempotentCallback IdempotentCallback;
|
||||||
|
|
||||||
typedef struct SockAddr SockAddr;
|
typedef struct SockAddr SockAddr;
|
||||||
|
|
||||||
typedef struct Socket_vtable Socket_vtable;
|
typedef struct SocketVtable SocketVtable;
|
||||||
typedef struct Plug_vtable Plug_vtable;
|
typedef struct PlugVtable PlugVtable;
|
||||||
|
|
||||||
typedef struct Backend Backend;
|
typedef struct Backend Backend;
|
||||||
typedef struct Backend_vtable Backend_vtable;
|
typedef struct BackendVtable BackendVtable;
|
||||||
|
|
||||||
typedef struct Ldisc_tag Ldisc;
|
typedef struct Ldisc_tag Ldisc;
|
||||||
typedef struct LogContext_tag LogContext;
|
typedef struct LogContext_tag LogContext;
|
||||||
|
@ -74,8 +74,8 @@ typedef struct settings_e settings_e;
|
||||||
|
|
||||||
typedef struct SessionSpecial SessionSpecial;
|
typedef struct SessionSpecial SessionSpecial;
|
||||||
|
|
||||||
typedef const Socket_vtable *Socket;
|
typedef const SocketVtable *Socket;
|
||||||
typedef const Plug_vtable *Plug;
|
typedef const PlugVtable *Plug;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A small structure wrapping up a (pointer, length) pair so that it
|
* A small structure wrapping up a (pointer, length) pair so that it
|
||||||
|
|
|
@ -14,7 +14,7 @@ typedef struct {
|
||||||
char *error;
|
char *error;
|
||||||
Plug *plug;
|
Plug *plug;
|
||||||
|
|
||||||
const Socket_vtable *sockvt;
|
const SocketVtable *sockvt;
|
||||||
} ErrorSocket;
|
} ErrorSocket;
|
||||||
|
|
||||||
static Plug *sk_error_plug(Socket *s, Plug *p)
|
static Plug *sk_error_plug(Socket *s, Plug *p)
|
||||||
|
@ -45,7 +45,7 @@ static char *sk_error_peer_info(Socket *s)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Socket_vtable ErrorSocket_sockvt = {
|
static const SocketVtable ErrorSocket_sockvt = {
|
||||||
sk_error_plug,
|
sk_error_plug,
|
||||||
sk_error_close,
|
sk_error_close,
|
||||||
NULL /* write */,
|
NULL /* write */,
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
struct Socket_vtable {
|
struct SocketVtable {
|
||||||
Plug *(*plug) (Socket *s, Plug *p);
|
Plug *(*plug) (Socket *s, Plug *p);
|
||||||
/* use a different plug (return the old one) */
|
/* use a different plug (return the old one) */
|
||||||
/* if p is NULL, it doesn't change the plug */
|
/* if p is NULL, it doesn't change the plug */
|
||||||
|
@ -34,7 +34,7 @@ struct Socket_vtable {
|
||||||
typedef union { void *p; int i; } accept_ctx_t;
|
typedef union { void *p; int i; } accept_ctx_t;
|
||||||
typedef Socket *(*accept_fn_t)(accept_ctx_t ctx, Plug *plug);
|
typedef Socket *(*accept_fn_t)(accept_ctx_t ctx, Plug *plug);
|
||||||
|
|
||||||
struct Plug_vtable {
|
struct PlugVtable {
|
||||||
void (*log)(Plug *p, int type, SockAddr *addr, int port,
|
void (*log)(Plug *p, int type, SockAddr *addr, int port,
|
||||||
const char *error_msg, int error_code);
|
const char *error_msg, int error_code);
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -25,7 +25,7 @@ static void nullplug_sent(Plug *plug, int bufsize)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable nullplug_plugvt = {
|
static const PlugVtable nullplug_plugvt = {
|
||||||
nullplug_socket_log,
|
nullplug_socket_log,
|
||||||
nullplug_closing,
|
nullplug_closing,
|
||||||
nullplug_receive,
|
nullplug_receive,
|
||||||
|
@ -33,7 +33,7 @@ static const Plug_vtable nullplug_plugvt = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static const Plug_vtable *nullplug_plugvt_ptr = &nullplug_plugvt;
|
static const PlugVtable *nullplug_plugvt_ptr = &nullplug_plugvt;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* There's a singleton instance of nullplug, because it's not
|
* There's a singleton instance of nullplug, because it's not
|
||||||
|
|
|
@ -707,7 +707,7 @@ struct pageant_conn_state {
|
||||||
int real_packet;
|
int real_packet;
|
||||||
int crLine; /* for coroutine in pageant_conn_receive */
|
int crLine; /* for coroutine in pageant_conn_receive */
|
||||||
|
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void pageant_conn_closing(Plug *plug, const char *error_msg,
|
static void pageant_conn_closing(Plug *plug, const char *error_msg,
|
||||||
|
@ -801,7 +801,7 @@ struct pageant_listen_state {
|
||||||
void *logctx;
|
void *logctx;
|
||||||
pageant_logfn_t logfn;
|
pageant_logfn_t logfn;
|
||||||
|
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void pageant_listen_closing(Plug *plug, const char *error_msg,
|
static void pageant_listen_closing(Plug *plug, const char *error_msg,
|
||||||
|
@ -815,7 +815,7 @@ static void pageant_listen_closing(Plug *plug, const char *error_msg,
|
||||||
pl->listensock = NULL;
|
pl->listensock = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable pageant_connection_plugvt = {
|
static const PlugVtable pageant_connection_plugvt = {
|
||||||
NULL, /* no log function, because that's for outgoing connections */
|
NULL, /* no log function, because that's for outgoing connections */
|
||||||
pageant_conn_closing,
|
pageant_conn_closing,
|
||||||
pageant_conn_receive,
|
pageant_conn_receive,
|
||||||
|
@ -858,7 +858,7 @@ static int pageant_listen_accepting(Plug *plug,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable pageant_listener_plugvt = {
|
static const PlugVtable pageant_listener_plugvt = {
|
||||||
NULL, /* no log function, because that's for outgoing connections */
|
NULL, /* no log function, because that's for outgoing connections */
|
||||||
pageant_listen_closing,
|
pageant_listen_closing,
|
||||||
NULL, /* no receive function on a listening socket */
|
NULL, /* no receive function on a listening socket */
|
||||||
|
|
|
@ -56,7 +56,7 @@ typedef struct PortForwarding {
|
||||||
strbuf *socksbuf;
|
strbuf *socksbuf;
|
||||||
size_t socksbuf_consumed;
|
size_t socksbuf_consumed;
|
||||||
|
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
Channel chan;
|
Channel chan;
|
||||||
} PortForwarding;
|
} PortForwarding;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ struct PortListener {
|
||||||
char *hostname;
|
char *hostname;
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct PortForwarding *new_portfwd_state(void)
|
static struct PortForwarding *new_portfwd_state(void)
|
||||||
|
@ -435,7 +435,7 @@ static void pfd_sent(Plug *plug, int bufsize)
|
||||||
sshfwd_unthrottle(pf->c, bufsize);
|
sshfwd_unthrottle(pf->c, bufsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable PortForwarding_plugvt = {
|
static const PlugVtable PortForwarding_plugvt = {
|
||||||
pfd_log,
|
pfd_log,
|
||||||
pfd_closing,
|
pfd_closing,
|
||||||
pfd_receive,
|
pfd_receive,
|
||||||
|
@ -509,7 +509,7 @@ static int pfl_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable PortListener_plugvt = {
|
static const PlugVtable PortListener_plugvt = {
|
||||||
pfl_log,
|
pfl_log,
|
||||||
pfl_closing,
|
pfl_closing,
|
||||||
NULL, /* recv */
|
NULL, /* recv */
|
||||||
|
|
4
proxy.c
4
proxy.c
|
@ -396,7 +396,7 @@ SockAddr *name_lookup(const char *host, int port, char **canonicalname,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct Socket_vtable ProxySocket_sockvt = {
|
static const struct SocketVtable ProxySocket_sockvt = {
|
||||||
sk_proxy_plug,
|
sk_proxy_plug,
|
||||||
sk_proxy_close,
|
sk_proxy_close,
|
||||||
sk_proxy_write,
|
sk_proxy_write,
|
||||||
|
@ -408,7 +408,7 @@ static const struct Socket_vtable ProxySocket_sockvt = {
|
||||||
NULL, /* peer_info */
|
NULL, /* peer_info */
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct Plug_vtable ProxySocket_plugvt = {
|
static const struct PlugVtable ProxySocket_plugvt = {
|
||||||
plug_proxy_log,
|
plug_proxy_log,
|
||||||
plug_proxy_closing,
|
plug_proxy_closing,
|
||||||
plug_proxy_receive,
|
plug_proxy_receive,
|
||||||
|
|
4
proxy.h
4
proxy.h
|
@ -87,8 +87,8 @@ struct ProxySocket {
|
||||||
int chap_current_attribute;
|
int chap_current_attribute;
|
||||||
int chap_current_datalen;
|
int chap_current_datalen;
|
||||||
|
|
||||||
const Socket_vtable *sockvt;
|
const SocketVtable *sockvt;
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void proxy_activate (ProxySocket *);
|
extern void proxy_activate (ProxySocket *);
|
||||||
|
|
22
putty.h
22
putty.h
|
@ -476,9 +476,9 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Backend {
|
struct Backend {
|
||||||
const Backend_vtable *vt;
|
const BackendVtable *vt;
|
||||||
};
|
};
|
||||||
struct Backend_vtable {
|
struct BackendVtable {
|
||||||
const char *(*init) (Frontend *frontend, Backend **backend_out,
|
const char *(*init) (Frontend *frontend, Backend **backend_out,
|
||||||
Conf *conf, const char *host, int port,
|
Conf *conf, const char *host, int port,
|
||||||
char **realhost, int nodelay, int keepalive);
|
char **realhost, int nodelay, int keepalive);
|
||||||
|
@ -535,7 +535,7 @@ struct Backend_vtable {
|
||||||
#define backend_unthrottle(be, bufsize) ((be)->vt->unthrottle(be, bufsize))
|
#define backend_unthrottle(be, bufsize) ((be)->vt->unthrottle(be, bufsize))
|
||||||
#define backend_cfg_info(be) ((be)->vt->cfg_info(be))
|
#define backend_cfg_info(be) ((be)->vt->cfg_info(be))
|
||||||
|
|
||||||
extern const struct Backend_vtable *const backends[];
|
extern const struct BackendVtable *const backends[];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Suggested default protocol provided by the backend link module.
|
* Suggested default protocol provided by the backend link module.
|
||||||
|
@ -1099,8 +1099,8 @@ void random_destroy_seed(void);
|
||||||
/*
|
/*
|
||||||
* Exports from settings.c.
|
* Exports from settings.c.
|
||||||
*/
|
*/
|
||||||
const struct Backend_vtable *backend_vt_from_name(const char *name);
|
const struct BackendVtable *backend_vt_from_name(const char *name);
|
||||||
const struct Backend_vtable *backend_vt_from_proto(int proto);
|
const struct BackendVtable *backend_vt_from_proto(int proto);
|
||||||
char *get_remote_username(Conf *conf); /* dynamically allocated */
|
char *get_remote_username(Conf *conf); /* dynamically allocated */
|
||||||
char *save_settings(const char *section, Conf *conf);
|
char *save_settings(const char *section, Conf *conf);
|
||||||
void save_open_settings(settings_w *sesskey, Conf *conf);
|
void save_open_settings(settings_w *sesskey, Conf *conf);
|
||||||
|
@ -1195,31 +1195,31 @@ void log_packet(LogContext *logctx, int direction, int type,
|
||||||
* Exports from testback.c
|
* Exports from testback.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern const struct Backend_vtable null_backend;
|
extern const struct BackendVtable null_backend;
|
||||||
extern const struct Backend_vtable loop_backend;
|
extern const struct BackendVtable loop_backend;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exports from raw.c.
|
* Exports from raw.c.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern const struct Backend_vtable raw_backend;
|
extern const struct BackendVtable raw_backend;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exports from rlogin.c.
|
* Exports from rlogin.c.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern const struct Backend_vtable rlogin_backend;
|
extern const struct BackendVtable rlogin_backend;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exports from telnet.c.
|
* Exports from telnet.c.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern const struct Backend_vtable telnet_backend;
|
extern const struct BackendVtable telnet_backend;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exports from ssh.c.
|
* Exports from ssh.c.
|
||||||
*/
|
*/
|
||||||
extern const struct Backend_vtable ssh_backend;
|
extern const struct BackendVtable ssh_backend;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exports from ldisc.c.
|
* Exports from ldisc.c.
|
||||||
|
|
6
raw.c
6
raw.c
|
@ -20,7 +20,7 @@ struct Raw {
|
||||||
|
|
||||||
Conf *conf;
|
Conf *conf;
|
||||||
|
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
Backend backend;
|
Backend backend;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ static void raw_sent(Plug *plug, int bufsize)
|
||||||
raw->bufsize = bufsize;
|
raw->bufsize = bufsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable Raw_plugvt = {
|
static const PlugVtable Raw_plugvt = {
|
||||||
raw_log,
|
raw_log,
|
||||||
raw_closing,
|
raw_closing,
|
||||||
raw_receive,
|
raw_receive,
|
||||||
|
@ -307,7 +307,7 @@ static int raw_cfg_info(Backend *be)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct Backend_vtable raw_backend = {
|
const struct BackendVtable raw_backend = {
|
||||||
raw_init,
|
raw_init,
|
||||||
raw_free,
|
raw_free,
|
||||||
raw_reconfig,
|
raw_reconfig,
|
||||||
|
|
6
rlogin.c
6
rlogin.c
|
@ -26,7 +26,7 @@ struct Rlogin {
|
||||||
/* In case we need to read a username from the terminal before starting */
|
/* In case we need to read a username from the terminal before starting */
|
||||||
prompts_t *prompt;
|
prompts_t *prompt;
|
||||||
|
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
Backend backend;
|
Backend backend;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ static void rlogin_startup(Rlogin *rlogin, const char *ruser)
|
||||||
rlogin->prompt = NULL;
|
rlogin->prompt = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable Rlogin_plugvt = {
|
static const PlugVtable Rlogin_plugvt = {
|
||||||
rlogin_log,
|
rlogin_log,
|
||||||
rlogin_closing,
|
rlogin_closing,
|
||||||
rlogin_receive,
|
rlogin_receive,
|
||||||
|
@ -398,7 +398,7 @@ static int rlogin_cfg_info(Backend *be)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct Backend_vtable rlogin_backend = {
|
const struct BackendVtable rlogin_backend = {
|
||||||
rlogin_init,
|
rlogin_init,
|
||||||
rlogin_free,
|
rlogin_free,
|
||||||
rlogin_reconfig,
|
rlogin_reconfig,
|
||||||
|
|
12
settings.c
12
settings.c
|
@ -74,18 +74,18 @@ const char *const ttymodes[] = {
|
||||||
* (which is only present in tools that manage settings).
|
* (which is only present in tools that manage settings).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const struct Backend_vtable *backend_vt_from_name(const char *name)
|
const struct BackendVtable *backend_vt_from_name(const char *name)
|
||||||
{
|
{
|
||||||
const struct Backend_vtable *const *p;
|
const struct BackendVtable *const *p;
|
||||||
for (p = backends; *p != NULL; p++)
|
for (p = backends; *p != NULL; p++)
|
||||||
if (!strcmp((*p)->name, name))
|
if (!strcmp((*p)->name, name))
|
||||||
return *p;
|
return *p;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct Backend_vtable *backend_vt_from_proto(int proto)
|
const struct BackendVtable *backend_vt_from_proto(int proto)
|
||||||
{
|
{
|
||||||
const struct Backend_vtable *const *p;
|
const struct BackendVtable *const *p;
|
||||||
for (p = backends; *p != NULL; p++)
|
for (p = backends; *p != NULL; p++)
|
||||||
if ((*p)->protocol == proto)
|
if ((*p)->protocol == proto)
|
||||||
return *p;
|
return *p;
|
||||||
|
@ -529,7 +529,7 @@ void save_open_settings(settings_w *sesskey, Conf *conf)
|
||||||
write_setting_i(sesskey, "SSHLogOmitData", conf_get_int(conf, CONF_logomitdata));
|
write_setting_i(sesskey, "SSHLogOmitData", conf_get_int(conf, CONF_logomitdata));
|
||||||
p = "raw";
|
p = "raw";
|
||||||
{
|
{
|
||||||
const struct Backend_vtable *vt =
|
const struct BackendVtable *vt =
|
||||||
backend_vt_from_proto(conf_get_int(conf, CONF_protocol));
|
backend_vt_from_proto(conf_get_int(conf, CONF_protocol));
|
||||||
if (vt)
|
if (vt)
|
||||||
p = vt->name;
|
p = vt->name;
|
||||||
|
@ -794,7 +794,7 @@ void load_open_settings(settings_r *sesskey, Conf *conf)
|
||||||
conf_set_int(conf, CONF_protocol, default_protocol);
|
conf_set_int(conf, CONF_protocol, default_protocol);
|
||||||
conf_set_int(conf, CONF_port, default_port);
|
conf_set_int(conf, CONF_port, default_port);
|
||||||
{
|
{
|
||||||
const struct Backend_vtable *vt = backend_vt_from_name(prot);
|
const struct BackendVtable *vt = backend_vt_from_name(prot);
|
||||||
if (vt) {
|
if (vt) {
|
||||||
conf_set_int(conf, CONF_protocol, vt->protocol);
|
conf_set_int(conf, CONF_protocol, vt->protocol);
|
||||||
gppi(sesskey, "PortNumber", default_port, conf, CONF_port);
|
gppi(sesskey, "PortNumber", default_port, conf, CONF_port);
|
||||||
|
|
6
ssh.c
6
ssh.c
|
@ -37,7 +37,7 @@ struct Ssh {
|
||||||
struct ssh_version_receiver version_receiver;
|
struct ssh_version_receiver version_receiver;
|
||||||
int remote_bugs;
|
int remote_bugs;
|
||||||
|
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
Backend backend;
|
Backend backend;
|
||||||
|
|
||||||
Ldisc *ldisc;
|
Ldisc *ldisc;
|
||||||
|
@ -599,7 +599,7 @@ static int ssh_test_for_upstream(const char *host, int port, Conf *conf)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable Ssh_plugvt = {
|
static const PlugVtable Ssh_plugvt = {
|
||||||
ssh_socket_log,
|
ssh_socket_log,
|
||||||
ssh_closing,
|
ssh_closing,
|
||||||
ssh_receive,
|
ssh_receive,
|
||||||
|
@ -1087,7 +1087,7 @@ void ssh_got_fallback_cmd(Ssh *ssh)
|
||||||
ssh->fallback_cmd = TRUE;
|
ssh->fallback_cmd = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct Backend_vtable ssh_backend = {
|
const struct BackendVtable ssh_backend = {
|
||||||
ssh_init,
|
ssh_init,
|
||||||
ssh_free,
|
ssh_free,
|
||||||
ssh_reconfig,
|
ssh_reconfig,
|
||||||
|
|
|
@ -147,7 +147,7 @@ struct ssh_sharing_state {
|
||||||
ConnectionLayer *cl; /* instance of the ssh connection layer */
|
ConnectionLayer *cl; /* instance of the ssh connection layer */
|
||||||
char *server_verstring; /* server version string after "SSH-" */
|
char *server_verstring; /* server version string after "SSH-" */
|
||||||
|
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct share_globreq;
|
struct share_globreq;
|
||||||
|
@ -200,7 +200,7 @@ struct ssh_sharing_connstate {
|
||||||
/* Global requests we've sent on to the server, pending replies. */
|
/* Global requests we've sent on to the server, pending replies. */
|
||||||
struct share_globreq *globreq_head, *globreq_tail;
|
struct share_globreq *globreq_head, *globreq_tail;
|
||||||
|
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct share_halfchannel {
|
struct share_halfchannel {
|
||||||
|
@ -1910,7 +1910,7 @@ void share_activate(ssh_sharing_state *sharestate,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable ssh_sharing_conn_plugvt = {
|
static const PlugVtable ssh_sharing_conn_plugvt = {
|
||||||
NULL, /* no log function, because that's for outgoing connections */
|
NULL, /* no log function, because that's for outgoing connections */
|
||||||
share_closing,
|
share_closing,
|
||||||
share_receive,
|
share_receive,
|
||||||
|
@ -2054,7 +2054,7 @@ int ssh_share_test_for_upstream(const char *host, int port, Conf *conf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable ssh_sharing_listen_plugvt = {
|
static const PlugVtable ssh_sharing_listen_plugvt = {
|
||||||
NULL, /* no log function, because that's for outgoing connections */
|
NULL, /* no log function, because that's for outgoing connections */
|
||||||
share_listen_closing,
|
share_listen_closing,
|
||||||
NULL, /* no receive function on a listening socket */
|
NULL, /* no receive function on a listening socket */
|
||||||
|
|
6
telnet.c
6
telnet.c
|
@ -197,7 +197,7 @@ struct Telnet {
|
||||||
|
|
||||||
Pinger *pinger;
|
Pinger *pinger;
|
||||||
|
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
Backend backend;
|
Backend backend;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -691,7 +691,7 @@ static void telnet_sent(Plug *plug, int bufsize)
|
||||||
telnet->bufsize = bufsize;
|
telnet->bufsize = bufsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable Telnet_plugvt = {
|
static const PlugVtable Telnet_plugvt = {
|
||||||
telnet_log,
|
telnet_log,
|
||||||
telnet_closing,
|
telnet_closing,
|
||||||
telnet_receive,
|
telnet_receive,
|
||||||
|
@ -1079,7 +1079,7 @@ static int telnet_cfg_info(Backend *be)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct Backend_vtable telnet_backend = {
|
const struct BackendVtable telnet_backend = {
|
||||||
telnet_init,
|
telnet_init,
|
||||||
telnet_free,
|
telnet_free,
|
||||||
telnet_reconfig,
|
telnet_reconfig,
|
||||||
|
|
|
@ -54,14 +54,14 @@ static void null_provide_logctx(Backend *, LogContext *);
|
||||||
static void null_unthrottle(Backend *, int);
|
static void null_unthrottle(Backend *, int);
|
||||||
static int null_cfg_info(Backend *);
|
static int null_cfg_info(Backend *);
|
||||||
|
|
||||||
const struct Backend_vtable null_backend = {
|
const struct BackendVtable null_backend = {
|
||||||
null_init, null_free, null_reconfig, null_send, null_sendbuffer, null_size,
|
null_init, null_free, null_reconfig, null_send, null_sendbuffer, null_size,
|
||||||
null_special, null_get_specials, null_connected, null_exitcode, null_sendok,
|
null_special, null_get_specials, null_connected, null_exitcode, null_sendok,
|
||||||
null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
|
null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
|
||||||
null_cfg_info, NULL /* test_for_upstream */, "null", -1, 0
|
null_cfg_info, NULL /* test_for_upstream */, "null", -1, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct Backend_vtable loop_backend = {
|
const struct BackendVtable loop_backend = {
|
||||||
loop_init, loop_free, null_reconfig, loop_send, null_sendbuffer, null_size,
|
loop_init, loop_free, null_reconfig, loop_send, null_sendbuffer, null_size,
|
||||||
null_special, null_get_specials, null_connected, null_exitcode, null_sendok,
|
null_special, null_get_specials, null_connected, null_exitcode, null_sendok,
|
||||||
null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
|
null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
|
||||||
|
|
|
@ -67,9 +67,9 @@ typedef void (*fontsel_add_entry)(void *ctx, const char *realfontname,
|
||||||
const char *family, const char *charset,
|
const char *family, const char *charset,
|
||||||
const char *style, const char *stylekey,
|
const char *style, const char *stylekey,
|
||||||
int size, int flags,
|
int size, int flags,
|
||||||
const struct unifont_vtable *fontclass);
|
const struct UnifontVtable *fontclass);
|
||||||
|
|
||||||
struct unifont_vtable {
|
struct UnifontVtable {
|
||||||
/*
|
/*
|
||||||
* `Methods' of the `class'.
|
* `Methods' of the `class'.
|
||||||
*/
|
*/
|
||||||
|
@ -213,7 +213,7 @@ struct x11font {
|
||||||
unifont u;
|
unifont u;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct unifont_vtable x11font_vtable = {
|
static const struct UnifontVtable x11font_vtable = {
|
||||||
x11font_create,
|
x11font_create,
|
||||||
NULL, /* no fallback fonts in X11 */
|
NULL, /* no fallback fonts in X11 */
|
||||||
x11font_destroy,
|
x11font_destroy,
|
||||||
|
@ -1347,7 +1347,7 @@ struct pangofont {
|
||||||
struct unifont u;
|
struct unifont u;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct unifont_vtable pangofont_vtable = {
|
static const struct UnifontVtable pangofont_vtable = {
|
||||||
pangofont_create,
|
pangofont_create,
|
||||||
pangofont_create_fallback,
|
pangofont_create_fallback,
|
||||||
pangofont_destroy,
|
pangofont_destroy,
|
||||||
|
@ -2057,7 +2057,7 @@ static char *pangofont_size_increment(unifont *font, int increment)
|
||||||
*
|
*
|
||||||
* The 'multifont' subclass is omitted here, as discussed above.
|
* The 'multifont' subclass is omitted here, as discussed above.
|
||||||
*/
|
*/
|
||||||
static const struct unifont_vtable *unifont_types[] = {
|
static const struct UnifontVtable *unifont_types[] = {
|
||||||
#if GTK_CHECK_VERSION(2,0,0)
|
#if GTK_CHECK_VERSION(2,0,0)
|
||||||
&pangofont_vtable,
|
&pangofont_vtable,
|
||||||
#endif
|
#endif
|
||||||
|
@ -2183,7 +2183,7 @@ struct multifont {
|
||||||
struct unifont u;
|
struct unifont u;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct unifont_vtable multifont_vtable = {
|
static const struct UnifontVtable multifont_vtable = {
|
||||||
NULL, /* creation is done specially */
|
NULL, /* creation is done specially */
|
||||||
NULL,
|
NULL,
|
||||||
multifont_destroy,
|
multifont_destroy,
|
||||||
|
@ -2363,7 +2363,7 @@ struct fontinfo {
|
||||||
/*
|
/*
|
||||||
* The class of font.
|
* The class of font.
|
||||||
*/
|
*/
|
||||||
const struct unifont_vtable *fontclass;
|
const struct UnifontVtable *fontclass;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fontinfo_realname_find {
|
struct fontinfo_realname_find {
|
||||||
|
@ -2966,7 +2966,7 @@ static void unifontsel_add_entry(void *ctx, const char *realfontname,
|
||||||
const char *family, const char *charset,
|
const char *family, const char *charset,
|
||||||
const char *style, const char *stylekey,
|
const char *style, const char *stylekey,
|
||||||
int size, int flags,
|
int size, int flags,
|
||||||
const struct unifont_vtable *fontclass)
|
const struct UnifontVtable *fontclass)
|
||||||
{
|
{
|
||||||
unifontsel_internal *fs = (unifontsel_internal *)ctx;
|
unifontsel_internal *fs = (unifontsel_internal *)ctx;
|
||||||
fontinfo *info;
|
fontinfo *info;
|
||||||
|
|
|
@ -49,9 +49,9 @@
|
||||||
/*
|
/*
|
||||||
* Exports from gtkfont.c.
|
* Exports from gtkfont.c.
|
||||||
*/
|
*/
|
||||||
struct unifont_vtable; /* contents internal to gtkfont.c */
|
struct UnifontVtable; /* contents internal to gtkfont.c */
|
||||||
typedef struct unifont {
|
typedef struct unifont {
|
||||||
const struct unifont_vtable *vt;
|
const struct UnifontVtable *vt;
|
||||||
/*
|
/*
|
||||||
* `Non-static data members' of the `class', accessible to
|
* `Non-static data members' of the `class', accessible to
|
||||||
* external code.
|
* external code.
|
||||||
|
|
|
@ -5001,7 +5001,7 @@ void update_specials_menu(Frontend *inst)
|
||||||
|
|
||||||
static void start_backend(Frontend *inst)
|
static void start_backend(Frontend *inst)
|
||||||
{
|
{
|
||||||
const struct Backend_vtable *vt;
|
const struct BackendVtable *vt;
|
||||||
char *realhost;
|
char *realhost;
|
||||||
const char *error;
|
const char *error;
|
||||||
char *s;
|
char *s;
|
||||||
|
|
|
@ -67,7 +67,7 @@ struct FontSpec *fontspec_new(const char *name);
|
||||||
|
|
||||||
typedef struct draw_ctx *Context;
|
typedef struct draw_ctx *Context;
|
||||||
|
|
||||||
extern const struct Backend_vtable pty_backend;
|
extern const struct BackendVtable pty_backend;
|
||||||
|
|
||||||
#define BROKEN_PIPE_ERROR_CODE EPIPE /* used in sshshare.c */
|
#define BROKEN_PIPE_ERROR_CODE EPIPE /* used in sshshare.c */
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ void window_setup_error(const char *errmsg);
|
||||||
GtkWidget *make_gtk_toplevel_window(Frontend *frontend);
|
GtkWidget *make_gtk_toplevel_window(Frontend *frontend);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const struct Backend_vtable *select_backend(Conf *conf);
|
const struct BackendVtable *select_backend(Conf *conf);
|
||||||
|
|
||||||
/* Defined in gtkcomm.c */
|
/* Defined in gtkcomm.c */
|
||||||
void gtkcomm_setup(void);
|
void gtkcomm_setup(void);
|
||||||
|
@ -328,7 +328,7 @@ void *sk_getxdmdata(Socket *sock, int *lenp);
|
||||||
/*
|
/*
|
||||||
* Exports from uxser.c.
|
* Exports from uxser.c.
|
||||||
*/
|
*/
|
||||||
extern const struct Backend_vtable serial_backend;
|
extern const struct BackendVtable serial_backend;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* uxpeer.c, wrapping getsockopt(SO_PEERCRED).
|
* uxpeer.c, wrapping getsockopt(SO_PEERCRED).
|
||||||
|
|
|
@ -89,7 +89,7 @@ struct NetSocket {
|
||||||
*/
|
*/
|
||||||
NetSocket *parent, *child;
|
NetSocket *parent, *child;
|
||||||
|
|
||||||
const Socket_vtable *sockvt;
|
const SocketVtable *sockvt;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SockAddr {
|
struct SockAddr {
|
||||||
|
@ -507,7 +507,7 @@ static void sk_net_set_frozen(Socket *s, int is_frozen);
|
||||||
static char *sk_net_peer_info(Socket *s);
|
static char *sk_net_peer_info(Socket *s);
|
||||||
static const char *sk_net_socket_error(Socket *s);
|
static const char *sk_net_socket_error(Socket *s);
|
||||||
|
|
||||||
static struct Socket_vtable NetSocket_sockvt = {
|
static struct SocketVtable NetSocket_sockvt = {
|
||||||
sk_net_plug,
|
sk_net_plug,
|
||||||
sk_net_close,
|
sk_net_close,
|
||||||
sk_net_write,
|
sk_net_write,
|
||||||
|
|
|
@ -176,7 +176,7 @@ static void x11_closing(Plug *plug, const char *error_msg, int error_code,
|
||||||
time_to_die = TRUE;
|
time_to_die = TRUE;
|
||||||
}
|
}
|
||||||
struct X11Connection {
|
struct X11Connection {
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
};
|
};
|
||||||
|
|
||||||
char *socketname;
|
char *socketname;
|
||||||
|
@ -728,7 +728,7 @@ void run_client(void)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable X11Connection_plugvt = {
|
static const PlugVtable X11Connection_plugvt = {
|
||||||
x11_log,
|
x11_log,
|
||||||
x11_closing,
|
x11_closing,
|
||||||
x11_receive,
|
x11_receive,
|
||||||
|
|
|
@ -595,7 +595,7 @@ int main(int argc, char **argv)
|
||||||
int just_test_share_exists = FALSE;
|
int just_test_share_exists = FALSE;
|
||||||
unsigned long now;
|
unsigned long now;
|
||||||
struct winsize size;
|
struct winsize size;
|
||||||
const struct Backend_vtable *backvt;
|
const struct BackendVtable *backvt;
|
||||||
|
|
||||||
fdlist = NULL;
|
fdlist = NULL;
|
||||||
fdcount = fdsize = 0;
|
fdcount = fdsize = 0;
|
||||||
|
@ -633,7 +633,7 @@ int main(int argc, char **argv)
|
||||||
*/
|
*/
|
||||||
char *p = getenv("PLINK_PROTOCOL");
|
char *p = getenv("PLINK_PROTOCOL");
|
||||||
if (p) {
|
if (p) {
|
||||||
const struct Backend_vtable *vt = backend_vt_from_name(p);
|
const struct BackendVtable *vt = backend_vt_from_name(p);
|
||||||
if (vt) {
|
if (vt) {
|
||||||
default_protocol = vt->protocol;
|
default_protocol = vt->protocol;
|
||||||
default_port = vt->default_port;
|
default_port = vt->default_port;
|
||||||
|
|
|
@ -29,7 +29,7 @@ typedef struct LocalProxySocket {
|
||||||
|
|
||||||
int pending_error;
|
int pending_error;
|
||||||
|
|
||||||
const Socket_vtable *sockvt;
|
const SocketVtable *sockvt;
|
||||||
} LocalProxySocket;
|
} LocalProxySocket;
|
||||||
|
|
||||||
static void localproxy_select_result(int fd, int event);
|
static void localproxy_select_result(int fd, int event);
|
||||||
|
@ -303,7 +303,7 @@ static void localproxy_select_result(int fd, int event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Socket_vtable LocalProxySocket_sockvt = {
|
static const SocketVtable LocalProxySocket_sockvt = {
|
||||||
sk_localproxy_plug,
|
sk_localproxy_plug,
|
||||||
sk_localproxy_close,
|
sk_localproxy_close,
|
||||||
sk_localproxy_write,
|
sk_localproxy_write,
|
||||||
|
|
|
@ -13,7 +13,7 @@ const int new_session = 0, saved_sessions = 0; /* or these */
|
||||||
const int dup_check_launchable = 0; /* no need to check host name in conf */
|
const int dup_check_launchable = 0; /* no need to check host name in conf */
|
||||||
const int use_pty_argv = TRUE;
|
const int use_pty_argv = TRUE;
|
||||||
|
|
||||||
const struct Backend_vtable *select_backend(Conf *conf)
|
const struct BackendVtable *select_backend(Conf *conf)
|
||||||
{
|
{
|
||||||
return &pty_backend;
|
return &pty_backend;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1240,7 +1240,7 @@ static int pty_cfg_info(Backend *be)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct Backend_vtable pty_backend = {
|
const struct BackendVtable pty_backend = {
|
||||||
pty_init,
|
pty_init,
|
||||||
pty_free,
|
pty_free,
|
||||||
pty_reconfig,
|
pty_reconfig,
|
||||||
|
|
|
@ -37,9 +37,9 @@ void cleanup_exit(int code)
|
||||||
exit(code);
|
exit(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct Backend_vtable *select_backend(Conf *conf)
|
const struct BackendVtable *select_backend(Conf *conf)
|
||||||
{
|
{
|
||||||
const struct Backend_vtable *vt =
|
const struct BackendVtable *vt =
|
||||||
backend_vt_from_proto(conf_get_int(conf, CONF_protocol));
|
backend_vt_from_proto(conf_get_int(conf, CONF_protocol));
|
||||||
assert(vt != NULL);
|
assert(vt != NULL);
|
||||||
return vt;
|
return vt;
|
||||||
|
@ -84,7 +84,7 @@ void setup(int single)
|
||||||
default_protocol = be_default_protocol;
|
default_protocol = be_default_protocol;
|
||||||
/* Find the appropriate default port. */
|
/* Find the appropriate default port. */
|
||||||
{
|
{
|
||||||
const struct Backend_vtable *vt =
|
const struct BackendVtable *vt =
|
||||||
backend_vt_from_proto(default_protocol);
|
backend_vt_from_proto(default_protocol);
|
||||||
default_port = 0; /* illegal */
|
default_port = 0; /* illegal */
|
||||||
if (vt)
|
if (vt)
|
||||||
|
|
|
@ -575,7 +575,7 @@ static int serial_cfg_info(Backend *be)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct Backend_vtable serial_backend = {
|
const struct BackendVtable serial_backend = {
|
||||||
serial_init,
|
serial_init,
|
||||||
serial_free,
|
serial_free,
|
||||||
serial_reconfig,
|
serial_reconfig,
|
||||||
|
|
|
@ -247,7 +247,7 @@ char *get_ttymode(Frontend *frontend, const char *mode)
|
||||||
|
|
||||||
static void start_backend(void)
|
static void start_backend(void)
|
||||||
{
|
{
|
||||||
const struct Backend_vtable *vt;
|
const struct BackendVtable *vt;
|
||||||
const char *error;
|
const char *error;
|
||||||
char msg[1024], *title;
|
char msg[1024], *title;
|
||||||
char *realhost;
|
char *realhost;
|
||||||
|
@ -412,7 +412,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||||
default_protocol = be_default_protocol;
|
default_protocol = be_default_protocol;
|
||||||
/* Find the appropriate default port. */
|
/* Find the appropriate default port. */
|
||||||
{
|
{
|
||||||
const struct Backend_vtable *vt =
|
const struct BackendVtable *vt =
|
||||||
backend_vt_from_proto(default_protocol);
|
backend_vt_from_proto(default_protocol);
|
||||||
default_port = 0; /* illegal */
|
default_port = 0; /* illegal */
|
||||||
if (vt)
|
if (vt)
|
||||||
|
|
|
@ -43,7 +43,7 @@ typedef struct HandleSocket {
|
||||||
|
|
||||||
Plug *plug;
|
Plug *plug;
|
||||||
|
|
||||||
const Socket_vtable *sockvt;
|
const SocketVtable *sockvt;
|
||||||
} HandleSocket;
|
} HandleSocket;
|
||||||
|
|
||||||
static int handle_gotdata(struct handle *h, void *data, int len)
|
static int handle_gotdata(struct handle *h, void *data, int len)
|
||||||
|
@ -306,7 +306,7 @@ static char *sk_handle_peer_info(Socket *s)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Socket_vtable HandleSocket_sockvt = {
|
static const SocketVtable HandleSocket_sockvt = {
|
||||||
sk_handle_plug,
|
sk_handle_plug,
|
||||||
sk_handle_close,
|
sk_handle_close,
|
||||||
sk_handle_write,
|
sk_handle_write,
|
||||||
|
|
|
@ -76,7 +76,7 @@ struct NetSocket {
|
||||||
*/
|
*/
|
||||||
NetSocket *parent, *child;
|
NetSocket *parent, *child;
|
||||||
|
|
||||||
const Socket_vtable *sockvt;
|
const SocketVtable *sockvt;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SockAddr {
|
struct SockAddr {
|
||||||
|
@ -935,7 +935,7 @@ static char *sk_net_peer_info(Socket *s);
|
||||||
|
|
||||||
extern char *do_select(SOCKET skt, int startup);
|
extern char *do_select(SOCKET skt, int startup);
|
||||||
|
|
||||||
static const Socket_vtable NetSocket_sockvt = {
|
static const SocketVtable NetSocket_sockvt = {
|
||||||
sk_net_plug,
|
sk_net_plug,
|
||||||
sk_net_close,
|
sk_net_close,
|
||||||
sk_net_write,
|
sk_net_write,
|
||||||
|
|
|
@ -34,7 +34,7 @@ typedef struct NamedPipeServerSocket {
|
||||||
Plug *plug;
|
Plug *plug;
|
||||||
char *error;
|
char *error;
|
||||||
|
|
||||||
const Socket_vtable *sockvt;
|
const SocketVtable *sockvt;
|
||||||
} NamedPipeServerSocket;
|
} NamedPipeServerSocket;
|
||||||
|
|
||||||
static Plug *sk_namedpipeserver_plug(Socket *s, Plug *p)
|
static Plug *sk_namedpipeserver_plug(Socket *s, Plug *p)
|
||||||
|
@ -204,7 +204,7 @@ static void named_pipe_connect_callback(void *vps)
|
||||||
* This socket type is only used for listening, so it should never
|
* This socket type is only used for listening, so it should never
|
||||||
* be asked to write or flush or set_frozen.
|
* be asked to write or flush or set_frozen.
|
||||||
*/
|
*/
|
||||||
static const Socket_vtable NamedPipeServerSocket_sockvt = {
|
static const SocketVtable NamedPipeServerSocket_sockvt = {
|
||||||
sk_namedpipeserver_plug,
|
sk_namedpipeserver_plug,
|
||||||
sk_namedpipeserver_close,
|
sk_namedpipeserver_close,
|
||||||
NULL /* write */,
|
NULL /* write */,
|
||||||
|
|
|
@ -289,7 +289,7 @@ int main(int argc, char **argv)
|
||||||
int use_subsystem = 0;
|
int use_subsystem = 0;
|
||||||
int just_test_share_exists = FALSE;
|
int just_test_share_exists = FALSE;
|
||||||
unsigned long now, next, then;
|
unsigned long now, next, then;
|
||||||
const struct Backend_vtable *vt;
|
const struct BackendVtable *vt;
|
||||||
|
|
||||||
dll_hijacking_protection();
|
dll_hijacking_protection();
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ int main(int argc, char **argv)
|
||||||
*/
|
*/
|
||||||
char *p = getenv("PLINK_PROTOCOL");
|
char *p = getenv("PLINK_PROTOCOL");
|
||||||
if (p) {
|
if (p) {
|
||||||
const struct Backend_vtable *vt = backend_vt_from_name(p);
|
const struct BackendVtable *vt = backend_vt_from_name(p);
|
||||||
if (vt) {
|
if (vt) {
|
||||||
default_protocol = vt->protocol;
|
default_protocol = vt->protocol;
|
||||||
default_port = vt->default_port;
|
default_port = vt->default_port;
|
||||||
|
|
|
@ -440,7 +440,7 @@ static int serial_cfg_info(Backend *be)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct Backend_vtable serial_backend = {
|
const struct BackendVtable serial_backend = {
|
||||||
serial_init,
|
serial_init,
|
||||||
serial_free,
|
serial_free,
|
||||||
serial_reconfig,
|
serial_reconfig,
|
||||||
|
|
|
@ -596,7 +596,7 @@ void agent_schedule_callback(void (*callback)(void *, void *, int),
|
||||||
/*
|
/*
|
||||||
* Exports from winser.c.
|
* Exports from winser.c.
|
||||||
*/
|
*/
|
||||||
extern const struct Backend_vtable serial_backend;
|
extern const struct BackendVtable serial_backend;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exports from winjump.c.
|
* Exports from winjump.c.
|
||||||
|
|
4
x11fwd.c
4
x11fwd.c
|
@ -42,7 +42,7 @@ typedef struct X11Connection {
|
||||||
SshChannel *c; /* channel structure held by SSH backend */
|
SshChannel *c; /* channel structure held by SSH backend */
|
||||||
Socket *s;
|
Socket *s;
|
||||||
|
|
||||||
const Plug_vtable *plugvt;
|
const PlugVtable *plugvt;
|
||||||
Channel chan;
|
Channel chan;
|
||||||
} X11Connection;
|
} X11Connection;
|
||||||
|
|
||||||
|
@ -699,7 +699,7 @@ int x11_get_screen_number(char *display)
|
||||||
return atoi(display + n + 1);
|
return atoi(display + n + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const Plug_vtable X11Connection_plugvt = {
|
static const PlugVtable X11Connection_plugvt = {
|
||||||
x11_log,
|
x11_log,
|
||||||
x11_closing,
|
x11_closing,
|
||||||
x11_receive,
|
x11_receive,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче