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 /* @(#)globals.h 2.1 (Berkeley) 12/10/85 */ 8 9 #include <sys/param.h> 10 #include <stdio.h> 11 #include <sys/time.h> 12 #include <errno.h> 13 #include <syslog.h> 14 #include <sys/socket.h> 15 #include <netinet/in.h> 16 #include <netdb.h> 17 #include <arpa/inet.h> 18 19 extern int errno; 20 extern int sock; 21 22 #define RANGE 20 23 #define MSGS 5 24 #define TRIALS 6 25 #define SAMPLEINTVL 240 26 #define MAXSEQ 30000 27 #define MINTOUT 360 28 #define MAXTOUT 900 29 30 #define GOOD 1 31 #define UNREACHABLE 2 32 #define NONSTDTIME 3 33 #define HOSTDOWN 0x7fffffff 34 35 #define OFF 0 36 #define ON 1 37 38 #define SLAVE 1 39 #define MASTER 2 40 #define IGNORE 4 41 #define ALL (SLAVE|MASTER|IGNORE) 42 #define SUBMASTER (SLAVE|MASTER) 43 44 #define NHOSTS 30 /* max number of hosts controlled by timed */ 45 46 struct host { 47 char *name; 48 struct sockaddr_in addr; 49 long delta; 50 u_short seq; 51 }; 52 53 struct netinfo { 54 struct netinfo *next; 55 u_long net; 56 u_long mask; 57 struct in_addr my_addr; 58 struct sockaddr_in dest_addr; /* broadcast addr or point-point */ 59 long status; 60 }; 61 62 extern struct netinfo *nettab; 63 extern int status; 64 extern int trace; 65 extern int sock; 66 extern struct sockaddr_in from; 67 extern FILE *fd; 68 extern char hostname[]; 69 extern char tracefile[]; 70 extern struct host hp[]; 71 extern int backoff; 72 extern long delay1, delay2; 73 extern int slvcount; 74 75 char *strcpy(), *malloc(); 76