Back to index

glibc  2.9
timed.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1983, 1993
00003  *     The Regents of the University of California.  All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 4. Neither the name of the University nor the names of its contributors
00014  *    may be used to endorse or promote products derived from this software
00015  *    without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00027  * SUCH DAMAGE.
00028  *
00029  *     @(#)timed.h   8.1 (Berkeley) 6/2/93
00030  */
00031 
00032 #ifndef       _PROTOCOLS_TIMED_H
00033 #define       _PROTOCOLS_TIMED_H 1
00034 
00035 #include <rpc/types.h>
00036 
00037 /*
00038  * Time Synchronization Protocol
00039  */
00040 
00041 #define       TSPVERSION    1
00042 #define ANYADDR      NULL
00043 
00044 struct tsp {
00045        u_char tsp_type;
00046        u_char tsp_vers;
00047        u_short       tsp_seq;
00048        union {
00049               struct timeval tspu_time;
00050               char tspu_hopcnt;
00051        } tsp_u;
00052        char tsp_name[MAXHOSTNAMELEN];
00053 };
00054 
00055 #define       tsp_time      tsp_u.tspu_time
00056 #define       tsp_hopcnt    tsp_u.tspu_hopcnt
00057 
00058 /*
00059  * Command types.
00060  */
00061 #define       TSP_ANY                     0      /* match any types */
00062 #define       TSP_ADJTIME          1      /* send adjtime */
00063 #define       TSP_ACK                     2      /* generic acknowledgement */
00064 #define       TSP_MASTERREQ        3      /* ask for master's name */
00065 #define       TSP_MASTERACK        4      /* acknowledge master request */
00066 #define       TSP_SETTIME          5      /* send network time */
00067 #define       TSP_MASTERUP         6      /* inform slaves that master is up */
00068 #define       TSP_SLAVEUP          7      /* slave is up but not polled */
00069 #define       TSP_ELECTION         8      /* advance candidature for master */
00070 #define       TSP_ACCEPT           9      /* support candidature of master */
00071 #define       TSP_REFUSE           10     /* reject candidature of master */
00072 #define       TSP_CONFLICT         11     /* two or more masters present */
00073 #define       TSP_RESOLVE          12     /* masters' conflict resolution */
00074 #define       TSP_QUIT             13     /* reject candidature if master is up */
00075 #define       TSP_DATE             14     /* reset the time (date command) */
00076 #define       TSP_DATEREQ          15     /* remote request to reset the time */
00077 #define       TSP_DATEACK          16     /* acknowledge time setting  */
00078 #define       TSP_TRACEON          17     /* turn tracing on */
00079 #define       TSP_TRACEOFF         18     /* turn tracing off */
00080 #define       TSP_MSITE            19     /* find out master's site */
00081 #define       TSP_MSITEREQ         20     /* remote master's site request */
00082 #define       TSP_TEST             21     /* for testing election algo */
00083 #define       TSP_SETDATE          22     /* New from date command */
00084 #define       TSP_SETDATEREQ              23     /* New remote for above */
00085 #define       TSP_LOOP             24     /* loop detection packet */
00086 
00087 #define       TSPTYPENUMBER        25
00088 
00089 #ifdef TSPTYPES
00090 char *tsptype[TSPTYPENUMBER] =
00091   { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP",
00092   "SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT",
00093   "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ",
00094   "TEST", "SETDATE", "SETDATEREQ", "LOOP" };
00095 #endif
00096 
00097 #endif /* protocols/timed.h */