115{
117
122
125
126 if (addr.is_v4())
127 {
128 auto bytes = addr.to_v4().to_bytes();
130 }
131 else if (addr.is_v6())
132 {
133 auto bytes = addr.to_v6().to_bytes();
135 }
136
139 header.
Opcode = packet.GetOpcode();
140
141 fwrite(&header,
sizeof(header), 1,
_file);
142
143 if (!packet.empty())
144 {
145 fwrite(packet.contents(), 1, packet.size(),
_file);
146 }
147
149}
@ CLIENT_TO_SERVER
Definition: PacketLog.h:27
Definition: PacketLog.cpp:42
uint32 Direction
Definition: PacketLog.cpp:50
uint32 OptionalDataSize
Definition: PacketLog.cpp:53
uint32 Opcode
Definition: PacketLog.cpp:56
uint32 ArrivalTicks
Definition: PacketLog.cpp:52
OptionalData OptionalData
Definition: PacketLog.cpp:55
uint32 Length
Definition: PacketLog.cpp:54
uint32 ConnectionId
Definition: PacketLog.cpp:51
uint32 SocketPort
Definition: PacketLog.cpp:47
uint8 SocketIPBytes[16]
Definition: PacketLog.cpp:46
std::mutex _logPacketLock
Definition: PacketLog.h:38