- case 'c': /* config file */
- configfilename = xmalloc(strlen(optarg)+1);
- strcpy(configfilename, optarg);
- break;
- case 'd': /* inc debug level */
- debug_lvl++;
- break;
- case 'k': /* kill old tincds */
- kill_tincd = 1;
- break;
- case 'n': /* net name given */
- netname = xmalloc(strlen(optarg)+1);
- strcpy(netname, optarg);
- break;
- case 't': /* timeout */
- if(!(p = add_config_val(&config, TYPE_INT, optarg)))
- {
- printf("Invalid timeout value `%s'.\n", optarg);
- usage(1);
- }
- break;
+ case 'c': /* config file */
+ confbase = xmalloc(strlen(optarg)+1);
+ strcpy(confbase, optarg);
+ break;
+ case 'D': /* no detach */
+ do_detach = 0;
+ break;
+ case 'd': /* inc debug level */
+ if(optarg)
+ debug_lvl = atoi(optarg);
+ else
+ debug_lvl++;
+ break;
+ case 'k': /* kill old tincds */
+ if(optarg)
+ {
+ if(!strcasecmp(optarg, "HUP"))
+ kill_tincd = SIGHUP;
+ else if(!strcasecmp(optarg, "TERM"))
+ kill_tincd = SIGTERM;
+ else if(!strcasecmp(optarg, "KILL"))
+ kill_tincd = SIGKILL;
+ else if(!strcasecmp(optarg, "USR1"))
+ kill_tincd = SIGUSR1;
+ else if(!strcasecmp(optarg, "USR2"))
+ kill_tincd = SIGUSR2;
+ else if(!strcasecmp(optarg, "WINCH"))
+ kill_tincd = SIGWINCH;
+ else if(!strcasecmp(optarg, "INT"))
+ kill_tincd = SIGINT;
+ else if(!strcasecmp(optarg, "ALRM"))
+ kill_tincd = SIGALRM;
+ else
+ {
+ kill_tincd = atoi(optarg);
+ if(!kill_tincd)
+ {
+ fprintf(stderr, _("Invalid argument `%s'; SIGNAL must be a number or one of HUP, TERM, KILL, USR1, USR2, WINCH, INT or ALRM.\n"), optarg);
+ usage(1);
+ }
+ }
+ }
+ else
+ kill_tincd = SIGTERM;
+ break;
+ case 'n': /* net name given */
+ netname = xmalloc(strlen(optarg)+1);
+ strcpy(netname, optarg);
+ break;
+ case 'K': /* generate public/private keypair */
+ if(optarg)
+ {
+ generate_keys = atoi(optarg);
+ if(generate_keys < 512)
+ {
+ fprintf(stderr, _("Invalid argument `%s'; BITS must be a number equal to or greater than 512.\n"),
+ optarg);
+ usage(1);
+ }
+ generate_keys &= ~7; /* Round it to bytes */
+ }
+ else
+ generate_keys = 1024;
+ break;