Bert Wesarg
2011-Jan-13 21:40 UTC
[PATCH] mux: update PROTOCOL.mux and fix error messages on client side
--- PROTOCOL.mux | 24 ++++++++++++------------ mux.c | 10 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/PROTOCOL.mux b/PROTOCOL.mux index 1d8c463..958e0d5 100644 --- a/PROTOCOL.mux +++ b/PROTOCOL.mux @@ -28,7 +28,7 @@ defined. To open a new multiplexed session, a client may send the following request: - uint32 MUX_C_MSG_NEW_SESSION + uint32 MUX_C_NEW_SESSION uint32 request id string reserved bool want tty flag @@ -99,7 +99,7 @@ The server will reply with one of MUX_S_OK or MUX_S_PERMISSION_DENIED. A client may request the master to establish a port forward: - uint32 MUX_C_OPEN_FORWARD + uint32 MUX_C_OPEN_FWD uint32 request id uint32 forwarding type string listen host @@ -118,24 +118,23 @@ For dynamically allocated listen port the server replies with uint32 client request id uint32 allocated remote listen port -5. Requesting closure of port forwards +6. Requesting closure of port forwards + +Note: currently unimplemented (server will always reply with MUX_S_FAILURE). A client may request the master to establish a port forward: - uint32 MUX_C_OPEN_FORWARD + uint32 MUX_C_CLOSE_FWD uint32 request id - uint32 forwarding type string listen host string listen port string connect host string connect port -forwarding type may be MUX_FWD_LOCAL, MUX_FWD_REMOTE, MUX_FWD_DYNAMIC. - A server may reply with a MUX_S_OK, a MUX_S_PERMISSION_DENIED or a MUX_S_FAILURE. -6. Requesting stdio forwarding +7. Requesting stdio forwarding A client may request the master to establish a stdio forwarding: @@ -153,7 +152,7 @@ The contents of "reserved" are currently ignored. A server may reply with a MUX_S_SESSION_OPEED, a MUX_S_PERMISSION_DENIED or a MUX_S_FAILURE. -7. Status messages +8. Status messages The MUX_S_OK message is empty: @@ -170,14 +169,15 @@ The MUX_S_PERMISSION_DENIED and MUX_S_FAILURE include a reason: uint32 client request id string reason -7. Protocol numbers +9. Protocol numbers #define MUX_MSG_HELLO 0x00000001 #define MUX_C_NEW_SESSION 0x10000002 #define MUX_C_ALIVE_CHECK 0x10000004 #define MUX_C_TERMINATE 0x10000005 -#define MUX_C_OPEN_FORWARD 0x10000006 -#define MUX_C_CLOSE_FORWARD 0x10000007 +#define MUX_C_OPEN_FWD 0x10000006 +#define MUX_C_CLOSE_FWD 0x10000007 +#define MUX_C_NEW_STDIO_FWD 0x10000008 #define MUX_S_OK 0x80000001 #define MUX_S_PERMISSION_DENIED 0x80000002 #define MUX_S_FAILURE 0x80000003 diff --git a/mux.c b/mux.c index f1f7e6b..9b3633b 100644 --- a/mux.c +++ b/mux.c @@ -1530,7 +1530,7 @@ mux_client_request_forward(int fd, u_int ftype, Forward *fwd) case MUX_S_FAILURE: e = buffer_get_string(&m, NULL); buffer_free(&m); - error("%s: session request failed: %s", __func__, e); + error("%s: forwarding request failed: %s", __func__, e); return -1; default: fatal("%s: unexpected response from master 0x%08x", @@ -1649,12 +1649,12 @@ mux_client_request_session(int fd) case MUX_S_PERMISSION_DENIED: e = buffer_get_string(&m, NULL); buffer_free(&m); - error("Master refused forwarding request: %s", e); + error("Master refused session request: %s", e); return -1; case MUX_S_FAILURE: e = buffer_get_string(&m, NULL); buffer_free(&m); - error("%s: forwarding request failed: %s", __func__, e); + error("%s: session request failed: %s", __func__, e); return -1; default: buffer_free(&m); @@ -1781,11 +1781,11 @@ mux_client_request_stdio_fwd(int fd) case MUX_S_PERMISSION_DENIED: e = buffer_get_string(&m, NULL); buffer_free(&m); - fatal("Master refused forwarding request: %s", e); + fatal("Master refused stdio forwarding request: %s", e); case MUX_S_FAILURE: e = buffer_get_string(&m, NULL); buffer_free(&m); - fatal("%s: stdio forwarding request failed: %s", __func__, e); + fatal("%s: stdio stdio forwarding request failed: %s", __func__, e); default: buffer_free(&m); error("%s: unexpected response from master 0x%08x", -- 1.7.3.3.1603.g7f137
Damien Miller
2011-Jan-13 21:55 UTC
[PATCH] mux: update PROTOCOL.mux and fix error messages on client side
applied, except:> - fatal("%s: stdio forwarding request failed: %s", __func__, e); > + fatal("%s: stdio stdio forwarding request failed: %s", __func__, e);thanks
Bert Wesarg
2011-Jan-14 08:42 UTC
[PATCH] mux: update PROTOCOL.mux and fix error messages on client side
On Thu, Jan 13, 2011 at 22:55, Damien Miller <djm at mindrot.org> wrote:> applied, except: > >> - ? ? ? ? ? ? fatal("%s: stdio forwarding request failed: %s", __func__, e); >> + ? ? ? ? ? ? fatal("%s: stdio stdio forwarding request failed: %s", __func__, e); >Yeah, sorry, and thanks for spotting.> thanks >