PROTOCOL.mux (215116) | PROTOCOL.mux (221420) |
---|---|
1This document describes the multiplexing protocol used by ssh(1)'s 2ControlMaster connection-sharing. 3 4Most messages from the client to the server contain a "request id" field. 5This field is returned in replies as "client request id" to facilitate 6matching of responses to requests. 7 81. Connection setup --- 14 unchanged lines hidden (view full) --- 23represented as a name/value pair. No extensions are currently 24defined. 25 262. Opening sessions 27 28To open a new multiplexed session, a client may send the following 29request: 30 | 1This document describes the multiplexing protocol used by ssh(1)'s 2ControlMaster connection-sharing. 3 4Most messages from the client to the server contain a "request id" field. 5This field is returned in replies as "client request id" to facilitate 6matching of responses to requests. 7 81. Connection setup --- 14 unchanged lines hidden (view full) --- 23represented as a name/value pair. No extensions are currently 24defined. 25 262. Opening sessions 27 28To open a new multiplexed session, a client may send the following 29request: 30 |
31 uint32 MUX_C_MSG_NEW_SESSION | 31 uint32 MUX_C_NEW_SESSION |
32 uint32 request id 33 string reserved 34 bool want tty flag 35 bool want X11 forwarding flag 36 bool want agent flag 37 bool subsystem flag 38 uint32 escape char 39 string terminal type --- 54 unchanged lines hidden (view full) --- 94 uint32 request id 95 96The server will reply with one of MUX_S_OK or MUX_S_PERMISSION_DENIED. 97 985. Requesting establishment of port forwards 99 100A client may request the master to establish a port forward: 101 | 32 uint32 request id 33 string reserved 34 bool want tty flag 35 bool want X11 forwarding flag 36 bool want agent flag 37 bool subsystem flag 38 uint32 escape char 39 string terminal type --- 54 unchanged lines hidden (view full) --- 94 uint32 request id 95 96The server will reply with one of MUX_S_OK or MUX_S_PERMISSION_DENIED. 97 985. Requesting establishment of port forwards 99 100A client may request the master to establish a port forward: 101 |
102 uint32 MUX_C_OPEN_FORWARD | 102 uint32 MUX_C_OPEN_FWD |
103 uint32 request id 104 uint32 forwarding type 105 string listen host 106 string listen port 107 string connect host 108 string connect port 109 110forwarding type may be MUX_FWD_LOCAL, MUX_FWD_REMOTE, MUX_FWD_DYNAMIC. 111 112A server may reply with a MUX_S_OK, a MUX_S_REMOTE_PORT, a 113MUX_S_PERMISSION_DENIED or a MUX_S_FAILURE. 114 115For dynamically allocated listen port the server replies with 116 117 uint32 MUX_S_REMOTE_PORT 118 uint32 client request id 119 uint32 allocated remote listen port 120 | 103 uint32 request id 104 uint32 forwarding type 105 string listen host 106 string listen port 107 string connect host 108 string connect port 109 110forwarding type may be MUX_FWD_LOCAL, MUX_FWD_REMOTE, MUX_FWD_DYNAMIC. 111 112A server may reply with a MUX_S_OK, a MUX_S_REMOTE_PORT, a 113MUX_S_PERMISSION_DENIED or a MUX_S_FAILURE. 114 115For dynamically allocated listen port the server replies with 116 117 uint32 MUX_S_REMOTE_PORT 118 uint32 client request id 119 uint32 allocated remote listen port 120 |
1215. Requesting closure of port forwards | 1216. Requesting closure of port forwards |
122 | 122 |
123A client may request the master to establish a port forward: | 123Note: currently unimplemented (server will always reply with MUX_S_FAILURE). |
124 | 124 |
125 uint32 MUX_C_OPEN_FORWARD | 125A client may request the master to close a port forward: 126 127 uint32 MUX_C_CLOSE_FWD |
126 uint32 request id | 128 uint32 request id |
127 uint32 forwarding type | |
128 string listen host 129 string listen port 130 string connect host 131 string connect port 132 | 129 string listen host 130 string listen port 131 string connect host 132 string connect port 133 |
133forwarding type may be MUX_FWD_LOCAL, MUX_FWD_REMOTE, MUX_FWD_DYNAMIC. 134 | |
135A server may reply with a MUX_S_OK, a MUX_S_PERMISSION_DENIED or a 136MUX_S_FAILURE. 137 | 134A server may reply with a MUX_S_OK, a MUX_S_PERMISSION_DENIED or a 135MUX_S_FAILURE. 136 |
1386. Requesting stdio forwarding | 1377. Requesting stdio forwarding |
139 140A client may request the master to establish a stdio forwarding: 141 142 uint32 MUX_C_NEW_STDIO_FWD 143 uint32 request id 144 string reserved 145 string connect host 146 string connect port 147 148The client then sends its standard input and output file descriptors 149(in that order) using Unix domain socket control messages. 150 151The contents of "reserved" are currently ignored. 152 153A server may reply with a MUX_S_SESSION_OPEED, a MUX_S_PERMISSION_DENIED 154or a MUX_S_FAILURE. 155 | 138 139A client may request the master to establish a stdio forwarding: 140 141 uint32 MUX_C_NEW_STDIO_FWD 142 uint32 request id 143 string reserved 144 string connect host 145 string connect port 146 147The client then sends its standard input and output file descriptors 148(in that order) using Unix domain socket control messages. 149 150The contents of "reserved" are currently ignored. 151 152A server may reply with a MUX_S_SESSION_OPEED, a MUX_S_PERMISSION_DENIED 153or a MUX_S_FAILURE. 154 |
1567. Status messages | 1558. Status messages |
157 158The MUX_S_OK message is empty: 159 160 uint32 MUX_S_OK 161 uint32 client request id 162 163The MUX_S_PERMISSION_DENIED and MUX_S_FAILURE include a reason: 164 165 uint32 MUX_S_PERMISSION_DENIED 166 uint32 client request id 167 string reason 168 169 uint32 MUX_S_FAILURE 170 uint32 client request id 171 string reason 172 | 156 157The MUX_S_OK message is empty: 158 159 uint32 MUX_S_OK 160 uint32 client request id 161 162The MUX_S_PERMISSION_DENIED and MUX_S_FAILURE include a reason: 163 164 uint32 MUX_S_PERMISSION_DENIED 165 uint32 client request id 166 string reason 167 168 uint32 MUX_S_FAILURE 169 uint32 client request id 170 string reason 171 |
1737. Protocol numbers | 1729. Protocol numbers |
174 175#define MUX_MSG_HELLO 0x00000001 176#define MUX_C_NEW_SESSION 0x10000002 177#define MUX_C_ALIVE_CHECK 0x10000004 178#define MUX_C_TERMINATE 0x10000005 | 173 174#define MUX_MSG_HELLO 0x00000001 175#define MUX_C_NEW_SESSION 0x10000002 176#define MUX_C_ALIVE_CHECK 0x10000004 177#define MUX_C_TERMINATE 0x10000005 |
179#define MUX_C_OPEN_FORWARD 0x10000006 180#define MUX_C_CLOSE_FORWARD 0x10000007 | 178#define MUX_C_OPEN_FWD 0x10000006 179#define MUX_C_CLOSE_FWD 0x10000007 180#define MUX_C_NEW_STDIO_FWD 0x10000008 |
181#define MUX_S_OK 0x80000001 182#define MUX_S_PERMISSION_DENIED 0x80000002 183#define MUX_S_FAILURE 0x80000003 184#define MUX_S_EXIT_MESSAGE 0x80000004 185#define MUX_S_ALIVE 0x80000005 186#define MUX_S_SESSION_OPENED 0x80000006 187#define MUX_S_REMOTE_PORT 0x80000007 188 --- 6 unchanged lines hidden (view full) --- 195XXX graceful close (delete listening socket, but keep existing sessions active) 196XXX lock (maybe) 197XXX watch in/out traffic (pre/post crypto) 198XXX inject packet (what about replies) 199XXX server->client error/warning notifications 200XXX port0 rfwd (need custom response message) 201XXX send signals via mux 202 | 181#define MUX_S_OK 0x80000001 182#define MUX_S_PERMISSION_DENIED 0x80000002 183#define MUX_S_FAILURE 0x80000003 184#define MUX_S_EXIT_MESSAGE 0x80000004 185#define MUX_S_ALIVE 0x80000005 186#define MUX_S_SESSION_OPENED 0x80000006 187#define MUX_S_REMOTE_PORT 0x80000007 188 --- 6 unchanged lines hidden (view full) --- 195XXX graceful close (delete listening socket, but keep existing sessions active) 196XXX lock (maybe) 197XXX watch in/out traffic (pre/post crypto) 198XXX inject packet (what about replies) 199XXX server->client error/warning notifications 200XXX port0 rfwd (need custom response message) 201XXX send signals via mux 202 |
203$OpenBSD: PROTOCOL.mux,v 1.2 2010/05/16 12:55:51 markus Exp $ | 203$OpenBSD: PROTOCOL.mux,v 1.4 2011/01/31 21:42:15 djm Exp $ |