FreeCalypso > hg > freecalypso-tools
comparison rvinterf/lowlevel/logsent.c @ 928:65953c172f24
rvinterf/lowlevel: new hex dump format
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 23 May 2023 05:23:19 +0000 |
parents | 4e243402f453 |
children | 3d1abb9f05ef |
comparison
equal
deleted
inserted
replaced
927:4e243402f453 | 928:65953c172f24 |
---|---|
9 #include "../include/pktmux.h" | 9 #include "../include/pktmux.h" |
10 #include "../include/limits.h" | 10 #include "../include/limits.h" |
11 | 11 |
12 extern int no_output, verbose; | 12 extern int no_output, verbose; |
13 extern FILE *logF; | 13 extern FILE *logF; |
14 | |
15 extern void output_cont(); | |
14 | 16 |
15 static void | 17 static void |
16 log_sent_ati(pkt, pktlen) | 18 log_sent_ati(pkt, pktlen) |
17 u_char *pkt; | 19 u_char *pkt; |
18 { | 20 { |
32 strcpy(buf, "Sent "); | 34 strcpy(buf, "Sent "); |
33 format_g23_packet(pkt, pktlen, buf + 5); | 35 format_g23_packet(pkt, pktlen, buf + 5); |
34 output_line(buf); | 36 output_line(buf); |
35 } | 37 } |
36 | 38 |
37 static void | |
38 log_sent_other(pkt, pktlen) | |
39 u_char *pkt; | |
40 { | |
41 char buf[MAX_PKT_TO_TARGET*3+5]; | |
42 int i; | |
43 char *dp; | |
44 | |
45 dp = buf; | |
46 strcpy(dp, "Sent"); | |
47 dp += 4; | |
48 for (i = 0; i < pktlen; i++) { | |
49 sprintf(dp, " %02X", pkt[i]); | |
50 dp += 3; | |
51 } | |
52 *dp = '\0'; | |
53 output_line(buf); | |
54 } | |
55 | |
56 log_sent_packet(pkt, pktlen) | 39 log_sent_packet(pkt, pktlen) |
57 u_char *pkt; | 40 u_char *pkt; |
58 { | 41 { |
59 if (no_output && !logF) | 42 if (no_output && !logF) |
60 return; | 43 return; |
61 switch (pkt[0]) { | 44 switch (pkt[0]) { |
62 case RVT_L23_HEADER: | 45 case RVT_L23_HEADER: |
63 log_sent_gpf(pkt, pktlen); | 46 log_sent_gpf(pkt, pktlen); |
64 return; | 47 return; |
48 case RVT_TM_HEADER: | |
49 output_line("Sent Test Mode packet"); | |
50 packet_hex_dump(pkt, pktlen, output_cont); | |
51 return; | |
65 case RVT_AT_HEADER: | 52 case RVT_AT_HEADER: |
66 log_sent_ati(pkt, pktlen); | 53 log_sent_ati(pkt, pktlen); |
67 return; | 54 return; |
68 case RVT_TCH_HEADER: | 55 case RVT_TCH_HEADER: |
69 if (verbose) | 56 if (verbose) { |
70 goto generic; | 57 output_line("Sent TCH packet"); |
71 tch_inc_count_tx(); | 58 packet_hex_dump(pkt, pktlen, output_cont); |
59 } else { | |
60 tch_inc_count_tx(); | |
61 } | |
72 return; | 62 return; |
73 default: | 63 default: |
74 generic: | 64 output_line("Sent misc packet"); |
75 log_sent_other(pkt, pktlen); | 65 packet_hex_dump(pkt, pktlen, output_cont); |
76 } | 66 } |
77 } | 67 } |