+ ftrace = NULL;
+ }
+ traceactions = 0;
+ tracehistory = 0;
+ tracepackets = 0;
+ tracecontents = 0;
+}
+
+void
+sigtrace(s)
+ int s;
+{
+
+ if (s == SIGUSR2)
+ traceoff();
+ else if (ftrace == NULL && savetracename)
+ traceon(savetracename);
+ else
+ bumploglevel();
+}
+
+/*
+ * Move to next higher level of tracing when -t option processed or
+ * SIGUSR1 is received. Successive levels are:
+ * traceactions
+ * traceactions + tracepackets
+ * traceactions + tracehistory (packets and contents after change)
+ * traceactions + tracepackets + tracecontents
+ */
+bumploglevel()
+{
+
+ (void) gettimeofday(&now, (struct timezone *)NULL);
+ if (traceactions == 0) {
+ traceactions++;
+ if (ftrace)
+ fprintf(ftrace, "Tracing actions started %s\n",
+ ctime((time_t *)&now.tv_sec));
+ } else if (tracepackets == 0) {
+ tracepackets++;
+ tracehistory = 0;
+ tracecontents = 0;
+ if (ftrace)
+ fprintf(ftrace, "Tracing packets started %s\n",
+ ctime((time_t *)&now.tv_sec));
+ } else if (tracehistory == 0) {
+ tracehistory++;
+ if (ftrace)
+ fprintf(ftrace, "Tracing history started %s\n",
+ ctime((time_t *)&now.tv_sec));
+ } else {
+ tracepackets++;
+ tracecontents++;
+ tracehistory = 0;
+ if (ftrace)
+ fprintf(ftrace, "Tracing packet contents started %s\n",
+ ctime((time_t *)&now.tv_sec));
+ }
+ if (ftrace)
+ fflush(ftrace);