Commit a9a99daa authored by Niels Möller's avatar Niels Möller
Browse files

Use gateway_channel.

Rev: src/lsh_proxy.c:1.8
Rev: src/proxy.c:1.6
Rev: src/proxy_agentforward.c:1.2
Rev: src/proxy_session.c:1.6
Rev: src/proxy_tcpforward.c:1.3
Rev: src/proxy_x11forward.c:1.2
parent b741be99
...@@ -35,12 +35,12 @@ ...@@ -35,12 +35,12 @@
#include "crypto.h" #include "crypto.h"
#include "daemon.h" #include "daemon.h"
#include "format.h" #include "format.h"
#include "gateway_channel.h"
#include "io.h" #include "io.h"
#include "io_commands.h" #include "io_commands.h"
#include "lookup_verifier.h" #include "lookup_verifier.h"
#include "proxy.h" #include "proxy.h"
#include "proxy_agentforward.h" #include "proxy_agentforward.h"
#include "proxy_channel.h"
#include "proxy_session.h" #include "proxy_session.h"
#include "proxy_tcpforward.h" #include "proxy_tcpforward.h"
#include "proxy_userauth.h" #include "proxy_userauth.h"
...@@ -683,23 +683,23 @@ int main(int argc, char **argv) ...@@ -683,23 +683,23 @@ int main(int argc, char **argv)
server_session_requests = make_alist server_session_requests = make_alist
(4, (4,
ATOM_SHELL, &proxy_channel_request, ATOM_SHELL, &gateway_channel_request,
ATOM_PTY_REQ, &proxy_channel_request, ATOM_PTY_REQ, &gateway_channel_request,
ATOM_EXIT_STATUS, &proxy_channel_request, ATOM_EXIT_STATUS, &gateway_channel_request,
ATOM_EXIT_SIGNAL, &proxy_channel_request, ATOM_EXIT_SIGNAL, &gateway_channel_request,
-1); -1);
client_session_requests = make_alist(0, -1); client_session_requests = make_alist(0, -1);
#if WITH_X11_FORWARD #if WITH_X11_FORWARD
if (options->with_x11_forward) if (options->with_x11_forward)
{ {
ALIST_SET(server_session_requests, ATOM_X11_REQ, &proxy_channel_request); ALIST_SET(server_session_requests, ATOM_X11_REQ, &gateway_channel_request);
} }
#endif #endif
#if WITH_AGENT_FORWARD #if WITH_AGENT_FORWARD
if (options->with_agent_forward) if (options->with_agent_forward)
{ {
ALIST_SET(server_session_requests, ATOM_AUTH_AGENT_REQ, &proxy_channel_request); ALIST_SET(server_session_requests, ATOM_AUTH_AGENT_REQ, &gateway_channel_request);
} }
#endif #endif
...@@ -717,10 +717,10 @@ int main(int argc, char **argv) ...@@ -717,10 +717,10 @@ int main(int argc, char **argv)
{ {
object_queue_add_tail(&connection_server_hooks, object_queue_add_tail(&connection_server_hooks,
&make_install_fix_global_request_handler &make_install_fix_global_request_handler
(ATOM_TCPIP_FORWARD, &proxy_global_request)->super); (ATOM_TCPIP_FORWARD, &gateway_global_request)->super);
object_queue_add_tail(&connection_server_hooks, object_queue_add_tail(&connection_server_hooks,
&make_install_fix_global_request_handler &make_install_fix_global_request_handler
(ATOM_CANCEL_TCPIP_FORWARD, &proxy_global_request)->super); (ATOM_CANCEL_TCPIP_FORWARD, &gateway_global_request)->super);
object_queue_add_tail(&connection_server_hooks, object_queue_add_tail(&connection_server_hooks,
&make_install_fix_channel_open_handler &make_install_fix_channel_open_handler
(ATOM_DIRECT_TCPIP, (ATOM_DIRECT_TCPIP,
......
...@@ -22,18 +22,20 @@ ...@@ -22,18 +22,20 @@
*/ */
#include "proxy.h" #include "proxy.h"
#include "proxy_channel.h"
#include "proxy_session.h"
#include "proxy_userauth.h"
#include "channel_commands.h" #include "channel_commands.h"
#include "exception.h"
#include "xalloc.h"
#include "connection.h"
#include "command.h" #include "command.h"
#include "connection.h"
#include "exception.h"
#include "format.h" #include "format.h"
#include "gateway_channel.h"
#include "io_commands.h" #include "io_commands.h"
#include "proxy_session.h"
#include "proxy_userauth.h"
#include "ssh.h" #include "ssh.h"
#include "werror.h" #include "werror.h"
#include "xalloc.h"
#include <assert.h> #include <assert.h>
#include <arpa/inet.h> #include <arpa/inet.h>
......
...@@ -22,12 +22,13 @@ ...@@ -22,12 +22,13 @@
*/ */
#include "proxy_agentforward.h" #include "proxy_agentforward.h"
#include "proxy_channel.h"
#include "xalloc.h"
#include "ssh.h"
#include "werror.h"
#include "channel_commands.h" #include "channel_commands.h"
#include "format.h" #include "format.h"
#include "gateway_channel.h"
#include "ssh.h"
#include "werror.h"
#include "xalloc.h"
#define WINDOW_SIZE 10000 #define WINDOW_SIZE 10000
...@@ -35,6 +36,7 @@ static void ...@@ -35,6 +36,7 @@ static void
do_proxy_open_auth_agent(struct channel_open *s UNUSED, do_proxy_open_auth_agent(struct channel_open *s UNUSED,
struct ssh_connection *connection, struct ssh_connection *connection,
UINT32 type, UINT32 type,
UINT32 send_window_size,
UINT32 send_max_packet, UINT32 send_max_packet,
struct simple_buffer *args, struct simple_buffer *args,
struct command_continuation *c, struct command_continuation *c,
...@@ -43,25 +45,21 @@ do_proxy_open_auth_agent(struct channel_open *s UNUSED, ...@@ -43,25 +45,21 @@ do_proxy_open_auth_agent(struct channel_open *s UNUSED,
if (parse_eod(args)) if (parse_eod(args))
{ {
struct proxy_channel *server struct gateway_channel *server
= make_proxy_channel(WINDOW_SIZE, = make_gateway_channel(NULL);
/* FIXME: We should adapt to the other
* end's max packet size. Parhaps should /* NOTE: The origin's rec_window_size and rec_max_packet becomes the target's
* be done by * send_window_size and send_max_packet. */
* do_proxy_channel_open_continuation() ?
* */
SSH_MAX_PACKET,
NULL, 0);
struct command *o struct command *o
= make_proxy_channel_open_command(type, = make_gateway_channel_open_command(type,
send_max_packet, send_window_size, send_max_packet,
ssh_format(""), ssh_format(""),
NULL); NULL);
werror("auth-agent open request\n"); werror("auth-agent open request\n");
COMMAND_CALL(o, COMMAND_CALL(o,
connection->chain, connection->chain,
make_proxy_channel_open_continuation(c, server), make_gateway_channel_open_continuation(c, server),
e); e);
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "channel_commands.h" #include "channel_commands.h"
#include "format.h" #include "format.h"
#include "proxy_channel.h" #include "gateway_channel.h"
#include "ssh.h" #include "ssh.h"
#include "werror.h" #include "werror.h"
#include "xalloc.h" #include "xalloc.h"
...@@ -51,6 +51,7 @@ static void ...@@ -51,6 +51,7 @@ static void
do_proxy_open_session(struct channel_open *s, do_proxy_open_session(struct channel_open *s,
struct ssh_connection *connection, struct ssh_connection *connection,
UINT32 type, UINT32 type,
UINT32 send_window_size,
UINT32 send_max_packet, UINT32 send_max_packet,
struct simple_buffer *args, struct simple_buffer *args,
struct command_continuation *c, struct command_continuation *c,
...@@ -62,22 +63,18 @@ do_proxy_open_session(struct channel_open *s, ...@@ -62,22 +63,18 @@ do_proxy_open_session(struct channel_open *s,
if (parse_eod(args)) if (parse_eod(args))
{ {
struct proxy_channel *server struct gateway_channel *server
= make_proxy_channel(WINDOW_SIZE, = make_gateway_channel(closure->server_requests);
/* FIXME: We should adapt to the other
* end's max packet size. Parhaps should /* NOTE: The origin's rec_window_size and rec_max_packet becomes the target's
* be done by * send_window_size and send_max_packet. */
* do_proxy_channel_open_continuation() ?
* */
SSH_MAX_PACKET,
closure->server_requests, 0);
struct command *o = struct command *o =
make_proxy_channel_open_command(type, send_max_packet, make_gateway_channel_open_command(type, send_window_size, send_max_packet,
ssh_format(""), closure->client_requests); ssh_format(""), closure->client_requests);
COMMAND_CALL(o, COMMAND_CALL(o,
connection->chain, connection->chain,
make_proxy_channel_open_continuation(c, server), make_gateway_channel_open_continuation(c, server),
e); e);
} }
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
*/ */
#include "proxy_tcpforward.h" #include "proxy_tcpforward.h"
#include "proxy_channel.h"
#include "gateway_channel.h"
#include "xalloc.h" #include "xalloc.h"
#include "ssh.h" #include "ssh.h"
#include "werror.h" #include "werror.h"
...@@ -35,6 +36,7 @@ static void ...@@ -35,6 +36,7 @@ static void
do_proxy_open_direct_tcpip(struct channel_open *s UNUSED, do_proxy_open_direct_tcpip(struct channel_open *s UNUSED,
struct ssh_connection *connection, struct ssh_connection *connection,
UINT32 type, UINT32 type,
UINT32 send_window_size,
UINT32 send_max_packet, UINT32 send_max_packet,
struct simple_buffer *args, struct simple_buffer *args,
struct command_continuation *c, struct command_continuation *c,
...@@ -51,26 +53,24 @@ do_proxy_open_direct_tcpip(struct channel_open *s UNUSED, ...@@ -51,26 +53,24 @@ do_proxy_open_direct_tcpip(struct channel_open *s UNUSED,
parse_uint32(args, &orig_port) && parse_uint32(args, &orig_port) &&
parse_eod(args)) parse_eod(args))
{ {
struct proxy_channel *server struct gateway_channel *server
= make_proxy_channel(WINDOW_SIZE, = make_gateway_channel(NULL);
/* FIXME: We should adapt to the other
* end's max packet size. Parhaps should /* NOTE: The origin's rec_window_size and rec_max_packet becomes the target's
* be done by * send_window_size and send_max_packet. */
* do_proxy_channel_open_continuation() ?
* */
SSH_MAX_PACKET,
NULL, 0);
struct command *o
= make_proxy_channel_open_command(type,
send_max_packet,
ssh_format("%S%i%S%i",
host, port,
orig_host, orig_port), NULL);
werror("direct-tcpip open request: host to connect=%S:%i, originator=%S:%i", host, port, orig_host, orig_port); struct command *o
= make_gateway_channel_open_command(type,
send_window_size, send_max_packet,
ssh_format("%S%i%S%i",
host, port,
orig_host, orig_port), NULL);
werror("direct-tcpip open request: host to connect=%S:%i, originator=%S:%i",
host, port, orig_host, orig_port);
COMMAND_CALL(o, COMMAND_CALL(o,
connection->chain, connection->chain,
make_proxy_channel_open_continuation(c, server), make_gateway_channel_open_continuation(c, server),
e); e);
} }
...@@ -95,6 +95,7 @@ static void ...@@ -95,6 +95,7 @@ static void
do_proxy_open_forwarded_tcpip(struct channel_open *s UNUSED, do_proxy_open_forwarded_tcpip(struct channel_open *s UNUSED,
struct ssh_connection *connection, struct ssh_connection *connection,
UINT32 type, UINT32 type,
UINT32 send_window_size,
UINT32 send_max_packet, UINT32 send_max_packet,
struct simple_buffer *args, struct simple_buffer *args,
struct command_continuation *c, struct command_continuation *c,
...@@ -111,26 +112,22 @@ do_proxy_open_forwarded_tcpip(struct channel_open *s UNUSED, ...@@ -111,26 +112,22 @@ do_proxy_open_forwarded_tcpip(struct channel_open *s UNUSED,
parse_uint32(args, &orig_port) && parse_uint32(args, &orig_port) &&
parse_eod(args)) parse_eod(args))
{ {
struct proxy_channel *server struct gateway_channel *server
= make_proxy_channel(WINDOW_SIZE, = make_gateway_channel(NULL);
/* FIXME: We should adapt to the other
* end's max packet size. Parhaps should /* NOTE: The origin's rec_window_size and rec_max_packet becomes the target's
* be done by * send_window_size and send_max_packet. */
* do_proxy_channel_open_continuation() ?
* */
SSH_MAX_PACKET,
NULL, 0);
struct command *o struct command *o
= make_proxy_channel_open_command(type, = make_gateway_channel_open_command(type,
send_max_packet, send_window_size, send_max_packet,
ssh_format("%S%i%S%i", ssh_format("%S%i%S%i",
host, port, host, port,
orig_host, orig_port), NULL); orig_host, orig_port), NULL);
werror("direct-tcpip open request: address where connection was accepted=%S:%i, originator=%S:%i", host, port, orig_host, orig_port); werror("direct-tcpip open request: address where connection was accepted=%S:%i, originator=%S:%i", host, port, orig_host, orig_port);
COMMAND_CALL(o, COMMAND_CALL(o,
connection->chain, connection->chain,
make_proxy_channel_open_continuation(c, server), make_gateway_channel_open_continuation(c, server),
e); e);
} }
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
*/ */
#include "proxy_x11forward.h" #include "proxy_x11forward.h"
#include "proxy_channel.h"
#include "gateway_channel.h"
#include "xalloc.h" #include "xalloc.h"
#include "ssh.h" #include "ssh.h"
#include "werror.h" #include "werror.h"
...@@ -35,6 +36,7 @@ static void ...@@ -35,6 +36,7 @@ static void
do_proxy_open_x11(struct channel_open *s UNUSED, do_proxy_open_x11(struct channel_open *s UNUSED,
struct ssh_connection *connection, struct ssh_connection *connection,
UINT32 type, UINT32 type,
UINT32 send_window_size,
UINT32 send_max_packet, UINT32 send_max_packet,
struct simple_buffer *args, struct simple_buffer *args,
struct command_continuation *c, struct command_continuation *c,
...@@ -52,38 +54,33 @@ do_proxy_open_x11(struct channel_open *s UNUSED, ...@@ -52,38 +54,33 @@ do_proxy_open_x11(struct channel_open *s UNUSED,
#endif #endif
parse_eod(args)) parse_eod(args))
{ {
struct proxy_channel *server struct gateway_channel *server
= make_proxy_channel(WINDOW_SIZE, = make_gateway_channel(NULL);
/* FIXME: We should adapt to the other
* end's max packet size. Parhaps should
* be done by
* do_proxy_channel_open_continuation() ?
* */
SSH_MAX_PACKET,
NULL, 0);
struct command *o; struct command *o;
/* NOTE: The origin's rec_window_size and rec_max_packet becomes the target's
* send_window_size and send_max_packet. */
if (connection->chain->peer_flags & PEER_X11_OPEN_KLUDGE) if (connection->chain->peer_flags & PEER_X11_OPEN_KLUDGE)
o = make_proxy_channel_open_command(type, o = make_gateway_channel_open_command(type,
send_max_packet, send_window_size, send_max_packet,
ssh_format("%S", ssh_format("%S",
host), host),
NULL); NULL);
else else
/* FIXME: maybe parse the sent string to get the port value */ /* FIXME: maybe parse the sent string to get the port value */
o = make_proxy_channel_open_command(type, o = make_gateway_channel_open_command(type,
send_max_packet, send_window_size, send_max_packet,
ssh_format("%S%i", ssh_format("%S%i",
host, port), host, port),
NULL); NULL);
if (port) if (port)
werror("x11 open request: host=%S:%i\n", host, port); werror("x11 open request: host=%S:%i\n", host, port);
else else
werror("datafellows compatible x11 open request: %S\n", host); werror("datafellows compatible x11 open request: %S\n", host);
COMMAND_CALL(o, COMMAND_CALL(o,
connection->chain, connection->chain,
make_proxy_channel_open_continuation(c, server), make_gateway_channel_open_continuation(c, server),
e); e);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment