NAME
     dial, srv, hangup, netdial - connect to a 9P server

SYNOPSIS
     dial dialstring [aname]
     srv dialstring [name [aname]]
     hangup name
     netdial tcp!host!port [{ commands }]

DESCRIPTION
     A file tree on another machine reaches this one in three steps: dial the
     machine, post the connection in /srv, mount it somewhere.  Srv does the
     first two, mount(1) the third.

     Dial opens a connection and waits up to thirty seconds for the 9P attach
     to complete, then reports the name it was given.  It is a test of whether
     something is there; it leaves the connection open but posts nothing, so
     almost every real use is srv instead.

     Srv dials, waits up to forty-five seconds -- the mesh is slow and
     authentication has its own timeout -- and posts the connection as
     /srv/name.  Without a name it uses the one derived from the dial string:
     the host for tcp!, the node address or discovered name for aether!, 9p
     for an l2cap!  scan.  Posting over an existing name closes the old
     connection and replaces it.

     The optional aname is the tree to attach to on the far side.  A server
     that exports one filesystem at its root needs none; a server that exports
     a whole namespace wants the subtree, as in srv l2cap!?!0 bbs srv/bbs.

     Hangup removes /srv/name and closes the connection under it.  Mounts that
     were using it stop working; unmount them too.  ls /srv lists what is
     connected.

   Dial strings
     A dial string is transport!address!port, Plan 9 style.

     tcp!host!port
          9P over TCP.  The port defaults to 564 if omitted.  This does not
          require the deck to have its own network stack: it uses whatever
          /net/tcp is in the namespace, which may be one borrowed from another
          machine.

     l2cap!?!0
          Scan for a nearby 9P server over Bluetooth and discover its channel.
          The ?  means scan rather than name an address, and the 0 means ask
          rather than assume.

     l2cap!?!psm
          Scan, but use the given channel, e.g.  0x0081.

     l2cap!addr!psm
          Connect to one Bluetooth address, AA:BB:CC:DD:EE:FF, on the given
          channel.

     aether!node
          A node on the mesh: aa:bb (short) or aa:bb:cc:dd:ee:ff (full), or
          the name of a node heard by discovery -- see who(1).  A name claimed
          by two live nodes is refused rather than guessed at; dial by address
          instead.

     aether!node!service
          The same, attaching to the named service.  9fs is the node's whole
          exported namespace and is the usual one; it attaches at the export
          root.

     There are no ports on the mesh: the service field is the attach name.

     Netdial is a different thing that shares the syntax.  It opens a plain
     TCP connection through /net/tcp, sets $netdir to the connection's
     directory, and runs the following block with that connection as its input
     and output.  No 9P is involved; it is for speaking some other protocol by
     hand.  Only tcp!  works here.

EXAMPLES
     The whole sequence, one board on a public crystal:

          srv tcp!bbs.frstcomputer.net!9777 dc
          mount /srv/dc /n/dc
          bind /n/dc/rooms /n/bbs
          ls /n/bbs

     Tunein(1) does exactly this and rather more; the point of doing it by
     hand is that nothing is hidden.

     A deck in the same room, over Bluetooth, whose board sits under srv/bbs
     in its namespace:

          srv l2cap!?!0 bbs srv/bbs
          mount /srv/bbs /n/bbs

     Over the mesh, to a deck that is exporting (see aexport(1)):

          who
          srv aether!kestrel!9fs kes
          mount /srv/kes /n/kes
          cat /n/kes/n/local/text/conscience.txt

     See what is connected, then let go:

          ls /srv
          unmount /n/kes
          hangup kes

     Speak a protocol by hand:

          netdial tcp!example.com!79 { echo jrsharp; cat }

FILES
     /srv One file per posted connection.

     /net/tcp
          The interface tcp!  and netdial use; it may be the deck's own or one
          bound in from elsewhere.

     /net/aether/peers
          Nodes heard on the mesh, which is where a name in an aether!  dial
          string is resolved.

SEE ALSO
     bind(1), ns(1), tunein(1), aexport(1), who(1), aether(3)

NOTES
     l2cap!  needs a build with Bluetooth, aether!  one with the mesh; a dial
     string for a transport this image does not have fails at parse.

     The registry holds sixteen entries.  A deck with many things posted may
     refuse a new one.

FRST Computer                                                          DIAL(1)
