Commit 0f3f22d6 authored by Stas Korobeynikov's avatar Stas Korobeynikov Committed by Pavel Vainerman

add nx buffer

parent 16d101e8
...@@ -83,6 +83,13 @@ ...@@ -83,6 +83,13 @@
#include "authfd.h" #include "authfd.h"
#include "pathnames.h" #include "pathnames.h"
/*
* Include the NX specific functions and
* definitions.
*/
#include "proxy.h"
#define PANIC #define PANIC
#define WARNING #define WARNING
#undef TEST #undef TEST
...@@ -387,6 +394,11 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd, ...@@ -387,6 +394,11 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
c->mux_pause = 0; c->mux_pause = 0;
c->delayed = 1; /* prevent call to channel_post handler */ c->delayed = 1; /* prevent call to channel_post handler */
TAILQ_INIT(&c->status_confirms); TAILQ_INIT(&c->status_confirms);
/*
* Initialize the NX members.
*/
buffer_init(&c->nx_buffer);
debug("channel %d: new [%s]", found, remote_name); debug("channel %d: new [%s]", found, remote_name);
return c; return c;
} }
...@@ -499,6 +511,10 @@ channel_free(Channel *c) ...@@ -499,6 +511,10 @@ channel_free(Channel *c)
buffer_free(&c->input); buffer_free(&c->input);
buffer_free(&c->output); buffer_free(&c->output);
buffer_free(&c->extended); buffer_free(&c->extended);
/*
* Free the NX members.
*/
buffer_free(&c->nx_buffer);
free(c->remote_name); free(c->remote_name);
c->remote_name = NULL; c->remote_name = NULL;
free(c->path); free(c->path);
......
...@@ -164,6 +164,13 @@ struct Channel { ...@@ -164,6 +164,13 @@ struct Channel {
void *mux_ctx; void *mux_ctx;
int mux_pause; int mux_pause;
int mux_downstream_id; int mux_downstream_id;
/*
* Enqueue data read from the local side
* to intercept the switch command.
*/
Buffer nx_buffer;
}; };
#define CHAN_EXTENDED_IGNORE 0 #define CHAN_EXTENDED_IGNORE 0
...@@ -275,6 +282,7 @@ void channel_update_permitted_opens(int, int); ...@@ -275,6 +282,7 @@ void channel_update_permitted_opens(int, int);
void channel_clear_permitted_opens(void); void channel_clear_permitted_opens(void);
void channel_clear_adm_permitted_opens(void); void channel_clear_adm_permitted_opens(void);
void channel_print_adm_permitted_opens(void); void channel_print_adm_permitted_opens(void);
int channel_input_port_forward_request(int, struct ForwardOptions *);
Channel *channel_connect_to_port(const char *, u_short, char *, char *, int *, Channel *channel_connect_to_port(const char *, u_short, char *, char *, int *,
const char **); const char **);
Channel *channel_connect_to_path(const char *, char *, char *); Channel *channel_connect_to_path(const char *, char *, char *);
......
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