]> andersk Git - openssh.git/blame - nchan.ms
- djm@cvs.openbsd.org 2010/01/30 02:54:53
[openssh.git] / nchan.ms
CommitLineData
aff51935 1.\" $OpenBSD: nchan.ms,v 1.8 2003/11/21 11:57:03 djm Exp $
2.\"
23c2a7a5 3.\"
aa3378df 4.\" Copyright (c) 1999 Markus Friedl. All rights reserved.
aff51935 5.\"
aa3378df 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.
aff51935 14.\"
aa3378df 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.\"
8efc0c15 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
48e671d5 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
8efc0c15 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
48e671d5 79(the socket represents the local consumer/producer of the
8efc0c15 80forwarded channel).
69256d9d 81The data is then sent over the INPUT-end (transmit-end) of the channel to the
8efc0c15 82remote peer.
69256d9d 83Data sent by the peer is received on the OUTPUT-end (receive-end),
8efc0c15 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.
48e671d5 88If the peer receives the IEOF and has consumed all
8efc0c15 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.
48e671d5 97Note that when an instance is unable to consume the
8efc0c15 98received data, he is permitted to send an OCLOSE
99before the matching IEOF is received.
This page took 0.293954 seconds and 5 git commands to generate.