have the name specified with the
.B \-w
flag, with a number after it, starting at 1 and continuing upward.
-The units of \fIfile_size\fP are millions of bytes (1,000,000 bytes,
+The default unit of \fIfile_size\fP is millions of bytes (1,000,000 bytes,
not 1,048,576 bytes).
+.IP
+By adding a suffix of k, m or g to the value, the unit
+can be changed to 1,024 (KiB), 1,048,576 (MiB), or 1,073,741,824 (GiB)
+respectively.
.TP
.B \-d
Dump the compiled packet-matching code in a human readable form to
int yflag_dlt = -1;
const char *yflag_dlt_name = NULL;
int print = 0;
+ long Cflagmult = 1000000;
netdissect_options Ndo;
netdissect_options *ndo = &Ndo;
case 'C':
errno = 0;
+ if (optarg[strlen(optarg)-1] == 'k') {
+ Cflagmult = 1024;
+ optarg[strlen(optarg)-1] = '\0';
+ }
+ if (optarg[strlen(optarg)-1] == 'm') {
+ Cflagmult = 1024*1024;
+ optarg[strlen(optarg)-1] = '\0';
+ }
+ if (optarg[strlen(optarg)-1] == 'g') {
+ Cflagmult = 1024*1024*1024;
+ optarg[strlen(optarg)-1] = '\0';
+ }
#ifdef HAVE_PCAP_DUMP_FTELL64
Cflag = strtoint64_t(optarg, &endp, 10);
#else
|| Cflag <= 0)
error("invalid file size %s", optarg);
/*
- * Will multiplying it by 1000000 overflow?
+ * Will multiplying it by multiplier overflow?
*/
#ifdef HAVE_PCAP_DUMP_FTELL64
- if (Cflag > INT64_T_CONSTANT(0x7fffffffffffffff) / 1000000)
+ if (Cflag > INT64_T_CONSTANT(0x7fffffffffffffff) / Cflagmult)
#else
- if (Cflag > LONG_MAX / 1000000)
+ if (Cflag > LONG_MAX / Cflagmult)
#endif
error("file size %s is too large", optarg);
- Cflag *= 1000000;
+ Cflag *= Cflagmult;
break;
case 'd':