\input texinfo   @c -*-texinfo-*-
@c
@c $Id: gtalkd.texinfo,v 1.6 1995/05/26 00:04:57 zappo Exp $
@c
@setfilename gtalkd.info
@settitle The GNU talk daemon

@ifinfo
@format
START-INFO-DIR-ENTRY
* Gtalkd: (gtalkd).       The GNU talk daemon, and protocols.
END-INFO-DIR-ENTRY
@end format
@end ifinfo

@titlepage
@sp 10
@center @titlefont{GNU Talk Daemon}
@vskip 0pt plus 1 fill
Copyright @copyright{} 1994, 1995 Free Software Foundation
@end titlepage

@node Top, , (dir),   (dir)

Copyright @copyright{} 1994, 1995 Free Software Foundation

This file documents the GNU talk daemon.  The GNU talk daemon is
designed to completely replace the standard BSD talk daemon found on most
systems.  The advantages to the GNU talk daemon include greater
compatibility between BSD and SunOS versions of the talk daemon and all
clients, plus some improved options available when used with a GNU talk
client.  In addition, the GNU talk daemon source is not "dead" and I
enjoy reading your comments.  You can always reach me as:
zappo@@gnu.ai.mit.edu

This documentation is still primitive.  Please send suggestions to me on
topics you would like to see included.

@menu
* Introduction::        About gtalk, and why it exists
* Bugs::                Some problems you may encounter
* Install::             How to setup gtalkd for use.
* Protocol::            How the talk protocol works.
* Index::
@end menu

@node Introduction, Bugs, ,Top
@chapter Introduction
@cindex Introduction

The GNU talk daemon has three major talk versions which it emulates.
One version is that found on SunOS, referenced in this document as OTALK
or OTALKD.  It also handles the more common BSD post 4.2 talk protocol,
referenced here as NTALK, NTALKD, or TALK version 1.  (I guess that
makes otalk version 0) Lastly, the GNU talk daemon handles a modified
version of NTALK which will be referenced as the GNU talk protocol, or
GTALK, or TALK version 2.  As this product develops to revision 1, TALK
version 2 will slowly be improved.

The reason behind this project is to create a talk daemon which takes
advantage of todays distributed networks.  It is my hope, that when this
project reaches version 1, a talk request made to a daemon on
machine 1, will act happily along with a daemon on machine 2 to
transparently make sure all requests and lookups are correctly forwarded
to the correct machine.

@node  Bugs, Install, Introduction, Top
@chapter Bugs
@cindex Bugs

There are currently some problems with the GNU talk daemon.

In the announcement message.  If using the older talk protocol, the
announcement message says to use "otalk".  Otalk, of course, may not
exist, and I have not written a terminal version of my talk program.  I
only have etalk.  Users of the system should know that if "otalk" is
announced, that they should use emacs talk.  (Or a talk program
compatible with the older methods)

If, on the other hand otalk forwarding is used, then the message printed
relates to "talk" instead of "otalk".  This is because the message is
converted from the older talk protocol into the newer protocol, and the
result sent to the ntalk daemon.  In this case, the normal talk protocol
will fail unless the perpetrator of the otalk message has both types of
daemons running on his system.

A system with many users unfamiliar with emacs should install "ytalk" on
the system, and potentially link "talk" and "otalk" to "ytalk".

Additionally, I can't get requests over a PPP line to work reliably.
Then again, using ntalk, and ntalkd, and even ytalk, I still can't get
it to work reliably.

The ability to read a @file{.ringer} file has not been completely tested
yet.  It works when things go well, but it has not been completely
debugged.

The best way to report problems of the talk daemon is to send me output
of what is going on.  There is a command "etalk-report" which will walk
you through steps of reported bugs in etalk, which may divulge
information about the talk daemon if it is installed.  If the
information resulting from an "etalk -t" is innocuous (ie, "I failed to
do something that should be easy.") the following may prove useful.

1) comment out talk/ntalk from inetd.conf and restart inetd
2) run: gtalkd -tv > /tmp/gtalkd-n
3) run: gtalkd -tvsS > /tmp/gtalkd-s
4) run: etalk -tv > /tmp/etalk-t

Remember that there is a 30 second timeout before gtalkd exits cleanly,
so this must be done in relatively quick succession.  (wait 1 second
after starting the daemons before starting "etalk -t") Then wait 30
seconds for each daemon to exit.  The resulting files should be able to
tell me almost everything that may be wrong.  It may also tell you
specifically what may be wrong so you can fix it yourself.

@node Install, Protocol, Bugs, Top
@chapter Installation
@cindex install

To install gtalkd, run @code{make install}, or copy the gtalkd install
program someplace useful (/usr/sbin, /usr/local/sbin, etc).  Next, in
your inetd.services file, you must comment out the two lines relating to
talk protocols, and replace them with something like this on my linux
box:
@cindex inetd.conf

@example
#talk	dgram	udp	wait	root	/usr/sbin/tcpd	/usr/sbin/in.ntalkd
#ntalk	dgram	udp	wait	root	/usr/sbin/tcpd	/usr/sbin/in.ntalkd
talk	dgram	udp	wait	root	/usr/sbin/tcpd	/usr/sbin/gtalkd -sS
ntalk	dgram	udp	wait	root	/usr/sbin/tcpd	/usr/sbin/gtalkd
@end example

@cindex command line parameters
@cindex forwarding mode
Here the "-s" option means to use the "sun" protocol version, and the
"-S" option, which means to allow sunpacket conversion and forwarding.
Other options are:

@table @code
@item --bsd -b
Emulate BSD post 4.2 talk protocol, by not accepting
version numbers > 1, or any GNU extensions.
@item --forever -f
Open a local socket, and loop forever on that socket.  Any timeouts are
ignored.  This is useful for debugging since output may be captured, and
also for launching permanently from rc.inet.
@item --gnu -g
Run as GNU talk daemon with all the options. [default]
@item --help -h,-?
Print this help.
@item --sun -s
Use Sun OTALK protocol.
@item --sunforward -S
When using Sun OTALK protocol, convert message to NTALK format, and
forward to the NTALK protocol address.
@item --tty -t
This indicates a "TTY" is available to be written to.  Use for testing
on command line.
@item --user -u
Execute from USER space with non-special socket id.  NOT YET IMPLEMENTED.
@item --verbose -v
Print extra debugging information as we go to stdout.  If not in tty mode,
messages are logged with syslog.
@item --version
Print version and exit.
@end table

If the GNU talk daemon does not perform, check the messages file where
system errors are logged.  If the error messages logged there are not
descriptive enough, then run gtalkd with the parameters "-tvf" which
will run from the tty in verbose mode, and loop forever waiting for
contact.  In order to do this, you must comment out all references to
"talk" and "ntalk" from @file{/etc/services}, and restart @file{inetd}.
The messages printed in this case are much more verbose.
@cindex /etc/services file

@node Protocol, Index, Install, Top
@chapter The TALK Protocol
@cindex protocol

The talk protocol model works similarly despite the versions 0-2.  The
version 2 protocol adds some simple user-visible changes as well.  In
addition, version 2 adds some under-cover protocol to aid in making
transparent distributed requests.  (Woah, sound high tech eh?)

The general protocol model flows like this when a user requests a
connection to a specific individual.

@example
send( lookup invitation message to target machine )
if( found )
  connect( found socket )
else
  listen( for remote connect )
  send( invitation to on local machine )
  send( announcement to target machine )
  while (no new connections)
     send( delete for previous invitation )
     send( delete for previous announcement )
     send( invitation to on local machine )
     send( announcement to target machine )
     wait( until timeout or connection from remote )
  end while
endif
@end example

If a user specifies the extension --reply, the following protocol flow
is followed.
@cindex Reply mode

@example
send( request for caller information )
if( caller information available )
   initiate_callout( see above )
endif
@end example

When the ringer option is used by an individual, then the announcement
phase of the talk daemon looks like this:

@cindex ~/.ringer
@example
if( exists( ~/.ringer ) AND no tty specified )
  read( port specified from ~/.ringer )
  if( port on same machine )
    send( ringer control )
    if( respond SUCCESS )
      respond( SUCCESS to announcement )
    else if (respond FAIL )
      respond( FAIL to announcement )
    else
      announce( via tty )
      respond( based on above )
    endif
  else
    respond( TRY_HERE to announcement )
  endif
endif
@end example

@node  Index, , Protocol, Top
@unnumbered Concept Index
@printindex cp

@bye
