| 113 | return *(ui8*)(buf + UDP_VERSION_OFFSET); |
| 114 | } |
| 115 | static void WriteVersion(char* buf) { |
| 116 | // We use version field to distinguish between netliba v12 and old netliba v6 packets. |
| 117 | // At this offset netliba v6 had CMD field (from TUdpHost) which was less than 100. |
| 118 | *(ui8*)(buf + UDP_VERSION_OFFSET) = (char)UDP_NETLIBA_VERSION_V12; |
| 119 | } |
| 120 | |
| 121 | static ui16 ReadPacketDataSize(const char* buf) { |
| 122 | return *(ui16*)(buf + UDP_PACKET_DATA_SIZE_OFFSET); |