| 2496 | } |
| 2497 | |
| 2498 | static cJSON *dict_avp_dec_time(struct avp_hdr * h, struct dict_avp_data *avp) |
| 2499 | { |
| 2500 | cJSON *obj; |
| 2501 | uint32_t dt; |
| 2502 | unsigned char *bytes; |
| 2503 | |
| 2504 | if (avp->avp_basetype != AVP_TYPE_OCTETSTRING) { |
| 2505 | LM_ERR("invalid base type for TIME: %d\n", avp->avp_basetype); |
| 2506 | return NULL; |
| 2507 | } |
| 2508 | bytes = h->avp_value->os.data; |
| 2509 | dt = ((uint32_t)bytes[0] << 24) | ((uint32_t)bytes[1] << 16) | |
| 2510 | ((uint32_t)bytes[2] << 8) | ((uint32_t)bytes[3]); |
| 2511 | obj = cJSON_CreateNumber(dt - AAA_DIAM_TIME_OFFSET); |
| 2512 | return obj; |
| 2513 | } |
nothing calls this directly
no test coverage detected