Blame doc/README.dag

Packit Service c0f7c7
Packit Service c0f7c7
The following instructions apply if you have a Linux or FreeBSD platform and
Packit Service c0f7c7
want libpcap to support the DAG range of passive network monitoring cards from
Packit Service c0f7c7
Endace (http://www.endace.com, see below for further contact details).
Packit Service c0f7c7
Packit Service c0f7c7
1) Install and build the DAG software distribution by following the
Packit Service c0f7c7
instructions supplied with that package. Current Endace customers can download
Packit Service c0f7c7
the DAG software distribution from https://www.endace.com
Packit Service c0f7c7
Packit Service c0f7c7
2) Configure libcap. To allow the 'configure' script to locate the DAG
Packit Service c0f7c7
software distribution use the '--with-dag' option:
Packit Service c0f7c7
Packit Service c0f7c7
        ./configure --with-dag=DIR
Packit Service c0f7c7
Packit Service c0f7c7
Where DIR is the root of the DAG software distribution, for example
Packit Service c0f7c7
/var/src/dag. If the DAG software is correctly detected 'configure' will
Packit Service c0f7c7
report:
Packit Service c0f7c7
Packit Service c0f7c7
        checking whether we have DAG API... yes
Packit Service c0f7c7
Packit Service c0f7c7
If 'configure' reports that there is no DAG API, the directory may have been
Packit Service c0f7c7
incorrectly specified or the DAG software was not built before configuring
Packit Service c0f7c7
libpcap.
Packit Service c0f7c7
Packit Service c0f7c7
See also the libpcap INSTALL.txt file for further libpcap configuration
Packit Service c0f7c7
options.
Packit Service c0f7c7
Packit Service c0f7c7
Building libpcap at this stage will include support for both the native packet
Packit Service c0f7c7
capture stream (linux or bpf) and for capturing from DAG cards. To build
Packit Service c0f7c7
libpcap with only DAG support specify the capture type as 'dag' when
Packit Service c0f7c7
configuring libpcap:
Packit Service c0f7c7
Packit Service c0f7c7
        ./configure --with-dag=DIR --with-pcap=dag
Packit Service c0f7c7
Packit Service c0f7c7
Applications built with libpcap configured in this way will only detect DAG
Packit Service c0f7c7
cards and will not capture from the native OS packet stream.
Packit Service c0f7c7
Packit Service c0f7c7
----------------------------------------------------------------------
Packit Service c0f7c7
Packit Service c0f7c7
Libpcap when built for DAG cards against dag-2.5.1 or later releases:
Packit Service c0f7c7
Packit Service c0f7c7
Timeouts are supported. pcap_dispatch() will return after to_ms milliseconds
Packit Service c0f7c7
regardless of how many packets are received. If to_ms is zero pcap_dispatch()
Packit Service c0f7c7
will block waiting for data indefinitely.
Packit Service c0f7c7
Packit Service c0f7c7
pcap_dispatch() will block on and process a minimum of 64kB of data (before
Packit Service c0f7c7
filtering) for efficiency. This can introduce high latencies on quiet
Packit Service c0f7c7
interfaces unless a timeout value is set. The timeout expiring will override
Packit Service c0f7c7
the 64kB minimum causing pcap_dispatch() to process any available data and
Packit Service c0f7c7
return.
Packit Service c0f7c7
Packit Service c0f7c7
pcap_setnonblock is supported. When nonblock is set, pcap_dispatch() will
Packit Service c0f7c7
check once for available data, process any data available up to count, then
Packit Service c0f7c7
return immediately.
Packit Service c0f7c7
Packit Service c0f7c7
pcap_findalldevs() is supported, e.g. dag0, dag1...
Packit Service c0f7c7
Packit Service c0f7c7
Some DAG cards can provide more than one 'stream' of received data.
Packit Service c0f7c7
This can be data from different physical ports, or separated by filtering
Packit Service c0f7c7
or load balancing mechanisms. Receive streams have even numbers, e.g.
Packit Service c0f7c7
dag0:0, dag0:2 etc. Specifying transmit streams for capture is not supported.
Packit Service c0f7c7
Packit Service c0f7c7
pcap_setfilter() is supported, BPF programs run in userspace.
Packit Service c0f7c7
Packit Service c0f7c7
pcap_setdirection() is not supported. Only received traffic is captured.
Packit Service c0f7c7
DAG cards normally do not have IP or link layer addresses assigned as
Packit Service c0f7c7
they are used to passively monitor links.
Packit Service c0f7c7
Packit Service c0f7c7
pcap_breakloop() is supported.
Packit Service c0f7c7
Packit Service c0f7c7
pcap_datalink() and pcap_list_datalinks() are supported. The DAG card does
Packit Service c0f7c7
not attempt to set the correct datalink type automatically where more than
Packit Service c0f7c7
one type is possible.
Packit Service c0f7c7
Packit Service c0f7c7
pcap_stats() is supported. ps_drop is the number of packets dropped due to
Packit Service c0f7c7
RX stream buffer overflow, this count is before filters are applied (it will
Packit Service c0f7c7
include packets that would have been dropped by the filter). The RX stream
Packit Service c0f7c7
buffer size is user configurable outside libpcap, typically 16-512MB.
Packit Service c0f7c7
Packit Service c0f7c7
pcap_get_selectable_fd() is not supported, as DAG cards do not support
Packit Service c0f7c7
poll/select methods.
Packit Service c0f7c7
Packit Service c0f7c7
pcap_inject() and pcap_sendpacket() are not supported.
Packit Service c0f7c7
Packit Service c0f7c7
Some DAG cards now support capturing to multiple virtual interfaces, called
Packit Service c0f7c7
streams. Capture streams have even numbers. These are available via libpcap
Packit Service c0f7c7
as separate interfaces, e.g. dag0:0, dag0:2, dag0:4 etc. dag0:0 is the same
Packit Service c0f7c7
as dag0. These are visible via pcap_findalldevs().
Packit Service c0f7c7
Packit Service c0f7c7
libpcap now does NOT set the card's hardware snaplen (slen). This must now be
Packit Service c0f7c7
set using the appropriate DAG configuration program, e.g. dagthree, dagfour,
Packit Service c0f7c7
dagsix, dagconfig. This is because the snaplen is currently shared between
Packit Service c0f7c7
all of the streams. In future this may change if per-stream slen is
Packit Service c0f7c7
implemented.
Packit Service c0f7c7
Packit Service c0f7c7
DAG cards by default capture entire packets including the L2
Packit Service c0f7c7
CRC/FCS. If the card is not configured to discard the CRC/FCS, this
Packit Service c0f7c7
can confuse applications that use libpcap if they're not prepared for
Packit Service c0f7c7
packets to have an FCS.
Packit Service c0f7c7
Packit Service c0f7c7
Libpcap now reads the environment variable ERF_FCS_BITS to determine
Packit Service c0f7c7
how many bits of CRC/FCS to strip from the end of the captured
Packit Service c0f7c7
frame. This defaults to 32 for use with Ethernet. If the card is
Packit Service c0f7c7
configured to strip the CRC/FCS, then set ERF_FCS_BITS=0. If used with
Packit Service c0f7c7
a HDLC/PoS/PPP/Frame Relay link with 16 bit CRC/FCS, then set
Packit Service c0f7c7
ERF_FCS_BITS=16.
Packit Service c0f7c7
Packit Service c0f7c7
If you wish to create a pcap file that DOES contain the Ethernet FCS,
Packit Service c0f7c7
specify the environment variable ERF_DONT_STRIP_FCS. This will cause
Packit Service c0f7c7
the existing FCS to be captured into the pcap file. Note some
Packit Service c0f7c7
applications may incorrectly report capture errors or oversize packets
Packit Service c0f7c7
when reading these files.
Packit Service c0f7c7
Packit Service c0f7c7
----------------------------------------------------------------------
Packit Service c0f7c7
Packit Service c0f7c7
Please submit bug reports via <support@endace.com>.
Packit Service c0f7c7
Packit Service c0f7c7
Please also visit our Web site at:
Packit Service c0f7c7
Packit Service c0f7c7
        http://www.endace.com/
Packit Service c0f7c7
Packit Service c0f7c7
For more information about Endace DAG cards contact <sales@endace.com>.