/* tipc_core_start - switch TIPC from NOT RUNNING to SINGLE NODE mode  */
int tipc_core_start(void)
/* tipc_core_start - switch TIPC from NOT RUNNING to SINGLE NODE mode  */
int tipc_core_start(void)
{
	int res;
	if (tipc_mode != TIPC_NOT_RUNNING)
		return -ENOPROTOOPT;
	get_random_bytes(&tipc_random, sizeof(tipc_random));
	tipc_mode = TIPC_NODE_MODE;
	if ((res = tipc_handler_start()) ||
	    (res = tipc_ref_table_init(tipc_max_ports, tipc_random)) ||
	    (res = tipc_reg_start()) ||
	    (res = tipc_nametbl_init()) ||
	    (res = tipc_k_signal((Handler)tipc_subscr_start, 0)) ||
	    (res = tipc_k_signal((Handler)tipc_cfg_init, 0)) ||
	    (res = tipc_netlink_start()) ||
	    (res = tipc_socket_init())) {
		tipc_core_stop();
	}
	return res;
}