28 char src_ip[46] = { 0 }, dst_ip[46] = { 0 };
30 if (PacketIsIPv4(p)) {
31 PrintInet(AF_INET, (
const void *)&(p->
src.addr_data32[0]), src_ip,
sizeof(src_ip));
32 PrintInet(AF_INET, (
const void *)&(p->
dst.addr_data32[0]), dst_ip,
sizeof(dst_ip));
33 }
else if (PacketIsIPv6(p)) {
44 static bool CustomPacketLoggerCondition(
ThreadVars *
tv,
void *thread_data,
const Packet *)
52 char src_ip[46] = { 0 }, dst_ip[46] = { 0 };
57 PrintInet(AF_INET, (
const void *)&(f->
src.addr_data32[0]), src_ip,
sizeof(src_ip));
58 PrintInet(AF_INET, (
const void *)&(f->
dst.addr_data32[0]), dst_ip,
sizeof(dst_ip));
67 PrintInet(AF_INET, (
const void *)&(f->
dst.addr_data32[0]), src_ip,
sizeof(src_ip));
68 PrintInet(AF_INET, (
const void *)&(f->
src.addr_data32[0]), dst_ip,
sizeof(dst_ip));
77 SCLogNotice(
"Flow: %s:%u -> %s:%u", src_ip, sp, dst_ip, dp);
84 void *tx, uint64_t tx_id)
103 static void Init(
void)
106 CustomPacketLoggerCondition, NULL, ThreadInit, ThreadDeinit);
108 "custom-flow-logger", CustomFlowLogger, NULL, ThreadInit, ThreadDeinit);
116 -1, NULL, ThreadInit, ThreadDeinit);
121 .
name =
"CustomLogger",
122 .author =
"Firstname Lastname",