comparison rvinterf/lowlevel/logsent.c @ 628:c2f2f7d78451

rvinterf: log sent GPF packets with the same decoding as received ones
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 01 Sep 2014 07:42:59 +0000
parents 2f285f20d617
children da9a36515da6
comparison
equal deleted inserted replaced
627:42c91c51ca7f 628:c2f2f7d78451
4 4
5 #include <sys/types.h> 5 #include <sys/types.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <string.h> 7 #include <string.h>
8 #include <strings.h> 8 #include <strings.h>
9 #include "../include/pktmux.h"
9 #include "../include/limits.h" 10 #include "../include/limits.h"
10 11
11 log_sent_packet(pkt, pktlen) 12 static void
13 log_sent_gpf(pkt, pktlen)
14 u_char *pkt;
15 {
16 char buf[MAX_PKT_TO_TARGET*4+30];
17
18 strcpy(buf, "Sent ");
19 format_g23_packet(pkt, pktlen, buf + 5);
20 output_line(buf);
21 }
22
23 static void
24 log_sent_other(pkt, pktlen)
12 u_char *pkt; 25 u_char *pkt;
13 { 26 {
14 char buf[MAX_PKT_TO_TARGET*3+5]; 27 char buf[MAX_PKT_TO_TARGET*3+5];
15 int i; 28 int i;
16 char *dp; 29 char *dp;
23 dp += 3; 36 dp += 3;
24 } 37 }
25 *dp = '\0'; 38 *dp = '\0';
26 output_line(buf); 39 output_line(buf);
27 } 40 }
41
42 log_sent_packet(pkt, pktlen)
43 u_char *pkt;
44 {
45 if (pkt[0] == RVT_L23_HEADER)
46 log_sent_gpf(pkt, pktlen);
47 else
48 log_sent_other(pkt, pktlen);
49 }