void setup(void)
/*****************************************************************************
*   Input    :
*   Output   :
*   Function :
******************************************************************************/ 
{
	if(setup_lcm(LCM_IP))
	{
		printf("	Failure in setup_lcm with this IP %s\n",  LCM_IP);
	}
	else
	{
		printf("	LCM created with this IP %s\n",  LCM_IP);
	}
	if(init_variables())
	{
	}
		
	if(setup_threads())			// run threads
	{
		printf("	Threads UNSUCCESSFUL created\n");
	}
	else
	{
		printf("	Threads succesful created\n");
	}
}
예제 #2
0
int
main(int argc, char **argv) {
	assert(nmsg_init() == nmsg_res_success);
	assert(nmsg_msgmod_lookup_byname("base", "pkt") != NULL);

	setup_io();
	process_args(argc, argv);
	setup_pcap();
	setup_threads();

	signal(SIGINT, shutdown_handler);
	signal(SIGTERM, shutdown_handler);

	if (nmsg_io_loop(io) != nmsg_res_success)
		errx(EXIT_FAILURE, "nmsg_io_loop() failed");

	cleanup();

	return (EXIT_SUCCESS);
}