| 2450 | } |
| 2451 | |
| 2452 | static cJSON *dict_avp_dec_hex(struct avp_hdr * h, struct dict_avp_data *avp) |
| 2453 | { |
| 2454 | char *buf; |
| 2455 | int len; |
| 2456 | cJSON *obj; |
| 2457 | |
| 2458 | if (avp->avp_basetype != AVP_TYPE_OCTETSTRING) { |
| 2459 | LM_ERR("invalid base type for IP: %d\n", avp->avp_basetype); |
| 2460 | return NULL; |
| 2461 | } |
| 2462 | buf = pkg_malloc(h->avp_value->os.len * 2); |
| 2463 | if (!buf) { |
| 2464 | LM_ERR("oom for hex buffer\n"); |
| 2465 | return NULL; |
| 2466 | } |
| 2467 | len = string2hex((const char *)h->avp_value->os.data, h->avp_value->os.len, buf); |
| 2468 | obj = cJSON_CreateStr(buf, len); |
| 2469 | pkg_free(buf); |
| 2470 | return obj; |
| 2471 | } |
| 2472 | |
| 2473 | #define AAA_DIAM_TIME_OFFSET 2208988800U |
| 2474 |
nothing calls this directly
no test coverage detected