Blame inet/protocols/timed.h

Packit 6c4009
/*
Packit 6c4009
 * Copyright (c) 1983, 1993
Packit 6c4009
 *	The Regents of the University of California.  All rights reserved.
Packit 6c4009
 *
Packit 6c4009
 * Redistribution and use in source and binary forms, with or without
Packit 6c4009
 * modification, are permitted provided that the following conditions
Packit 6c4009
 * are met:
Packit 6c4009
 * 1. Redistributions of source code must retain the above copyright
Packit 6c4009
 *    notice, this list of conditions and the following disclaimer.
Packit 6c4009
 * 2. Redistributions in binary form must reproduce the above copyright
Packit 6c4009
 *    notice, this list of conditions and the following disclaimer in the
Packit 6c4009
 *    documentation and/or other materials provided with the distribution.
Packit 6c4009
 * 4. Neither the name of the University nor the names of its contributors
Packit 6c4009
 *    may be used to endorse or promote products derived from this software
Packit 6c4009
 *    without specific prior written permission.
Packit 6c4009
 *
Packit 6c4009
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
Packit 6c4009
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 6c4009
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit 6c4009
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
Packit 6c4009
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 6c4009
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Packit 6c4009
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Packit 6c4009
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Packit 6c4009
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Packit 6c4009
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Packit 6c4009
 * SUCH DAMAGE.
Packit 6c4009
 *
Packit 6c4009
 *	@(#)timed.h	8.1 (Berkeley) 6/2/93
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifndef	_PROTOCOLS_TIMED_H
Packit 6c4009
#define	_PROTOCOLS_TIMED_H 1
Packit 6c4009
Packit 6c4009
#include <sys/types.h>
Packit 6c4009
#include <sys/time.h>
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Time Synchronization Protocol
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#define	TSPVERSION	1
Packit 6c4009
#define ANYADDR 	NULL
Packit 6c4009
#define MAXHOSTNAMELEN	64
Packit 6c4009
Packit 6c4009
struct tsp {
Packit 6c4009
	unsigned char	tsp_type;
Packit 6c4009
	unsigned char	tsp_vers;
Packit 6c4009
	unsigned short	tsp_seq;
Packit 6c4009
	union {
Packit 6c4009
		struct timeval tspu_time;
Packit 6c4009
		char tspu_hopcnt;
Packit 6c4009
	} tsp_u;
Packit 6c4009
	char tsp_name[MAXHOSTNAMELEN];
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
#define	tsp_time	tsp_u.tspu_time
Packit 6c4009
#define	tsp_hopcnt	tsp_u.tspu_hopcnt
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Command types.
Packit 6c4009
 */
Packit 6c4009
#define	TSP_ANY			0	/* match any types */
Packit 6c4009
#define	TSP_ADJTIME		1	/* send adjtime */
Packit 6c4009
#define	TSP_ACK			2	/* generic acknowledgement */
Packit 6c4009
#define	TSP_MASTERREQ		3	/* ask for master's name */
Packit 6c4009
#define	TSP_MASTERACK		4	/* acknowledge master request */
Packit 6c4009
#define	TSP_SETTIME		5	/* send network time */
Packit 6c4009
#define	TSP_MASTERUP		6	/* inform slaves that master is up */
Packit 6c4009
#define	TSP_SLAVEUP		7	/* slave is up but not polled */
Packit 6c4009
#define	TSP_ELECTION		8	/* advance candidature for master */
Packit 6c4009
#define	TSP_ACCEPT		9	/* support candidature of master */
Packit 6c4009
#define	TSP_REFUSE		10	/* reject candidature of master */
Packit 6c4009
#define	TSP_CONFLICT		11	/* two or more masters present */
Packit 6c4009
#define	TSP_RESOLVE		12	/* masters' conflict resolution */
Packit 6c4009
#define	TSP_QUIT		13	/* reject candidature if master is up */
Packit 6c4009
#define	TSP_DATE		14	/* reset the time (date command) */
Packit 6c4009
#define	TSP_DATEREQ		15	/* remote request to reset the time */
Packit 6c4009
#define	TSP_DATEACK		16	/* acknowledge time setting  */
Packit 6c4009
#define	TSP_TRACEON		17	/* turn tracing on */
Packit 6c4009
#define	TSP_TRACEOFF		18	/* turn tracing off */
Packit 6c4009
#define	TSP_MSITE		19	/* find out master's site */
Packit 6c4009
#define	TSP_MSITEREQ		20	/* remote master's site request */
Packit 6c4009
#define	TSP_TEST		21	/* for testing election algo */
Packit 6c4009
#define	TSP_SETDATE		22	/* New from date command */
Packit 6c4009
#define	TSP_SETDATEREQ		23	/* New remote for above */
Packit 6c4009
#define	TSP_LOOP		24	/* loop detection packet */
Packit 6c4009
Packit 6c4009
#define	TSPTYPENUMBER		25
Packit 6c4009
Packit 6c4009
#ifdef TSPTYPES
Packit 6c4009
char *tsptype[TSPTYPENUMBER] =
Packit 6c4009
  { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP",
Packit 6c4009
  "SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT",
Packit 6c4009
  "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ",
Packit 6c4009
  "TEST", "SETDATE", "SETDATEREQ", "LOOP" };
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#endif /* protocols/timed.h */