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