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 @@
#include "crypto.h"
#include "daemon.h"
#include "format.h"
#include "gateway_channel.h"
#include "io.h"
#include "io_commands.h"
#include "lookup_verifier.h"
#include "proxy.h"
#include "proxy_agentforward.h"
#include "proxy_channel.h"
#include "proxy_session.h"
#include "proxy_tcpforward.h"
#include "proxy_userauth.h"
......@@ -683,23 +683,23 @@ int main(int argc, char **argv)
server_session_requests = make_alist
(4,
ATOM_SHELL, &proxy_channel_request,
ATOM_PTY_REQ, &proxy_channel_request,
ATOM_EXIT_STATUS, &proxy_channel_request,
ATOM_EXIT_SIGNAL, &proxy_channel_request,
ATOM_SHELL, &gateway_channel_request,
ATOM_PTY_REQ, &gateway_channel_request,
ATOM_EXIT_STATUS, &gateway_channel_request,
ATOM_EXIT_SIGNAL, &gateway_channel_request,
-1);
client_session_requests = make_alist(0, -1);
#if 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
#if 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
......@@ -717,10 +717,10 @@ int main(int argc, char **argv)
{
object_queue_add_tail(&connection_server_hooks,
&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,
&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,
&make_install_fix_channel_open_handler
(ATOM_DIRECT_TCPIP,
......
......@@ -22,18 +22,20 @@
*/
#include "proxy.h"
#include "proxy_channel.h"
#include "proxy_session.h"
#include "proxy_userauth.h"
#include "channel_commands.h"
#include "exception.h"
#include "xalloc.h"
#include "connection.h"
#include "command.h"
#include "connection.h"
#include "exception.h"
#include "format.h"
#include "gateway_channel.h"
#include "io_commands.h"
#include "proxy_session.h"
#include "proxy_userauth.h"
#include "ssh.h"
#include "werror.h"
#include "xalloc.h"
#include <assert.h>
#include <arpa/inet.h>
......
......@@ -22,12 +22,13 @@
*/
#include "proxy_agentforward.h"
#include "proxy_channel.h"
#include "xalloc.h"
#include "ssh.h"
#include "werror.h"
#include "channel_commands.h"
#include "format.h"
#include "gateway_channel.h"
#include "ssh.h"
#include "werror.h"
#include "xalloc.h"
#define WINDOW_SIZE 10000
......@@ -35,6 +36,7 @@ static void
do_proxy_open_auth_agent(struct channel_open *s UNUSED,
struct ssh_connection *connection,
UINT32 type,
UINT32 send_window_size,
UINT32 send_max_packet,
struct simple_buffer *args,
struct command_continuation *c,
......@@ -43,25 +45,21 @@ do_proxy_open_auth_agent(struct channel_open *s UNUSED,
if (parse_eod(args))
{
struct proxy_channel *server
= make_proxy_channel(WINDOW_SIZE,
/* 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 gateway_channel *server
= make_gateway_channel(NULL);
/* NOTE: The origin's rec_window_size and rec_max_packet becomes the target's
* send_window_size and send_max_packet. */
struct command *o
= make_proxy_channel_open_command(type,
send_max_packet,
ssh_format(""),
NULL);
= make_gateway_channel_open_command(type,
send_window_size, send_max_packet,
ssh_format(""),
NULL);
werror("auth-agent open request\n");
COMMAND_CALL(o,
connection->chain,
make_proxy_channel_open_continuation(c, server),
make_gateway_channel_open_continuation(c, server),
e);
}
......
......@@ -25,7 +25,7 @@
#include "channel_commands.h"
#include "format.h"
#include "proxy_channel.h"
#include "gateway_channel.h"
#include "ssh.h"
#include "werror.h"
#include "xalloc.h"
......@@ -51,6 +51,7 @@ static void
do_proxy_open_session(struct channel_open *s,
struct ssh_connection *connection,
UINT32 type,
UINT32 send_window_size,
UINT32 send_max_packet,
struct simple_buffer *args,
struct command_continuation *c,
......@@ -62,22 +63,18 @@ do_proxy_open_session(struct channel_open *s,
if (parse_eod(args))
{
struct proxy_channel *server
= make_proxy_channel(WINDOW_SIZE,
/* 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,
closure->server_requests, 0);
struct gateway_channel *server
= make_gateway_channel(closure->server_requests);
/* NOTE: The origin's rec_window_size and rec_max_packet becomes the target's
* send_window_size and send_max_packet. */
struct command *o =
make_proxy_channel_open_command(type, send_max_packet,
ssh_format(""), closure->client_requests);
make_gateway_channel_open_command(type, send_window_size, send_max_packet,
ssh_format(""), closure->client_requests);
COMMAND_CALL(o,
connection->chain,
make_proxy_channel_open_continuation(c, server),
make_gateway_channel_open_continuation(c, server),
e);
}
......
......@@ -22,7 +22,8 @@
*/
#include "proxy_tcpforward.h"
#include "proxy_channel.h"
#include "gateway_channel.h"
#include "xalloc.h"
#include "ssh.h"
#include "werror.h"
......@@ -35,6 +36,7 @@ static void
do_proxy_open_direct_tcpip(struct channel_open *s UNUSED,
struct ssh_connection *connection,
UINT32 type,
UINT32 send_window_size,
UINT32 send_max_packet,
struct simple_buffer *args,
struct command_continuation *c,
......@@ -51,26 +53,24 @@ do_proxy_open_direct_tcpip(struct channel_open *s UNUSED,
parse_uint32(args, &orig_port) &&
parse_eod(args))
{
struct proxy_channel *server
= make_proxy_channel(WINDOW_SIZE,
/* 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
= make_proxy_channel_open_command(type,
send_max_packet,
ssh_format("%S%i%S%i",
host, port,
orig_host, orig_port), NULL);
struct gateway_channel *server
= make_gateway_channel(NULL);
/* NOTE: The origin's rec_window_size and rec_max_packet becomes the target's
* send_window_size and send_max_packet. */
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,
connection->chain,
make_proxy_channel_open_continuation(c, server),
make_gateway_channel_open_continuation(c, server),
e);
}
......@@ -95,6 +95,7 @@ static void
do_proxy_open_forwarded_tcpip(struct channel_open *s UNUSED,
struct ssh_connection *connection,
UINT32 type,
UINT32 send_window_size,
UINT32 send_max_packet,
struct simple_buffer *args,
struct command_continuation *c,
......@@ -111,26 +112,22 @@ do_proxy_open_forwarded_tcpip(struct channel_open *s UNUSED,
parse_uint32(args, &orig_port) &&
parse_eod(args))
{
struct proxy_channel *server
= make_proxy_channel(WINDOW_SIZE,
/* 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 gateway_channel *server
= make_gateway_channel(NULL);
/* NOTE: The origin's rec_window_size and rec_max_packet becomes the target's
* send_window_size and send_max_packet. */
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);
= 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: address where connection was accepted=%S:%i, originator=%S:%i", host, port, orig_host, orig_port);
COMMAND_CALL(o,
connection->chain,
make_proxy_channel_open_continuation(c, server),
make_gateway_channel_open_continuation(c, server),
e);
}
......
......@@ -22,7 +22,8 @@
*/
#include "proxy_x11forward.h"
#include "proxy_channel.h"
#include "gateway_channel.h"
#include "xalloc.h"
#include "ssh.h"
#include "werror.h"
......@@ -35,6 +36,7 @@ static void
do_proxy_open_x11(struct channel_open *s UNUSED,
struct ssh_connection *connection,
UINT32 type,
UINT32 send_window_size,
UINT32 send_max_packet,
struct simple_buffer *args,
struct command_continuation *c,
......@@ -52,38 +54,33 @@ do_proxy_open_x11(struct channel_open *s UNUSED,
#endif
parse_eod(args))
{
struct proxy_channel *server
= make_proxy_channel(WINDOW_SIZE,
/* 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 gateway_channel *server
= make_gateway_channel(NULL);
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)
o = make_proxy_channel_open_command(type,
send_max_packet,
ssh_format("%S",
host),
NULL);
o = make_gateway_channel_open_command(type,
send_window_size, send_max_packet,
ssh_format("%S",
host),
NULL);
else
/* FIXME: maybe parse the sent string to get the port value */
o = make_proxy_channel_open_command(type,
send_max_packet,
ssh_format("%S%i",
host, port),
NULL);
o = make_gateway_channel_open_command(type,
send_window_size, send_max_packet,
ssh_format("%S%i",
host, port),
NULL);
if (port)
werror("x11 open request: host=%S:%i\n", host, port);
else
werror("datafellows compatible x11 open request: %S\n", host);
COMMAND_CALL(o,
connection->chain,
make_proxy_channel_open_continuation(c, server),
make_gateway_channel_open_continuation(c, server),
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