corosync  3.1.5.15-9134
lib/cmap.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2017 Red Hat, Inc.
3  *
4  * All rights reserved.
5  *
6  * Author: Jan Friesse (jfriesse@redhat.com)
7  *
8  * This software licensed under BSD license, the text of which follows:
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions are met:
12  *
13  * - Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  * - Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  * - Neither the name of the Red Hat, Inc. nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32  * THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #include <config.h>
36 
37 #include <stdlib.h>
38 #include <string.h>
39 #include <unistd.h>
40 #include <pthread.h>
41 #include <sys/types.h>
42 #include <sys/uio.h>
43 #include <errno.h>
44 
45 #include <corosync/corotypes.h>
46 #include <corosync/corodefs.h>
47 #include <corosync/hdb.h>
48 #include <qb/qbipcc.h>
49 
50 #include <corosync/cmap.h>
51 #include <corosync/ipc_cmap.h>
52 
53 #include "util.h"
54 #include <stdio.h>
55 
56 struct cmap_inst {
57  int finalize;
58  qb_ipcc_connection_t *c;
59  const void *context;
60 };
61 
63  void *user_data;
65  qb_ipcc_connection_t *c;
67 };
68 
69 static void cmap_inst_free (void *inst);
70 
71 DECLARE_HDB_DATABASE(cmap_handle_t_db, cmap_inst_free);
72 DECLARE_HDB_DATABASE(cmap_track_handle_t_db,NULL);
73 
74 /*
75  * Function prototypes
76  */
77 static cs_error_t cmap_get_int(
78  cmap_handle_t handle,
79  const char *key_name,
80  void *value,
81  size_t value_size,
83 
84 static cs_error_t cmap_adjust_int(cmap_handle_t handle, const char *key_name, int32_t step);
85 
86 /*
87  * Function implementations
88  */
90 {
91  cs_error_t error;
92  struct cmap_inst *cmap_inst;
93 
94  error = hdb_error_to_cs(hdb_handle_create(&cmap_handle_t_db, sizeof(*cmap_inst), handle));
95  if (error != CS_OK) {
96  goto error_no_destroy;
97  }
98 
99  error = hdb_error_to_cs(hdb_handle_get(&cmap_handle_t_db, *handle, (void *)&cmap_inst));
100  if (error != CS_OK) {
101  goto error_destroy;
102  }
103 
104  error = CS_OK;
105  cmap_inst->finalize = 0;
106  cmap_inst->c = qb_ipcc_connect("cmap", IPC_REQUEST_SIZE);
107  if (cmap_inst->c == NULL) {
108  error = qb_to_cs_error(-errno);
109  goto error_put_destroy;
110  }
111 
112  (void)hdb_handle_put(&cmap_handle_t_db, *handle);
113 
114  return (CS_OK);
115 
116 error_put_destroy:
117  (void)hdb_handle_put(&cmap_handle_t_db, *handle);
118 error_destroy:
119  (void)hdb_handle_destroy(&cmap_handle_t_db, *handle);
120 error_no_destroy:
121  return (error);
122 }
123 
125  cmap_map_t map)
126 {
127  cs_error_t error;
128  struct iovec iov[1];
129  struct cmap_inst *cmap_inst;
131  struct qb_ipc_response_header res_lib_cmap_set_current_map;
132 
133  error = cmap_initialize(handle);
134 
135  if (error == CS_OK) {
136  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, *handle, (void *)&cmap_inst));
137  if (error != CS_OK) {
138  return (error);
139  }
140 
145 
146  iov[0].iov_base = (char *)&req_lib_cmap_set_current_map;
147  iov[0].iov_len = sizeof(req_lib_cmap_set_current_map);
148 
149  error = qb_to_cs_error(qb_ipcc_sendv_recv(
150  cmap_inst->c,
151  iov,
152  1,
153  &res_lib_cmap_set_current_map,
154  sizeof (res_lib_cmap_set_current_map), CS_IPC_TIMEOUT_MS));
155 
156  if (error == CS_OK) {
157  error = res_lib_cmap_set_current_map.error;
158  }
159 
160  (void)hdb_handle_put (&cmap_handle_t_db, *handle);
161 
162  return (error);
163  }
164  return (error);
165 }
166 
167 static void cmap_inst_free (void *inst)
168 {
169  struct cmap_inst *cmap_inst = (struct cmap_inst *)inst;
170  qb_ipcc_disconnect(cmap_inst->c);
171 }
172 
174 {
175  struct cmap_inst *cmap_inst;
176  cs_error_t error;
177  hdb_handle_t track_inst_handle = 0;
179 
180  error = hdb_error_to_cs(hdb_handle_get(&cmap_handle_t_db, handle, (void *)&cmap_inst));
181  if (error != CS_OK) {
182  return (error);
183  }
184 
185  if (cmap_inst->finalize) {
186  (void)hdb_handle_put (&cmap_handle_t_db, handle);
187  return (CS_ERR_BAD_HANDLE);
188  }
189  cmap_inst->finalize = 1;
190 
191  /*
192  * Destroy all track instances for given connection
193  */
194  hdb_iterator_reset(&cmap_track_handle_t_db);
195  while (hdb_iterator_next(&cmap_track_handle_t_db,
196  (void*)&cmap_track_inst, &track_inst_handle) == 0) {
197 
198  if (cmap_track_inst->c == cmap_inst->c) {
199  (void)hdb_handle_destroy(&cmap_track_handle_t_db, track_inst_handle);
200  }
201 
202  (void)hdb_handle_put (&cmap_track_handle_t_db, track_inst_handle);
203  }
204 
205  (void)hdb_handle_destroy(&cmap_handle_t_db, handle);
206 
207  (void)hdb_handle_put(&cmap_handle_t_db, handle);
208 
209  return (CS_OK);
210 }
211 
213 {
214  cs_error_t error;
215  struct cmap_inst *cmap_inst;
216 
217  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
218  if (error != CS_OK) {
219  return (error);
220  }
221 
222  error = qb_to_cs_error (qb_ipcc_fd_get (cmap_inst->c, fd));
223 
224  (void)hdb_handle_put (&cmap_handle_t_db, handle);
225 
226  return (error);
227 }
228 
230  cmap_handle_t handle,
231  cs_dispatch_flags_t dispatch_types)
232 {
233  int timeout = -1;
234  cs_error_t error;
235  int cont = 1; /* always continue do loop except when set to 0 */
236  struct cmap_inst *cmap_inst;
237  struct qb_ipc_response_header *dispatch_data;
238  char dispatch_buf[IPC_DISPATCH_SIZE];
241  struct cmap_notify_value old_val;
242  struct cmap_notify_value new_val;
243 
244  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
245  if (error != CS_OK) {
246  return (error);
247  }
248 
249  /*
250  * Timeout instantly for CS_DISPATCH_ONE_NONBLOCKING or CS_DISPATCH_ALL and
251  * wait indefinately for CS_DISPATCH_ONE or CS_DISPATCH_BLOCKING
252  */
253  if (dispatch_types == CS_DISPATCH_ALL || dispatch_types == CS_DISPATCH_ONE_NONBLOCKING) {
254  timeout = 0;
255  }
256 
257  dispatch_data = (struct qb_ipc_response_header *)dispatch_buf;
258  do {
259  error = qb_to_cs_error(qb_ipcc_event_recv (
260  cmap_inst->c,
261  dispatch_buf,
263  timeout));
264 
265  if (error == CS_ERR_BAD_HANDLE) {
266  error = CS_OK;
267  goto error_put;
268  }
269  if (error == CS_ERR_TRY_AGAIN) {
270  if (dispatch_types == CS_DISPATCH_ONE_NONBLOCKING) {
271  /*
272  * Don't mask error
273  */
274  goto error_put;
275  }
276  error = CS_OK;
277  if (dispatch_types == CS_DISPATCH_ALL) {
278  break; /* exit do while cont is 1 loop */
279  } else {
280  continue; /* next poll */
281  }
282  }
283 
284  if (error != CS_OK) {
285  goto error_put;
286  }
287 
288  /*
289  * Dispatch incoming message
290  */
291  switch (dispatch_data->id) {
294 
295  error = hdb_error_to_cs(hdb_handle_get(&cmap_track_handle_t_db,
296  res_lib_cmap_notify_callback->track_inst_handle,
297  (void *)&cmap_track_inst));
298  if (error == CS_ERR_BAD_HANDLE) {
299  /*
300  * User deleted tracker -> ignore error
301  */
302  break;
303  }
304  if (error != CS_OK) {
305  goto error_put;
306  }
307 
308  new_val.type = res_lib_cmap_notify_callback->new_value_type;
309  old_val.type = res_lib_cmap_notify_callback->old_value_type;
310  new_val.len = res_lib_cmap_notify_callback->new_value_len;
311  old_val.len = res_lib_cmap_notify_callback->old_value_len;
313  old_val.data = (((const char *)res_lib_cmap_notify_callback->new_value) + new_val.len);
314 
315  cmap_track_inst->notify_fn(handle,
318  (char *)res_lib_cmap_notify_callback->key_name.value,
319  new_val,
320  old_val,
322 
323  (void)hdb_handle_put(&cmap_track_handle_t_db, res_lib_cmap_notify_callback->track_inst_handle);
324  break;
325  default:
326  error = CS_ERR_LIBRARY;
327  goto error_put;
328  break;
329  }
330  if (cmap_inst->finalize) {
331  /*
332  * If the finalize has been called then get out of the dispatch.
333  */
334  error = CS_ERR_BAD_HANDLE;
335  goto error_put;
336  }
337 
338  /*
339  * Determine if more messages should be processed
340  */
341  if (dispatch_types == CS_DISPATCH_ONE || dispatch_types == CS_DISPATCH_ONE_NONBLOCKING) {
342  cont = 0;
343  }
344  } while (cont);
345 
346 error_put:
347  (void)hdb_handle_put (&cmap_handle_t_db, handle);
348 
349  return (error);
350 }
351 
353  cmap_handle_t handle,
354  const void **context)
355 {
356  cs_error_t error;
357  struct cmap_inst *cmap_inst;
358 
359  error = hdb_error_to_cs(hdb_handle_get(&cmap_handle_t_db, handle, (void *)&cmap_inst));
360  if (error != CS_OK) {
361  return (error);
362  }
363 
365 
366  (void)hdb_handle_put (&cmap_handle_t_db, handle);
367 
368  return (CS_OK);
369 }
370 
372  cmap_handle_t handle,
373  const void *context)
374 {
375  cs_error_t error;
376  struct cmap_inst *cmap_inst;
377 
378  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
379  if (error != CS_OK) {
380  return (error);
381  }
382 
384 
385  (void)hdb_handle_put (&cmap_handle_t_db, handle);
386 
387  return (CS_OK);
388 }
389 
391  cmap_handle_t handle,
392  const char *key_name,
393  const void *value,
394  size_t value_len,
396 {
397  cs_error_t error;
398  struct iovec iov[2];
399  struct cmap_inst *cmap_inst;
402 
403  if (key_name == NULL || value == NULL) {
404  return (CS_ERR_INVALID_PARAM);
405  }
406 
407  if (strlen(key_name) >= CS_MAX_NAME_LENGTH) {
408  return (CS_ERR_NAME_TOO_LONG);
409  }
410 
411  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
412  if (error != CS_OK) {
413  return (error);
414  }
415 
416  memset(&req_lib_cmap_set, 0, sizeof(req_lib_cmap_set));
417  req_lib_cmap_set.header.size = sizeof(req_lib_cmap_set) + value_len;
419 
420  memcpy(req_lib_cmap_set.key_name.value, key_name, strlen(key_name));
421  req_lib_cmap_set.key_name.length = strlen(key_name);
422 
423  req_lib_cmap_set.value_len = value_len;
424  req_lib_cmap_set.type = type;
425 
426  iov[0].iov_base = (char *)&req_lib_cmap_set;
427  iov[0].iov_len = sizeof(req_lib_cmap_set);
428  iov[1].iov_base = (void *)value;
429  iov[1].iov_len = value_len;
430 
431  error = qb_to_cs_error(qb_ipcc_sendv_recv(
432  cmap_inst->c,
433  iov,
434  2,
436  sizeof (struct res_lib_cmap_set), CS_IPC_TIMEOUT_MS));
437 
438  if (error == CS_OK) {
439  error = res_lib_cmap_set.header.error;
440  }
441 
442  (void)hdb_handle_put (&cmap_handle_t_db, handle);
443 
444  return (error);
445 }
446 
447 cs_error_t cmap_set_int8(cmap_handle_t handle, const char *key_name, int8_t value)
448 {
449  return (cmap_set(handle, key_name, &value, sizeof(value), CMAP_VALUETYPE_INT8));
450 }
451 
452 cs_error_t cmap_set_uint8(cmap_handle_t handle, const char *key_name, uint8_t value)
453 {
454  return (cmap_set(handle, key_name, &value, sizeof(value), CMAP_VALUETYPE_UINT8));
455 }
456 
457 cs_error_t cmap_set_int16(cmap_handle_t handle, const char *key_name, int16_t value)
458 {
459  return (cmap_set(handle, key_name, &value, sizeof(value), CMAP_VALUETYPE_INT16));
460 }
461 
462 cs_error_t cmap_set_uint16(cmap_handle_t handle, const char *key_name, uint16_t value)
463 {
464  return (cmap_set(handle, key_name, &value, sizeof(value), CMAP_VALUETYPE_UINT16));
465 }
466 
467 cs_error_t cmap_set_int32(cmap_handle_t handle, const char *key_name, int32_t value)
468 {
469  return (cmap_set(handle, key_name, &value, sizeof(value), CMAP_VALUETYPE_INT32));
470 }
471 
472 cs_error_t cmap_set_uint32(cmap_handle_t handle, const char *key_name, uint32_t value)
473 {
474  return (cmap_set(handle, key_name, &value, sizeof(value), CMAP_VALUETYPE_UINT32));
475 }
476 
477 cs_error_t cmap_set_int64(cmap_handle_t handle, const char *key_name, int64_t value)
478 {
479  return (cmap_set(handle, key_name, &value, sizeof(value), CMAP_VALUETYPE_INT64));
480 }
481 
482 cs_error_t cmap_set_uint64(cmap_handle_t handle, const char *key_name, uint64_t value)
483 {
484  return (cmap_set(handle, key_name, &value, sizeof(value), CMAP_VALUETYPE_UINT64));
485 }
486 
487 cs_error_t cmap_set_float(cmap_handle_t handle, const char *key_name, float value)
488 {
489  return (cmap_set(handle, key_name, &value, sizeof(value), CMAP_VALUETYPE_FLOAT));
490 }
491 
492 cs_error_t cmap_set_double(cmap_handle_t handle, const char *key_name, double value)
493 {
494  return (cmap_set(handle, key_name, &value, sizeof(value), CMAP_VALUETYPE_DOUBLE));
495 }
496 
497 cs_error_t cmap_set_string(cmap_handle_t handle, const char *key_name, const char *value)
498 {
499 
500  if (value == NULL) {
501  return (CS_ERR_INVALID_PARAM);
502  }
503 
504  return (cmap_set(handle, key_name, value, strlen(value), CMAP_VALUETYPE_STRING));
505 }
506 
507 cs_error_t cmap_delete(cmap_handle_t handle, const char *key_name)
508 {
509  cs_error_t error;
510  struct iovec iov;
511  struct cmap_inst *cmap_inst;
514 
515  if (key_name == NULL) {
516  return (CS_ERR_INVALID_PARAM);
517  }
518  if (strlen(key_name) >= CS_MAX_NAME_LENGTH) {
519  return (CS_ERR_NAME_TOO_LONG);
520  }
521 
522  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
523  if (error != CS_OK) {
524  return (error);
525  }
526 
527  memset(&req_lib_cmap_delete, 0, sizeof(req_lib_cmap_delete));
528  req_lib_cmap_delete.header.size = sizeof(req_lib_cmap_delete);
530 
531  memcpy(req_lib_cmap_delete.key_name.value, key_name, strlen(key_name));
532  req_lib_cmap_delete.key_name.length = strlen(key_name);
533 
534  iov.iov_base = (char *)&req_lib_cmap_delete;
535  iov.iov_len = sizeof(req_lib_cmap_delete);
536 
537  error = qb_to_cs_error(qb_ipcc_sendv_recv(
538  cmap_inst->c,
539  &iov,
540  1,
542  sizeof (struct res_lib_cmap_delete), CS_IPC_TIMEOUT_MS));
543 
544  if (error == CS_OK) {
545  error = res_lib_cmap_delete.header.error;
546  }
547 
548  (void)hdb_handle_put (&cmap_handle_t_db, handle);
549 
550  return (error);
551 }
552 
554  cmap_handle_t handle,
555  const char *key_name,
556  void *value,
557  size_t *value_len,
559 {
560  cs_error_t error;
561  struct cmap_inst *cmap_inst;
562  struct iovec iov;
565  size_t res_size;
566 
567  if (key_name == NULL) {
568  return (CS_ERR_INVALID_PARAM);
569  }
570  if (strlen(key_name) >= CS_MAX_NAME_LENGTH) {
571  return (CS_ERR_NAME_TOO_LONG);
572  }
573 
574  if (value != NULL && value_len == NULL) {
575  return (CS_ERR_INVALID_PARAM);
576  }
577 
578  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
579  if (error != CS_OK) {
580  return (error);
581  }
582 
583  memset(&req_lib_cmap_get, 0, sizeof(req_lib_cmap_get));
584  req_lib_cmap_get.header.size = sizeof(req_lib_cmap_get);
586 
587  memcpy(req_lib_cmap_get.key_name.value, key_name, strlen(key_name));
588  req_lib_cmap_get.key_name.length = strlen(key_name);
589 
590  if (value != NULL && value_len != NULL) {
591  req_lib_cmap_get.value_len = *value_len;
592  } else {
593  req_lib_cmap_get.value_len = 0;
594  }
595 
596  iov.iov_base = (char *)&req_lib_cmap_get;
597  iov.iov_len = sizeof(req_lib_cmap_get);
598 
599  res_size = sizeof(struct res_lib_cmap_get) + req_lib_cmap_get.value_len;
600 
601  res_lib_cmap_get = malloc(res_size);
602  if (res_lib_cmap_get == NULL) {
603  return (CS_ERR_NO_MEMORY);
604  }
605 
606  error = qb_to_cs_error(qb_ipcc_sendv_recv(
607  cmap_inst->c,
608  &iov,
609  1,
611  res_size, CS_IPC_TIMEOUT_MS));
612 
613  if (error == CS_OK) {
614  error = res_lib_cmap_get->header.error;
615  }
616 
617  if (error == CS_OK) {
618  if (type != NULL) {
619  *type = res_lib_cmap_get->type;
620  }
621 
622  if (value_len != NULL) {
623  *value_len = res_lib_cmap_get->value_len;
624  }
625 
626  if (value != NULL && value_len != NULL) {
627  memcpy(value, res_lib_cmap_get->value, res_lib_cmap_get->value_len);
628  }
629  }
630 
631  free(res_lib_cmap_get);
632 
633  (void)hdb_handle_put (&cmap_handle_t_db, handle);
634 
635  return (error);
636 }
637 
638 static cs_error_t cmap_get_int(
639  cmap_handle_t handle,
640  const char *key_name,
641  void *value,
642  size_t value_size,
644 {
645  char key_value[16];
646  size_t key_size;
647  cs_error_t err;
648 
649  cmap_value_types_t key_type;
650 
651  key_size = sizeof(key_value);
652  memset(key_value, 0, key_size);
653 
654  err = cmap_get(handle, key_name, key_value, &key_size, &key_type);
655  if (err != CS_OK)
656  return (err);
657 
658  if (key_type != type) {
659  return (CS_ERR_INVALID_PARAM);
660  }
661 
662  memcpy(value, key_value, value_size);
663 
664  return (CS_OK);
665 }
666 
667 cs_error_t cmap_get_int8(cmap_handle_t handle, const char *key_name, int8_t *i8)
668 {
669 
670  return (cmap_get_int(handle, key_name, i8, sizeof(*i8), CMAP_VALUETYPE_INT8));
671 }
672 
673 cs_error_t cmap_get_uint8(cmap_handle_t handle, const char *key_name, uint8_t *u8)
674 {
675 
676  return (cmap_get_int(handle, key_name, u8, sizeof(*u8), CMAP_VALUETYPE_UINT8));
677 }
678 
679 cs_error_t cmap_get_int16(cmap_handle_t handle, const char *key_name, int16_t *i16)
680 {
681 
682  return (cmap_get_int(handle, key_name, i16, sizeof(*i16), CMAP_VALUETYPE_INT16));
683 }
684 
685 cs_error_t cmap_get_uint16(cmap_handle_t handle, const char *key_name, uint16_t *u16)
686 {
687 
688  return (cmap_get_int(handle, key_name, u16, sizeof(*u16), CMAP_VALUETYPE_UINT16));
689 }
690 
691 cs_error_t cmap_get_int32(cmap_handle_t handle, const char *key_name, int32_t *i32)
692 {
693 
694  return (cmap_get_int(handle, key_name, i32, sizeof(*i32), CMAP_VALUETYPE_INT32));
695 }
696 
697 cs_error_t cmap_get_uint32(cmap_handle_t handle, const char *key_name, uint32_t *u32)
698 {
699 
700  return (cmap_get_int(handle, key_name, u32, sizeof(*u32), CMAP_VALUETYPE_UINT32));
701 }
702 
703 cs_error_t cmap_get_int64(cmap_handle_t handle, const char *key_name, int64_t *i64)
704 {
705 
706  return (cmap_get_int(handle, key_name, i64, sizeof(*i64), CMAP_VALUETYPE_INT64));
707 }
708 
709 cs_error_t cmap_get_uint64(cmap_handle_t handle, const char *key_name, uint64_t *u64)
710 {
711 
712  return (cmap_get_int(handle, key_name, u64, sizeof(*u64), CMAP_VALUETYPE_UINT64));
713 }
714 
715 cs_error_t cmap_get_float(cmap_handle_t handle, const char *key_name, float *flt)
716 {
717 
718  return (cmap_get_int(handle, key_name, flt, sizeof(*flt), CMAP_VALUETYPE_FLOAT));
719 }
720 
721 cs_error_t cmap_get_double(cmap_handle_t handle, const char *key_name, double *dbl)
722 {
723 
724  return (cmap_get_int(handle, key_name, dbl, sizeof(*dbl), CMAP_VALUETYPE_DOUBLE));
725 }
726 
727 cs_error_t cmap_get_string(cmap_handle_t handle, const char *key_name, char **str)
728 {
729  cs_error_t res;
730  size_t str_len;
732 
733  res = cmap_get(handle, key_name, NULL, &str_len, &type);
734 
735  if (res != CS_OK || type != CMAP_VALUETYPE_STRING) {
736  if (res == CS_OK) {
737  res = CS_ERR_INVALID_PARAM;
738  }
739 
740  goto return_error;
741  }
742 
743  *str = malloc(str_len);
744  if (*str == NULL) {
745  res = CS_ERR_NO_MEMORY;
746 
747  goto return_error;
748  }
749 
750  res = cmap_get(handle, key_name, *str, &str_len, &type);
751  if (res != CS_OK) {
752  free(*str);
753 
754  goto return_error;
755  }
756 
757  return (CS_OK);
758 
759 return_error:
760  return (res);
761 }
762 
763 static cs_error_t cmap_adjust_int(cmap_handle_t handle, const char *key_name, int32_t step)
764 {
765  cs_error_t error;
766  struct iovec iov;
767  struct cmap_inst *cmap_inst;
770 
771  if (key_name == NULL) {
772  return (CS_ERR_INVALID_PARAM);
773  }
774  if (strlen(key_name) >= CS_MAX_NAME_LENGTH) {
775  return (CS_ERR_NAME_TOO_LONG);
776  }
777 
778  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
779  if (error != CS_OK) {
780  return (error);
781  }
782 
784  req_lib_cmap_adjust_int.header.size = sizeof(req_lib_cmap_adjust_int);
786 
787  memcpy(req_lib_cmap_adjust_int.key_name.value, key_name, strlen(key_name));
788  req_lib_cmap_adjust_int.key_name.length = strlen(key_name);
789 
790  req_lib_cmap_adjust_int.step = step;
791 
792  iov.iov_base = (char *)&req_lib_cmap_adjust_int;
793  iov.iov_len = sizeof(req_lib_cmap_adjust_int);
794 
795  error = qb_to_cs_error(qb_ipcc_sendv_recv(
796  cmap_inst->c,
797  &iov,
798  1,
800  sizeof (struct res_lib_cmap_adjust_int), CS_IPC_TIMEOUT_MS));
801 
802  if (error == CS_OK) {
803  error = res_lib_cmap_adjust_int.header.error;
804  }
805 
806  (void)hdb_handle_put (&cmap_handle_t_db, handle);
807 
808  return (error);
809 }
810 
811 cs_error_t cmap_inc(cmap_handle_t handle, const char *key_name)
812 {
813 
814  return (cmap_adjust_int(handle, key_name, 1));
815 }
816 
817 cs_error_t cmap_dec(cmap_handle_t handle, const char *key_name)
818 {
819 
820  return (cmap_adjust_int(handle, key_name, -1));
821 }
822 
824  cmap_handle_t handle,
825  const char *prefix,
826  cmap_iter_handle_t *cmap_iter_handle)
827 {
828  cs_error_t error;
829  struct iovec iov;
830  struct cmap_inst *cmap_inst;
833 
834  if (cmap_iter_handle == NULL) {
835  return (CS_ERR_INVALID_PARAM);
836  }
837 
838  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
839  if (error != CS_OK) {
840  return (error);
841  }
842 
843  memset(&req_lib_cmap_iter_init, 0, sizeof(req_lib_cmap_iter_init));
844  req_lib_cmap_iter_init.header.size = sizeof(req_lib_cmap_iter_init);
846 
847  if (prefix) {
848  if (strlen(prefix) >= CS_MAX_NAME_LENGTH) {
849  return (CS_ERR_NAME_TOO_LONG);
850  }
851  memcpy(req_lib_cmap_iter_init.prefix.value, prefix, strlen(prefix));
852  req_lib_cmap_iter_init.prefix.length = strlen(prefix);
853  }
854 
855  iov.iov_base = (char *)&req_lib_cmap_iter_init;
856  iov.iov_len = sizeof(req_lib_cmap_iter_init);
857 
858  error = qb_to_cs_error(qb_ipcc_sendv_recv(
859  cmap_inst->c,
860  &iov,
861  1,
863  sizeof (struct res_lib_cmap_iter_init), CS_IPC_TIMEOUT_MS));
864 
865  if (error == CS_OK) {
866  error = res_lib_cmap_iter_init.header.error;
867  }
868 
869  if (error == CS_OK) {
870  *cmap_iter_handle = res_lib_cmap_iter_init.iter_handle;
871  }
872 
873  (void)hdb_handle_put (&cmap_handle_t_db, handle);
874 
875  return (error);
876 }
877 
879  cmap_handle_t handle,
880  cmap_iter_handle_t iter_handle,
881  char key_name[],
882  size_t *value_len,
884 {
885  cs_error_t error;
886  struct iovec iov;
887  struct cmap_inst *cmap_inst;
890 
891  if (key_name == NULL) {
892  return (CS_ERR_INVALID_PARAM);
893  }
894 
895  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
896  if (error != CS_OK) {
897  return (error);
898  }
899 
900  memset(&req_lib_cmap_iter_next, 0, sizeof(req_lib_cmap_iter_next));
901  req_lib_cmap_iter_next.header.size = sizeof(req_lib_cmap_iter_next);
903  req_lib_cmap_iter_next.iter_handle = iter_handle;
904 
905  iov.iov_base = (char *)&req_lib_cmap_iter_next;
906  iov.iov_len = sizeof(req_lib_cmap_iter_next);
907 
908  error = qb_to_cs_error(qb_ipcc_sendv_recv(
909  cmap_inst->c,
910  &iov,
911  1,
913  sizeof (struct res_lib_cmap_iter_next), CS_IPC_TIMEOUT_MS));
914 
915  if (error == CS_OK) {
916  error = res_lib_cmap_iter_next.header.error;
917  }
918 
919  if (error == CS_OK) {
920  memcpy(key_name, (const char *)res_lib_cmap_iter_next.key_name.value,
921  res_lib_cmap_iter_next.key_name.length);
922  key_name[res_lib_cmap_iter_next.key_name.length] = '\0';
923 
924  if (value_len != NULL) {
925  *value_len = res_lib_cmap_iter_next.value_len;
926  }
927 
928  if (type != NULL) {
930  }
931  }
932 
933  (void)hdb_handle_put (&cmap_handle_t_db, handle);
934 
935  return (error);
936 }
937 
939  cmap_handle_t handle,
940  cmap_iter_handle_t iter_handle)
941 {
942  cs_error_t error;
943  struct iovec iov;
944  struct cmap_inst *cmap_inst;
947 
948  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
949  if (error != CS_OK) {
950  return (error);
951  }
952 
956  req_lib_cmap_iter_finalize.iter_handle = iter_handle;
957 
958  iov.iov_base = (char *)&req_lib_cmap_iter_finalize;
959  iov.iov_len = sizeof(req_lib_cmap_iter_finalize);
960 
961  error = qb_to_cs_error(qb_ipcc_sendv_recv(
962  cmap_inst->c,
963  &iov,
964  1,
967 
968  if (error == CS_OK) {
969  error = res_lib_cmap_iter_finalize.header.error;
970  }
971 
972  (void)hdb_handle_put (&cmap_handle_t_db, handle);
973 
974  return (error);
975 }
976 
978  cmap_handle_t handle,
979  const char *key_name,
980  int32_t track_type,
981  cmap_notify_fn_t notify_fn,
982  void *user_data,
983  cmap_track_handle_t *cmap_track_handle)
984 {
985  cs_error_t error;
986  struct iovec iov;
987  struct cmap_inst *cmap_inst;
991  cmap_track_handle_t cmap_track_inst_handle;
992 
993  if (cmap_track_handle == NULL || notify_fn == NULL) {
994  return (CS_ERR_INVALID_PARAM);
995  }
996 
997  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
998  if (error != CS_OK) {
999  return (error);
1000  }
1001 
1002  error = hdb_error_to_cs(hdb_handle_create(&cmap_track_handle_t_db,
1003  sizeof(*cmap_track_inst), &cmap_track_inst_handle));
1004  if (error != CS_OK) {
1005  goto error_put;
1006  }
1007 
1008  error = hdb_error_to_cs(hdb_handle_get(&cmap_track_handle_t_db,
1009  cmap_track_inst_handle, (void *)&cmap_track_inst));
1010  if (error != CS_OK) {
1011  goto error_put_destroy;
1012  }
1013 
1017 
1018  memset(&req_lib_cmap_track_add, 0, sizeof(req_lib_cmap_track_add));
1019  req_lib_cmap_track_add.header.size = sizeof(req_lib_cmap_track_add);
1021 
1022  if (key_name) {
1023  if (strlen(key_name) >= CS_MAX_NAME_LENGTH) {
1024  return (CS_ERR_NAME_TOO_LONG);
1025  }
1026  memcpy(req_lib_cmap_track_add.key_name.value, key_name, strlen(key_name));
1027  req_lib_cmap_track_add.key_name.length = strlen(key_name);
1028  }
1029 
1030  req_lib_cmap_track_add.track_type = track_type;
1031  req_lib_cmap_track_add.track_inst_handle = cmap_track_inst_handle;
1032 
1033  iov.iov_base = (char *)&req_lib_cmap_track_add;
1034  iov.iov_len = sizeof(req_lib_cmap_track_add);
1035 
1036  error = qb_to_cs_error(qb_ipcc_sendv_recv(
1037  cmap_inst->c,
1038  &iov,
1039  1,
1041  sizeof (struct res_lib_cmap_track_add), CS_IPC_TIMEOUT_MS));
1042 
1043  if (error == CS_OK) {
1044  error = res_lib_cmap_track_add.header.error;
1045  }
1046 
1047  if (error == CS_OK) {
1048  *cmap_track_handle = res_lib_cmap_track_add.track_handle;
1049  cmap_track_inst->track_handle = *cmap_track_handle;
1050  }
1051 
1052  (void)hdb_handle_put (&cmap_track_handle_t_db, cmap_track_inst_handle);
1053 
1054  (void)hdb_handle_put (&cmap_handle_t_db, handle);
1055 
1056  return (error);
1057 
1058 error_put_destroy:
1059  (void)hdb_handle_put (&cmap_track_handle_t_db, cmap_track_inst_handle);
1060  (void)hdb_handle_destroy (&cmap_track_handle_t_db, cmap_track_inst_handle);
1061 
1062 error_put:
1063  (void)hdb_handle_put (&cmap_handle_t_db, handle);
1064 
1065  return (error);
1066 }
1067 
1069  cmap_handle_t handle,
1071 {
1072  cs_error_t error;
1073  struct iovec iov;
1074  struct cmap_inst *cmap_inst;
1078 
1079  error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
1080  if (error != CS_OK) {
1081  return (error);
1082  }
1083 
1087  req_lib_cmap_track_delete.track_handle = track_handle;
1088 
1089  iov.iov_base = (char *)&req_lib_cmap_track_delete;
1090  iov.iov_len = sizeof(req_lib_cmap_track_delete);
1091 
1092  error = qb_to_cs_error(qb_ipcc_sendv_recv(
1093  cmap_inst->c,
1094  &iov,
1095  1,
1097  sizeof (struct res_lib_cmap_track_delete), CS_IPC_TIMEOUT_MS));
1098 
1099  if (error == CS_OK) {
1100  error = res_lib_cmap_track_delete.header.error;
1101  }
1102 
1103  if (error == CS_OK) {
1104  error = hdb_error_to_cs(hdb_handle_get(&cmap_track_handle_t_db,
1105  res_lib_cmap_track_delete.track_inst_handle,
1106  (void *)&cmap_track_inst));
1107  if (error != CS_OK) {
1108  goto error_put;
1109  }
1110 
1111  (void)hdb_handle_put(&cmap_track_handle_t_db, res_lib_cmap_track_delete.track_inst_handle);
1112  (void)hdb_handle_destroy(&cmap_track_handle_t_db, res_lib_cmap_track_delete.track_inst_handle);
1113  }
1114 
1115 error_put:
1116  (void)hdb_handle_put (&cmap_handle_t_db, handle);
1117 
1118  return (error);
1119 }
cs_dispatch_flags_t
The cs_dispatch_flags_t enum.
Definition: corotypes.h:84
@ CS_DISPATCH_ONE
Definition: corotypes.h:85
@ CS_DISPATCH_ONE_NONBLOCKING
Definition: corotypes.h:88
@ CS_DISPATCH_ALL
Definition: corotypes.h:86
cs_error_t qb_to_cs_error(int result)
qb_to_cs_error
#define CS_MAX_NAME_LENGTH
Definition: corotypes.h:55
cs_error_t
The cs_error_t enum.
Definition: corotypes.h:98
@ CS_ERR_NAME_TOO_LONG
Definition: corotypes.h:111
@ CS_ERR_NO_MEMORY
Definition: corotypes.h:106
@ CS_ERR_BAD_HANDLE
Definition: corotypes.h:107
@ CS_ERR_TRY_AGAIN
Definition: corotypes.h:104
@ CS_OK
Definition: corotypes.h:99
@ CS_ERR_INVALID_PARAM
Definition: corotypes.h:105
@ CS_ERR_LIBRARY
Definition: corotypes.h:100
#define CS_IPC_TIMEOUT_MS
Definition: corotypes.h:131
uint32_t value
cmap_map_t
Definition: cmap.h:107
cs_error_t cmap_context_set(cmap_handle_t handle, const void *context)
cmap_context_set
Definition: lib/cmap.c:371
cmap_value_types_t
Possible types of value.
Definition: cmap.h:92
uint64_t cmap_iter_handle_t
Definition: cmap.h:59
cs_error_t cmap_set_int8(cmap_handle_t handle, const char *key_name, int8_t value)
Definition: lib/cmap.c:447
cs_error_t cmap_get_double(cmap_handle_t handle, const char *key_name, double *dbl)
Definition: lib/cmap.c:721
cs_error_t cmap_get_int64(cmap_handle_t handle, const char *key_name, int64_t *i64)
Definition: lib/cmap.c:703
cs_error_t cmap_finalize(cmap_handle_t handle)
Close the cmap handle.
Definition: lib/cmap.c:173
cs_error_t cmap_set_uint32(cmap_handle_t handle, const char *key_name, uint32_t value)
Definition: lib/cmap.c:472
cs_error_t cmap_iter_next(cmap_handle_t handle, cmap_iter_handle_t iter_handle, char key_name[], size_t *value_len, cmap_value_types_t *type)
Return next item in iterator iter.
Definition: lib/cmap.c:878
cs_error_t cmap_inc(cmap_handle_t handle, const char *key_name)
Increment value of key_name if it is [u]int* type.
Definition: lib/cmap.c:811
cs_error_t cmap_set_uint8(cmap_handle_t handle, const char *key_name, uint8_t value)
Definition: lib/cmap.c:452
cs_error_t cmap_get_float(cmap_handle_t handle, const char *key_name, float *flt)
Definition: lib/cmap.c:715
cs_error_t cmap_track_add(cmap_handle_t handle, const char *key_name, int32_t track_type, cmap_notify_fn_t notify_fn, void *user_data, cmap_track_handle_t *cmap_track_handle)
Add tracking function for given key_name.
Definition: lib/cmap.c:977
uint64_t cmap_handle_t
Definition: cmap.h:54
uint64_t cmap_track_handle_t
Definition: cmap.h:64
cs_error_t cmap_context_get(cmap_handle_t handle, const void **context)
cmap_context_get
Definition: lib/cmap.c:352
cs_error_t cmap_dec(cmap_handle_t handle, const char *key_name)
Decrement value of key_name if it is [u]int* type.
Definition: lib/cmap.c:817
cs_error_t cmap_get_uint64(cmap_handle_t handle, const char *key_name, uint64_t *u64)
Definition: lib/cmap.c:709
cs_error_t cmap_delete(cmap_handle_t handle, const char *key_name)
Deletes key from cmap database.
Definition: lib/cmap.c:507
cs_error_t cmap_get_int16(cmap_handle_t handle, const char *key_name, int16_t *i16)
Definition: lib/cmap.c:679
cs_error_t cmap_get(cmap_handle_t handle, const char *key_name, void *value, size_t *value_len, cmap_value_types_t *type)
Retrieve value of key key_name and store it in user preallocated value pointer.
Definition: lib/cmap.c:553
cs_error_t cmap_fd_get(cmap_handle_t handle, int *fd)
Get a file descriptor on which to poll.
Definition: lib/cmap.c:212
cs_error_t cmap_initialize(cmap_handle_t *handle)
Create a new cmap connection.
Definition: lib/cmap.c:89
cs_error_t cmap_set_int32(cmap_handle_t handle, const char *key_name, int32_t value)
Definition: lib/cmap.c:467
cs_error_t cmap_get_uint32(cmap_handle_t handle, const char *key_name, uint32_t *u32)
Definition: lib/cmap.c:697
cs_error_t cmap_get_uint8(cmap_handle_t handle, const char *key_name, uint8_t *u8)
Definition: lib/cmap.c:673
cs_error_t cmap_dispatch(cmap_handle_t handle, cs_dispatch_flags_t dispatch_types)
Dispatch data from service.
Definition: lib/cmap.c:229
cs_error_t cmap_set_uint16(cmap_handle_t handle, const char *key_name, uint16_t value)
Definition: lib/cmap.c:462
cs_error_t cmap_set_int16(cmap_handle_t handle, const char *key_name, int16_t value)
Definition: lib/cmap.c:457
cs_error_t cmap_track_delete(cmap_handle_t handle, cmap_track_handle_t track_handle)
Delete track created previously by cmap_track_add.
Definition: lib/cmap.c:1068
cs_error_t cmap_get_string(cmap_handle_t handle, const char *key_name, char **str)
Shortcut for cmap_get for string type.
Definition: lib/cmap.c:727
cs_error_t cmap_iter_finalize(cmap_handle_t handle, cmap_iter_handle_t iter_handle)
Finalize iterator.
Definition: lib/cmap.c:938
cs_error_t cmap_initialize_map(cmap_handle_t *handle, cmap_map_t map)
Create a new cmap connection on a specified map.
Definition: lib/cmap.c:124
cs_error_t cmap_iter_init(cmap_handle_t handle, const char *prefix, cmap_iter_handle_t *cmap_iter_handle)
Initialize iterator with given prefix.
Definition: lib/cmap.c:823
void(* cmap_notify_fn_t)(cmap_handle_t cmap_handle, cmap_track_handle_t cmap_track_handle, int32_t event, const char *key_name, struct cmap_notify_value new_value, struct cmap_notify_value old_value, void *user_data)
Prototype for notify callback function.
Definition: cmap.h:129
cs_error_t cmap_set(cmap_handle_t handle, const char *key_name, const void *value, size_t value_len, cmap_value_types_t type)
Store value in cmap.
Definition: lib/cmap.c:390
cs_error_t cmap_set_string(cmap_handle_t handle, const char *key_name, const char *value)
Definition: lib/cmap.c:497
cs_error_t cmap_get_uint16(cmap_handle_t handle, const char *key_name, uint16_t *u16)
Definition: lib/cmap.c:685
cs_error_t cmap_get_int8(cmap_handle_t handle, const char *key_name, int8_t *i8)
Definition: lib/cmap.c:667
cs_error_t cmap_set_int64(cmap_handle_t handle, const char *key_name, int64_t value)
Definition: lib/cmap.c:477
cs_error_t cmap_set_double(cmap_handle_t handle, const char *key_name, double value)
Definition: lib/cmap.c:492
cs_error_t cmap_set_float(cmap_handle_t handle, const char *key_name, float value)
Definition: lib/cmap.c:487
cs_error_t cmap_get_int32(cmap_handle_t handle, const char *key_name, int32_t *i32)
Definition: lib/cmap.c:691
cs_error_t cmap_set_uint64(cmap_handle_t handle, const char *key_name, uint64_t value)
Definition: lib/cmap.c:482
@ CMAP_VALUETYPE_UINT8
Definition: cmap.h:94
@ CMAP_VALUETYPE_UINT32
Definition: cmap.h:98
@ CMAP_VALUETYPE_INT8
Definition: cmap.h:93
@ CMAP_VALUETYPE_FLOAT
Definition: cmap.h:101
@ CMAP_VALUETYPE_UINT16
Definition: cmap.h:96
@ CMAP_VALUETYPE_UINT64
Definition: cmap.h:100
@ CMAP_VALUETYPE_STRING
Definition: cmap.h:103
@ CMAP_VALUETYPE_DOUBLE
Definition: cmap.h:102
@ CMAP_VALUETYPE_INT16
Definition: cmap.h:95
@ CMAP_VALUETYPE_INT32
Definition: cmap.h:97
@ CMAP_VALUETYPE_INT64
Definition: cmap.h:99
qb_handle_t hdb_handle_t
Definition: hdb.h:52
@ MESSAGE_REQ_CMAP_ITER_NEXT
Definition: ipc_cmap.h:51
@ MESSAGE_REQ_CMAP_SET
Definition: ipc_cmap.h:46
@ MESSAGE_REQ_CMAP_ITER_INIT
Definition: ipc_cmap.h:50
@ MESSAGE_REQ_CMAP_TRACK_DELETE
Definition: ipc_cmap.h:54
@ MESSAGE_REQ_CMAP_ADJUST_INT
Definition: ipc_cmap.h:49
@ MESSAGE_REQ_CMAP_GET
Definition: ipc_cmap.h:48
@ MESSAGE_REQ_CMAP_SET_CURRENT_MAP
Definition: ipc_cmap.h:55
@ MESSAGE_REQ_CMAP_ITER_FINALIZE
Definition: ipc_cmap.h:52
@ MESSAGE_REQ_CMAP_TRACK_ADD
Definition: ipc_cmap.h:53
@ MESSAGE_REQ_CMAP_DELETE
Definition: ipc_cmap.h:47
@ MESSAGE_RES_CMAP_NOTIFY_CALLBACK
Definition: ipc_cmap.h:71
DECLARE_HDB_DATABASE(cmap_handle_t_db, cmap_inst_free)
#define IPC_REQUEST_SIZE
Definition: lib/util.h:49
cs_error_t hdb_error_to_cs(int res)
#define IPC_DISPATCH_SIZE
Definition: lib/util.h:51
void * user_data
Definition: sam.c:127
int finalize
Definition: lib/cmap.c:57
const void * context
Definition: lib/cmap.c:59
qb_ipcc_connection_t * c
Definition: lib/cmap.c:58
Structure passed as new_value and old_value in change callback.
Definition: cmap.h:117
cmap_value_types_t type
Definition: cmap.h:118
const void * data
Definition: cmap.h:120
size_t len
Definition: cmap.h:119
cmap_notify_fn_t notify_fn
Definition: lib/cmap.c:64
qb_ipcc_connection_t * c
Definition: lib/cmap.c:65
void * user_data
Definition: lib/cmap.c:63
cmap_track_handle_t track_handle
Definition: lib/cmap.c:66
The req_lib_cmap_adjust_int struct.
Definition: ipc_cmap.h:135
The req_lib_cmap_delete struct.
Definition: ipc_cmap.h:101
The req_lib_cmap_get struct.
Definition: ipc_cmap.h:116
The req_lib_cmap_iter_finalize struct.
Definition: ipc_cmap.h:185
The req_lib_cmap_iter_init struct.
Definition: ipc_cmap.h:151
The req_lib_cmap_iter_next struct.
Definition: ipc_cmap.h:167
The req_lib_cmap_set_current_map struct used by cmap_initialize_map()
Definition: ipc_cmap.h:257
The req_lib_cmap_set struct.
Definition: ipc_cmap.h:83
The req_lib_cmap_track_add struct.
Definition: ipc_cmap.h:200
The req_lib_cmap_track_delete struct.
Definition: ipc_cmap.h:218
The res_lib_cmap_adjust_int struct.
Definition: ipc_cmap.h:144
The res_lib_cmap_delete struct.
Definition: ipc_cmap.h:109
The res_lib_cmap_get struct.
Definition: ipc_cmap.h:125
The res_lib_cmap_iter_finalize struct.
Definition: ipc_cmap.h:193
The res_lib_cmap_iter_init struct.
Definition: ipc_cmap.h:159
The res_lib_cmap_iter_next struct.
Definition: ipc_cmap.h:175
The res_lib_cmap_notify_callback struct.
Definition: ipc_cmap.h:234
The res_lib_cmap_set struct.
Definition: ipc_cmap.h:94
The res_lib_cmap_track_add struct.
Definition: ipc_cmap.h:210
The res_lib_cmap_track_delete struct.
Definition: ipc_cmap.h:226
char type
Definition: totem.h:2