# 2.11BSD#431 - /usr/src/sbin/routed/trace.h

##### Variables

    tracepackets      X
    tracing           X

##### Macros

    TRACE_ACTION      X
    TRACE_INPUT       X
    TRACE_OUTPUT      X

##### struct's

    ifdebug           X
    iftrace           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:  *	@(#)trace.h	5.2 (Berkeley) 4/20/86
       7:  */
       8:
       9: /*
      10:  * Routing table management daemon.
      11:  */
      12:
      13: /*
      14:  * Trace record format.
      15:  */
      16: struct  iftrace {
      17:     time_t  ift_stamp;      /* time stamp */
      18:     struct  sockaddr ift_who;   /* from/to */
      19:     char    *ift_packet;        /* pointer to packet */
      20:     short   ift_size;       /* size of packet */
      21:     short   ift_metric;     /* metric on associated metric */
      22: };
      23:
      24: /*
      25:  * Per interface packet tracing buffers.  An incoming and
      26:  * outgoing circular buffer of packets is maintained, per
      27:  * interface, for debugging.  Buffers are dumped whenever
      28:  * an interface is marked down.
      29:  */
      30: struct  ifdebug {
      31:     struct  iftrace *ifd_records;   /* array of trace records */
      32:     struct  iftrace *ifd_front; /* next empty trace record */
      33:     int ifd_count;      /* number of unprinted records */
      34:     struct  interface *ifd_if;  /* for locating stuff */
      35: };
      36:
      37: /*
      38:  * Packet tracing stuff.
      39:  */
      40: int tracepackets;       /* watch packets as they go by */
      41: int tracing;        /* on/off */
      42: FILE    *ftrace;        /* output trace file */
      43:
      44: #define TRACE_ACTION(action, route) { \
      45:       if (tracing) \
      46:         traceaction(ftrace, "action", route); \
      47:     }
      48: #define TRACE_INPUT(ifp, src, size) { \
      49:       if (tracing) { \
      50:         ifp = if_iflookup(src); \
      51:         if (ifp) \
      52:             trace(&ifp->int_input, src, packet, size, \
      53:                 ntohl(ifp->int_metric)); \
      54:       } \
      55:       if (tracepackets) \
      56:         dumppacket(stdout, "from", src, packet, size); \
      57:     }
      58: #define TRACE_OUTPUT(ifp, dst, size) { \
      59:       if (tracing && ifp) \
      60:         trace(&ifp->int_output, dst, packet, size, ifp->int_metric); \
      61:       if (tracepackets) \
      62:         dumppacket(stdout, "to", dst, packet, size); \
      63:     }

#### Defined variables

tracepackets defined in line 40; used 5 times

- in line 55, 61
- in /usr/src/sbin/routed/main.c line 70, 90
- in /usr/src/sbin/routed/trace.c line 174

tracing defined in line 41; used 7 times

- in line 45-49(2), 59
- in /usr/src/sbin/routed/trace.c line 31, 70-80(3)

#### Defined struct's

ifdebug defined in line 30; used 6 times

- in /usr/src/sbin/routed/trace.c line 38(2), 84(2), 195(2)

iftrace defined in line 16; used 14 times

- in line 31-32(4)
- in /usr/src/sbin/routed/trace.c line 40-43(6), 89(2), 197(2)

#### Defined macros

TRACE_ACTION defined in line 44; used 5 times

- in /usr/src/sbin/routed/tables.c line 150, 160, 180, 200, 217

TRACE_INPUT defined in line 48; used 1 times

- in /usr/src/sbin/routed/input.c line 32

TRACE_OUTPUT defined in line 58; used 3 times

- in /usr/src/sbin/routed/output.c line 53, 101, 117

#### Usage of this include

trace.h used 1 times

- in /usr/src/sbin/routed/defs.h line 26

Last modified: 1987-07-21 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1180 |