Exemplo n.º 1
0
int main(int argc, char **argv)
{	int c;

	if(argc < 2)
	{
		usage();
		exit(0);
	}

	while ((c = getopt(argc, argv, "i:e:")) != -1)
	{
		switch (c)
		{
			case 'i':
				if(optarg != NULL && *optarg)
					test_ip(optarg);
				else
					printf("Bogus/Missing command line arguement\n");
				break;

			case 'e':
				if(optarg != NULL && *optarg)
				{	char	*frm = NULL;
					char	*dom = NULL;

					if(mlfi_regex_mboxsplit(optarg,&frm,&dom))
					{
						printf("split: '%s'@'%s'\n",frm,dom);
						if(mlfi_regex_mboxStripEncoding(&frm))
							printf("encoding stripped split: '%s'@'%s'\n", frm, dom);

						if(frm != NULL)
							free(frm);
						if(dom != NULL)
							free(dom);
					}
					else
						printf("regex fail\n");
				}
				else
					printf("Bogus/Missing command line arguement\n");
				break;
		}
	}

	argc -= optind;
	argv += optind;

	return 0;
}
Exemplo n.º 2
0
//  -----------------------------
int main( int argc, char ** argv )
{
    printf("ipobj \n");

    test_ip();

    test_ipset();

    test_ip4_parsing();

    test_ip4set_parsing();

    printf("normal pgm completion\n");

    return 0;
}