view rvinterf/lowlevel/rviftmode.c @ 932:3d1abb9f05ef

rvinterf proper: move TM logging to new module
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 23 May 2023 06:20:21 +0000
parents
children bd6dd6120180
line wrap: on
line source

/*
 * 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 <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>

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);
}