Lines Matching full:packet

19     // Check if the packet has atleast the size of the RMCP Header  in unflatten()
122 // the packet length in the header in unflatten()
140 std::vector<uint8_t> packet(sizeof(SessionHeader_t)); in flatten() local
142 // Insert Session Header into the Packet in flatten()
143 auto header = reinterpret_cast<SessionHeader_t*>(packet.data()); in flatten()
155 // Insert the Payload into the Packet in flatten()
156 packet.insert(packet.end(), outMessage->payload.begin(), in flatten()
160 packet.resize(packet.size() + sizeof(SessionTrailer_t)); in flatten()
162 reinterpret_cast<SessionTrailer_t*>(packet.data() + packet.size()); in flatten()
165 return packet; in flatten()
175 // Check if the packet has atleast the Session Header in unflatten()
204 // the packet length in the header in unflatten()
227 throw std::runtime_error("Packet Integrity check failed"); in unflatten()
251 std::vector<uint8_t> packet(sizeof(SessionHeader_t)); in flatten() local
253 SessionHeader_t* header = reinterpret_cast<SessionHeader_t*>(packet.data()); in flatten()
264 internal::addSequenceNumber(packet, session); in flatten()
276 // Insert the encrypted payload into the outgoing IPMI packet in flatten()
277 packet.insert(packet.end(), cipherPayload.begin(), cipherPayload.end()); in flatten()
285 // Insert the Payload into the Packet in flatten()
286 packet.insert(packet.end(), outMessage->payload.begin(), in flatten()
292 header = reinterpret_cast<SessionHeader_t*>(packet.data()); in flatten()
294 internal::addIntegrityData(packet, outMessage, payloadLen, session); in flatten()
297 return packet; in flatten()
303 void addSequenceNumber(std::vector<uint8_t>& packet, in addSequenceNumber() argument
306 SessionHeader_t* header = reinterpret_cast<SessionHeader_t*>(packet.data()); in addSequenceNumber()
319 bool verifyPacketIntegrity(const std::vector<uint8_t>& packet, in verifyPacketIntegrity() argument
328 * calculates the number of padding bytes added in the IPMI packet. in verifyPacketIntegrity()
334 // verify packet size includes trailer struct starts at sessTrailerPos in verifyPacketIntegrity()
335 if (packet.size() < (sessTrailerPos + sizeof(SessionTrailer_t))) in verifyPacketIntegrity()
341 packet.data() + sessTrailerPos); in verifyPacketIntegrity()
355 if ((packet.size() - sessTrailerPos - sizeof(SessionTrailer_t)) != in verifyPacketIntegrity()
361 auto integrityIter = packet.cbegin(); in verifyPacketIntegrity()
366 size_t length = packet.size() - integrityAlgo->authCodeLength - in verifyPacketIntegrity()
369 return integrityAlgo->verifyIntegrityData(packet, length, integrityIter, in verifyPacketIntegrity()
370 packet.cend()); in verifyPacketIntegrity()
373 void addIntegrityData(std::vector<uint8_t>& packet, in addIntegrityData() argument
379 // IPMI packet. If needed each integrity Pad byte is set to FFh. in addIntegrityData()
381 packet.insert(packet.end(), paddingLen, 0xFF); in addIntegrityData()
383 packet.resize(packet.size() + sizeof(SessionTrailer_t)); in addIntegrityData()
386 packet.data() + packet.size() - sizeof(SessionTrailer_t)); in addIntegrityData()
392 session->getIntegrityAlgo()->generateIntegrityData(packet); in addIntegrityData()
394 packet.insert(packet.end(), integrityData.begin(), integrityData.end()); in addIntegrityData()
398 const std::vector<uint8_t>& packet, in decryptPayload() argument
403 packet, sizeof(SessionHeader_t), payloadLen); in decryptPayload()
435 std::vector<uint8_t> packet(sizeof(AsfMessagePong_t)); in flatten() local
437 // Insert RMCP header into the Packet in flatten()
438 auto header = reinterpret_cast<AsfMessagePong_t*>(packet.data()); in flatten()
460 return packet; in flatten()