Attempt to put the time into the pcap packet record
diff --git a/src/misdn.c b/src/misdn.c
index 0d54c79..3c9fc99 100644
--- a/src/misdn.c
+++ b/src/misdn.c
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
+#include <time.h>
#include <sys/fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -106,6 +107,8 @@
return;
int ret;
+ time_t cur_time;
+ struct tm *tm;
struct fake_lapd_frame header = {
.ea1 = 0,
.cr = PCAP_OUTPUT ? 1 : 0,
@@ -122,6 +125,10 @@
.orig_len = msg->len + sizeof(header) - MISDN_HEADER_LEN,
};
+ cur_time = time(NULL);
+ tm = localtime(&cur_time);
+ payload_header.ts_sec = mktime(tm);
+
ret = write(pcap_fd, &header, sizeof(header));
ret = write(pcap_fd, &payload_header, sizeof(payload_header));
ret = write(pcap_fd, msg->data + MISDN_HEADER_LEN,