| 36 | } |
| 37 | |
| 38 | void remove_security_policy_command::deserialize(const std::vector<byte_t>& _buffer, error_e& _error) { |
| 39 | |
| 40 | if (COMMAND_HEADER_SIZE + sizeof(update_id_) + sizeof(uid_) + sizeof(gid_t) > _buffer.size()) { |
| 41 | |
| 42 | _error = error_e::ERROR_NOT_ENOUGH_BYTES; |
| 43 | return; |
| 44 | } |
| 45 | |
| 46 | // deserialize header |
| 47 | command::deserialize(_buffer, _error); |
| 48 | if (_error != error_e::ERROR_OK) |
| 49 | return; |
| 50 | |
| 51 | // deserialize payload |
| 52 | size_t its_offset(COMMAND_HEADER_SIZE); |
| 53 | std::memcpy(&update_id_, &_buffer[its_offset], sizeof(update_id_)); |
| 54 | its_offset += sizeof(update_id_); |
| 55 | std::memcpy(&uid_, &_buffer[its_offset], sizeof(uid_)); |
| 56 | its_offset += sizeof(uid_); |
| 57 | std::memcpy(&gid_, &_buffer[its_offset], sizeof(gid_)); |
| 58 | } |
| 59 | |
| 60 | uint32_t remove_security_policy_command::get_update_id() const { |
| 61 |
nothing calls this directly
no test coverage detected