I changed the demo so that the openPcap function read like (includes
linty bits):
static void openPcapFile(void)
{
pcap_t *handle; /* Session handle */
char *dev = "wlan0"; /* The device to sniff on */
char errbuf[PCAP_ERRBUF_SIZE]; /* Error string */
struct bpf_program fp; /* The compiled filter */
char filter_exp[] = "port 80"; /* The filter expression */
bpf_u_int32 mask; /* Our netmask */
bpf_u_int32 net; /* Our IP */
/* Define the device */
if (dev == NULL) {
fprintf(stderr, "Couldn't find default device: %s\n", errbuf);
return (2);
}
printf("Setting dev: %s\n", dev);
/* Find the properties for the device */
if (pcap_lookupnet(dev, &net, &mask, errbuf) == -1) {
fprintf(stderr, "Couldn't get netmask for device %s: %s\n", dev,
errbuf);
net = 0;
mask = 0;
}
printf("Net(%d) and Mask(%d)\n", net, mask);
/* Open the session in promiscuous mode */
_pcap_handle = pcap_open_live(dev, BUFSIZ, 1, -1, errbuf);
if (handle == NULL) {
fprintf(stderr, "Couldn't open device %s: %s\n", dev, errbuf);
return (2);
}
printf("Opened session\n");
_pcap_datalink_type = pcap_datalink(_pcap_handle);
==============================================================
When I do this and run I get an error that I don't get with my non DPI
capture program (including linty file error):
ERROR: no pcap file path provided; use option -f with the path to a
valid pcap file
Setting dev: wlan0
Net(10372523) and Mask(16711679)
Couldn't open device wlan0: ��O
==============================================================
Normally when the device can't open this is because you aren't in su
mode. However I am. Is this a function of libtools (which I'm not at
all familiar with)? Am I doing something obviously wrong to get this
working in live mode?
--
Subscription settings:
http://groups.google.com/group/opendpi/subscribe?hl=en