#ifdef HAVE_GETOPT_LONG
#include <getopt.h>
#else
-#include "getopt_long.h"
+#include "missing/getopt_long.h"
#endif
/* Capsicum-specific code requires macros from <net/bpf.h>, which will fail
* to compile if <pcap.h> has already been included; including the headers
#include "interface.h"
#include "addrtoname.h"
#include "machdep.h"
-#include "gmt2local.h"
#include "pcap-missing.h"
#include "ascii_strcasecmp.h"
copy_argv(char **argv)
{
char **p;
- u_int len = 0;
+ size_t len = 0;
char *buf;
char *src, *dst;
status = pcap_set_tstamp_precision(pc, ndo->ndo_tstamp_precision);
if (status != 0)
error("%s: Can't set %ssecond time stamp precision: %s",
- device,
- tstamp_precision_to_string(ndo->ndo_tstamp_precision),
- pcap_statustostr(status));
+ device,
+ tstamp_precision_to_string(ndo->ndo_tstamp_precision),
+ pcap_statustostr(status));
#endif
#ifdef HAVE_PCAP_SET_IMMEDIATE_MODE
status = pcap_set_immediate_mode(pc, 1);
if (status != 0)
error("%s: Can't set immediate mode: %s",
- device,
- pcap_statustostr(status));
+ device, pcap_statustostr(status));
}
#endif
/*
status = pcap_set_tstamp_type(pc, jflag);
if (status < 0)
error("%s: Can't set time stamp type: %s",
- device, pcap_statustostr(status));
+ device, pcap_statustostr(status));
else if (status > 0)
warning("When trying to set timestamp type '%s' on %s: %s",
- pcap_tstamp_type_val_to_name(jflag), device,
- pcap_statustostr(status));
+ pcap_tstamp_type_val_to_name(jflag), device,
+ pcap_statustostr(status));
}
#endif
status = pcap_activate(pc);
{
int cnt, op, i;
bpf_u_int32 localnet = 0, netmask = 0;
- int timezone_offset = 0;
char *cp, *infile, *cmdbuf, *device, *RFileName, *VFileName, *WFileName;
char *endp;
pcap_handler callback;
ndo->ndo_snaplen = strtol(optarg, &end, 0);
if (optarg == end || *end != '\0'
|| ndo->ndo_snaplen < 0 || ndo->ndo_snaplen > MAXIMUM_SNAPLEN)
- error("invalid snaplen %s", optarg);
+ error("invalid snaplen %s (must be >= 0 and <= %d)",
+ optarg, MAXIMUM_SNAPLEN);
break;
case 'S':
switch (ndo->ndo_tflag) {
case 0: /* Default */
- case 4: /* Default + Date*/
- timezone_offset = gmt2local(0);
- break;
-
case 1: /* No time stamp */
case 2: /* Unix timeval style */
- case 3: /* Microseconds since previous packet */
- case 5: /* Microseconds since first packet */
+ case 3: /* Microseconds/nanoseconds since previous packet */
+ case 4: /* Date + Default */
+ case 5: /* Microseconds/nanoseconds since first packet */
break;
default: /* Not supported */
capdns = capdns_setup();
#endif /* HAVE_CASPER */
- init_print(ndo, localnet, netmask, timezone_offset);
+ init_print(ndo, localnet, netmask);
#ifndef _WIN32
(void)setsignal(SIGPIPE, cleanup);