view rvinterf/libasync/rvtrace.c @ 926:6a0aa8d36d06

rvinterf backslash escape: introduce libprint The new helper function library named libprint is meant to replace the badly misnamed libg23, and will soon contain functions for printing all of the same kinds of GPF TST packets that are now handled in libg23. However, we are also moving safe_print_trace() from libasync to this new library, and changing it to emit our new backslash escape format.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 23 May 2023 03:47:46 +0000
parents e7502631a0f9
children
line wrap: on
line source

/*
 * Here we detect and handle "Lost Message" packets.
 */

#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include "pktmux.h"
#include "limits.h"
#include "localsock.h"

extern u_char rvi_msg[];
extern int rvi_msg_len;

void
handle_useid_0()
{
	char buf[MAX_PKT_FROM_TARGET*4];

	if (strncmp(rvi_msg + 7, "RVT: Lost Message", 17))
		return;
	safe_print_trace(rvi_msg + 7, rvi_msg_len - 7, buf);
	async_msg_output(buf);
}