示例#1
0
static void
display_version(void)
{
    enum msg_type *supported_messages;
    size_t no_supported_messages;
    size_t zi;

    msg_get_supported_messages(&supported_messages, &no_supported_messages);
    printf("Corosync Qdevice Network Daemon, version '%s'\n\n", VERSION);
    printf("Supported algorithms: ");
    for (zi = 0; zi < QNETD_STATIC_SUPPORTED_DECISION_ALGORITHMS_SIZE; zi++) {
        if (zi != 0) {
            printf(", ");
        }
        printf("%s (%u)",
               tlv_decision_algorithm_type_to_str(qnetd_static_supported_decision_algorithms[zi]),
               qnetd_static_supported_decision_algorithms[zi]);
    }
    printf("\n");
    printf("Supported message types: ");
    for (zi = 0; zi < no_supported_messages; zi++) {
        if (zi != 0) {
            printf(", ");
        }
        printf("%s (%u)", msg_type_to_str(supported_messages[zi]), supported_messages[zi]);
    }
    printf("\n");
}
示例#2
0
static int check_acceptor_resp(const struct node_data *me, int ty, int src)
{
	if (me->state != NODE_STATE_PROPOSING) {
		if (g_verbose) {
			fprintf(stderr, "%d: got %s message from %d, but we are "
				"not proposing.\n",
				me->id, msg_type_to_str(ty), src);
		}
		return 1;
	}
	if (me->remotes[src] != REMOTE_STATE_NO_RESP) {
		fprintf(stderr, "%d: got %s message from %d, but "
			"remote_state for that node is already %d\n",
			me->id, msg_type_to_str(ty),
			src, me->remotes[src]);
		return 1;
	}
	return 0;
}