changeset 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 42c91c51ca7f
children e7ba9fcb3637
files rvinterf/lowlevel/logsent.c
diffstat 1 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/lowlevel/logsent.c	Mon Sep 01 06:23:38 2014 +0000
+++ b/rvinterf/lowlevel/logsent.c	Mon Sep 01 07:42:59 2014 +0000
@@ -6,9 +6,22 @@
 #include <stdio.h>
 #include <string.h>
 #include <strings.h>
+#include "../include/pktmux.h"
 #include "../include/limits.h"
 
-log_sent_packet(pkt, pktlen)
+static void
+log_sent_gpf(pkt, pktlen)
+	u_char *pkt;
+{
+	char buf[MAX_PKT_TO_TARGET*4+30];
+
+	strcpy(buf, "Sent ");
+	format_g23_packet(pkt, pktlen, buf + 5);
+	output_line(buf);
+}
+
+static void
+log_sent_other(pkt, pktlen)
 	u_char *pkt;
 {
 	char buf[MAX_PKT_TO_TARGET*3+5];
@@ -25,3 +38,12 @@
 	*dp = '\0';
 	output_line(buf);
 }
+
+log_sent_packet(pkt, pktlen)
+	u_char *pkt;
+{
+	if (pkt[0] == RVT_L23_HEADER)
+		log_sent_gpf(pkt, pktlen);
+	else
+		log_sent_other(pkt, pktlen);
+}