rem: break; case 'E': expires_t=atoi(optarg);
context: int main(int argc, char *argv[]){	FILE	*pf;	char	buff[BUFSIZE];	int		length, c;	char	*delim, *delim2;	/* some initialisation to be shure */	file_b=uri_b=trace=lport=usrloc=flood=verbose=randtrash=trashchar = 0;	numeric=warning_ext = 0;	namebeg=nameend=maxforw = -1;	via_ins=redirects = 1;	username = NULL;	address = 0;    rport = 5060;	expires_t = USRLOC_EXP_DEF;	memset(buff, 0, BUFSIZE);	memset(message, 0, BUFSIZE);	memset(mes_reply, 0, BUFSIZE);	memset(fqdn, 0, FQDN_SIZE);	memset(messusern, 0, FQDN_SIZE);	if (argc==1) print_help();	/* lots of command line switches to handle*/	while ((c=getopt(argc,argv,"b:c:dE:e:Ff:hil:m:nr:Rs:tT:uvw")) != EOF){		switch(c){			case 'b':				//namebeg=atoi(optarg);				if ((namebeg=atoi(optarg))==-1) {					printf("error: non-numerical appendix begin for the username\n");					exit(2);				}				break;			case 'c':				if ((namebeg=atoi(optarg))==-1) {					printf("error: non-numerical CSeq maximum\n");					exit(2);				}				break;			case 'd':				redirects=0;				break;			case 'E':				expires_t=atoi(optarg);				break;			case 'e':				//nameend=atoi(optarg);				if ((nameend=atoi(optarg))==-1) {					printf("error: non-numerical appendix end for the username\n");					exit(2);				}				break;			case 'F':				flood=1;				break;			case 'f':				/* file is opened in binary mode so that the cr-lf is preserved */				pf = fopen(optarg, "rb");				if (!pf){					puts("unable to open the file.\n");					exit(2);				}				length  = fread(buff, 1, sizeof(buff), pf);				if (length >= sizeof(buff)){					printf("error:the file is too big. try files of less than %i bytes.\n", BUFSIZE);					printf("      or recompile the program with bigger BUFSIZE defined.\n");					exit(2);				}				fclose(pf);				buff[length] = '\0';				file_b=1;				break;			case 'h':				print_help();				break;			case 'i':				via_ins=0;				break;			case 'l':				lport=atoi(optarg);				if (!lport) {					puts("error: non-numerical local port number");					exit(2);				}				break;			case 'm':				maxforw=atoi(optarg);				if (maxforw==-1) {					printf("error: non-numerical number of max-forwards\n");					exit(2);				}				break;			case 'n':				numeric = 1;				break;			case 'r':				rport=atoi(optarg);				if (!rport) {					printf("error: non-numerical remote port number\n");					exit(2);				}				break;			case 'R':				randtrash=1;				break;			case 's':				if (!strncmp(optarg,"sip",3)){					if ((delim=strchr(optarg,':'))!=NULL){						delim++;						if ((delim2=strchr(delim,'@'))!=NULL){							username=malloc(delim2-delim+1);							strncpy(username, delim, delim2-delim);							delim2++;							delim=delim2;						}						if ((delim2=strchr(delim,':'))!=NULL){							*delim2 = '\0';							delim2++;							rport = atoi(delim2);							if (!rport) {								printf("error: non-numerical remote port number\n");								exit(2);							}						}						domainname=malloc(strlen(delim)+1);						strncpy(domainname, delim, strlen(delim));						address = getaddress(delim);						if (!address){							printf("error:unable to determine the remote host address\n");							exit(2);						}					}					else{						printf("error: sip:uri doesn't contain a : ?!\n");						exit(2);					}				}				else{					printf("error: sip:uri doesn't not begin with sip\n");					exit(2);				}				uri_b=1;				break;			break;			case 't':				trace=1;				break;			case 'T':				trashchar=atoi(optarg);				if (!trashchar) {					printf("error: non-numerical number of trashed character\n");					exit(2);				}				break;			case 'u':				usrloc=1;				break;			case 'v':				verbose=1;				break;			case 'w':				warning_ext=1;				break;			default:				printf("error: unknown parameter %c\n", c);				exit(2);				break;		}	}	/* lots of conditions to check */	if (trace) {		if (usrloc || flood || randtrash) {			printf("error: trace can't be combined with usrloc, random or flood\n");			exit(2);		}		if (!uri_b) {			printf("error: for trace modus a sip:uri is realy needed\n");			exit(2);		}		if (file_b) {			printf("warning: file will be ignored for tracing.");		}		if (!username) {			printf("error: for trace modus without a file the sip:uir have to contain a username\n");			exit(2);		}		if (!via_ins){			printf("warning: Via-Line is needed for tracing. Ignoring -i\n");			via_ins=1;		}		if (!warning_ext) {			printf("warning: IP extract from warning activated to be more informational\n");			warning_ext=1;		}		if (maxforw==-1) maxforw=255;	}	else if (usrloc) {		if (trace || flood || randtrash) {			printf("error: usrloc can't be combined with trace, random or flood\n");			exit(2);		}		if (!username || !uri_b || nameend==-1) {			printf("error: for the USRLOC modus you have to give a sip:uri with a "					"username and the\n       username appendix end at least\n");			exit(2);		}		if (via_ins) {			via_ins=0;		}		if (redirects) {			printf("warning: redirects are not expected in USRLOC. Disableing\n");			redirects=0;		}		if (namebeg==-1)			namebeg=0;	}	else if (flood) {		if (trace || usrloc || randtrash) {			printf("error: flood can't be combined with trace, random or usrloc\n");			exit(2);		}		if (!uri_b) {			printf("error: we need at least a sip uri for flood\n");			exit(2);		}		if (redirects) {			printf("warning: redirects are not expected in flood. Disableing\n");			redirects=0;		}	}	else if (randtrash) {		if (trace || usrloc || flood) {			printf("error: random can't be combined with trace, flood or usrloc\n");			exit(2);		}		if (!uri_b) {			printf("error: need at least a sip uri for random\n");			exit(2);		}		if (redirects) {			printf("warning: redirects are not expected in random. Disableing\n");			redirects=0;		}		if (verbose) {			printf("warning: random characters may destroy your terminal output\n");		}	}	else {		if (!uri_b) {			printf("error: a spi uri is needed at least\n");			exit(2);		}		if (!(username || file_b)) {			printf("error: ether a file or an username in the sip uri is required\n");			exit(2);		}			}	/* determine our hostname */	get_fqdn();		/* this is not a cryptographic random number generator,	   but hey this is only a test-tool => should be satisfying*/	srand(time(0));	/* here we go...*/	shoot(buff);	/* normaly we won't come back here, but to satisfy the compiler */	return 0;}