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.4.1	(2.11BSD GTE)	1/1/94	*/
   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 SAMPLEINTVL 240     /* synch() freq for master, sec */
  23: #define MAXADJ      20      /* max correction (sec) for adjtime */
  24: /*
  25:  * Parameters for network time measurement
  26:  * of each host using ICMP timestamp requests.
  27:  */
  28: #define RANGE       20      /* best expected round-trip time, ms */
  29: #define MSGS        5       /* # of timestamp replies to average */
  30: #define TRIALS      10      /* max # of timestamp echos sent */
  31: 
  32: #define MINTOUT     360
  33: #define MAXTOUT     900
  34: 
  35: #define GOOD        1
  36: #define UNREACHABLE 2
  37: #define NONSTDTIME  3
  38: #ifdef pdp11
  39: #define HOSTDOWN    0x7fff
  40: #else
  41: #define HOSTDOWN    0x7fffffff
  42: #endif
  43: 
  44: #define OFF 0
  45: #define ON  1
  46: 
  47: /*
  48:  * Global and per-network states.
  49:  */
  50: #define NOMASTER    0       /* no master on any network */
  51: #define SLAVE       1
  52: #define MASTER      2
  53: #define IGNORE      4
  54: #define ALL     (SLAVE|MASTER|IGNORE)
  55: #define SUBMASTER   (SLAVE|MASTER)
  56: 
  57: #define NHOSTS      100 /* max number of hosts controlled by timed */
  58: 
  59: struct host {
  60:     char *name;
  61:     struct sockaddr_in addr;
  62:     long delta;
  63:     u_short seq;
  64: };
  65: 
  66: struct netinfo {
  67:     struct netinfo *next;
  68:     u_long net;
  69:     u_long mask;
  70:     struct in_addr my_addr;
  71:     struct sockaddr_in dest_addr;   /* broadcast addr or point-point */
  72:     long status;
  73: };
  74: 
  75: extern struct netinfo *nettab;
  76: extern int status;
  77: extern int trace;
  78: extern int sock;
  79: extern struct sockaddr_in from;
  80: extern struct netinfo *fromnet, *slavenet;
  81: extern FILE *fd;
  82: extern char hostname[];
  83: extern char tracefile[];
  84: extern struct host hp[];
  85: extern int backoff;
  86: extern long delay1, delay2;
  87: extern int slvcount;
  88: extern int nslavenets;      /* Number of nets were I could be a slave */
  89: extern int nmasternets;     /* Number of nets were I could be a master */
  90: extern int nignorednets;    /* Number of ignored nets */
  91: extern int nnets;       /* Number of nets I am connected to */
  92: 
  93: char *strcpy(), *malloc();

Defined struct's

host defined in line 59; used 4 times
netinfo defined in line 66; used 86 times

Defined macros

ALL defined in line 54; never used
GOOD defined in line 35; used 3 times
IGNORE defined in line 53; used 8 times
MAXADJ defined in line 23; used 2 times
MSGS defined in line 29; used 1 times
NOMASTER defined in line 50; never used
NONSTDTIME defined in line 37; used 1 times
RANGE defined in line 28; used 4 times
SAMPLEINTVL defined in line 22; used 2 times
SUBMASTER defined in line 55; used 5 times
TRIALS defined in line 30; used 1 times
UNREACHABLE defined in line 36; used 1 times

Usage of this include

Last modified: 1994-01-11
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1521
Valid CSS Valid XHTML 1.0 Strict