View | Details | Raw Unified | Return to bug 218433 | Differences between
and this patch

Collapse All | Expand All

(-)contrib/ipfilter/man/ippool.8 (-6 / +9 lines)
Lines 6-30 Link Here
6
.SH SYNOPSIS
6
.SH SYNOPSIS
7
.br
7
.br
8
.B ippool
8
.B ippool
9
-a [-dnv] [-m <name>] [-o <role>] [-t <type>] [-T ttl] -i <ipaddr>[/<netmask>]
9
-a [-dnvR] [-m <name>] [-o <role>] [-t <type>] [-T ttl] -i <ipaddr>[/<netmask>]
10
.br
10
.br
11
.B ippool
11
.B ippool
12
-A [-dnv] [-m <name>] [-o <role>] [-S <seed>] [-t <type>]
12
-A [-dnvR] [-m <name>] [-o <role>] [-S <seed>] [-t <type>]
13
.br
13
.br
14
.B ippool
14
.B ippool
15
-f <file> [-dnuv]
15
-f <file> [-dnuvR]
16
.br
16
.br
17
.B ippool
17
.B ippool
18
-F [-dv] [-o <role>] [-t <type>]
18
-F [-dv] [-o <role>] [-t <type>]
19
.br
19
.br
20
.B ippool
20
.B ippool
21
-l [-dv] [-m <name>] [-t <type>]
21
-l [-dvR] [-m <name>] [-t <type>]
22
.br
22
.br
23
.B ippool
23
.B ippool
24
-r [-dnv] [-m <name>] [-o <role>] [-t <type>] -i <ipaddr>[/<netmask>]
24
-r [-dnvR] [-m <name>] [-o <role>] [-t <type>] -i <ipaddr>[/<netmask>]
25
.br
25
.br
26
.B ippool
26
.B ippool
27
-R [-dnv] [-m <name>] [-o <role>] [-t <type>]
27
-R [-dnvR] [-m <name>] [-o <role>] [-t <type>]
28
.br
28
.br
29
.B ippool
29
.B ippool
30
-s [-dtv] [-M <core>] [-N <namelist>]
30
-s [-dtv] [-M <core>] [-N <namelist>]
Lines 123-128 Link Here
123
.B -u
123
.B -u
124
When parsing a configuration file, rather than load new pool data into the
124
When parsing a configuration file, rather than load new pool data into the
125
kernel, unload it.
125
kernel, unload it.
126
.TP
127
.B -R
128
Do not resolve IP addresses to hostnames.
126
.DT
129
.DT
127
.SH FILES
130
.SH FILES
128
.br
131
.br
(-)contrib/ipfilter/tools/ippool.c (-22 / +53 lines)
Lines 75-87 Link Here
75
	char *prog;
75
	char *prog;
76
{
76
{
77
	fprintf(stderr, "Usage:\t%s\n", prog);
77
	fprintf(stderr, "Usage:\t%s\n", prog);
78
	fprintf(stderr, "\t-a [-dnv] [-m <name>] [-o <role>] [-t type] [-T ttl] -i <ipaddr>[/netmask]\n");
78
	fprintf(stderr, "\t-a [-dnvR] [-m <name>] [-o <role>] [-t type] [-T ttl] -i <ipaddr>[/netmask]\n");
79
	fprintf(stderr, "\t-A [-dnv] [-m <name>] [-o <role>] [-S <seed>] [-t <type>]\n");
79
	fprintf(stderr, "\t-A [-dnvR] [-m <name>] [-o <role>] [-S <seed>] [-t <type>]\n");
80
	fprintf(stderr, "\t-f <file> [-dnuv]\n");
80
	fprintf(stderr, "\t-f <file> [-dnuvR]\n");
81
	fprintf(stderr, "\t-F [-dv] [-o <role>] [-t <type>]\n");
81
	fprintf(stderr, "\t-F [-dv] [-o <role>] [-t <type>]\n");
82
	fprintf(stderr, "\t-l [-dv] [-m <name>] [-t <type>] [-O <fields>]\n");
82
	fprintf(stderr, "\t-l [-dvR] [-m <name>] [-t <type>] [-O <fields>]\n");
83
	fprintf(stderr, "\t-r [-dnv] [-m <name>] [-o <role>] [-t type] -i <ipaddr>[/netmask]\n");
83
	fprintf(stderr, "\t-r [-dnvR] [-m <name>] [-o <role>] [-t type] -i <ipaddr>[/netmask]\n");
84
	fprintf(stderr, "\t-R [-dnv] [-m <name>] [-o <role>] [-t <type>]\n");
84
	fprintf(stderr, "\t-R [-dnvR] [-m <name>] [-o <role>] [-t <type>]\n");
85
	fprintf(stderr, "\t-s [-dtv] [-M <core>] [-N <namelist>]\n");
85
	fprintf(stderr, "\t-s [-dtv] [-M <core>] [-N <namelist>]\n");
86
	exit(1);
86
	exit(1);
87
}
87
}
Lines 99-105 Link Here
99
99
100
	assigndefined(getenv("IPPOOL_PREDEFINED"));
100
	assigndefined(getenv("IPPOOL_PREDEFINED"));
101
101
102
	switch (getopt(argc, argv, "aAf:FlnrRsv"))
102
	switch (getopt(argc, argv, "aAf:FlrRs"))
103
	{
103
	{
104
	case 'a' :
104
	case 'a' :
105
		err = poolnodecommand(0, argc, argv);
105
		err = poolnodecommand(0, argc, argv);
Lines 116-124 Link Here
116
	case 'l' :
116
	case 'l' :
117
		err = poollist(argc, argv);
117
		err = poollist(argc, argv);
118
		break;
118
		break;
119
	case 'n' :
120
		opts |= OPT_DONOTHING|OPT_DONTOPEN;
121
		break;
122
	case 'r' :
119
	case 'r' :
123
		err = poolnodecommand(1, argc, argv);
120
		err = poolnodecommand(1, argc, argv);
124
		break;
121
		break;
Lines 128-136 Link Here
128
	case 's' :
125
	case 's' :
129
		err = poolstats(argc, argv);
126
		err = poolstats(argc, argv);
130
		break;
127
		break;
131
	case 'v' :
132
		opts |= OPT_VERBOSE;
133
		break;
134
	default :
128
	default :
135
		exit(1);
129
		exit(1);
136
	}
130
	}
Lines 207-221 Link Here
207
			}
201
			}
208
			break;
202
			break;
209
		case 'T' :
203
		case 'T' :
210
			ttl = atoi(optarg);
204
			if (remove == 0) {
211
			if (ttl < 0) {
205
				ttl = atoi(optarg);
212
				fprintf(stderr, "cannot set negative ttl\n");
206
				if (ttl < 0) {
213
				return -1;
207
					fprintf(stderr, "cannot set negative ttl\n");
208
					return -1;
209
				}
210
			} else {
211
				usage(argv[0]);
214
			}
212
			}
215
			break;
213
			break;
216
		case 'v' :
214
		case 'v' :
217
			opts |= OPT_VERBOSE;
215
			opts |= OPT_VERBOSE;
218
			break;
216
			break;
217
		default :
218
			usage(argv[0]);
219
			break;		/* keep compiler happy */
219
		}
220
		}
220
221
221
	if (argv[optind] != NULL && ipset == 0) {
222
	if (argv[optind] != NULL && ipset == 0) {
Lines 262-268 Link Here
262
	char *argv[];
263
	char *argv[];
263
{
264
{
264
	int type, role, c, err;
265
	int type, role, c, err;
265
	char *poolname;
266
	char *poolname, *typearg = NULL;
266
	iphtable_t iph;
267
	iphtable_t iph;
267
	ip_pool_t pool;
268
	ip_pool_t pool;
268
269
Lines 274-280 Link Here
274
	bzero((char *)&iph, sizeof(iph));
275
	bzero((char *)&iph, sizeof(iph));
275
	bzero((char *)&pool, sizeof(pool));
276
	bzero((char *)&pool, sizeof(pool));
276
277
277
	while ((c = getopt(argc, argv, "dm:no:RSv")) != -1)
278
	optreset = optind = 1;
279
280
	while ((c = getopt(argc, argv, "dm:no:RSvt:")) != -1)
278
		switch (c)
281
		switch (c)
279
		{
282
		{
280
		case 'd' :
283
		case 'd' :
Lines 295-310 Link Here
295
			}
298
			}
296
			break;
299
			break;
297
		case 'R' :
300
		case 'R' :
301
			/* not in man page */
298
			opts |= OPT_NORESOLVE;
302
			opts |= OPT_NORESOLVE;
299
			break;
303
			break;
300
		case 'S' :
304
		case 'S' :
301
			iph.iph_seed = atoi(optarg);
305
			if (remove == 0)
306
				iph.iph_seed = atoi(optarg);
307
			else
308
				usage(argv[0]);
302
			break;
309
			break;
303
		case 'v' :
310
		case 'v' :
304
			opts |= OPT_VERBOSE;
311
			opts |= OPT_VERBOSE;
305
			break;
312
			break;
313
		case 't' :
314
			type = gettype(optarg, &iph.iph_type);
315
			typearg = optarg;
316
			break;
317
		default :
318
			usage(argv[0]);
319
			break;		/* keep compiler happy */
306
		}
320
		}
307
321
322
	if (argc - optind > 0)
323
		usage(argv[0]);
324
308
	if (opts & OPT_DEBUG)
325
	if (opts & OPT_DEBUG)
309
		fprintf(stderr, "poolcommand: opts = %#x\n", opts);
326
		fprintf(stderr, "poolcommand: opts = %#x\n", opts);
310
327
Lines 313-321 Link Here
313
		return -1;
330
		return -1;
314
	}
331
	}
315
332
316
	type = gettype(argv[optind], &iph.iph_type);
317
	if (type == IPLT_NONE) {
333
	if (type == IPLT_NONE) {
318
		fprintf(stderr, "unknown type '%s'\n", argv[optind]);
334
		if (typearg == NULL)
335
			usage(argv[0]);
336
		else
337
			fprintf(stderr, "unknown type '%s'\n", typearg);
319
		return -1;
338
		return -1;
320
	}
339
	}
321
340
Lines 382-387 Link Here
382
		case 'v' :
401
		case 'v' :
383
			opts |= OPT_VERBOSE;
402
			opts |= OPT_VERBOSE;
384
			break;
403
			break;
404
		default :
405
			usage(argv[0]);
406
			break;		/* keep compiler happy */
385
		}
407
		}
386
408
387
	if (opts & OPT_DEBUG)
409
	if (opts & OPT_DEBUG)
Lines 453-458 Link Here
453
		case 'v' :
475
		case 'v' :
454
			opts |= OPT_VERBOSE;
476
			opts |= OPT_VERBOSE;
455
			break;
477
			break;
478
		default :
479
			usage(argv[0]);
480
			break;		/* keep compiler happy */
456
		}
481
		}
457
482
458
	if (opts & OPT_DEBUG)
483
	if (opts & OPT_DEBUG)
Lines 559-564 Link Here
559
		case 'v' :
584
		case 'v' :
560
			opts |= OPT_VERBOSE;
585
			opts |= OPT_VERBOSE;
561
			break;
586
			break;
587
		default :
588
			usage(argv[0]);
589
			break;		/* keep compiler happy */
562
		}
590
		}
563
591
564
	if (opts & OPT_DEBUG)
592
	if (opts & OPT_DEBUG)
Lines 703-708 Link Here
703
		case 'v' :
731
		case 'v' :
704
			opts |= OPT_VERBOSE;
732
			opts |= OPT_VERBOSE;
705
			break;
733
			break;
734
		default :
735
			usage(argv[0]);
736
			break;		/* keep compiler happy */
706
		}
737
		}
707
738
708
	if (opts & OPT_DEBUG)
739
	if (opts & OPT_DEBUG)

Return to bug 218433