38 #include <sys/types.h>
40 #include <sys/socket.h>
43 #include <netinet/in.h>
44 #include <arpa/inet.h>
58 #include <qb/qblist.h>
59 #include <qb/qbutil.h>
60 #define LOGSYS_UTILS_ONLY 1
101 const char **error_string,
108 struct qb_list_head
list;
134 static int read_config_file_into_icmap(
135 const char **error_string,
icmap_map_t config_map);
136 static char error_string_response[512];
138 static int uid_determine (
const char *req_user)
141 struct passwd passwd;
142 struct passwd* pwdptr = &passwd;
143 struct passwd* temp_pwd_pt;
149 id = strtol(req_user, &ep, 10);
150 if (*req_user !=
'\0' && *ep ==
'\0' &&
id >= 0 &&
id <= UINT_MAX) {
154 pwdlinelen = sysconf (_SC_GETPW_R_SIZE_MAX);
156 if (pwdlinelen == -1) {
160 pwdbuffer = malloc (pwdlinelen);
162 while ((rc = getpwnam_r (req_user, pwdptr, pwdbuffer, pwdlinelen, &temp_pwd_pt)) == ERANGE) {
166 if (pwdlinelen <= 32678) {
167 n = realloc (pwdbuffer, pwdlinelen);
176 sprintf (error_string_response,
"getpwnam_r(): %s", strerror(rc));
179 if (temp_pwd_pt == NULL) {
181 sprintf (error_string_response,
182 "The '%s' user is not found in /etc/passwd, please read the documentation.",
186 pw_uid = passwd.pw_uid;
192 static int gid_determine (
const char *req_group)
194 int corosync_gid = 0;
196 struct group * grpptr = &group;
197 struct group * temp_grp_pt;
203 id = strtol(req_group, &ep, 10);
204 if (*req_group !=
'\0' && *ep ==
'\0' &&
id >= 0 &&
id <= UINT_MAX) {
208 grplinelen = sysconf (_SC_GETGR_R_SIZE_MAX);
210 if (grplinelen == -1) {
214 grpbuffer = malloc (grplinelen);
216 while ((rc = getgrnam_r (req_group, grpptr, grpbuffer, grplinelen, &temp_grp_pt)) == ERANGE) {
220 if (grplinelen <= 32678) {
221 n = realloc (grpbuffer, grplinelen);
230 sprintf (error_string_response,
"getgrnam_r(): %s", strerror(rc));
233 if (temp_grp_pt == NULL) {
235 sprintf (error_string_response,
236 "The '%s' group is not found in /etc/group, please read the documentation.",
240 corosync_gid = group.gr_gid;
245 static char *strchr_rs (
const char *haystack,
int byte)
247 const char *end_address = strchr (haystack,
byte);
251 while (*end_address ==
' ' || *end_address ==
'\t')
255 return ((
char *) end_address);
260 if (read_config_file_into_icmap(error_string, config_map)) {
267 static char *remove_whitespace(
char *
string,
int remove_colon_and_brace)
273 while (*start ==
' ' || *start ==
'\t')
276 end = start+(strlen(start))-1;
277 while ((*end ==
' ' || *end ==
'\t' || (remove_colon_and_brace && (*end ==
':' || *end ==
'{'))) && end > start)
287 static int parse_section(FILE *fp,
291 const char **error_string,
303 static char formated_err[384];
304 const char *tmp_error_string;
306 if (strcmp(path,
"") == 0) {
310 tmp_error_string = NULL;
312 while (fgets (line,
sizeof (line), fp)) {
315 if (strlen(line) > 0) {
320 if ((line[strlen(line) - 1] !=
'\n') && !feof(fp)) {
321 tmp_error_string =
"Line too long";
325 if (line[strlen(line) - 1] ==
'\n')
326 line[strlen(line) - 1] =
'\0';
327 if (strlen (line) > 0 && line[strlen(line) - 1] ==
'\r')
328 line[strlen(line) - 1] =
'\0';
333 for (i = strlen (line) - 1; i > -1; i--) {
334 if (line[i] ==
'\t' || line[i] ==
' ') {
342 for (i = 0; i < strlen (line); i++) {
343 if (line[i] !=
'\t' && line[i] !=
' ') {
358 if ((loc = strchr_rs (line,
'{'))) {
364 section = remove_whitespace(line, 1);
365 after_section = remove_whitespace(loc, 0);
367 if (strcmp(section,
"") == 0) {
368 tmp_error_string =
"Missing section name before opening bracket '{'";
372 if (strcmp(after_section,
"") != 0) {
373 tmp_error_string =
"Extra characters after opening bracket '{'";
378 tmp_error_string =
"Start of section makes total cmap path too long";
381 strcpy(new_keyname, path);
382 if (strcmp(path,
"") != 0) {
383 strcat(new_keyname,
".");
385 strcat(new_keyname, section);
390 &tmp_error_string, config_map,
user_data)) {
394 if (parse_section(fp, fname, line_no, new_keyname, error_string, depth + 1, newstate,
402 if ((loc = strchr_rs (line,
':'))) {
407 key = remove_whitespace(line, 1);
408 value = remove_whitespace(loc, 0);
411 tmp_error_string =
"New key makes total cmap path too long";
414 strcpy(new_keyname, path);
415 if (strcmp(path,
"") != 0) {
416 strcat(new_keyname,
".");
418 strcat(new_keyname, key);
428 if (strchr_rs (line,
'}')) {
430 trimmed_line = remove_whitespace(line, 0);
432 if (strcmp(trimmed_line,
"}") != 0) {
433 tmp_error_string =
"Extra characters before or after closing bracket '}'";
438 tmp_error_string =
"Unexpected closing brace";
454 tmp_error_string =
"Line is not opening or closing section or key value";
458 if (strcmp(path,
"") != 0) {
459 tmp_error_string =
"Missing closing brace";
463 if (strcmp(path,
"") == 0) {
470 if (snprintf(formated_err,
sizeof(formated_err),
"parser error: %s:%u: %s", fname, *line_no,
471 tmp_error_string) >=
sizeof(formated_err)) {
472 *error_string =
"Can't format parser error message";
474 *error_string = formated_err;
480 static int safe_atoq_range(
icmap_value_types_t value_type,
long long int *min_val,
long long int *max_val)
482 switch (value_type) {
504 long long int min_val, max_val;
509 val = strtoll(str, &endptr, 10);
510 if (errno == ERANGE) {
518 if (*endptr !=
'\0') {
522 if (safe_atoq_range(target_type, &min_val, &max_val) != 0) {
526 if (val < min_val || val > max_val) {
534 static int str_to_ull(
const char *str,
unsigned long long int *res)
536 unsigned long long int val;
541 val = strtoull(str, &endptr, 10);
542 if (errno == ERANGE) {
550 if (*endptr !=
'\0') {
558 static int main_config_parser_cb(
const char *path,
563 const char **error_string,
569 long long int min_val, max_val;
571 unsigned long long int ull;
574 static char formated_err[256];
577 struct qb_list_head *iter, *tmp_iter;
586 if (strlen(path) >=
sizeof(key_name)) {
587 if (snprintf(formated_err,
sizeof(formated_err),
588 "Can't store path \"%s\" into key_name", path) >=
sizeof(formated_err)) {
589 *error_string =
"Can't format path into key_name error message";
591 *error_string = formated_err;
599 strncpy(key_name, path,
sizeof(key_name) - 1);
615 if ((strcmp(path,
"pload.count") == 0) ||
616 (strcmp(path,
"pload.size") == 0)) {
618 if (safe_atoq(
value, &val, val_type) != 0) {
622 goto icmap_set_error;
628 if ((strcmp(path,
"quorum.expected_votes") == 0) ||
629 (strcmp(path,
"quorum.votes") == 0) ||
630 (strcmp(path,
"quorum.last_man_standing_window") == 0) ||
631 (strcmp(path,
"quorum.leaving_timeout") == 0)) {
633 if (safe_atoq(
value, &val, val_type) != 0) {
637 goto icmap_set_error;
642 if ((strcmp(path,
"quorum.two_node") == 0) ||
643 (strcmp(path,
"quorum.expected_votes_tracking") == 0) ||
644 (strcmp(path,
"quorum.allow_downscale") == 0) ||
645 (strcmp(path,
"quorum.wait_for_all") == 0) ||
646 (strcmp(path,
"quorum.auto_tie_breaker") == 0) ||
647 (strcmp(path,
"quorum.last_man_standing") == 0)) {
649 if (safe_atoq(
value, &val, val_type) != 0) {
653 goto icmap_set_error;
659 if ((strcmp(path,
"quorum.device.timeout") == 0) ||
660 (strcmp(path,
"quorum.device.sync_timeout") == 0) ||
661 (strcmp(path,
"quorum.device.votes") == 0)) {
663 if (safe_atoq(
value, &val, val_type) != 0) {
667 goto icmap_set_error;
671 if ((strcmp(path,
"quorum.device.master_wins") == 0)) {
673 if (safe_atoq(
value, &val, val_type) != 0) {
677 goto icmap_set_error;
683 if ((strcmp(path,
"totem.version") == 0) ||
684 (strcmp(path,
"totem.nodeid") == 0) ||
685 (strcmp(path,
"totem.threads") == 0) ||
686 (strcmp(path,
"totem.token") == 0) ||
687 (strcmp(path,
"totem.token_coefficient") == 0) ||
688 (strcmp(path,
"totem.token_retransmit") == 0) ||
689 (strcmp(path,
"totem.token_warning") == 0) ||
690 (strcmp(path,
"totem.hold") == 0) ||
691 (strcmp(path,
"totem.token_retransmits_before_loss_const") == 0) ||
692 (strcmp(path,
"totem.join") == 0) ||
693 (strcmp(path,
"totem.send_join") == 0) ||
694 (strcmp(path,
"totem.consensus") == 0) ||
695 (strcmp(path,
"totem.merge") == 0) ||
696 (strcmp(path,
"totem.downcheck") == 0) ||
697 (strcmp(path,
"totem.fail_recv_const") == 0) ||
698 (strcmp(path,
"totem.seqno_unchanged_const") == 0) ||
699 (strcmp(path,
"totem.rrp_token_expired_timeout") == 0) ||
700 (strcmp(path,
"totem.rrp_problem_count_timeout") == 0) ||
701 (strcmp(path,
"totem.rrp_problem_count_threshold") == 0) ||
702 (strcmp(path,
"totem.rrp_problem_count_mcast_threshold") == 0) ||
703 (strcmp(path,
"totem.rrp_autorecovery_check_timeout") == 0) ||
704 (strcmp(path,
"totem.heartbeat_failures_allowed") == 0) ||
705 (strcmp(path,
"totem.max_network_delay") == 0) ||
706 (strcmp(path,
"totem.window_size") == 0) ||
707 (strcmp(path,
"totem.max_messages") == 0) ||
708 (strcmp(path,
"totem.miss_count_const") == 0) ||
709 (strcmp(path,
"totem.knet_pmtud_interval") == 0) ||
710 (strcmp(path,
"totem.knet_compression_threshold") == 0) ||
711 (strcmp(path,
"totem.netmtu") == 0)) {
713 if (safe_atoq(
value, &val, val_type) != 0) {
717 goto icmap_set_error;
721 if (strcmp(path,
"totem.knet_compression_level") == 0) {
723 if (safe_atoq(
value, &val, val_type) != 0) {
727 goto icmap_set_error;
731 if (strcmp(path,
"totem.config_version") == 0) {
732 if (str_to_ull(
value, &ull) != 0) {
736 goto icmap_set_error;
740 if (strcmp(path,
"totem.ip_version") == 0) {
741 if ((strcmp(
value,
"ipv4") != 0) &&
742 (strcmp(
value,
"ipv6") != 0) &&
743 (strcmp(
value,
"ipv6-4") != 0) &&
744 (strcmp(
value,
"ipv4-6") != 0)) {
745 *error_string =
"Invalid ip_version type";
750 if (strcmp(path,
"totem.crypto_model") == 0) {
751 if ((strcmp(
value,
"nss") != 0) &&
752 (strcmp(
value,
"openssl") != 0)) {
753 *error_string =
"Invalid crypto model. "
754 "Should be nss or openssl";
759 if (strcmp(path,
"totem.crypto_cipher") == 0) {
760 if ((strcmp(
value,
"none") != 0) &&
761 (strcmp(
value,
"aes256") != 0) &&
762 (strcmp(
value,
"aes192") != 0) &&
763 (strcmp(
value,
"aes128") != 0)) {
764 *error_string =
"Invalid cipher type. "
765 "Should be none, aes256, aes192 or aes128";
770 if (strcmp(path,
"totem.crypto_hash") == 0) {
771 if ((strcmp(
value,
"none") != 0) &&
772 (strcmp(
value,
"md5") != 0) &&
773 (strcmp(
value,
"sha1") != 0) &&
774 (strcmp(
value,
"sha256") != 0) &&
775 (strcmp(
value,
"sha384") != 0) &&
776 (strcmp(
value,
"sha512") != 0)) {
777 *error_string =
"Invalid hash type. "
778 "Should be none, md5, sha1, sha256, sha384 or sha512";
786 if (strcmp(path,
"system.qb_ipc_type") == 0) {
787 if ((strcmp(
value,
"native") != 0) &&
788 (strcmp(
value,
"shm") != 0) &&
789 (strcmp(
value,
"socket") != 0)) {
790 *error_string =
"Invalid system.qb_ipc_type";
795 if (strcmp(path,
"system.sched_rr") == 0) {
796 if ((strcmp(
value,
"yes") != 0) &&
797 (strcmp(
value,
"no") != 0)) {
798 *error_string =
"Invalid system.sched_rr value";
803 if (strcmp(path,
"system.move_to_root_cgroup") == 0) {
804 if ((strcmp(
value,
"yes") != 0) &&
805 (strcmp(
value,
"no") != 0)) {
806 *error_string =
"Invalid system.move_to_root_cgroup";
811 if (strcmp(path,
"system.allow_knet_handle_fallback") == 0) {
812 if ((strcmp(
value,
"yes") != 0) &&
813 (strcmp(
value,
"no") != 0)) {
814 *error_string =
"Invalid system.allow_knet_handle_fallback";
822 if (strcmp(path,
"totem.interface.linknumber") == 0) {
824 if (safe_atoq(
value, &val, val_type) != 0) {
831 if (strcmp(path,
"totem.interface.bindnetaddr") == 0) {
835 if (strcmp(path,
"totem.interface.mcastaddr") == 0) {
839 if (strcmp(path,
"totem.interface.broadcast") == 0) {
843 if (strcmp(path,
"totem.interface.mcastport") == 0) {
845 if (safe_atoq(
value, &val, val_type) != 0) {
851 if (strcmp(path,
"totem.interface.ttl") == 0) {
853 if (safe_atoq(
value, &val, val_type) != 0) {
859 if (strcmp(path,
"totem.interface.knet_link_priority") == 0) {
861 if (safe_atoq(
value, &val, val_type) != 0) {
867 if (strcmp(path,
"totem.interface.knet_ping_interval") == 0) {
869 if (safe_atoq(
value, &val, val_type) != 0) {
875 if (strcmp(path,
"totem.interface.knet_ping_timeout") == 0) {
877 if (safe_atoq(
value, &val, val_type) != 0) {
883 if (strcmp(path,
"totem.interface.knet_ping_precision") == 0) {
885 if (safe_atoq(
value, &val, val_type) != 0) {
891 if (strcmp(path,
"totem.interface.knet_pong_count") == 0) {
893 if (safe_atoq(
value, &val, val_type) != 0) {
899 if (strcmp(path,
"totem.interface.knet_transport") == 0) {
906 if (strcmp(key,
"subsys") == 0) {
908 if (data->
subsys == NULL) {
909 *error_string =
"Can't alloc memory";
914 kv_item = malloc(
sizeof(*kv_item));
915 if (kv_item == NULL) {
916 *error_string =
"Can't alloc memory";
920 memset(kv_item, 0,
sizeof(*kv_item));
922 kv_item->
key = strdup(key);
924 if (kv_item->
key == NULL || kv_item->
value == NULL) {
926 *error_string =
"Can't alloc memory";
930 qb_list_init(&kv_item->
list);
936 if (strcmp(key,
"subsys") == 0) {
938 if (data->
subsys == NULL) {
939 *error_string =
"Can't alloc memory";
943 }
else if (strcmp(key,
"name") == 0) {
946 *error_string =
"Can't alloc memory";
951 kv_item = malloc(
sizeof(*kv_item));
952 if (kv_item == NULL) {
953 *error_string =
"Can't alloc memory";
957 memset(kv_item, 0,
sizeof(*kv_item));
959 kv_item->
key = strdup(key);
961 if (kv_item->
key == NULL || kv_item->
value == NULL) {
963 *error_string =
"Can't alloc memory";
967 qb_list_init(&kv_item->
list);
973 if (strcmp(key,
"uid") == 0) {
974 uid = uid_determine(
value);
976 *error_string = error_string_response;
982 goto icmap_set_error;
985 }
else if (strcmp(key,
"gid") == 0) {
986 gid = gid_determine(
value);
988 *error_string = error_string_response;
994 goto icmap_set_error;
998 *error_string =
"uidgid: Only uid and gid are allowed items";
1003 if (strcmp(key,
"memberaddr") != 0) {
1004 *error_string =
"Only memberaddr is allowed in member section";
1009 kv_item = malloc(
sizeof(*kv_item));
1010 if (kv_item == NULL) {
1011 *error_string =
"Can't alloc memory";
1015 memset(kv_item, 0,
sizeof(*kv_item));
1017 kv_item->
key = strdup(key);
1019 if (kv_item->
key == NULL || kv_item->
value == NULL) {
1021 *error_string =
"Can't alloc memory";
1025 qb_list_init(&kv_item->
list);
1033 if ((strcmp(key,
"nodeid") == 0) ||
1034 (strcmp(key,
"quorum_votes") == 0)) {
1036 if (safe_atoq(
value, &val, val_type) != 0) {
1041 goto icmap_set_error;
1046 if (add_as_string) {
1048 goto icmap_set_error;
1054 if (strcmp(key,
"watchdog_timeout") == 0) {
1056 if (safe_atoq(
value, &val, val_type) != 0) {
1060 goto icmap_set_error;
1067 if (strcmp(key,
"poll_period") == 0) {
1068 if (str_to_ull(
value, &ull) != 0) {
1072 goto icmap_set_error;
1079 if (strcmp(key,
"poll_period") == 0) {
1080 if (str_to_ull(
value, &ull) != 0) {
1084 goto icmap_set_error;
1091 if (add_as_string) {
1093 goto icmap_set_error;
1098 if (strcmp(path,
"totem.interface") == 0) {
1111 if (strcmp(path,
"totem") == 0) {
1114 if (strcmp(path,
"system") == 0) {
1117 if (strcmp(path,
"logging.logger_subsys") == 0) {
1122 if (strcmp(path,
"logging.logging_daemon") == 0) {
1128 if (strcmp(path,
"uidgid") == 0) {
1131 if (strcmp(path,
"totem.interface.member") == 0) {
1134 if (strcmp(path,
"quorum") == 0) {
1137 if (strcmp(path,
"quorum.device") == 0) {
1140 if (strcmp(path,
"nodelist") == 0) {
1144 if (strcmp(path,
"nodelist.node") == 0) {
1147 if (strcmp(path,
"resources") == 0) {
1150 if (strcmp(path,
"resources.system") == 0) {
1153 if (strcmp(path,
"resources.system.memory_used") == 0) {
1156 if (strcmp(path,
"resources.process") == 0) {
1159 if (strcmp(path,
"resources.process.memory_used") == 0) {
1177 if (cs_err !=
CS_OK) {
1178 goto icmap_set_error;
1190 if (cs_err !=
CS_OK) {
1191 goto icmap_set_error;
1203 if (cs_err !=
CS_OK) {
1204 goto icmap_set_error;
1213 goto icmap_set_error;
1217 if (data->
ttl > -1) {
1221 goto icmap_set_error;
1229 goto icmap_set_error;
1237 goto icmap_set_error;
1245 goto icmap_set_error;
1253 goto icmap_set_error;
1261 goto icmap_set_error;
1270 if (cs_err !=
CS_OK) {
1271 goto icmap_set_error;
1284 free(kv_item->
value);
1289 if (cs_err !=
CS_OK) {
1290 goto icmap_set_error;
1296 if (data->
subsys == NULL) {
1297 *error_string =
"No subsys key in logger_subsys directive";
1309 free(kv_item->
value);
1313 if (cs_err !=
CS_OK) {
1314 goto icmap_set_error;
1324 if (cs_err !=
CS_OK) {
1325 goto icmap_set_error;
1330 *error_string =
"No name key in logging_daemon directive";
1338 if (data->
subsys == NULL) {
1345 "logging.logging_daemon.%s.%s",
1351 "logging.logger_subsys.%s.%s",
1356 "logging.logging_daemon.%s.%s.%s",
1363 free(kv_item->
value);
1367 if (cs_err !=
CS_OK) {
1368 goto icmap_set_error;
1372 if (data->
subsys == NULL) {
1389 if (cs_err !=
CS_OK) {
1393 goto icmap_set_error;
1404 if (cs_err !=
CS_OK) {
1405 goto icmap_set_error;
1443 min_val = max_val = 0;
1448 assert(safe_atoq_range(val_type, &min_val, &max_val) == 0);
1450 if (snprintf(formated_err,
sizeof(formated_err),
1451 "Value of key \"%s\" is expected to be integer in range (%lld..%lld), but \"%s\" was given",
1452 key_name, min_val, max_val,
value) >=
sizeof(formated_err)) {
1453 *error_string =
"Can't format parser error message";
1455 *error_string = formated_err;
1461 if (snprintf(formated_err,
sizeof(formated_err),
1462 "Can't store key \"%s\" into icmap, returned error is %s",
1463 key_name,
cs_strerror(cs_err)) >=
sizeof(formated_err)) {
1464 *error_string =
"Can't format parser error message";
1466 *error_string = formated_err;
1472 static int uidgid_config_parser_cb(
const char *path,
1477 const char **error_string,
1483 static char formated_err[256];
1492 if (strcmp(path,
"uidgid.uid") == 0) {
1493 uid = uid_determine(
value);
1495 *error_string = error_string_response;
1501 goto icmap_set_error;
1503 }
else if (strcmp(path,
"uidgid.gid") == 0) {
1504 gid = gid_determine(
value);
1506 *error_string = error_string_response;
1512 goto icmap_set_error;
1515 *error_string =
"uidgid: Only uid and gid are allowed items";
1520 if (strcmp(path,
"uidgid") != 0) {
1521 *error_string =
"uidgid: Can't add subsection different than uidgid";
1532 if (snprintf(formated_err,
sizeof(formated_err),
1533 "Can't store key \"%s\" into icmap, returned error is %s",
1534 key_name,
cs_strerror(cs_err)) >=
sizeof(formated_err)) {
1535 *error_string =
"Can't format parser error message";
1537 *error_string = formated_err;
1543 static int read_uidgid_files_into_icmap(
1544 const char **error_string,
1550 struct dirent *dirent;
1551 char filename[PATH_MAX + FILENAME_MAX + 1];
1552 char uidgid_dirname[PATH_MAX + FILENAME_MAX + 1];
1554 struct stat stat_buf;
1562 res = snprintf(filename,
sizeof(filename),
"%s",
1564 if (res >=
sizeof(filename)) {
1565 *error_string =
"uidgid.d path too long";
1570 dirname_res = dirname(filename);
1572 res = snprintf(uidgid_dirname,
sizeof(uidgid_dirname),
"%s/%s",
1573 dirname_res,
"uidgid.d");
1574 if (res >=
sizeof(uidgid_dirname)) {
1575 *error_string =
"uidgid.d path too long";
1580 dp = opendir (uidgid_dirname);
1585 for (dirent = readdir(dp);
1587 dirent = readdir(dp)) {
1589 res = snprintf(filename,
sizeof (filename),
"%s/%s", uidgid_dirname, dirent->d_name);
1590 if (res >=
sizeof(filename)) {
1592 *error_string =
"uidgid.d dirname path too long";
1596 res = stat (filename, &stat_buf);
1597 if (res == 0 && S_ISREG(stat_buf.st_mode)) {
1599 fp = fopen (filename,
"r");
1600 if (fp == NULL)
continue;
1605 res = parse_section(fp, filename, &line_no, key_name, error_string, 0, state,
1606 uidgid_config_parser_cb, config_map, NULL);
1623 static int read_config_file_into_icmap(
1624 const char **error_string,
1628 const char *filename;
1629 char *error_reason = error_string_response;
1638 fp = fopen (filename,
"r");
1640 char error_str[100];
1641 const char *error_ptr = qb_strerror_r(errno, error_str,
sizeof(error_str));
1642 snprintf (error_reason,
sizeof(error_string_response),
1643 "Can't read file %s: %s",
1644 filename, error_ptr);
1645 *error_string = error_reason;
1652 res = parse_section(fp, filename, &line_no, key_name, error_string, 0, state,
1653 main_config_parser_cb, config_map, &data);
1658 res = read_uidgid_files_into_icmap(error_string, config_map);
1662 snprintf (error_reason,
sizeof(error_string_response),
1663 "Successfully read main configuration file '%s'.", filename);
1664 *error_string = error_reason;
int(* parser_cb_f)(const char *path, char *key, char *value, enum main_cp_cb_data_state *state, enum parser_cb_type type, const char **error_string, icmap_map_t config_map, void *user_data)
@ MAIN_CP_CB_DATA_STATE_LOGGING_DAEMON
@ MAIN_CP_CB_DATA_STATE_RESOURCES_PROCESS_MEMUSED
@ MAIN_CP_CB_DATA_STATE_RESOURCES_SYSTEM_MEMUSED
@ MAIN_CP_CB_DATA_STATE_MEMBER
@ MAIN_CP_CB_DATA_STATE_UIDGID
@ MAIN_CP_CB_DATA_STATE_INTERFACE
@ MAIN_CP_CB_DATA_STATE_NORMAL
@ MAIN_CP_CB_DATA_STATE_PLOAD
@ MAIN_CP_CB_DATA_STATE_LOGGER_SUBSYS
@ MAIN_CP_CB_DATA_STATE_TOTEM
@ MAIN_CP_CB_DATA_STATE_RESOURCES_PROCESS
@ MAIN_CP_CB_DATA_STATE_SYSTEM
@ MAIN_CP_CB_DATA_STATE_QUORUM
@ MAIN_CP_CB_DATA_STATE_QDEVICE
@ MAIN_CP_CB_DATA_STATE_RESOURCES_SYSTEM
@ MAIN_CP_CB_DATA_STATE_NODELIST_NODE
@ MAIN_CP_CB_DATA_STATE_RESOURCES
@ MAIN_CP_CB_DATA_STATE_NODELIST
int coroparse_configparse(icmap_map_t config_map, const char **error_string)
@ PARSER_CB_SECTION_START
const char * cs_strerror(cs_error_t err)
cs_strerror
cs_error_t
The cs_error_t enum.
cs_error_t icmap_set_uint16_r(const icmap_map_t map, const char *key_name, uint16_t value)
cs_error_t icmap_set_uint32_r(const icmap_map_t map, const char *key_name, uint32_t value)
icmap_value_types_t
Possible types of value.
cs_error_t icmap_set_uint8_r(const icmap_map_t map, const char *key_name, uint8_t value)
cs_error_t icmap_set_uint64_r(const icmap_map_t map, const char *key_name, uint64_t value)
cs_error_t icmap_set_int32_r(const icmap_map_t map, const char *key_name, int32_t value)
cs_error_t icmap_set_string_r(const icmap_map_t map, const char *key_name, const char *value)
#define ICMAP_KEYNAME_MAXLEN
Maximum length of key in icmap.
const char * corosync_get_config_file(void)
struct qb_list_head logger_subsys_items_head
char * logging_daemon_name
struct qb_list_head member_items_head