1
0

Source code upload

This commit is contained in:
calmsacibis995
2022-09-29 17:59:04 +03:00
parent 72fa9da3d7
commit 8fc8fa8089
33399 changed files with 11964078 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
#
# Makefile for bsd/protocols header file installation.
#
include $(ROOT)/usr/include/make/commondefs
PUBLIC_HFILES= bootp.h dumprestore.h routed.h rwhod.h talkd.h timed.h
HPUT= $(INSTALL) -F /usr/include/protocols -m 444
default: install
include $(COMMONRULES)
install:
$(HPUT) $(PUBLIC_HFILES)

View File

@@ -0,0 +1,84 @@
#ifndef __PROTOCOLS_BOOTP_H__
#define __PROTOCOLS_BOOTP_H__
#ifdef __cplusplus
extern "C" {
#endif
#ident "$Revision: 1.8 $"
/*
*
* Copyright 1992, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
/*
* "vendor" data permitted for Stanford boot clients.
*/
struct vend {
u_char v_magic[4]; /* magic number */
u_int v_flags; /* flags/opcodes, etc. */
u_char v_unused[56]; /* currently unused */
};
/*
* Bootstrap Protocol (BOOTP). RFC 951.
*/
struct bootp {
u_char bp_op; /* packet opcode type */
#define BOOTREQUEST 1
#define BOOTREPLY 2
u_char bp_htype; /* hardware addr type */
u_char bp_hlen; /* hardware addr length */
u_char bp_hops; /* gateway hops */
u_int bp_xid; /* transaction ID */
u_short bp_secs; /* seconds since boot began */
u_short bp_unused;
iaddr_t bp_ciaddr; /* client IP address */
iaddr_t bp_yiaddr; /* 'your' IP address */
iaddr_t bp_siaddr; /* server IP address */
iaddr_t bp_giaddr; /* gateway IP address */
u_char bp_chaddr[16]; /* client hardware address */
u_char bp_sname[64]; /* server host name */
u_char bp_file[128]; /* boot file name */
union {
u_char vend_unused[64];
struct vend sgi_vadmin;
} rfc1048;
#define bp_vend rfc1048.vend_unused /* rfc951 field */
#define vd_magic rfc1048.sgi_vadmin.v_magic /* magic # */
#define vd_flags rfc1048.sgi_vadmin.v_flags /* opcodes */
#define vd_clntname rfc1048.sgi_vadmin.v_unused /* client name */
};
/*
* UDP port numbers, server and client.
*/
#define IPPORT_BOOTPS 67
#define IPPORT_BOOTPC 68
#define VM_STANFORD "STAN" /* v_magic for Stanford */
#define VM_SGI 0xc01a3309 /* v_magic for Silicon Graphics Inc., */
#define VM_AUTOREG 0xc01a330a /* v_magic for Silicon Graphics Inc., */
/* v_flags values */
#define VF_PCBOOT 1 /* an IBMPC or Mac wants environment info */
#define VF_HELP 2 /* help me, I'm not registered */
#define VF_GET_IPADDR 3 /* Request for client IP address */
#define VF_RET_IPADDR 4 /* Response for client IP address */
#define VF_NEW_IPADDR 5 /* Response for client IP address */
#ifdef __cplusplus
}
#endif
#endif /* !__PROTOCOLS_BOOTP_H__ */

View File

@@ -0,0 +1,141 @@
#ifndef __PROTOCOLS_DUMPRESTORE_H__
#define __PROTOCOLS_DUMPRESTORE_H__
#ifdef __cplusplus
extern "C" {
#endif
#ident "$Revision: 1.7 $"
/*
*
* Copyright 1992, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* @(#)dumprestore.h 5.3 (Berkeley) 1/28/87
* @(#)inode.h 2.28 88/02/08 SMI; from UCB 4.24 83/07/01
*/
/*
* The I node is the focus of all local file activity in UNIX.
* There is a unique inode allocated for each active file,
* each current directory, each mounted-on file, each mapping,
* and the root. An inode is `named' by its dev/inumber pair.
* Data in icommon is read in from permanent inode on volume.
*/
#define NDADDR 12 /* direct addresses in inode */
#define NIADDR 3 /* indirect addresses in inode */
typedef int32_t baddr_t; /* BSD-compatible daddr_t (32 bits) */
struct icommon {
u_short ic_mode; /* 0: mode and type of file */
short ic_nlink; /* 2: number of links to file */
u_short ic_uid; /* 4: owner's user id */
u_short ic_gid; /* 6: owner's group id */
quad ic_size; /* 8: number of bytes in file */
time_t ic_atime; /* 16: time last accessed */
long ic_atspare;
time_t ic_mtime; /* 24: time last modified */
long ic_mtspare;
time_t ic_ctime; /* 32: last time inode changed */
long ic_ctspare;
baddr_t ic_db[NDADDR]; /* 40: disk block addresses */
baddr_t ic_ib[NIADDR]; /* 88: indirect blocks */
long ic_flags; /* 100: status, currently unused */
long ic_blocks; /* 104: blocks actually held */
long ic_gen; /* 108: generation number */
long ic_spare[4]; /* 112: reserved, currently unused */
};
struct sun_dinode {
union {
struct icommon di_icom;
char di_size[128];
} di_un;
};
/*
* TP_BSIZE is the size of file blocks on the dump tapes.
* Note that TP_BSIZE must be a multiple of DEV_BSIZE.
*
* NTREC is the number of TP_BSIZE blocks that are written
* in each tape record. HIGHDENSITYTREC is the number of
* TP_BSIZE blocks that are written in each tape record on
* 6250 BPI or higher density tapes.
*
* TP_NINDIR is the number of indirect pointers in a TS_INODE
* or TS_ADDR record. Note that it must be a power of two.
*/
#define TP_BSIZE 1024
#define NTREC 10
#define HIGHDENSITYTREC 32
#define TP_NINDIR (TP_BSIZE/2)
#define LBLSIZE 16
#define NAMELEN 64
/*
* special record types
*/
#define TS_TAPE 1 /* dump tape header */
#define TS_INODE 2 /* beginning of file record */
#define TS_BITS 3 /* map of inodes on tape */
#define TS_ADDR 4 /* continuation of file record */
#define TS_END 5 /* end of volume marker */
#define TS_CLRI 6 /* map of inodes deleted since last dump */
#define OFS_MAGIC (int)60011
#define NFS_MAGIC (int)60012
#define CHECKSUM (int)84446
union u_spcl {
char dummy[TP_BSIZE];
struct s_spcl {
long c_type; /* record type (see below) */
time_t c_date; /* date of previous dump */
time_t c_ddate; /* date of this dump */
long c_volume; /* dump volume number */
baddr_t c_tapea; /* logical block of this record */
efs_ino_t c_inumber; /* number of inode */
long c_magic; /* magic number (see above) */
long c_checksum; /* record checksum */
struct sun_dinode c_dinode; /* ownership and mode of inode */
long c_count; /* number of valid c_addr entries */
char c_addr[TP_NINDIR]; /* 1 => data; 0 => hole in inode */
char c_label[LBLSIZE]; /* dump label */
long c_level; /* level of this dump */
char c_filesys[NAMELEN]; /* name of dumpped file system */
char c_dev[NAMELEN]; /* name of dumpped device */
char c_host[NAMELEN]; /* name of dumpped host */
long c_flags; /* additional information */
} s_spcl;
};
#define spcl u_spcl.s_spcl
/*
* flag values
*/
#define DR_NEWHEADER 1 /* new format tape header */
#define DR_EFSDIRS 2 /* directories are in EFS format */
#define DUMPOUTFMT "%-16s %c %s" /* for printf */
/* name, incno, ctime(date) */
#define DUMPINFMT "%[^ ] %c %[^\n]\n" /* inverse for scanf */
#ifdef __cplusplus
}
#endif
#endif /* !__PROTOCOLS_DUMPRESTORE_H__ */

View File

@@ -0,0 +1,191 @@
/*-
* Copyright (c) 1983, 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)routed.h 8.1 (Berkeley) 6/2/93
*
* $NetBSD$
*/
#ifndef _ROUTED_H_
#define _ROUTED_H_
#ifdef __cplusplus
extern "C" {
#endif
#ident "$Revision: 1.12 $"
/*
* Routing Information Protocol
*
* Derived from Xerox NS Routing Information Protocol
* by changing 32-bit net numbers to sockaddr's and
* padding stuff to 32-bit boundaries.
*/
#define RIPv1 1
#define RIPv2 2
#ifndef RIPVERSION
#define RIPVERSION RIPv1
#endif
#define RIP_PORT 520
#if RIPVERSION == 1
/* Note that this so called sockaddr has a 2-byte sa_family and no sa_len.
* It is not a UNIX sockaddr, but the shape of an address as defined
* in RIPv1. It is still defined to allow old versions of programs
* such as `gated` to use this file to define RIPv1.
*/
struct netinfo {
struct sockaddr rip_dst; /* destination net/host */
u_int32_t rip_metric; /* cost of route */
};
#else
struct netinfo {
u_int16_t n_family;
#define RIP_AF_INET htons(AF_INET)
#define RIP_AF_UNSPEC 0
#define RIP_AF_AUTH 0xffff
u_int16_t n_tag; /* optional in RIPv2 */
u_int32_t n_dst; /* destination net or host */
#define RIP_DEFAULT 0
u_int32_t n_mask; /* netmask in RIPv2 */
u_int32_t n_nhop; /* optional next hop in RIPv2 */
u_int32_t n_metric; /* cost of route */
};
#endif
/* RIPv2 authentication */
struct netauth {
u_int16_t a_family; /* always RIP_AF_AUTH */
u_int16_t a_type;
#define RIP_AUTH_NONE 0
#define RIP_AUTH_PW htons(2) /* password type */
#define RIP_AUTH_MD5 htons(3) /* Keyed MD5 */
union {
#define RIP_AUTH_PW_LEN 16
u_int8_t au_pw[RIP_AUTH_PW_LEN];
struct a_md5 {
int16_t md5_pkt_len; /* RIP-II packet length */
int8_t md5_keyid; /* key ID and auth data len */
int8_t md5_auth_len; /* 16 */
u_int32_t md5_seqno; /* sequence number */
u_int32_t rsvd[2]; /* must be 0 */
#define RIP_AUTH_MD5_LEN RIP_AUTH_PW_LEN
} a_md5;
} au;
};
struct rip {
u_int8_t rip_cmd; /* request/response */
u_int8_t rip_vers; /* protocol version # */
u_int16_t rip_res1; /* pad to 32-bit boundary */
union { /* variable length... */
struct netinfo ru_nets[1];
int8_t ru_tracefile[1];
struct netauth ru_auth[1];
} ripun;
#define rip_nets ripun.ru_nets
#define rip_auths ripun.ru_auth
#define rip_tracefile ripun.ru_tracefile
};
/* Packet types.
*/
#define RIPCMD_REQUEST 1 /* want info */
#define RIPCMD_RESPONSE 2 /* responding to request */
#define RIPCMD_TRACEON 3 /* turn tracing on */
#define RIPCMD_TRACEOFF 4 /* turn it off */
/* Gated extended RIP to include a "poll" command instead of using
* RIPCMD_REQUEST with (RIP_AF_UNSPEC, RIP_DEFAULT). RFC 1058 says
* command 5 is used by Sun Microsystems for its own purposes.
*/
#define RIPCMD_POLL 5
#define RIPCMD_MAX 6
#ifdef RIPCMDS
char *ripcmds[RIPCMD_MAX] = {
"#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF"
};
#endif
#define HOPCNT_INFINITY 16
#define MAXPACKETSIZE 512 /* max broadcast size */
#define NETS_LEN ((MAXPACKETSIZE-sizeof(struct rip)) \
/ sizeof(struct netinfo) +1)
#define INADDR_RIP_GROUP (u_int32_t)0xe0000009 /* 224.0.0.9 */
/* Timer values used in managing the routing table.
*
* Complete tables are broadcast every SUPPLY_INTERVAL seconds.
* If changes occur between updates, dynamic updates containing only changes
* may be sent. When these are sent, a timer is set for a random value
* between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates
* are sent until the timer expires.
*
* Every update of a routing entry forces an entry's timer to be reset.
* After EXPIRE_TIME without updates, the entry is marked invalid,
* but held onto until GARBAGE_TIME so that others may see it, to
* "poison" the bad route.
*/
struct rip_timers_s {
time_t supply_interval; /* default = 30 */
time_t min_waittime; /* default = 2 */
time_t max_waittime; /* default = 5 */
time_t stale_time; /* default = 90 */
time_t expire_time; /* default = 180 */
time_t garbage_time; /* default = 240 */
};
#define SUPPLY_INTERVAL rip_timers.supply_interval /* time to supply tables */
#define MIN_WAITTIME rip_timers.min_waittime /* min sec until next flash update*/
#define MAX_WAITTIME rip_timers.max_waittime /* max sec until flash update */
#define STALE_TIME rip_timers.stale_time /* switch to a new gateway */
#define EXPIRE_TIME rip_timers.expire_time /* time to mark entry invalid */
#define GARBAGE_TIME rip_timers.garbage_time /* time to garbage collect */
#define RFC_SUPPLY_INTERVAL 30 /* time to supply tables */
#define RFC_MIN_WAITTIME 2 /* min sec uainntil next flash updates */
#define RFC_MAX_WAITTIME 5 /* max sec until flash update */
#define RFC_STALE_TIME 90 /* switch to a new gateway */
#define RFC_EXPIRE_TIME 180 /* time to mark entry invalid */
#define RFC_GARBAGE_TIME 240 /* time to garbage collect */
#ifdef __cplusplus
}
#endif
#endif /* !_ROUTED_H_ */

View File

@@ -0,0 +1,79 @@
#ifndef __PROTOCOLS_RWHOD_H__
#define __PROTOCOLS_RWHOD_H__
#ifdef __cplusplus
extern "C" {
#endif
#ident "$Revision: 1.7 $"
/*
*
* Copyright 1992, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
/*
* Copyright (c) 1983 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* @(#)rwhod.h 5.2 (Berkeley) 8/25/88
*/
/*
* rwho protocol packet format.
*/
struct outmp {
char out_line[8]; /* tty name */
char out_name[8]; /* user id */
long out_time; /* time on */
};
struct whod {
char wd_vers; /* protocol version # */
char wd_type; /* packet type, see below */
char wd_pad[2];
int wd_sendtime; /* time stamp by sender */
int wd_recvtime; /* time stamp applied by receiver */
char wd_hostname[32]; /* hosts's name */
int wd_loadav[3]; /* load average as in uptime */
int wd_boottime; /* time system booted */
struct whoent {
struct outmp we_utmp; /* active tty info */
int we_idle; /* tty idle time */
} wd_we[1024 / sizeof (struct whoent)];
};
#define WHODVERSION 1
#define WHODTYPE_STATUS 1 /* host status */
#define _PATH_RWHODIR "/var/spool/rwho"
#ifdef __sgi
#define INADDR_WHOD_GROUP (u_long)0xe0000103 /* 224.0.1.3 */
#endif
#ifdef __cplusplus
}
#endif
#endif /* !__PROTOCOLS_RWHOD_H__ */

View File

@@ -0,0 +1,122 @@
#ifndef __PROTOCOLS_TALKD_H__
#define __PROTOCOLS_TALKD_H__
#ifdef __cplusplus
extern "C" {
#endif
#ident "$Revision: 1.4 $"
/*
*
* Copyright 1992, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* @(#)talkd.h 5.3 (Berkeley) 7/9/88
*/
#include <sys/types.h>
#include <sys/socket.h>
/*
* This describes the protocol used by the talk server and clients.
*
* The talk server acts a repository of invitations, responding to
* requests by clients wishing to rendezvous for the purpose of
* holding a conversation. In normal operation, a client, the caller,
* initiates a rendezvous by sending a CTL_MSG to the server of
* type LOOK_UP. This causes the server to search its invitation
* tables to check if an invitation currently exists for the caller
* (to speak to the callee specified in the message). If the lookup
* fails, the caller then sends an ANNOUNCE message causing the server
* to broadcast an announcement on the callee's login ports requesting
* contact. When the callee responds, the local server uses the
* recorded invitation to respond with the appropriate rendezvous
* address and the caller and callee client programs establish a
* stream connection through which the conversation takes place.
*/
/*
* Client->server request message format.
*/
typedef struct {
u_char vers; /* protocol version */
u_char type; /* request type, see below */
u_char answer; /* not used */
u_char pad;
u_long id_num; /* message id */
struct sockaddr addr;
struct sockaddr ctl_addr;
long pid; /* caller's process id */
#define NAME_SIZE 12
char l_name[NAME_SIZE];/* caller's name */
char r_name[NAME_SIZE];/* callee's name */
#define TTY_SIZE 16
char r_tty[TTY_SIZE];/* callee's tty name */
} CTL_MSG;
/*
* Server->client response message format.
*/
typedef struct {
u_char vers; /* protocol version */
u_char type; /* type of request message, see below */
u_char answer; /* respose to request message, see below */
u_char pad;
u_long id_num; /* message id */
struct sockaddr addr; /* address for establishing conversation */
} CTL_RESPONSE;
#define TALK_VERSION 1 /* protocol version */
/* message type values */
#define LEAVE_INVITE 0 /* leave invitation with server */
#define LOOK_UP 1 /* check for invitation by callee */
#define DELETE 2 /* delete invitation by caller */
#define ANNOUNCE 3 /* announce invitation by caller */
/* answer values */
#define SUCCESS 0 /* operation completed properly */
#define NOT_HERE 1 /* callee not logged in */
#define FAILED 2 /* operation failed for unexplained reason */
#define MACHINE_UNKNOWN 3 /* caller's machine name unknown */
#define PERMISSION_DENIED 4 /* callee's tty doesn't permit announce */
#define UNKNOWN_REQUEST 5 /* request has invalid type value */
#define BADVERSION 6 /* request has invalid protocol version */
#define BADADDR 7 /* request has invalid addr value */
#define BADCTLADDR 8 /* request has invalid ctl_addr value */
/*
* Operational parameters.
*/
#define MAX_LIFE 60 /* max time daemon saves invitations */
/* RING_WAIT should be 10's of seconds less than MAX_LIFE */
#define RING_WAIT 30 /* time to wait before resending invitation */
#ifdef __cplusplus
}
#endif
#endif /* !__PROTOCOLS_TALKD_H__ */

View File

@@ -0,0 +1,107 @@
#ifndef __PROTOCOLS_TIMED_H__
#define __PROTOCOLS_TIMED_H__
#ifdef __cplusplus
extern "C" {
#endif
#ident "$Revision: 1.7 $"
/*
*
* Copyright 1992, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that: (1) source distributions retain this entire copyright
* notice and comment, and (2) distributions including binaries display
* the following acknowledgement: ``This product includes software
* developed by the University of California, Berkeley and its contributors''
* in the documentation or other materials provided with the distribution
* and in all advertising materials mentioning features or use of this
* software. Neither the name of the University nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* @(#)timed.h 1.9 (Berkeley) 6/1/90
*/
/*
* Time Synchronization Protocol
*/
#define TSPVERSION 1
#define ANYADDR 0
struct tsp {
u_char tsp_type;
u_char tsp_vers;
u_short tsp_seq;
union {
struct timeval tspu_time;
char tspu_hopcnt;
} tsp_u;
char tsp_name[MAXHOSTNAMELEN];
};
#define tsp_time tsp_u.tspu_time
#define tsp_hopcnt tsp_u.tspu_hopcnt
/*
* Command types.
*/
#define TSP_ANY 0 /* match any types */
#define TSP_ADJTIME 1 /* send adjtime */
#define TSP_ACK 2 /* generic acknowledgement */
#define TSP_MASTERREQ 3 /* ask for master's name */
#define TSP_MASTERACK 4 /* acknowledge master request */
#define TSP_SETTIME 5 /* send network time */
#define TSP_MASTERUP 6 /* inform slaves that master is up */
#define TSP_SLAVEUP 7 /* slave is up but not polled */
#define TSP_ELECTION 8 /* advance candidature for master */
#define TSP_ACCEPT 9 /* support candidature of master */
#define TSP_REFUSE 10 /* reject candidature of master */
#define TSP_CONFLICT 11 /* two or more masters present */
#define TSP_RESOLVE 12 /* masters' conflict resolution */
#define TSP_QUIT 13 /* reject candidature if master is up */
#define TSP_DATE 14 /* reset the time (date command) */
#define TSP_DATEREQ 15 /* remote request to reset the time */
#define TSP_DATEACK 16 /* acknowledge time setting */
#define TSP_TRACEON 17 /* turn tracing on */
#define TSP_TRACEOFF 18 /* turn tracing off */
#define TSP_MSITE 19 /* find out master's site */
#define TSP_MSITEREQ 20 /* remote master's site request */
#define TSP_TEST 21 /* for testing election algo */
#define TSP_SETDATE 22 /* New from date command */
#define TSP_SETDATEREQ 23 /* New remote for above */
#define TSP_LOOP 24 /* loop detection packet */
#define TSPTYPENUMBER 25
#ifdef TSPTYPES
char *tsptype[TSPTYPENUMBER] =
{ "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP",
"SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT",
"DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ",
"TEST", "SETDATE", "SETDATEREQ", "LOOP" };
#endif
#ifdef __cplusplus
}
#endif
#endif /* !__PROTOCOLS_TIMED_H__ */