/* Read the command line options and if they are correct create a listenning server socket. */
int main(int argc, char *argv[])
{
	struct cmd_opts copts;
	bool result = pars_cmd_args(&copts, argc, argv);
	if (!result)
		return -1;
	printf("Initializing server... Wait.\n");
	if (!generate_key())
	{
		printf("Unable to create key-pair... Aborting.\n");
		return -1;
	}
	printf("Server is ready.\n");
	return (int)create_socket(&copts);
}
Ejemplo n.º 2
0
/**
 * Read the command line options and if 
 * they are correct create a listenning server socket.
 * 
 */
int main(int argc,char *argv[])
{
	struct cmd_opts *copts= malloc(sizeof(struct cmd_opts));
	int result = pars_cmd_args(copts,argc,argv);
	switch(result) {
		case 0:
			return create_socket(copts);
		case -1:
			break;
		default:
			return 1;
	}
	return 0;
	
}
Ejemplo n.º 3
0
void *FtpStart(void *ptr)
{
   struct arg *s=ptr;
   int argc = s->ac;
   char **argv = s->av;
   struct cmd_opts *copts= malloc(sizeof(struct cmd_opts));
	int result = pars_cmd_args(copts,argc,argv);
	switch(result) {
		case 0:
			return create_socket(copts);
		case -1:
			break;
		default:
			return 1;
	}

}