| 71 | |
| 72 | |
| 73 | int init_extra_avps(void) |
| 74 | { |
| 75 | extra_lock = lock_alloc(); |
| 76 | if (!extra_lock) { |
| 77 | LM_ERR("cannot allocate lock\n"); |
| 78 | return -1; |
| 79 | } |
| 80 | if (!lock_init(extra_lock)) { |
| 81 | LM_ERR("cannot init lock\n"); |
| 82 | return -1; |
| 83 | } |
| 84 | last_avp_index_shm = shm_malloc(sizeof(int)); |
| 85 | if (!last_avp_index_shm) { |
| 86 | LM_ERR("not enough shm mem\n"); |
| 87 | return -1; |
| 88 | } |
| 89 | *last_avp_index_shm = last_avp_index; |
| 90 | /* initialize map for dynamic avps */ |
| 91 | avp_map_shm = map_create(AVLMAP_SHARED); |
| 92 | if (!avp_map_shm) { |
| 93 | LM_ERR("cannot create shared avp_map\n"); |
| 94 | return -1; |
| 95 | } |
| 96 | return 0; |
| 97 | } |
| 98 | |
| 99 | |
| 100 | struct usr_avp* new_avp(unsigned short flags, int id, int_str val) |
nothing calls this directly
no test coverage detected