aboutsummaryrefslogtreecommitdiff
path: root/man/man9/version.9p
blob: 99f30239b6893e09ed883d9da743c5ac3c50f012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
.TH VERSION 9P 
.SH NAME
version \- 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 DESCRIPTION
The 
.B version
request negotiates the protocol version and message size
to be used on the connection and initializes the connection for I/O.
.B Tversion
must be the first message sent on the 9P connection,
and the client cannot issue any further requests until it has received the
.B Rversion
reply.
The
.I tag
should be
.B NOTAG
(value
.BR (ushort)~0 )
for a
.B version
message.
.PP
The 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 size
field 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.
.PP
The
.B version
string 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 Rversion
message (not
.BR Rerror )
with the
.B version
string the 7 characters
.RB `` unknown ''.
.PP
The server may respond with the client's version string,
or a version string identifying
an 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 contains
one or more period characters, the initial substring up to but not including
any single period in the version string defines a version of the protocol.
After stripping any such period-separated suffix, the server is allowed to respond
with a string of the form
.BI 9P nnnn\f1,
where
.I nnnn
is less than or equal to the digits sent by the client.
.PP
The client and server will use the protocol version defined by the
server's response for all subsequent communication on the connection.
.PP
A successful
.B version
request 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 version
requests is called a
.IR session .
.SH ENTRY POINTS
.I Fsversion
(see
.IM 9pclient (3) )
generates
.B version
messages;
it is called automatically by
.IR fsmount .