# HG changeset patch # User Mychaela Falconia # Date 1684822821 0 # Node ID 3d1abb9f05ef21593e6c8afb6a39677cbef92d01 # Parent bb7a03cc1e437ccf0642bf1a73184aa200624544 rvinterf proper: move TM logging to new module diff -r bb7a03cc1e43 -r 3d1abb9f05ef rvinterf/lowlevel/Makefile --- a/rvinterf/lowlevel/Makefile Tue May 23 06:04:29 2023 +0000 +++ b/rvinterf/lowlevel/Makefile Tue May 23 06:20:21 2023 +0000 @@ -12,7 +12,7 @@ RVINTERF_OBJS= clientcmd.o format.o format_fc.o localsock.o logsent.o \ output.o packetrx.o packettx.o pktfwd.o rviflcd.o \ - rvifmain.o tchhide.o + rvifmain.o rviftmode.o tchhide.o TFC139_OBJS= format.o output.o packetrx.o packettx.o tfc139.o diff -r bb7a03cc1e43 -r 3d1abb9f05ef rvinterf/lowlevel/format.c --- a/rvinterf/lowlevel/format.c Tue May 23 06:04:29 2023 +0000 +++ b/rvinterf/lowlevel/format.c Tue May 23 06:20:21 2023 +0000 @@ -118,13 +118,6 @@ } void -print_tm_output_new() -{ - output_line("Rx Test Mode packet"); - packet_hex_dump(rxpkt, (unsigned) rxpkt_len, output_cont); -} - -void print_unknown_packet() { output_line("Rx unknown packet format"); diff -r bb7a03cc1e43 -r 3d1abb9f05ef rvinterf/lowlevel/logsent.c --- a/rvinterf/lowlevel/logsent.c Tue May 23 06:04:29 2023 +0000 +++ b/rvinterf/lowlevel/logsent.c Tue May 23 06:20:21 2023 +0000 @@ -36,6 +36,7 @@ output_line(buf); } +void log_sent_packet(pkt, pktlen) u_char *pkt; { @@ -46,8 +47,7 @@ log_sent_gpf(pkt, pktlen); return; case RVT_TM_HEADER: - output_line("Sent Test Mode packet"); - packet_hex_dump(pkt, pktlen, output_cont); + log_sent_tm(pkt, pktlen); return; case RVT_AT_HEADER: log_sent_ati(pkt, pktlen); diff -r bb7a03cc1e43 -r 3d1abb9f05ef rvinterf/lowlevel/rviftmode.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rvinterf/lowlevel/rviftmode.c Tue May 23 06:20:21 2023 +0000 @@ -0,0 +1,32 @@ +/* + * This module is for rvinterf only. Whenever we send or receive Test Mode + * packets, we should be a little more intelligent about how we display and + * log them. By default we only print a one-line summary, and in verbose mode + * we also emit a full hex dump. + */ + +#include +#include +#include +#include + +extern u_char rxpkt[]; +extern size_t rxpkt_len; +extern int verbose; + +extern void output_cont(); + +void +log_sent_tm(pkt, pktlen) + u_char *pkt; +{ + output_line("Sent Test Mode packet"); + packet_hex_dump(pkt, pktlen, output_cont); +} + +void +print_tm_output_new() +{ + output_line("Rx Test Mode packet"); + packet_hex_dump(rxpkt, (unsigned) rxpkt_len, output_cont); +}