forsyth20121205-174063a80cc13 years agoHistory
103 lines · 2.6 KB · Text
RawDownload
.TH VERSION 5 .SH NAMEversion \- negotiate protocol version.SH SYNOPSIS.ta \w'\fLTversion 'u.IR size [4].B Tversion.IR tag [2].IR msize [4].IR version [ s ].br.IR size [4].B Rversion.IR tag [2].IR msize [4].IR version [ s ].SH DESCRIPTIONThe .B versionrequest negotiates the protocol version and message sizeto be used on the connection and initializes the connection for I/O..B Tversionmust be the first message sent on the 9P connection,and the client cannot issue any further requests until it has received the.B Rversionreply.The.I tagshould be.B NOTAG(value.BR (ushort)~0 )for a.B versionmessage..PPThe client suggests a maximum message size,.BR msize ,that is the maximum length, in bytes,it will ever generate or expect to receive in a single 9P message.This count includes all 9P protocol data, starting from the.B sizefield and extending through the message,but excludes enveloping transport protocols.The server responds with its own maximum,.BR msize ,which must be less than or equal to the client's value.Thenceforth, both sides of the connection must honor this limit..PPThe.B versionstring identifies the level of the protocol.The string must always begin with the two characters.RB `` 9P ''.If the server does not understand the client's version string,it should respond with an.B Rversionmessage (not.BR Rerror )with the.B versionstring the 7 characters.RB `` unknown ''..PPThe server may respond with the client's version string,or a version string identifyingan earlier defined protocol version.Currently, the only defined version is the 6 characters.RB `` 9P2000 ''.Version strings are defined such that, if the client string containsone or more period characters, the initial substring up to but not includingany single period in the version string defines a version of the protocol.After stripping any such period-separated suffix, the server is allowed to respondwith a string of the form.BI 9P nnnn\f1,where.I nnnnis less than or equal to the digits sent by the client..PPThe client and server will use the protocol version defined by theserver's response for all subsequent communication on the connection..PPA successful.B versionrequest initializes the connection.All outstanding I/O on the connection is aborted; all active fids are freed (`clunked') automatically.The set of messages between.B versionrequests is called a.IR session ..SH ENTRY POINTSThe.B versionmessage is generated by.I sys-fversion (2).It is also generated automatically, if required, by a.B mountor.B fauthsystem call on an uninitialized connection..SH SEE ALSO.IR sys-bind (2),.IR sys-fversion (2)