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	(Berkeley)	5/27/86	*/
   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: #define HOSTDOWN    0x7fffffff
  39: 
  40: #define OFF 0
  41: #define ON  1
  42: 
  43: /*
  44:  * Global and per-network states.
  45:  */
  46: #define NOMASTER    0       /* no master on any network */
  47: #define SLAVE       1
  48: #define MASTER      2
  49: #define IGNORE      4
  50: #define ALL     (SLAVE|MASTER|IGNORE)
  51: #define SUBMASTER   (SLAVE|MASTER)
  52: 
  53: #define NHOSTS      100 /* max number of hosts controlled by timed */
  54: 
  55: struct host {
  56:     char *name;
  57:     struct sockaddr_in addr;
  58:     long delta;
  59:     u_short seq;
  60: };
  61: 
  62: struct netinfo {
  63:     struct netinfo *next;
  64:     u_long net;
  65:     u_long mask;
  66:     struct in_addr my_addr;
  67:     struct sockaddr_in dest_addr;   /* broadcast addr or point-point */
  68:     long status;
  69: };
  70: 
  71: extern struct netinfo *nettab;
  72: extern int status;
  73: extern int trace;
  74: extern int sock;
  75: extern struct sockaddr_in from;
  76: extern struct netinfo *fromnet, *slavenet;
  77: extern FILE *fd;
  78: extern char hostname[];
  79: extern char tracefile[];
  80: extern struct host hp[];
  81: extern int backoff;
  82: extern long delay1, delay2;
  83: extern int slvcount;
  84: extern int nslavenets;      /* Number of nets were I could be a slave */
  85: extern int nmasternets;     /* Number of nets were I could be a master */
  86: extern int nignorednets;    /* Number of ignored nets */
  87: extern int nnets;       /* Number of nets I am connected to */
  88: 
  89: char *strcpy(), *malloc();

Defined struct's

host defined in line 55; used 4 times
netinfo defined in line 62; used 86 times

Defined macros

ALL defined in line 50; never used
GOOD defined in line 35; used 3 times
IGNORE defined in line 49; used 8 times
MAXADJ defined in line 23; used 2 times
MSGS defined in line 29; used 1 times
NOMASTER defined in line 46; never used
NONSTDTIME defined in line 37; used 1 times
OFF defined in line 40; used 8 times
ON defined in line 41; used 11 times
RANGE defined in line 28; used 4 times
SAMPLEINTVL defined in line 22; used 2 times
SUBMASTER defined in line 51; 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: 1986-05-28
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1349
Valid CSS Valid XHTML 1.0 Strict