1: /* 2: * Copyright (c) 1983 Regents of the University of California. 3: * All rights reserved. The Berkeley software License Agreement 4: * specifies the terms and conditions for redistribution. 5: */ 6: 7: /* @(#)timed.h 1.6 (Berkeley) 5/28/86 */ 8: 9: /* 10: * Time Synchronization Protocol 11: */ 12: 13: #define TSPVERSION 1 14: #define ANYADDR NULL 15: 16: struct tsp { 17: u_char tsp_type; 18: u_char tsp_vers; 19: u_short tsp_seq; 20: union { 21: struct timeval tspu_time; 22: char tspu_hopcnt; 23: } tsp_u; 24: char tsp_name[MAXHOSTNAMELEN]; 25: }; 26: 27: #define tsp_time tsp_u.tspu_time 28: #define tsp_hopcnt tsp_u.tspu_hopcnt 29: 30: /* 31: * Command types. 32: */ 33: #define TSP_ANY 0 /* match any types */ 34: #define TSP_ADJTIME 1 /* send adjtime */ 35: #define TSP_ACK 2 /* generic acknowledgement */ 36: #define TSP_MASTERREQ 3 /* ask for master's name */ 37: #define TSP_MASTERACK 4 /* acknowledge master request */ 38: #define TSP_SETTIME 5 /* send network time */ 39: #define TSP_MASTERUP 6 /* inform slaves that master is up */ 40: #define TSP_SLAVEUP 7 /* slave is up but not polled */ 41: #define TSP_ELECTION 8 /* advance candidature for master */ 42: #define TSP_ACCEPT 9 /* support candidature of master */ 43: #define TSP_REFUSE 10 /* reject candidature of master */ 44: #define TSP_CONFLICT 11 /* two or more masters present */ 45: #define TSP_RESOLVE 12 /* masters' conflict resolution */ 46: #define TSP_QUIT 13 /* reject candidature if master is up */ 47: #define TSP_DATE 14 /* reset the time (date command) */ 48: #define TSP_DATEREQ 15 /* remote request to reset the time */ 49: #define TSP_DATEACK 16 /* acknowledge time setting */ 50: #define TSP_TRACEON 17 /* turn tracing on */ 51: #define TSP_TRACEOFF 18 /* turn tracing off */ 52: #define TSP_MSITE 19 /* find out master's site */ 53: #define TSP_MSITEREQ 20 /* remote master's site request */ 54: #define TSP_TEST 21 /* for testing election algo */ 55: #define TSP_SETDATE 22 /* New from date command */ 56: #define TSP_SETDATEREQ 23 /* New remote for above */ 57: #define TSP_LOOP 24 /* loop detection packet */ 58: 59: #define TSPTYPENUMBER 25 60: 61: #ifdef TSPTYPES 62: char *tsptype[TSPTYPENUMBER] = 63: { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP", 64: "SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT", 65: "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ", 66: "TEST", "SETDATE", "SETDATEREQ", "LOOP" }; 67: #endif