static
| 131 | |
| 132 | // static |
| 133 | void Protocol::InitHeader(vector<uint8_t> & packet, PacketType type, uint32_t payloadSize) |
| 134 | { |
| 135 | packet.resize(sizeof(uint32_t)); |
| 136 | uint32_t & size = *reinterpret_cast<uint32_t *>(packet.data()); |
| 137 | size = payloadSize; |
| 138 | |
| 139 | ASSERT_LESS(size, 0x00FFFFFF, ()); |
| 140 | |
| 141 | if (!IsBigEndianMacroBased()) |
| 142 | size = ReverseByteOrder(size); |
| 143 | |
| 144 | packet[0] = static_cast<uint8_t>(type); |
| 145 | } |
| 146 | |
| 147 | string DebugPrint(Protocol::PacketType type) |
| 148 | { |
nothing calls this directly
no test coverage detected