
                            SynCro v1.41

                      © 1994, 1995 Simon Dainty

                Remote time-synchronization for AmiTCP

======================================================================
  Contents:                                             SynCro v1.41
======================================================================

  Introduction: What is...?                                      1.0

  SynCro:                                                        2.0
    Installation ............................................... 2.1
    How to...? ................................................. 2.2
    Problems, problems ......................................... 2.3

  Legalities... damn:                                            3.0

  ...Forty Two:                                                  4.0
    A word in your shell-like .................................. 4.1
    Past, present and future ................................... 4.2

======================================================================
  Introduction: What is...?                              Chapter 1.0
======================================================================

There exists, as a  part of the  AmiTCP package, a mixed DOS and AREXX
script named SynClock that allows you  to set your local time and date
to that of  a remote  Internet-connected system.  SynCro  performs the
exact same function as the  original  SynClock, but with one  distinct
advantage: SynCro  was  written  in C; SynCro is  a stand-alone binary
executable that can be made resident.

  SynCro has been fully tested with AmiTCP version 3.x beta, KickStart
version 3.0 and  bsdsocket.library version 2; but it should work  with
any version of the AmiTCP distribution and KickStart 2.0 and above (at
least).  I'll be happy  to know of any problems  people may experience
with regard to running  SynCro on anything  other than what I was able
to test it on.

======================================================================
  SynCro:                                                Chapter 2.0
======================================================================

On startup, SynCro  will first perform  a check to see if AmiTCP is up
and running.  Next, SynCro will attempt to access the 'time' socket of
the  site that you have passed it as an argument at the Shell.  If the
attempt  at accessing  the  port is a success  then everything else is
plain sailing.

----------------------------------------------------------------------
  SynCro: Installation.                                  Chapter 2.1
----------------------------------------------------------------------

SynCro is nothing  more  than a  standard AmigaDOS Shell  command, and
with that it  can be placed anywhere you  deem fit.  Probably the best
location to copy SynCro to is AmiTCP's 'bin' directory, if that is how
your  AmiTCP hierarchy  is configured.  Otherwise  the C: directory is
more than  adequate.  Placing SynCro somewhere within your path offers
the obvious benefits.

  Alternatively, you may  wish to  make SynCro  resident.  This can be
achieved by the normal method of using AmigaDOS's  'Resident' command.
Making  SynCro  resident  isn't all  that  big  a deal  though, unless
you're likely to be setting your machine time on a very regular basis.
Still, the option is there if you ever need it.

In order to  correctly calculate the current  time, the GMT offset for
your local site must be set via the Local preferences executable.  All
you need do is click on the image of your country, as displayed on the
map of  the world, and the local  Time Zone relative  to GMT  will  be
modified to reflect  your offset.  Store the  new local  time zone  by
clicking on the Save gadget.

  If no local GMT offset is configured, SynCro will default to GMT.

With respect  to stack requirement, SynCro should  work perfectly well
with the default Shell stack size of 4096 bytes.

----------------------------------------------------------------------
  SynCro: How to...?                                     Chapter 2.2
----------------------------------------------------------------------

SynCro requires at least one argument in order to function  correctly:
Either the  Fully Qualified Domain Name, or the IP address, of a site.
All of  the valid command line arguments  that SynCro will  accept are
listed below.

    SITE    - This argument is the only argument required by SynCro in
              order for it to perform the desired task.  Any valid  IP
              address or FQDN is acceptable here.

    SAVE    - If specified, SynCro  will save  the received  time  and
              date to  a battery-backed clock, if such a clock exists.
              If SynCro is  unable to access the battery-backed clock,
              you may be notified.

    IGNORE  - SynCro will default to setting the local system clock to
              that  of the remote time and date.  Calling  SynCro with
              the IGNORE  switch set  will result in  no changes being
              made to the local system time at all.

    QUIET   - Just as  it says, don't bother displaying any  output to
              the  stdout.  By "any," I  mean  that  both the received
              date and time, as well as any errors that may occur will
              be suppressed.

  With exception  to the first obligatory  argument (the site), any of
the three  remaining arguments may be supplied or ignored at the users
discretion.  None of the arguments are mutually exclusive.

  What follows are several examples of SynCro usage:

  1) Examine  the current time of your  local machine (read the AmiTCP
     documentation for  information regarding 'localhost'), but do not
     set the system time to that of the received time.

     Shell> SynCro localhost IGNORE

  2) Set both the  system clock and  the internal battery-backed clock
     to the time and date of the remote machine 'my.fave.remote.host'.
     Any output will be suppressed.

     Shell> SynCro my.fave.remote.host SAVE QUIET

  3) Set the battery-backed clock time and  date to that of the remote
     machine, but  don't set the  local system  clock.  I cannot think
     of any  real reasons for wanting  to do this.

     Shell> SynCro my.fave.remote.host SAVE IGNORE

       If, after  receiving the  remote time and date, you wish to set
     the  local time and  date, then it is simply a  matter of typing:
     SETCLOCK LOAD at the Shell prompt.

  4) Set the  local system time and  date to that of the remote  site,
     but suppress all output.  Nothing will be written to the battery-
     backed clock.

     Shell> SynCro 255.255.255.255 QUIET

----------------------------------------------------------------------
  SynCro: Problems, problems.                            Chapter 2.3
----------------------------------------------------------------------

If, for  some  reason, SynCro is unable to  perform its  duty - if the
remote host  can't be found for example, a specific  return code shall
be met.  The value of  the return code relates  directly to a specific
error within SynCro, these errors are listed below:

    21 - Incorrect command line arguments were passed.
    22 - SynCro couldn't open the bsdsocket.library.
    23 - SynCro failed to connect to the given remote host.
    24 - SynCro  was  unable to  connect  to the 'time' socket  of the
         remote host.
    25 - For some reason, the battery-backed clock could not be found.

The  returning of  an error-specific return code  was a new feature of
SynCro, for version 1.1.

======================================================================
  Legalities... damn:                                    Chapter 3.0
======================================================================

You use  SynCro completely  at your *own* risk, no  warranty is either
expressed or implied.  I cannot (and will not) be held responsible for
any damages caused by SynCro, no matter what the circumstance.  Either
use this program  or ignore it, but don't blame me for  *any* unwanted
results.  I've probably  spent more time  testing SynCro than actually
coding it and  not  once has it misbehaved.  Hopefully  you too should
experience a care-free service life.

  Although SynCro is freely  distributable, it still remains copyright
1994-5 Simon P. Dainty.  SynCro is definitely not Public Domain, it is
freely distributable FreeWare - there is a difference.  Anyone wishing
to obtain a copy has the right to a copy, for little or no charge.

  Whilst the continued distribution of SynCro is the author's goal, he
hopes that you will conform to the following agreement:

  1) No files  are added to, or removed from, the archive with respect
     to the original distribution, and no  files are modified relative
     to their original state without the author's permission.

  2) No charge, other than the cost of media duplication, may be asked
     for this package unless the situation of that charge falls within
     item three (below).

  3) If  this package is to be  included as a part  of a commercial or
     ShareWare  (or  variant) distribution, or magazine coverdisk, the
     author would appreciate some form  of prior notification.  Aminet
     CD-ROM, or any "Public Domain" CD-ROM distribution is exempt from
     the above requirement.

If you  are a non-conformist, at least  make the  effort to appreciate
what I've written above. =o)  Above all though, have fun.

======================================================================
  ...Forty Two:                                          Chapter 4.0
======================================================================

SynCro was  written in C, with the aid of Matt Dillon's DICE C package
(version 2.07.57R) and  was  tested on a 3.0-based  AGA Amiga, running
AmiTCP v3.xbeta and bsdsocket.library version 2.

  Even though SynCro  is freely  distributable, I'd like  you to think
of it as "World-a-Ware".  If you find  SynCro to be useful, or you use
SynCro for any  period of time, please do  a little something to  help
the  environment of OUR home.  We are  all  ultimately responsible for
the world that we live in, and we are equally responsible for those we
share  it  with.  We only have  the one copy  of Earth, and  without a
back-up...

----------------------------------------------------------------------
  ...Forty Two: A word in your shell-like.               Chapter 4.1
----------------------------------------------------------------------

With respect to bug fixes, bug  reports, general  updates (if any) and
pure talkability, I can  be contacted at any  of the addresses  listed
below.  You will also find me lurking in most all of the Amiga related
Usenet groups, specifically the  comp.sys.amiga.* groups as  well as a
good few Amiga specific FidoNet and AmigaNet echos.

  Internet mailbox:

    syncro@ancient.demon.co.uk (Simon Dainty)

  Or,

    izzy@ancient.demon.co.uk (Simon Dainty)

  FidoNet and AmigaNet, via Dox's Amiga BBS (+44 01943 850340):

    2:250/320.3 (Simon Dainty)
    39:138/14.3    "     "

  Snail mail:

    25, Victor Road,
    Heaton,
    Bradford,
    West Yorkshire,
    England,
    BD9 4QN.

  Electronic mail is my most preferred form of communication.

  SYL,

       Si.


     "Breakin'  outta school an' we were  kickin' hard.  A lotta
      good dreams an' a lotta false starts; We swore we wouldn't
      get old before our time..." 
                                  - Little Angels.

----------------------------------------------------------------------
  ...Forty Two: Past, present and future.                Chapter 4.2
----------------------------------------------------------------------

 29-Nov-94:  

 v1.0  - Initial release with no know bugs.  Limited distribution.

 02-Dec-94:

 v1.1  - Optimized executable compilation by utilizing inline library
         calls.  Shaved off around 200 bytes from the binary.  

       - SynCro will return a specific code  in the event of an error.
         Refer to chapter 2.3 for more information.

 02-Jan-95:

 v1.2  - Optimized executable size.  Now down to 4.8K.

       - Modified the ordering of the error-specific return codes into
         something a little more logical.  Please refer to chapter 2.3
         with respect to those changes.

       - Fixed a bug where SynCro would complain about an invalid FQDN
         argument, when the argument was indeed valid.
 
 28-Jan-95:

 v1.3  - Optimized executable size.  Now down to 3.5K.

       - SynCro now goes directly  through the "bsdsocket.library", as
         opposed to  earlier versions that used the TCP: device.  This
         affords the user several benefits:

           * Not restricted to only giving an FQDN as the reference to
             a remote site; SynCro will also accept an IP address.

           * No need to  mount the TCP: device if  SynCro was the only
             program that needed it.

           * A CONTROL-C from  the Shell that SynCro  was started from
             will now stop it dead in its tracks.

       - Once more, several modifications have been made to the error-
         specific return codes.  Please  refer to chapter 2.3 for more
         information.

 04-Feb-95:

 v1.4  - Limited tester release.

       - Problems arose when SynCro was used with the Multilink AmiTCP
         and RS225  emulator (in beta).  Thanks to Osma Ahvenlampi for
         pointing the deficiency out.

       - If SynCro was unable to resolve the remote host, AmiTCP would
         not shutdown correctly.  This  was a problem with version 1.3
         of SynCro  not closing the  bsdsocket.library when it  should
         have done.  Any other time and it would have worked fine.  My
         fault entirely - it is now fixed.

       - Minor changes to the error-specific return codes. Again.

 09-Feb-95:

 v1.41 - Modified  the  way the remote time is  processed.  Instead of
         relying on the location-specific  time string as received via
         the 'daytime' port, SynCro  now goes through the 'time' port,
         and calculates the  current time by  processing the number of
         seconds since midnight of January the 1st 1900.

       - Because of the  above changes, SynCro now  requires the local
         system's GMT offset to be set within the Locale preferences.
