FreeCalypso > hg > freecalypso-tools
annotate 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 |
rev | line source |
---|---|
932
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module is for rvinterf only. Whenever we send or receive Test Mode |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * packets, we should be a little more intelligent about how we display and |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * log them. By default we only print a one-line summary, and in verbose mode |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * we also emit a full hex dump. |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 */ |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <sys/types.h> |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <stdio.h> |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <string.h> |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include <strings.h> |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 extern u_char rxpkt[]; |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 extern size_t rxpkt_len; |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 extern int verbose; |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 extern void output_cont(); |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 void |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 log_sent_tm(pkt, pktlen) |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 u_char *pkt; |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 { |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 output_line("Sent Test Mode packet"); |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 packet_hex_dump(pkt, pktlen, output_cont); |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 } |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 void |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 print_tm_output_new() |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 { |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 output_line("Rx Test Mode packet"); |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 packet_hex_dump(rxpkt, (unsigned) rxpkt_len, output_cont); |
3d1abb9f05ef
rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 } |