Annotation of src/usr.bin/ssh/nchan.h, Revision 1.4
1.4 ! deraadt 1: /* RCSID("$Id: nchan.h,v 1.3 1999/10/17 16:56:09 markus Exp $"); */
1.2 markus 2:
1.1 markus 3: #ifndef NCHAN_H
4: #define NCHAN_H
5:
6: /*
1.2 markus 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
1.4 ! deraadt 10: *
1.2 markus 11: * Protocol versions 1.3 and 1.5 differ in the handshake protocol used for the
12: * tear down of channels:
1.4 ! deraadt 13: *
1.2 markus 14: * 1.3: strict request-ack-protocol:
15: * CLOSE ->
16: * <- CLOSE_CONFIRM
1.4 ! deraadt 17: *
1.2 markus 18: * 1.5: uses variations of:
19: * IEOF ->
20: * <- OCLOSE
21: * <- IEOF
22: * OCLOSE ->
23: * i.e. both sides have to close the channel
1.4 ! deraadt 24: *
1.2 markus 25: * See the debugging output from 'ssh -v' and 'sshd -d' of
26: * ssh-1.2.27 as an example.
1.4 ! deraadt 27: *
1.2 markus 28: */
1.1 markus 29:
1.3 markus 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
33:
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
39:
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
1.1 markus 45:
1.3 markus 46: /* EVENTS for the input state */
1.4 ! deraadt 47: void chan_rcvd_oclose(Channel * c);
! 48: void chan_read_failed(Channel * c);
! 49: void chan_ibuf_empty(Channel * c);
1.3 markus 50:
51: /* EVENTS for the output state */
1.4 ! deraadt 52: void chan_rcvd_ieof(Channel * c);
! 53: void chan_write_failed(Channel * c);
! 54: void chan_obuf_empty(Channel * c);
1.3 markus 55:
1.4 ! deraadt 56: void chan_init_iostates(Channel * c);
1.1 markus 57: #endif