checkpoint
[unix-history] / usr / src / sbin / XNSrouted / trace.h
index 0613c1a..f3855c5 100644 (file)
@@ -1,4 +1,14 @@
-/*     trace.h 1.0 4/16/85     */
+/*
+ * Copyright (c) 1983 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This file includes significant work done at Cornell University by
+ * Bill Nesheim.  That work included by permission.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)trace.h     5.6 (Berkeley) %G%
+ */
 
 /*
  * Xerox Routing Information Protocol.
 
 /*
  * Xerox Routing Information Protocol.
@@ -46,8 +56,8 @@ FILE  *ftrace;                /* output trace file */
                        trace(&ifp->int_input, src, &packet[sizeof(struct idp)], size, \
                                ntohl(ifp->int_metric)); \
          } \
                        trace(&ifp->int_input, src, &packet[sizeof(struct idp)], size, \
                                ntohl(ifp->int_metric)); \
          } \
-         if (tracepackets) \
-               dumppacket(stdout, "from", src, &packet[sizeof(struct idp)], size); \
+         if (tracepackets && ftrace) \
+               dumppacket(ftrace, "from", src, &packet[sizeof(struct idp)], size); \
        }
 #define        TRACE_OUTPUT(ifp, dst, size) { \
          if (tracing) { \
        }
 #define        TRACE_OUTPUT(ifp, dst, size) { \
          if (tracing) { \
@@ -55,6 +65,6 @@ FILE  *ftrace;                /* output trace file */
                if (ifp) \
                    trace(&ifp->int_output, dst, &packet[sizeof(struct idp)], size, ifp->int_metric); \
          } \
                if (ifp) \
                    trace(&ifp->int_output, dst, &packet[sizeof(struct idp)], size, ifp->int_metric); \
          } \
-         if (tracepackets) \
-               dumppacket(stdout, "to", dst, &packet[sizeof(struct idp)], size); \
+         if (tracepackets && ftrace) \
+               dumppacket(ftrace, "to", dst, &packet[sizeof(struct idp)], size); \
        }
        }