# 2.11BSD#431 - /usr/src/usr.sbin/timed/globals.h

##### Macros

    ALL               X
    GOOD              X
    HOSTDOWN          X
    IGNORE            X
    MASTER            X
    MAXADJ            X
    MAXTOUT           X
    MINTOUT           X
    MSGS              X
    NHOSTS            X
    NOMASTER          X
    NONSTDTIME        X
    OFF               X
    ON                X
    RANGE             X
    SAMPLEINTVL       X
    SLAVE             X
    SUBMASTER         X
    TRIALS            X
    UNREACHABLE       X

##### struct's

    host              X
    netinfo           X

       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

- in line 84(2)
- in /usr/src/usr.sbin/timed/timed.c line 35(2)

netinfo defined in line 66; used 86 times

- in line 67(2), 75-80(4)
- in /usr/src/usr.sbin/timed/acksend.c line 35(2)
- in /usr/src/usr.sbin/timed/candidate.c line 24(2), 92(2)
- in /usr/src/usr.sbin/timed/correct.c line 56(2)
- in /usr/src/usr.sbin/timed/master.c line 54(2), 95(2), 187(2), 215(2), 253(2), 375(2), 440(2), 476(2), 524(2)
- in /usr/src/usr.sbin/timed/readmsg.c line 42(2), 58(2), 65(2)
- in /usr/src/usr.sbin/timed/slave.c line 37(2), 148(2), 359(2), 368(2), 398(2), 476(2), 516(2)
- in /usr/src/usr.sbin/timed/timed.c line 39-45(6), 86-88(6), 248(4), 413(2), 420(2), 488(2), 502(2), 548-550(4), 558-566(6)

#### Defined macros

ALL defined in line 54; never used
GOOD defined in line 35; used 3 times

- in /usr/src/usr.sbin/timed/master.c line 315
- in /usr/src/usr.sbin/timed/measure.c line 143, 175

HOSTDOWN defined in line 41; used 6 times

- in /usr/src/usr.sbin/timed/correct.c line 34, 50, 58
- in /usr/src/usr.sbin/timed/master.c line 345
- in /usr/src/usr.sbin/timed/measure.c line 53-54(2)

IGNORE defined in line 53; used 8 times

- in line 54
- in /usr/src/usr.sbin/timed/slave.c line 107-112(2), 169
- in /usr/src/usr.sbin/timed/timed.c line 402, 415, 540, 554

MASTER defined in line 52; used 21 times

- in line 54-55(2)
- in /usr/src/usr.sbin/timed/candidate.c line 38, 118
- in /usr/src/usr.sbin/timed/master.c line 68
- in /usr/src/usr.sbin/timed/readmsg.c line 229
- in /usr/src/usr.sbin/timed/slave.c line 57, 69, 109, 129, 286, 338(2), 378, 450, 460, 489
- in /usr/src/usr.sbin/timed/timed.c line 361, 388, 401, 465

MAXADJ defined in line 23; used 2 times

- in /usr/src/usr.sbin/timed/correct.c line 111(2)

MAXTOUT defined in line 33; used 3 times

- in /usr/src/usr.sbin/timed/candidate.c line 82
- in /usr/src/usr.sbin/timed/slave.c line 247
- in /usr/src/usr.sbin/timed/timed.c line 331

MINTOUT defined in line 32; used 3 times

- in /usr/src/usr.sbin/timed/candidate.c line 81
- in /usr/src/usr.sbin/timed/slave.c line 247
- in /usr/src/usr.sbin/timed/timed.c line 331

MSGS defined in line 29; used 1 times

- in /usr/src/usr.sbin/timed/measure.c line 88

NHOSTS defined in line 57; used 3 times

- in /usr/src/usr.sbin/timed/master.c line 418
- in /usr/src/usr.sbin/timed/networkdelta.c line 27
- in /usr/src/usr.sbin/timed/timed.c line 35

NOMASTER defined in line 50; never used
NONSTDTIME defined in line 37; used 1 times

- in /usr/src/usr.sbin/timed/measure.c line 140

OFF defined in line 44; used 8 times

- in /usr/src/usr.sbin/timed/master.c line 180, 302
- in /usr/src/usr.sbin/timed/slave.c line 80, 217, 335
- in /usr/src/usr.sbin/timed/timed.c line 100-102(3)

ON defined in line 45; used 11 times

- in /usr/src/usr.sbin/timed/master.c line 168, 296, 348, 428
- in /usr/src/usr.sbin/timed/slave.c line 216, 281, 323
- in /usr/src/usr.sbin/timed/timed.c line 119, 127, 138, 168

RANGE defined in line 28; used 4 times

- in /usr/src/usr.sbin/timed/measure.c line 164
- in /usr/src/usr.sbin/timed/networkdelta.c line 51-56(2), 65

SAMPLEINTVL defined in line 22; used 2 times

- in /usr/src/usr.sbin/timed/master.c line 75, 231

SLAVE defined in line 51; used 22 times

- in line 54-55(2)
- in /usr/src/usr.sbin/timed/candidate.c line 68, 83
- in /usr/src/usr.sbin/timed/master.c line 318, 353
- in /usr/src/usr.sbin/timed/readmsg.c line 231
- in /usr/src/usr.sbin/timed/slave.c line 182, 197, 253, 264, 289, 344, 462
- in /usr/src/usr.sbin/timed/timed.c line 369, 394, 427, 446, 454, 462, 553, 564

SUBMASTER defined in line 55; used 5 times

- in /usr/src/usr.sbin/timed/slave.c line 188(2), 211(2), 286

TRIALS defined in line 30; used 1 times

- in /usr/src/usr.sbin/timed/measure.c line 88

UNREACHABLE defined in line 36; used 1 times

- in /usr/src/usr.sbin/timed/measure.c line 103

#### Usage of this include

globals.h used 11 times

- in /usr/src/usr.sbin/timed/acksend.c line 11
- in /usr/src/usr.sbin/timed/byteorder.c line 11
- in /usr/src/usr.sbin/timed/candidate.c line 11
- in /usr/src/usr.sbin/timed/correct.c line 11
- in /usr/src/usr.sbin/timed/master.c line 11
- in /usr/src/usr.sbin/timed/measure.c line 11
- in /usr/src/usr.sbin/timed/networkdelta.c line 11
- in /usr/src/usr.sbin/timed/pdp/cksum.c line 12
- in /usr/src/usr.sbin/timed/readmsg.c line 11
- in /usr/src/usr.sbin/timed/slave.c line 11
- in /usr/src/usr.sbin/timed/timed.c line 15

Last modified: 1994-01-11 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1504 |