feature: add debug_plugin for development debugging
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "hexdump.h"
|
||||
#include "packet_dump.h"
|
||||
#include "packet_utils.h"
|
||||
|
||||
@@ -78,16 +79,8 @@ int packet_dump_pcap(const struct packet *pkt, const char *file)
|
||||
|
||||
void packet_dump_hex(const struct packet *pkt, int fd)
|
||||
{
|
||||
const char *data = packet_get_raw_data(pkt);
|
||||
uint16_t len = packet_get_raw_len(pkt);
|
||||
const char *data = packet_get_raw_data(pkt);
|
||||
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
if (i % 16 == 0)
|
||||
{
|
||||
dprintf(fd, "\n");
|
||||
}
|
||||
dprintf(fd, "%02x ", (unsigned char)data[i]);
|
||||
}
|
||||
dprintf(fd, "\n");
|
||||
hexdump_to_fd(fd, data, len);
|
||||
}
|
||||
Reference in New Issue
Block a user