[manual index][section index]

NAME

styxchat - exchange 9P (Styx) messages with a server or client

SYNOPSIS

styxchat [ -m messagesize ] [ -s ] [ -v ] [ -n ] [ destination ]

DESCRIPTION

Styxchat exchanges messages with a 9P service. (9P was previously called `Styx' when used by Inferno, hence the command's name.) See intro(5) for the protocol definition. It makes a connection to a given destination, (or waits for a connection on destination, if the -s option is specified), then reads a textual representation of 9P T-messages from the standard input and writes them on the connection, with a copy on standard output, simultaneously reading 9P R-messages from the connection and printing a representation of them on standard output. Each message is represented by one line on the standard output in the form of a literal of either Tmsg or Rmsg types defined in styx(2). The -v option causes a second line to be written for Rmsg.Read and Tmsg.Write that shows the data transmitted, as text or binary as appropriate; if -v appears a second time, a third line is written that shows the text equivalent of apparently binary data (useful to see text that is surrounded by binary data).

By default, destination is the name of a file, typically one end of a named pipe. The -n option causes destination to be interpreted as a network address, as accepted by dial(2) (or listen with -s). If destination is not provided, styxchat reads and writes 9P messages on its standard input, using /dev/cons where it would usually use its standard input and output.

Each line of standard input has the form:

Tversion messagesize version
Tauth afid uname aname
Tflush oldtag
Tattach fid afid uname aname
Twalk fid newfid [ name ... ]
Topen fid mode
Tcreate fid name perm mode
Tread fid offset count
Twrite fid offset data
Tclunk fid
Tremove fid
Tstat fid
Twstat fid name uid gid mode mtime length
nexttag [ tag ]
dump

The input is interpreted as space-separated fields using the quoting conventions of sh(1), allowing fields to contain spaces. Empty lines and lines beginning with # are ignored. The first field on each line is normally the name of a T-message. Subsequent fields provide parameter values for the corresponding message. Integers are given in the format accepted for integers by the Limbo compiler (e.g. 16rffff): a tag is 16 bits, offset and length are 64 bits, and all others are 32-bit integers. If the an integer parameter field contains ~0, it is taken to be the `all ones' value of appropriate size for that parameter; this is particularly useful with Twstat, where that value represents `no change'. In the ``mode'' field of a qid, letters can be given, representing mode bits: d for QTDIR, l for QTEXCL, a for QTAPPEND, and u for QTAUTH. In an Rstat message, the qid mode bits are copied into the Rstat mode field in the appropriate place.

Following the sh(1) quoting rules, an empty string is represented by a field containing ''. The data field is sent as its UTF-8 representation as an array of bytes. The value for fid can be nofid (or NOFID) to represent the `no fid' value in the protocol. The tag for each message is automatically supplied by styxchat, starting from 1, and incremented with each successful message transmission. The nexttag command will cause subsequent tags to start from tag; if none is given, it will print the next tag value. The tag may be notag to represent the `no tag' value (16rFFFF).

The dump command has the same effect as a -v option, allowing data display to be enabled later.

By default, styxchat sends a 9P client's T-messages and prints a server's R-messages. The -s option causes it to present a server's view: it prints the T-messages from 9P clients, and sends R-messages as it reads a textual representation of them from standard input:

Rversion tag messagesize version
Rauth tag aqid
Rflush tag
Rerror tag ename
Rattach tag qid
Rwalk tag qid ...
Ropen tag qid iounit
Rcreate tag qid iounit
Rread tag data
Rwrite tag count
Rclunk tag
Rremove tag
Rstat tag qid mode atime mtime length name uid gid muid
Rwstat tag
dump

The input conventions are as above, except that tags are required. A qid is a single field of the form path.vers[.type], where the three values are decimal integers.

SOURCE

/appl/cmd/styxchat.b

SEE ALSO

styx(2), intro(5), styxmon(8)

STYXCHAT(8 ) Rev:  Tue Mar 31 02:42:38 GMT 2015