13
0
Fork 1

dect_cli: add timestamps to the pcap filename

this way multiple calls can be recorded from a single basestation.
thanks to Darkscout for the patch.


git-svn-id: https://dedected.org/svn/trunk@24 8d8ab74c-27aa-4a3d-9bde-523a2bc1f624
This commit is contained in:
mazzoo 2009-01-07 09:22:05 +00:00
parent 342e5b50c7
commit 0caf39efd3
1 changed files with 17 additions and 7 deletions

View File

@ -416,13 +416,23 @@ void process_cli_data()
void init_pcap(struct sniffed_packet * packet)
{
char fname[100];
sprintf(fname, "dump_%.2x_%.2x_%.2x_%.2x_%.2x.pcap",
cli.RFPI[0],
cli.RFPI[1],
cli.RFPI[2],
cli.RFPI[3],
cli.RFPI[4]);
char fname[512];
char ftime[256];
time_t rawtime;
struct tm *timeinfo;
time (&rawtime);
timeinfo = localtime(&rawtime);
strftime(ftime, sizeof(ftime), "%Y-%m-%d_%H_%M_%S", timeinfo);
sprintf(fname, "dump_%s_RFPI_%.2x_%.2x_%.2x_%.2x_%.2x.pcap",
ftime,
cli.RFPI[0],
cli.RFPI[1],
cli.RFPI[2],
cli.RFPI[3],
cli.RFPI[4]);
LOG("### dumping to %s\n", fname);
cli.pcap = pcap_open_dead(DLT_EN10MB, 73);
if (!cli.pcap)