Lines Matching refs:id_map
159 struct sip_svc_id_map *id_map = NULL; in sip_svc_id_map_create() local
163 id_map = k_malloc(sizeof(struct sip_svc_id_map)); in sip_svc_id_map_create()
164 if (!id_map) { in sip_svc_id_map_create()
168 id_map->items = k_malloc(items_size); in sip_svc_id_map_create()
169 if (!id_map->items) { in sip_svc_id_map_create()
170 k_free(id_map); in sip_svc_id_map_create()
174 id_map->size = size; in sip_svc_id_map_create()
176 id_map->items[i].id = SIP_SVC_ID_INVALID; in sip_svc_id_map_create()
177 id_map->items[i].arg1 = NULL; in sip_svc_id_map_create()
178 id_map->items[i].arg2 = NULL; in sip_svc_id_map_create()
179 id_map->items[i].arg3 = NULL; in sip_svc_id_map_create()
180 id_map->items[i].arg4 = NULL; in sip_svc_id_map_create()
181 id_map->items[i].arg5 = NULL; in sip_svc_id_map_create()
182 id_map->items[i].arg6 = NULL; in sip_svc_id_map_create()
185 return id_map; in sip_svc_id_map_create()
190 void sip_svc_id_map_delete(struct sip_svc_id_map *id_map) in sip_svc_id_map_delete() argument
192 if (id_map) { in sip_svc_id_map_delete()
193 k_free(id_map->items); in sip_svc_id_map_delete()
194 k_free(id_map); in sip_svc_id_map_delete()
199 static int sip_svc_id_map_get_idx(struct sip_svc_id_map *id_map, uint32_t id) in sip_svc_id_map_get_idx() argument
203 if (!id_map) { in sip_svc_id_map_get_idx()
207 for (i = 0; i < id_map->size; i++) { in sip_svc_id_map_get_idx()
208 if (id_map->items[i].id == id) { in sip_svc_id_map_get_idx()
217 int sip_svc_id_map_insert_item(struct sip_svc_id_map *id_map, uint32_t id, void *arg1, void *arg2, in sip_svc_id_map_insert_item() argument
222 if (!id_map) { in sip_svc_id_map_insert_item()
226 i = sip_svc_id_map_get_idx(id_map, SIP_SVC_ID_INVALID); in sip_svc_id_map_insert_item()
231 id_map->items[i].id = id; in sip_svc_id_map_insert_item()
232 id_map->items[i].arg1 = arg1; in sip_svc_id_map_insert_item()
233 id_map->items[i].arg2 = arg2; in sip_svc_id_map_insert_item()
234 id_map->items[i].arg3 = arg3; in sip_svc_id_map_insert_item()
235 id_map->items[i].arg4 = arg4; in sip_svc_id_map_insert_item()
236 id_map->items[i].arg5 = arg5; in sip_svc_id_map_insert_item()
237 id_map->items[i].arg6 = arg6; in sip_svc_id_map_insert_item()
243 int sip_svc_id_map_remove_item(struct sip_svc_id_map *id_map, uint32_t id) in sip_svc_id_map_remove_item() argument
247 if (!id_map) { in sip_svc_id_map_remove_item()
251 i = sip_svc_id_map_get_idx(id_map, id); in sip_svc_id_map_remove_item()
256 id_map->items[i].id = SIP_SVC_ID_INVALID; in sip_svc_id_map_remove_item()
257 id_map->items[i].arg1 = NULL; in sip_svc_id_map_remove_item()
258 id_map->items[i].arg2 = NULL; in sip_svc_id_map_remove_item()
259 id_map->items[i].arg3 = NULL; in sip_svc_id_map_remove_item()
260 id_map->items[i].arg4 = NULL; in sip_svc_id_map_remove_item()
261 id_map->items[i].arg5 = NULL; in sip_svc_id_map_remove_item()
262 id_map->items[i].arg6 = NULL; in sip_svc_id_map_remove_item()
268 struct sip_svc_id_map_item *sip_svc_id_map_query_item(struct sip_svc_id_map *id_map, uint32_t id) in sip_svc_id_map_query_item() argument
272 if (!id_map) { in sip_svc_id_map_query_item()
276 i = sip_svc_id_map_get_idx(id_map, id); in sip_svc_id_map_query_item()
281 return &id_map->items[i]; in sip_svc_id_map_query_item()