home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / NETWORK / PDCLK102.ZIP / PDCLKSET.DOC < prev   
Encoding:
Text File  |  1991-04-13  |  13.5 KB  |  275 lines

  1. This is to announce the ver 1.02 release of PDCLKSET.
  2.  
  3. PDCLKSET sets the PC clock from an UDP/IP TIME server and uses a packet 
  4. driver interface. It is meant to be called from AUTOEXEC.BAT and is very
  5. small and fast. It knows a lot about daylight saving algorithms, but 
  6. please send me mail if the rules are wrong or you need more of them.
  7.  
  8. PDCLKSET is available by anonymous FTP from Pollux.lu.se (130.235.132.89):
  9. /pub/network/pdclkset/pdclk102.zip
  10.  
  11. The source code will be remade in August 1991, new names on variables,
  12. separation of application and UDP/IP library, ICMP handling added  and
  13. general clean up.
  14.  
  15.  
  16. Happy times will soon be here!
  17.  
  18.  
  19. Jan E LDC
  20.  
  21.  
  22. ;*************************************************************************
  23. ;**                                                                     **
  24. ;**                     PDCLKSET                                        **
  25. ;**                                                                     **
  26. ;**                                                                     **
  27. ;**             Copyright (C) 1991 Jan.Engvald @ LDC.lu.se        **
  28. ;**                                                                     **
  29. ;** This program is free software; you can redistribute it and/or modify**
  30. ;** it under the terms of the GNU General Public License as published by**
  31. ;** the Free Software Foundation, version 1.                **
  32. ;**                                    **
  33. ;** This program is distributed in the hope that it will be useful,    **
  34. ;** but WITHOUT ANY WARRANTY; without even the implied warranty of    **
  35. ;** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    **
  36. ;** GNU General Public License for more details.            **
  37. ;**                                    **
  38. ;** You should have received a copy of the GNU General Public License    **
  39. ;** along with this program; if not, write to the Free Software        **
  40. ;** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.        **
  41. ;**                                                                     **
  42. ;*************************************************************************
  43. ;**                                                                     **
  44. ;** PDCLKSET sets the time and date of the PC clock using a TIME server.**
  45. ;** To do so, the following information is required:            **
  46. ;**                                     **
  47. ;** - This clients unique IP number.                    **
  48. ;** - The IP number of a UDP/IP time server.                **
  49. ;** - The time offset from UTC (GMT) at this place.            **
  50. ;** - If daylight saving (summer) time is used, which algorithm to use.    **
  51. ;**                                     **
  52. ;** All the above info can be supplied as arguments to PDCLKSET. If any    **
  53. ;** of the first three are missing, it will send a BOOTP request to try    **
  54. ;** to find the missing info. Except for client IP number, arguments to    **
  55. ;** PDCLKSET overrides BOOTP info.                    **
  56. ;**                                     **
  57. ;** BOOTP can not supply which dst algorithm to use; also, time offset    **
  58. ;** can't always be trusted. So, in practice, time offset and dst algo-    **
  59. ;** rithm (if applicable) are required arguments.            **
  60. ;**                                     **
  61. ;** If PDCLKSET finds more than one time server (sum of arguments and    **
  62. ;** BOOTP fields) and the first one does not answer, it will try the    **
  63. ;** second server.                            **
  64. ;**                                     **
  65. ;** It is very hard to get accurate info on all the dst algorithms used    **
  66. ;** all over the world, so the one you choose, you should test out. Use    **
  67. ;** the alter argument to add or subtract time and days, and check that    **
  68. ;** the dst switch occurs correctly. When using the alter argument, the    **
  69. ;** date and time is displayed as usual, but the PC clock is not set.    **
  70. ;** If you find any errors, mail me the correct info to my mail address    **
  71. ;** below. If you want to, you can customize your own dst algorithm, see**
  72. ;** detailed info below.                        **
  73. ;**                                     **
  74. ;** PDCLKSET talks to the network card via a packet driver. If you have    **
  75. ;** more than one packet driver, it will use the first one (lowest     **
  76. ;** packet interrupt number) unless you use the pktintno argument.    **
  77. ;** In AUTOEXEC.BAT you should first load the packet driver, then call    **
  78. ;** PDCLKSET. It is very small (6 kbyte) and executes fast, so you will    **
  79. ;** not notice any delay. PDCLKSET is not a TSR and does not require any**
  80. ;** CONFIG.SYS files, so no memory is wasted. Use TERMIN.COM if you want**
  81. ;** to unload the packet driver.                    **
  82. ;** Note: If you always log into a Novell server after a boot, you     **
  83. ;** don't need this program, the PC clock will be set from the server.    **
  84. ;**                                     **
  85. ;** Call syntax:                            **
  86. ;**                                     **
  87. ;**   (time is [- | +]{<hours>h | <minutes>m | <seconds>[s]})        **
  88. ;**                                    **
  89. ;** pdclkset b[ootp]         or                        **
  90. ;**                                    **
  91. ;** pdclkset [o[ffset]=time]                        **
  92. ;**                                     **
  93. ;**          [d[aylightsave]=PAC | USA | CUB | CHIL | BRZ | GBR |    **
  94. ;**                          W_EU | M_EU | E_EU | LIBY | EGY | TURK |    **
  95. ;**                          ISR | IRAN | PRC | ROK | AUS | TASM |    **
  96. ;**                  NSW | LHI | NZE |                **
  97. ;**                          FrTime,FrWeekDay,FrDayOfYear,        **
  98. ;**                          ToTime,ToWday,ToDayOfYr,AddTime]        **
  99. ;**                                     **
  100. ;**          [i[pnr]=n.n.n.n]  [t[imserver]=n.n.n.n[,n.n.n.n]]        **
  101. ;**                                     **
  102. ;**          [m[ask]=n.n.n.n]  [g[ateway]=n.n.n.n[,n.n.n.n]]        **
  103. ;**                                     **
  104. ;**          [a[lter]=days,time]  [p[ktintno]=decimalnr]        **
  105. ;**                                     **
  106. ;**                                     **
  107. ;** Examples:                                **
  108. ;**                                     **
  109. ;** pdclkset offs= -60m dst=M_EU (my IP nr and timeserver(s) from BOOTP)**
  110. ;**                                     **
  111. ;** pdclkset o=5h  d=USA  ip=123.45.6.7  ts=123.45.6.8  (BOOTP not used)**
  112. ;**                                     **
  113. ;*************************************************************************
  114. ;**                                     **
  115. ;** Acknowledgments:                            **
  116. ;**                                     **
  117. ;** The checksum routine used is a modified NCSA Telnet version.    **
  118. ;** The dst algorithm was modelled after PCIP SETCLOCK (thanks Drew!),    **
  119. ;** but enhanced to use parameters from a table.            **
  120. ;** The dst algorithm table was derived from a comp.sources.unix 1989    **
  121. ;** posting by ado@ncifcrf.gov of localtime.c and related routines    **
  122. ;** and tables, and a later update (very useful data, thanks!).        **
  123. ;** The packet driver interface routines were copied from the Clarkson    **
  124. ;** packet driver distribution, without which this project would not    **
  125. ;** have been possible (thanks Russ!).                    **
  126. ;** The small UDP/IP library was written by me, and can probably be    **
  127. ;** used in other small assembler applications.                **
  128. ;*                                      *
  129. ;* Jan Engvald, Lund University Computing Center             *
  130. ;* ____________________________________________________________________     *
  131. ;*   Address: Box 783               E-mail: xjeldc@ldc.lu.se         *
  132. ;*            S-220 07 LUND    Earn/Bitnet: xjeldc@seldc52         *
  133. ;*            SWEDEN          (Span/Hepnet: Sweden::Gemini::xjeldc)     *
  134. ;*    Office: Soelvegatan 18        VAXPSI: psi%2403732202020::xjeldc     *
  135. ;* Telephone: +46 46 107458         (X.400: C=se; A=TeDe; P=Sunet; O=lu; *
  136. ;*   Telefax: +46 46 138225                 OU=ldc; S=Engvald; G=Jan)     *
  137. ;*     Telex: 33533 LUNIVER S                         *
  138. ;*                                      *
  139. ;*************************************************************************
  140.  
  141. ;************************************************************************
  142. ;*        Compile time constants                                  *
  143. ;************************************************************************
  144.  
  145. DEBUG        equ    0
  146. IDSTRING    equ    'PDCLKSET ver 1.02'
  147.  
  148. MN        equ    60            ; seconds in a minute
  149. HR        equ    60*MN            ; seconds in an hour
  150.  
  151. SUN        equ    0            ; Sunday
  152. SAT        equ    6            ; Saturday
  153. DAT        equ    0ffh            ; Specific date follows
  154.  
  155. JANLW        equ    31                ; Jan last week
  156. FEB2W        equ    31+2*7                ; Feb 2nd week
  157. MAR1W        equ    31+28+1*7            ; Mar 1st week
  158. MAR2W        equ    31+28+2*7            ; Mar 2nd week
  159. MAR3W        equ    31+28+3*7            ; Mar 2rd week
  160. MARLW        equ    31+28+31            ; Mar last week
  161. APR01        equ    31+28+31+1            ; Apr 1
  162. APR03        equ    31+28+31+3            ; Apr 3
  163. APR07        equ    31+28+31+7            ; Apr 7
  164. APR1W        equ    31+28+31+1*7            ; Apr 1st week
  165. APR12        equ    31+28+31+12            ; Apr 12
  166. APR14        equ    31+28+31+14            ; Apr 14
  167. APR2W        equ    31+28+31+2*7            ; Apr 2nd week
  168. APR18        equ    31+28+31+18            ; Apr 18
  169. APR3W        equ    31+28+31+3*7            ; Apr 3rd week
  170. APR22        equ    31+28+31+22            ; Apr 22
  171. APR23        equ    31+28+31+23            ; Apr 23
  172. APRNL        equ    31+28+31+30-7            ; Apr next last week
  173. APR26        equ    31+28+31+26            ; Apr 26
  174. APRLW        equ    31+28+31+30            ; Apr last week
  175. MAY01        equ    31+28+31+30+1            ; May 1
  176. MAY04        equ    31+28+31+30+4            ; May 4
  177. MAY1W        equ    31+28+31+30+1*7            ; May 1st week
  178. MAY2W        equ    31+28+31+30+2*7            ; May 2nd week
  179. AUG28        equ    31+28+31+30+31+30+31+28        ; Aug 28
  180. AUG4W        equ    31+28+31+30+31+30+31+4*7    ; Aug 4th week
  181. SEP01        equ    31+28+31+30+31+30+31+31+1    ; Sep 1
  182. SEP1W        equ    31+28+31+30+31+30+31+31+1*7    ; Sep 1st week
  183. SEP08        equ    31+28+31+30+31+30+31+31+8    ; Sep 8
  184. SEP12        equ    31+28+31+30+31+30+31+31+12    ; Sep 12
  185. SEP2W        equ    31+28+31+30+31+30+31+31+2*7    ; Sep 2nd week
  186. SEP16        equ    31+28+31+30+31+30+31+31+16    ; Sep 16
  187. SEP17        equ    31+28+31+30+31+30+31+31+17    ; Sep 17
  188. SEP20        equ    31+28+31+30+31+30+31+31+20    ; Sep 20
  189. SEP3W        equ    31+28+31+30+31+30+31+31+3*7    ; Sep 3rd week
  190. SEP28        equ    31+28+31+30+31+30+31+31+28    ; Sep 28
  191. SEP30        equ    31+28+31+30+31+30+31+31+30    ; Sep 30
  192. SEPLW        equ    31+28+31+30+31+30+31+31+30    ; Sep last week
  193. OCT01        equ    31+28+31+30+31+30+31+31+30+1    ; Oct 1
  194. OCT1W        equ    31+28+31+30+31+30+31+31+30+1*7    ; Oct 1st week
  195. OCT2W        equ    31+28+31+30+31+30+31+31+30+2*7    ; Oct 2nd week
  196. OCT3W        equ    31+28+31+30+31+30+31+31+30+3*7    ; Oct 3rd week
  197. OCT24        equ    31+28+31+30+31+30+31+31+30+24    ; Oct 18 - 24
  198. OCT4W        equ    31+28+31+30+31+30+31+31+30+4*7    ; Oct 4th week
  199. OCT29        equ    31+28+31+30+31+30+31+31+30+29    ; Oct 23 - 29
  200. OCTLW        equ    31+28+31+30+31+30+31+31+30+31        ; Oct last week
  201. NOV13        equ    31+28+31+30+31+30+31+31+30+31+13    ; Nov 5 - 13
  202. DEC01        equ    31+28+31+30+31+30+31+31+30+31+30+1    ; Dec 1
  203. DEC2W        equ    31+28+31+30+31+30+31+31+30+31+30+2*7    ; Dec 2nd week
  204.  
  205. AlgE        struc
  206. AlgName        db    "EUR "            ; Name of dst algorithm
  207. AlgFromTime    dw    2*HR            ; local standard time dst start
  208. AlgFromWeekDay    dw    SUN            ; weekday dst start
  209. AlgFromWeek    dw    MARLW            ; last day-of-year dst start
  210. AlgUntilTime    dw    2*HR            ; local standard time dst end
  211. AlgUntilWeekDay    dw    SUN            ; weekday dst end
  212. AlgUntilWeek    dw    SEPLW            ; last day-of-year dst end
  213. AlgAddAmount    dw    1*HR            ; dst advance amount
  214. AlgEntryLen    =    $-AlgName
  215. AlgE        ends
  216.  
  217. AlgData        struc
  218. AUSA AlgE <"USA ", 2*HR,SUN,APR1W, 1*HR,SUN,OCTLW, HR>    ; USA Canada Mexico
  219. ACub AlgE <"CUB ", 0*HR,SUN,MAY2W,-1*HR,SUN,OCT2W, HR>    ; Cuba
  220. AChl AlgE <"CHIL", 0*HR,SUN,OCT2W,-1*HR,SUN,MAR2W, HR>    ; Chile
  221. ABrz AlgE <"BRZ ", 2*HR,SAT,OCT4W, 1*HR,SAT,FEB2W, HR>    ; Brazil
  222. AGBR AlgE <"GBR ", 1*HR,SUN,MARLW, 1*HR,SUN,OCT29, HR>    ; United Kingdom
  223. AWEu AlgE <"W_EU", 1*HR,SUN,MARLW, 1*HR,SUN,SEPLW, HR>    ; West Europe
  224. AMEu AlgE <"M_EU", 2*HR,SUN,MARLW, 2*HR,SUN,SEPLW, HR>    ; Central Europe + SU
  225. AEEu AlgE <"E_EU", 3*HR,SUN,MARLW, 3*HR,SUN,SEPLW, HR>    ; East Europe
  226. ALby AlgE <"LIBY", 2*HR,DAT,APR01, 1*HR,DAT,SEP30, HR>    ; Libya
  227. AEgy AlgE <"EGY ", 2*HR,DAT,MAY01, 1*HR,DAT,OCT01, HR>    ; Egypt
  228. ATur AlgE <"TURK", 1*HR,SUN,MARLW, 0*HR,SUN,SEPLW, HR>    ; Turkey
  229. AIra AlgE <"IRAN", 2*HR,SUN,MARLW, 1*HR,SUN,SEP3W, HR>    ; Iran
  230. APRC AlgE <"PRC ", 2*HR,SUN,APR2W, 2*HR,SUN,SEP2W, HR>    ; People Rep of China
  231. AROK AlgE <"ROK ", 2*HR,SUN,MAY2W, 2*HR,SUN,OCT2W, HR>    ; Rep of Korea
  232. AAus AlgE <"AUS ", 2*HR,SUN,OCTLW, 2*HR,SUN,MAR3W, HR>    ; South Australia
  233. ATas AlgE <"TASM", 2*HR,SUN,OCT24, 2*HR,SUN,MAR3W, HR>    ; Tasmania
  234. ANSW AlgE <"NSW ", 2*HR,SUN,OCTLW, 2*HR,SUN,MAR1W, HR>    ; New South Wales
  235. ALHI AlgE <"LHI ", 2*HR,SUN,OCTLW, 2*HR,SUN,MAR1W, 30*MN> ; LHI (Australia) 
  236. ANZe AlgE <"NZE ", 2*HR,SUN,OCTLW, 2*HR,SUN,MAR1W, HR>    ; New Zealand
  237.  
  238. ; All entries below this line are indexed by year modulo 4
  239.  
  240. APa0 AlgE <"PAC ", 2*HR,SUN,APR1W, 1*HR,SUN,NOV13, HR>    ; Pacific presidential
  241. APa1 AlgE <"PAC ", 2*HR,SUN,APR1W, 1*HR,SUN,OCTLW, HR>    ; Pacific non-pres
  242. APa2 AlgE <"PAC ", 2*HR,SUN,APR1W, 1*HR,SUN,OCTLW, HR>    ; Pacific non-pres
  243. APa3 AlgE <"PAC ", 2*HR,SUN,APR1W, 1*HR,SUN,OCTLW, HR>    ; Pacific non-pres
  244.  
  245. ; All entries above this line are cyclic and will last forever
  246. ; All entries below this line are non-cyclic, they only last 4 years
  247.  
  248. AIs0 AlgE <"ISR ", 0*HR,DAT,APR26,-1*HR,DAT,SEP20, HR>    ; Israel 1992
  249. AIs1 AlgE <"ISR ", 0*HR,DAT,APR18,-1*HR,DAT,SEP12, HR>    ; Israel 1993
  250. AIs2 AlgE <"ISR ", 0*HR,DAT,APR03,-1*HR,DAT,AUG28, HR>    ; Israel 1994
  251. AIs3 AlgE <"ISR ", 0*HR,DAT,APR07,-1*HR,DAT,SEP01, HR>    ; Israel 1991
  252.  
  253. if    0    ; as years go by, replace entries above from below
  254. AIs3 AlgE <"ISR ", 0*HR,DAT,APR23,-1*HR,DAT,SEP17, HR>    ; Israel 1995
  255. AIs0 AlgE <"ISR ", 0*HR,DAT,APR14,-1*HR,DAT,SEP08, HR>    ; Israel 1996
  256. AIs1 AlgE <"ISR ", 0*HR,DAT,MAY04,-1*HR,DAT,SEP28, HR>    ; Israel 1997
  257. AIs2 AlgE <"ISR ", 0*HR,DAT,APR19,-1*HR,DAT,SEP13, HR>    ; Israel 1998
  258. AIs3 AlgE <"ISR ", 0*HR,DAT,APR11,-1*HR,DAT,SEP05, HR>    ; Israel 1999
  259. AIs0 AlgE <"ISR ", 0*HR,DAT,APR30,-1*HR,DAT,SEP24, HR>    ; Israel 2000
  260. AIs1 AlgE <"ISR ", 0*HR,DAT,APR15,-1*HR,DAT,SEP09, HR>    ; Israel 2001
  261. AIs2 AlgE <"ISR ", 0*HR,DAT,APR07,-1*HR,DAT,SEP01, HR>    ; Israel 2002
  262. AIs3 AlgE <"ISR ", 0*HR,DAT,APR27,-1*HR,DAT,SEP21, HR>    ; Israel 2003
  263. AIs0 AlgE <"ISR ", 0*HR,DAT,APR18,-1*HR,DAT,SEP12, HR>    ; Israel 2004
  264. AIs1 AlgE <"ISR ", 0*HR,DAT,MAY01,-1*HR,DAT,SEP25, HR>    ; Israel 2005
  265. AIs2 AlgE <"ISR ", 0*HR,DAT,APR23,-1*HR,DAT,SEP17, HR>    ; Israel 2006
  266. AIs3 AlgE <"ISR ", 0*HR,DAT,APR15,-1*HR,DAT,SEP09, HR>    ; Israel 2007
  267. AIs0 AlgE <"ISR ", 0*HR,DAT,APR27,-1*HR,DAT,SEP21, HR>    ; Israel 2008
  268. AIs1 AlgE <"ISR ", 0*HR,DAT,APR19,-1*HR,DAT,SEP13, HR>    ; Israel 2009
  269. endif
  270. AlgData        ends
  271.  
  272. WARNYEAR    equ    1995            ; acyclic data invalid year
  273.  
  274. ;************************************************************************
  275.