SNTP ActiveX Control for Microsoft Windows. Copyright Magneto Software All rights reserved



Similar documents
Time Calibrator Fountain Computer Products

DNS ActiveX Control for Microsoft Windows. Copyright Magneto Software All rights reserved

Clock Synchronization

Clock Synchronization

Computer Time Synchronization

Time Synchronization & Timekeeping

Internet Timekeeping Around the Globe 1,2

Windows Time Service Mark E. Donaldson

Network Management Card. User Manual

Computer Time Synchronization

? Index. Introduction. 1 of 38 About the QMS Network Print Monitor for Windows NT

Evaluating the Accuracy of Maxim Real-Time Clocks (RTCs)

Ethernet Port Quick Start Manual

CONTROL MICROSYSTEMS DNP3. User and Reference Manual

Using RADIUS Agent for Transparent User Identification

Network Time Protocol (NTP) General Overview

HANDBOOK. Measuring System DESIGN EDITORS PETER H. SYDENHAM RICHARD THORN ARTICLE OFFPRINT

3.7. Clock Synch hronisation

Synchronization in. Distributed Systems. Cooperation and Coordination in. Distributed Systems. Kinds of Synchronization.

DHCP and DNS Services

Talking Atomic Alarm Clock Instructions

TCP/IP Network Connectivity and ION Meters

Chapter 8 Router and Network Management

Downloading and Using the NIST Time Program

TS-300-MSF TS-300 INSTALLATION AND CONFIGURATION MANUAL

Event Center (rev b) EVENT CENTER. VPI 160 Camino Ruiz, Camarillo, CA (Voice) (Fax)

IP Routing Features. Contents

ODBC Client Driver Help Kepware, Inc.

Cisco CNR and DHCP FAQs for Cable Environment

Hands On Activities: TCP/IP Network Monitoring and Management

Kiwi SyslogGen. A Freeware Syslog message generator for Windows. by SolarWinds, Inc.

ClockWatch Client/Server

Andover Continuum Remote Communication Configuration Guide

Configuring CSS Remote Access Methods

Increasing Driver Performance

Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation

Configuring NTP. Information About NTP. NTP Overview. Send document comments to CHAPTER

1 Synchronizing Windows computers

GS510TP and GS110T Gigabit Smart Switches

Ethernet. Customer Provided Equipment Configuring the Ethernet port.

Kaseya 2. User Guide. for Network Monitor 4.1

How To Create An Easybelle History Database On A Microsoft Powerbook (Windows)

ACCESS 9340 and 9360 Meter Ethernet Communications Card ETHER

Configuring NetFlow Secure Event Logging (NSEL)

THE SNMP PROTOCOL THE SNMP REQUEST MIB SATELLAR 2DS/20DS SIMPLE NETWORK MANAGEMENT PROTOCOL SATELLAR MANAGEMENT WITH SNMP GET AND SET SMART RADIO

Table of Contents. Cisco Network Time Protocol: Best Practices White Paper

Deposit Direct. Getting Started Guide

JPMorgan Chase Treasury Workstation. Certification Setup Guide Version 2.0

Logging and SNMP Trap Notification Of Events. Isonas Access Control System. Release 12 June 2007

Best Practices for Leap Second Event Occurring on 30 June 2015

How to deploy console cable to connect WIAS-3200N and PC, to reset setting or check status via console

How To Use The Correlog With The Cpl Powerpoint Powerpoint Cpl.Org Powerpoint.Org (Powerpoint) Powerpoint (Powerplst) And Powerpoint 2 (Powerstation) (Powerpoints) (Operations

Manual. IP Sensor and Watchdog IPSW2210. I P S W M a n u a l P a g e 1. Relay Output. Power input. 12VDC adapter LED Indicators. 2 Dry.

The basic mode for adjusting a time zone clock are primarily: 21, 24 and 51-1 (51-1 is for Alpha Characters) Entering Mode Programming

Precision Time Protocol on Linux ~ Introduction to linuxptp

Implementing and testing tftp

Setup Manual and Programming Reference. RGA Ethernet Adapter. Stanford Research Systems. Revision 1.05 (11/2010)

Nokia E61i Configuring connection settings

Configuring Primary and Backup Proxy Servers for Standalone Content Engines

USB GSM 3G modem RMS-U-GSM-3G. Manual (PDF) Version 1.0,

MN-700 Base Station Configuration Guide

Understanding Slow Start

Global Monitoring + Support

Configuring Health Monitoring

Exploring the Remote Access Configuration Utility

How To Set Up A Modbus Cda On A Pc Or Maca (Powerline) With A Powerline (Powergen) And A Powergen (Powerbee) (Powernet) (Operating System) (Control Microsci

Configuring DHCP. DHCP Server Overview

Configuring connection settings

Network Security Part II: Standards

Configuring NTP. Information about NTP. NTP Overview. Send document comments to CHAPTER

Kaseya 2. Quick Start Guide. for Network Monitor 4.1

DNS Commands ip dns spoofing

Procedure: You can find the problem sheet on Drive D: of the lab PCs. 1. IP address for this host computer 2. Subnet mask 3. Default gateway address

PageR Enterprise Monitored Objects - AS/400-5

RADIUS Authentication and Accounting

COMSPHERE 6700 SERIES NETWORK MANAGEMENT SYSTEM

Jet Data Manager 2012 User Guide

Multi-Homing Gateway. User s Manual

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

User Manual of Web Client

Content Filtering Client Policy & Reporting Administrator s Guide

Temperature Alert. LAN-based Temperature and Humidity Data Logger

ProSafe Managed Switch

ichip FTP Client Theory of Operation Version 1.32

IP - The Internet Protocol

Monitoring the NTP Server. eg Enterprise v6.0

Managing Users and Identity Stores

Using Network Time Protocol (NTP): Introduction and Recommended Practices

95 Methodist Hill Drive Suite 500 Rochester, New York 14623

Clocking. Clocking in the Digital Network

Remote Access Server - Dial-Out User s Guide

Purpose Computer Hardware Configurations... 6 Single Computer Configuration... 6 Multiple Server Configurations Data Encryption...

WhatsUp Gold v11 Features Overview

Out n About! for Outlook Electronic In/Out Status Board. Administrators Guide. Version 3.x

How To Manage A Cart In A Remote Management Software

Network Time Management Configuration. Content CHAPTER 1 SNTP CONFIGURATION CHAPTER 2 NTP FUNCTION CONFIGURATION

Transcription:

SNTP ActiveX Control for Microsoft Windows Copyright Magneto Software All rights reserved

1 SNTP Overview... 3 1.1 Introduction... 3 1.2 Usage... 3 1.3 Property... 4 1.4 Event... 4 1.5 Method... 4 1.6 Error codes... 4 2 Properties... 6 2.1 optport... 6 2.2 optsntpserver... 7 2.3 optsyncinterval... 8 2.4 optsynconstartup... 9 2.5 opttimeout... 10 3 Events... 11 3.1 SntpCompleted... 11 3.2 SntpQueryCompleted... 12 4 Methods... 15 4.1 AboutBox... 15 4.2 ResetSntpSettings... 16 4.3 SntpGetReply... 17 4.4 SntpReset... 18 4.5 SntpSendRequest... 19

1 SNTP Overview 1.1 Introduction The Magneto Software SNTP (Simple Network Time Protocol) ActiveX control (sksntp.ocx) can be used for very accurate local clock synchronization with a remote time server across the Internet. The Magneto Software sksntp ActiveX control (sksntp.ocx) allows developers to integrate the SNTP protocol message sending capability into their 32-Bit or 64-Bit applications. Additional information about SNTP User Information Protocol can be found at this location: RFC2030 Simple Network Time Protocol (SNTP) Version 4 for IPv4, IPv6, and OSI. 1.2 Usage Sksntp ActiveX control can retrieve the exact time from any SNTP compliant time server across the Internet, and synchronize your computer' local clock accurately to the order of milliseconds.

1.3 Property optport SNTP service port on server optsntpserver SNTP Server to be used for time synchronization optsyncinterval Specify how frequently to synchronize local clock. optsynconstartup Specify if local clock has to be synchronized whenever sksntp.ocx is invoked. opttimeout Specify timeout value in milliseconds to wait for replies. 1.4 Event SntpCompleted Indicate that sksntp.ocx has stopped processing SNTP requests. SntpQueryCompleted Indicate that sksntp.ocx has stopped processing a single SNTP request. 1.5 Method AboutBox Display a dialog box with Sksntp ActiveX control license and version information. ResetSntpSettings Reset all SNTP settings back to default values. SntpGetReply Get a SNTP reply. SntpReset Stop SNTP messages. SntpSendRequest Send a SNTP request. 1.6 Error codes The following provides a complete listing of error codes returned by Sksntp ActiveX control. ERROR_SUCCESS (0) No errors. ERROR_CANCELLED (1223) User canceled the operation. ERROR_TIMEOUT (1460) This operation returned because the timeout period expired. WSAEFAULT (10014) The name or the namelen parameter is not a valid part of the user address space, the namelen parameter is too small, or the name parameter contains incorrect address format for the associated address family. WSAEPFNOSUPPORT (10046) The protocol family has not been configured into the system or

no implementation for it exists. WSAEADDRNOTAVAIL (10049) The remote address is not a valid address (such as ADDR_ANY). WSAENETDOWN (10050) The network subsystem has failed. WSAENETUNREACH (10051) The network cannot be reached from this host at this time. WSAENOBUFS (10055) No buffer space is available. The socket cannot be connected. WSAENOTCONN (10057) The socket is not connected. WSAETIMEDOUT (10060) Attempt to connect timed out without establishing a connection. WSAECONNREFUSED (10061) The attempt to connect was forcefully rejected.

2 Properties 2.1 optport SNTP service port on server This property specifies the remote port on the server on which the SNTP service resides. This property is of type int. The default value is 123. VB Example Dim Port As Int Port = 123 SKSNTP.optPort = Port

2.2 optsntpserver SNTP Server to be used for time synchronization. This property specifies the SNTP server to query. Note that this value will be used only in conjunction with optsynconstartup or with optsyncinterval options. By default this value is set to time.mit.edu. This property is of type string. VB Example Dim TimeServer As String TimeServer = time.nist.gov SKSNTP.optSntpServer = TimeServer

2.3 optsyncinterval Specify how frequently to synchronize local clock. SkSNTP can synchronize local clock on demand (via method SntpSendRequest), or periodically (when optsyncinterval is set to a non-zero value). This property specifies how frequently to synchronize local clock. To enable periodic local clock synchronization set this property to non-zero value. Note that SkSNTP will be querying the server, defined by the property optsntpserver. To disable periodic local clock synchronization set this property to zero. By default this value is set to 0 (Periodic local clock synchronization is disabled). This property is of type short. VB Example Dim SyncInterval As Int SyncInterval = 24 we want to synchronize our computer clock every 24 hours SKSNTP.optSyncInterval = SyncInterval

2.4 optsynconstartup Specify if local clock has to be synchronized whenever SkSNTP is invoked. This property specifies if local clock has to be synchronized whenever SkSNTP is invoked. This property is of type short. VB Example Dim Time As Long Time = 3000 SKSNTP.optTimeout = Time

2.5 opttimeout Timeout value to wait for replies, in milliseconds. This property specifies the timeout value in milliseconds that is used to wait for a reply when a request packet is sent. The application must set this value before the request is sent. By default this value is set to 3 seconds (3000 milliseconds). This property is of type long. VB Example Dim Time As Long Time = 3000 SKSNTP.optTimeout = Time

3 Events 3.1 SntpCompleted Indicate that sksntp.ocx has stopped processing SNTP requests. Syntax SntpCompleted (void); Indicate that sksntp.ocx has stopped processing SNTP requests. Parameters None.

3.2 SntpQueryCompleted Indicate that sksntp.ocx has stopped processing a single SNTP request. Syntax SntpQueryCompleted(BSTR bstrsntpserver, long lstatus, VARIANT varsntpdata); Indicate that sksntp.ocx has stopped processing a single SNTP request. Parameters strsntpserver is the name of the remote server that was queried. lstatus is the return status of each individual reply. See section 1.6 Error Codes the complete list of supported error codes, pvaricmpinfo is a variant, containing two-dimensional SAFEARRAY of data. Each element of this SAFEARRAY is a VARIANT. There are two columns in this array (column #0, column #1 Value). The SAFEARRAY row element indexes and their definitions are as follows: 0 varleapindicator, a code warning of an impending leap second to be inserted/deleted in the last minute of the current day, with bit 0 and bit 1, respectively, coded as follows: Value Meaning ------------------------------------------------------- 0 - no warning 1 - last minute has 61 seconds 2 - last minute has 59 seconds) 3 - alarm condition (clock not synchronized). 1 varversion, the NTP/SNTP version number. The version number is 3 for Version 3 (IPv4 only) and 4 for Version 4 (IPv4, IPv6 and OSI). If necessary to distinguish between IPv4, IPv6 and OSI, the encapsulating context must be inspected. 2 varmode, the mode, with values defined as follows: Mode Meaning ------------------------------------ 0 reserved 1 symmetric active 2 symmetric passive 3 client 4 server 5 broadcast 6 reserved for NTP control message 7 reserved for private use 3 varstratum, the stratum level of the local clock, with values defined as follows: Stratum Meaning ---------------------------------------------- 0 unspecified or unavailable

1 primary reference (e.g., radio clock) 2-15 secondary reference (via NTP or SNTP) 16-255 reserved 4 - varpollinterval, the maximum interval between successive messages, in seconds The values that can appear in this field presently range from 16 seconds to 16284 seconds; however, most applications use only the sub-range 64 seconds to 1024 seconds. 5 varprecision, the precision of the local clock, in seconds. The values that normally appear in this field range from 2 by the power of -6 for mains-frequency clocks to 2 by the power -20 for microsecond clocks found in some workstations. 6 - varrootdelay, the total roundtrip delay to the primary reference source, in seconds. Note that this variable can take on both positive and negative values, depending on the relative time and frequency offsets. The values that normally appear in this field range from negative values of a few milliseconds to positive values of several hundred milliseconds. 7 varrootdispersion, the nominal error relative to the primary reference source, in seconds. The values that normally appear in this field range from 0 to several hundred milliseconds. 8 - varreferenceidentifier, a string identifying the particular reference source. In the case of NTP Version 3 or Version 4 stratum-0 (unspecified) or stratum-1 (primary) servers, this is an ASCII string. In NTP Version 3 secondary servers, this is the 32-bit IPv4 address of the reference source. In NTP Version 4 secondary servers, this is the low order 32 bits of the latest transmit timestamp of the reference source. NTP primary (stratum 1) servers should set this field to a code identifying the external reference source according to the following list. If the external reference is one of those listed, the associated code should be used. Codes for sources not listed can be contrived as appropriate. Code External Reference Source ---------------------------------------------------------------- LOCL uncalibrated local clock used as a primary reference for a subnet without external means of synchronization PPS atomic clock or other pulse-per-second source individually calibrated to national standards ACTS NIST dialup modem service USNO USNO modem service PTB PTB (Germany) modem service TDF Allouis (France) Radio 164 khz DCF Mainflingen (Germany) Radio 77.5 khz MSF Rugby (UK) Radio 60 khz WWV Ft. Collins (US) Radio 2.5, 5, 10, 15, 20 MHz WWVB Boulder (US) Radio 60 khz WWVH Kaui Hawaii (US) Radio 2.5, 5, 10, 15 MHz CHU Ottawa (Canada) Radio 3330, 7335, 14670 khz LORC LORAN-C radionavigation system

OMEG OMEGA radionavigation system GPS Global Positioning Service GOES Geostationary Orbit Environment Satellite 9 varoriginatetimestamp, the time at which the request departed the client for the server, in DATE timestamp format. 10 varoriginatetimestampmsecs, the milliseconds part of the Originate Time (see element 9). 11 ReceiveTimestamp, the time at which the request arrived at the server, in DATE timestamp format. 12 varreceivetimestampmsecs, the milliseconds part of the Receive Time (see element 11). 13 - vartransmittimestamp, the time at which the reply departed the server for the client, in DATE timestamp format. 14 vartransmittimestampmsecs, the milliseconds part of the Transmit Time (see element 13). 15 vardestinationtimestamp, the time when the SNTP reply was received by the client. 16 vardestinationtimestampmsecs, the milliseconds part of the Destination Time (see element 13). 17 varroundtripdelay, the round trip time in seconds for the SNTP request. This is calculated as: RoundTripDelay = (DestinationTime - OriginateTime) - (ReceiveTime - TransmitTime); 18 varlocalclockoffset, the local clock offset relative to the server. This is calculated as: LocalClockOffset = ((ReceiveTime - OriginateTime) + (TransmitTime - DestinationTime)) / 2.

4 Methods 4.1 AboutBox Display a dialog box with Sksntp ActiveX control license and version information. Syntax void AboutBox(); This method could be used to display version license information or to register sksntp.ocx control. Parameters None.

4.2 ResetSntpSettings Reset all SNTP settings back to default values. Syntax void ResetSntpSettings(void) All SNTP related settings would be reset to defaults. Parameters None.

4.3 SntpGetReply Get a SNTP reply. Syntax long SntpGetReply(BSTR bstrsntpserver, VARIANT* pvarstatus, VARIANT* varsntpdata) Retrieves SNTP reply when SNTP query is sent. Note that this method should be used only when SkSNTP control is used as a COM server, not an ActiveX control, for instance, when SkSNTP is instantiated from ASP page or Windows Scripting Host. When SkSNTP is used as regular ActiveX control, notification event SntpQueryCompleted should be used instead. Parameters strsntpserver is the name of the remote server that was queried. lstatus is the return status of each individual reply. See section 1.6 Error Codes the complete list of supported error codes, pvaricmpinfo is a variant, containing two-dimensional SAFEARRAY of data. Each element of this SAFEARRAY is a VARIANT. See SntpQueryCompleted for the complete description of this argument. Return value Return value indicates current state. Possible values: 997 (ERROR_IO_PENDING), control is still processing SNTP request. 234 (ERROR_MORE_DATA), a SNTP reply is retrieved. 259 (ERROR_NO_MORE_ITEMS), there is no more data to retrieve.

4.4 SntpReset Stop SNTP messages. Syntax void SntpReset (void) The SntpReset method terminates any pending SNTP requests. Parameters None.

4.5 SntpSendRequest Send a SNTP request. Syntax long SntpSendRequest(BSTR bstrsntpserver, short bsynchronizeclock); The SntpSendRequest method sends a SNTP request to the host specified by bstrsntpserver. It returns a long, which is set to 0 (ERROR_SUCCESS) if the method is successfully executed, otherwise it will be set to the error code from section 1.6 Error Codes. Parameters bstrsntpserver is the name of the remote SNTP server to query. bsynchronizelocalclock specifies if local clock needs to be synchronized (1 if Yes, 0 if No ). Note that when SkSNTP used by IIS server, or some other services, it might fail to synchronize local clock due to the limited security privileges of the running process.