7 * SSH Protocol 1.5 aka New Channel Protocol
8 * Thanks to Martina, Axel and everyone who left Erlangen, leaving me bored.
9 * Written by Markus Friedl in October 1999
11 * Protocol versions 1.3 and 1.5 differ in the handshake protocol used for the
12 * tear down of channels:
14 * 1.3: strict request-ack-protocol:
18 * 1.5: uses variations of:
23 * i.e. both sides have to close the channel
25 * See the debugging output from 'ssh -v' and 'sshd -d' of
26 * ssh-1.2.27 as an example.
30 /* ssh-proto-1.5 overloads prot-1.3-message-types */
31 #define SSH_MSG_CHANNEL_INPUT_EOF SSH_MSG_CHANNEL_CLOSE
32 #define SSH_MSG_CHANNEL_OUTPUT_CLOSE SSH_MSG_CHANNEL_CLOSE_CONFIRMATION
34 /* possible input states */
35 #define CHAN_INPUT_OPEN 0x01
36 #define CHAN_INPUT_WAIT_DRAIN 0x02
37 #define CHAN_INPUT_WAIT_OCLOSE 0x04
38 #define CHAN_INPUT_CLOSED 0x08
40 /* possible output states */
41 #define CHAN_OUTPUT_OPEN 0x10
42 #define CHAN_OUTPUT_WAIT_DRAIN 0x20
43 #define CHAN_OUTPUT_WAIT_IEOF 0x40
44 #define CHAN_OUTPUT_CLOSED 0x80
46 /* EVENTS for the input state */
47 void chan_rcvd_oclose(Channel * c);
48 void chan_read_failed(Channel * c);
49 void chan_ibuf_empty(Channel * c);
51 /* EVENTS for the output state */
52 void chan_rcvd_ieof(Channel * c);
53 void chan_write_failed(Channel * c);
54 void chan_obuf_empty(Channel * c);
56 void chan_init_iostates(Channel * c);