Esempio n. 1
0
int main (int argc, char **argv, char **envp)
{
        int retcode = -1;
        (void) *envp;

        /* get configuration */
        retcode = proxenet_init_config(argc, argv);
        if (retcode<0)
                return EXIT_FAILURE;

        srand(time(0));
        serial_base = rand();

        /* proxenet starts here  */
        retcode = proxenet_start();

        /* proxenet ends here */
        proxenet_free_config();

        if (retcode == 0) {
                if (cfg->verbose)
                        xlog(LOG_INFO, "%s exits successfully\n", PROGNAME);
                return EXIT_SUCCESS;
        } else {
                if (cfg->verbose)
                        xlog(LOG_INFO, "%s exits with errors\n", PROGNAME);
                return EXIT_FAILURE;
        }

}
Esempio n. 2
0
int main (int argc, char **argv, char** envp)
{
	int retcode = -1;
	
	/* init semaphore for unified display */
	sem_init(&tty_semaphore, 0, 1);
	
	/* get configuration */
	retcode = proxenet_init_config(argc, argv);
	if (retcode<0)		
		return EXIT_FAILURE;
	
	
#ifdef _PERL_PLUGIN
	/* perform plugin pre-initialisation -- currently done only for Perl */
	proxenet_init_once_plugins(argc, argv, envp);
#endif

	/* proxenet starts here  */
	retcode = proxenet_start(); 


#ifdef _PERL_PLUGIN
	/* perform plugin post-deletion */
	proxenet_delete_once_plugins();
#endif

	/* proxenet ends here */
	proxenet_free_config();

	return (retcode == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}