MCPcopy Create free account
hub / github.com/COVESA/vsomeip / deserialize_id_item

Method deserialize_id_item

implementation/security/src/policy.cpp:215–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215bool policy::deserialize_id_item(const byte_t*& _data, uint32_t& _size, uint16_t& _low, uint16_t& _high) const {
216
217 uint32_t its_length, its_type;
218 bool its_result;
219
220 its_result = deserialize_u32(_data, _size, its_length);
221 if (its_result == false)
222 return false;
223
224 its_result = deserialize_u32(_data, _size, its_type);
225 if (its_result == false)
226 return false;
227
228 if (its_type == 1 && its_length == sizeof(uint16_t)) {
229 its_result = deserialize_u16(_data, _size, _low);
230 if (its_result == false)
231 return false;
232
233 _high = _low;
234 } else if (its_type == 2 && its_length == sizeof(uint16_t) + sizeof(uint16_t)) {
235 its_result = deserialize_u16(_data, _size, _low);
236 if (its_result == false)
237 return false;
238
239 its_result = deserialize_u16(_data, _size, _high);
240 if (its_result == false)
241 return false;
242
243 if (_low > _high)
244 return false;
245 }
246
247 // handle ANY_METHOD configuration
248 if (_low == ANY_METHOD && _high == ANY_METHOD) {
249 _low = 0x01;
250 }
251
252 return (_low != 0x0000);
253}
254
255bool policy::deserialize_u16(const byte_t*& _data, uint32_t& _size, uint16_t& _value) const {
256

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected