source: trunk/third/openssh/nchan.ms @ 16801

Revision 16801, 3.9 KB checked in by ghudson, 23 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r16800, which included commits to RCS files with non-trunk default branches.
Line 
1.\"     $OpenBSD: nchan.ms,v 1.7 2001/01/29 01:58:17 niklas Exp $
2.\"
3.\"
4.\" Copyright (c) 1999 Markus Friedl.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.TL
27OpenSSH Channel Close Protocol 1.5 Implementation
28.SH
29Channel Input State Diagram
30.PS
31reset
32l=1
33s=1.2
34ellipsewid=s*ellipsewid
35boxwid=s*boxwid
36ellipseht=s*ellipseht
37S1: ellipse "INPUT" "OPEN"
38move right 2*l from last ellipse.e
39S4: ellipse "INPUT" "CLOSED"
40move down l from last ellipse.s
41S3: ellipse "INPUT" "WAIT" "OCLOSED"
42move down l from 1st ellipse.s
43S2: ellipse "INPUT" "WAIT" "DRAIN"
44arrow "" "rcvd OCLOSE/" "shutdown_read" "send IEOF" from S1.e to S4.w
45arrow "ibuf_empty/" "send IEOF" from S2.e to S3.w
46arrow from S1.s to S2.n
47box invis "read_failed/" "shutdown_read" with .e at last arrow.c
48arrow  from S3.n to S4.s
49box invis "rcvd OCLOSE/" "-" with .w at last arrow.c
50ellipse wid .9*ellipsewid ht .9*ellipseht at S4
51arrow "start" "" from S1.w+(-0.5,0) to S1.w
52arrow from S2.ne to S4.sw
53box invis "rcvd OCLOSE/     " with .e at last arrow.c
54box invis " send IEOF" with .w at last arrow.c
55.PE
56.SH
57Channel Output State Diagram
58.PS
59S1: ellipse "OUTPUT" "OPEN"
60move right 2*l from last ellipse.e
61S3: ellipse "OUTPUT" "WAIT" "IEOF"
62move down l from last ellipse.s
63S4: ellipse "OUTPUT" "CLOSED"
64move down l from 1st ellipse.s
65S2: ellipse "OUTPUT" "WAIT" "DRAIN"
66arrow "" "write_failed/" "shutdown_write" "send OCLOSE" from S1.e to S3.w
67arrow "obuf_empty ||" "write_failed/" "shutdown_write" "send OCLOSE" from S2.e to S4.w
68arrow from S1.s to S2.n
69box invis "rcvd IEOF/" "-" with .e at last arrow.c
70arrow from S3.s to S4.n
71box invis "rcvd IEOF/" "-" with .w at last arrow.c
72ellipse wid .9*ellipsewid ht .9*ellipseht at S4
73arrow "start" "" from S1.w+(-0.5,0) to S1.w
74.PE
75.SH
76Notes
77.PP
78The input buffer is filled with data from the socket
79(the socket represents the local consumer/producer of the
80forwarded channel).
81The data is then sent over the INPUT-end (transmit-end) of the channel to the
82remote peer.
83Data sent by the peer is received on the OUTPUT-end (receive-end),
84saved in the output buffer and written to the socket.
85.PP
86If the local protocol instance has forwarded all data on the
87INPUT-end of the channel, it sends an IEOF message to the peer.
88If the peer receives the IEOF and has consumed all
89data he replies with an OCLOSE.
90When the local instance receives the OCLOSE
91he considers the INPUT-half of the channel closed.
92The peer has his OUTOUT-half closed.
93.PP
94A channel can be deallocated by a protocol instance
95if both the INPUT- and the OUTOUT-half on his
96side of the channel are closed.
97Note that when an instance is unable to consume the
98received data, he is permitted to send an OCLOSE
99before the matching IEOF is received.
Note: See TracBrowser for help on using the repository browser.