static
| 79 | |
| 80 | // static |
| 81 | pair<Protocol::PacketType, size_t> Protocol::DecodeHeader(vector<uint8_t> const & data) |
| 82 | { |
| 83 | if (data.size() < sizeof(uint32_t /* header */)) |
| 84 | { |
| 85 | LOG(LWARNING, ("Header size is too small", data.size(), sizeof(uint32_t /* header */))); |
| 86 | return make_pair(PacketType::Error, data.size()); |
| 87 | } |
| 88 | |
| 89 | uint32_t size = (*reinterpret_cast<uint32_t const *>(data.data())) & 0xFFFFFF00; |
| 90 | if (!IsBigEndianMacroBased()) |
| 91 | size = ReverseByteOrder(size); |
| 92 | return make_pair(PacketType(static_cast<uint8_t>(data[0])), size); |
| 93 | } |
| 94 | |
| 95 | // static |
| 96 | string Protocol::DecodeAuthPacket(Protocol::PacketType type, vector<uint8_t> const & data) |
nothing calls this directly
no test coverage detected