blob: b01512f780d8324d2a5247ee0d3525c876776e33 [file] [log] [blame]
Damien Millerd4a8b7e1999-10-27 13:42:43 +10001.TL
2OpenSSH Channel Close Protocol 1.5 Implementation
3.SH
4Channel Input State Diagram
5.PS
6reset
7l=1
8s=1.2
9ellipsewid=s*ellipsewid
10boxwid=s*boxwid
11ellipseht=s*ellipseht
12S1: ellipse "INPUT" "OPEN"
13move right 2*l from last ellipse.e
14S4: ellipse "INPUT" "CLOSED"
15move down l from last ellipse.s
16S3: ellipse "INPUT" "WAIT" "OCLOSED"
17move down l from 1st ellipse.s
18S2: ellipse "INPUT" "WAIT" "DRAIN"
19arrow "" "rcvd OCLOSE/" "shutdown_read" "send IEOF" from S1.e to S4.w
20arrow "ibuf_empty/" "send IEOF" from S2.e to S3.w
21arrow from S1.s to S2.n
22box invis "read_failed/" "shutdown_read" with .e at last arrow.c
23arrow from S3.n to S4.s
24box invis "rcvd OCLOSE/" "-" with .w at last arrow.c
25ellipse wid .9*ellipsewid ht .9*ellipseht at S4
26arrow "start" "" from S1.w+(-0.5,0) to S1.w
27.PE
28.SH
29Channel Output State Diagram
30.PS
31S1: ellipse "OUTPUT" "OPEN"
32move right 2*l from last ellipse.e
33S3: ellipse "OUTPUT" "WAIT" "IEOF"
34move down l from last ellipse.s
35S4: ellipse "OUTPUT" "CLOSED"
36move down l from 1st ellipse.s
37S2: ellipse "OUTPUT" "WAIT" "DRAIN"
38arrow "" "write_failed/" "shutdown_write" "send OCLOSE" from S1.e to S3.w
39arrow "obuf_empty ||" "write_failed/" "shutdown_write" "send OCLOSE" from S2.e to S4.w
40arrow from S1.s to S2.n
41box invis "rcvd IEOF/" "-" with .e at last arrow.c
42arrow from S3.s to S4.n
43box invis "rcvd IEOF/" "-" with .w at last arrow.c
44ellipse wid .9*ellipsewid ht .9*ellipseht at S4
45arrow "start" "" from S1.w+(-0.5,0) to S1.w
46.PE
47.SH
48Notes
49.PP
50The input buffer is filled with data from the socket
51(the socket represents the local comsumer/producer of the
52forwarded channel).
53The data is then sent over the INPUT-end of the channel to the
54remote peer.
55Data sent by the peer is received on the OUTPUT-end,
56saved in the output buffer and written to the socket.
57.PP
58If the local protocol instance has forwarded all data on the
59INPUT-end of the channel, it sends an IEOF message to the peer.
60If the peer receives the IEOF and has comsumed all
61data he replies with an OCLOSE.
62When the local instance receives the OCLOSE
63he considers the INPUT-half of the channel closed.
64The peer has his OUTOUT-half closed.
65.PP
66A channel can be deallocated by a protocol instance
67if both the INPUT- and the OUTOUT-half on his
68side of the channel are closed.
69Note that when an instance is unable to comsume the
70received data, he is permitted to send an OCLOSE
71before the matching IEOF is received.