19185e895Schristos 29185e895SchristosThe following instructions apply if you have a Linux or FreeBSD platform and 39185e895Schristoswant libpcap to support the DAG range of passive network monitoring cards from 4*748408edSchristosEndace (https://www.endace.com, see below for further contact details). 59185e895Schristos 69185e895Schristos1) Install and build the DAG software distribution by following the 79185e895Schristosinstructions supplied with that package. Current Endace customers can download 84a71e5f3Schristosthe DAG software distribution from https://www.endace.com 99185e895Schristos 109185e895Schristos2) Configure libcap. To allow the 'configure' script to locate the DAG 119185e895Schristossoftware distribution use the '--with-dag' option: 129185e895Schristos 139185e895Schristos ./configure --with-dag=DIR 149185e895Schristos 159185e895SchristosWhere DIR is the root of the DAG software distribution, for example 169185e895Schristos/var/src/dag. If the DAG software is correctly detected 'configure' will 179185e895Schristosreport: 189185e895Schristos 199185e895Schristos checking whether we have DAG API... yes 209185e895Schristos 219185e895SchristosIf 'configure' reports that there is no DAG API, the directory may have been 229185e895Schristosincorrectly specified or the DAG software was not built before configuring 239185e895Schristoslibpcap. 249185e895Schristos 25*748408edSchristosSee also the libpcap INSTALL.md file for further libpcap configuration 269185e895Schristosoptions. 279185e895Schristos 289185e895SchristosBuilding libpcap at this stage will include support for both the native packet 299185e895Schristoscapture stream (linux or bpf) and for capturing from DAG cards. To build 309185e895Schristoslibpcap with only DAG support specify the capture type as 'dag' when 319185e895Schristosconfiguring libpcap: 329185e895Schristos 339185e895Schristos ./configure --with-dag=DIR --with-pcap=dag 349185e895Schristos 359185e895SchristosApplications built with libpcap configured in this way will only detect DAG 369185e895Schristoscards and will not capture from the native OS packet stream. 379185e895Schristos 389185e895Schristos---------------------------------------------------------------------- 399185e895Schristos 409185e895SchristosLibpcap when built for DAG cards against dag-2.5.1 or later releases: 419185e895Schristos 429185e895SchristosTimeouts are supported. pcap_dispatch() will return after to_ms milliseconds 439185e895Schristosregardless of how many packets are received. If to_ms is zero pcap_dispatch() 449185e895Schristoswill block waiting for data indefinitely. 459185e895Schristos 469185e895Schristospcap_dispatch() will block on and process a minimum of 64kB of data (before 479185e895Schristosfiltering) for efficiency. This can introduce high latencies on quiet 489185e895Schristosinterfaces unless a timeout value is set. The timeout expiring will override 499185e895Schristosthe 64kB minimum causing pcap_dispatch() to process any available data and 509185e895Schristosreturn. 519185e895Schristos 529185e895Schristospcap_setnonblock is supported. When nonblock is set, pcap_dispatch() will 539185e895Schristoscheck once for available data, process any data available up to count, then 549185e895Schristosreturn immediately. 559185e895Schristos 569185e895Schristospcap_findalldevs() is supported, e.g. dag0, dag1... 579185e895Schristos 589185e895SchristosSome DAG cards can provide more than one 'stream' of received data. 599185e895SchristosThis can be data from different physical ports, or separated by filtering 609185e895Schristosor load balancing mechanisms. Receive streams have even numbers, e.g. 619185e895Schristosdag0:0, dag0:2 etc. Specifying transmit streams for capture is not supported. 629185e895Schristos 639185e895Schristospcap_setfilter() is supported, BPF programs run in userspace. 649185e895Schristos 659185e895Schristospcap_setdirection() is not supported. Only received traffic is captured. 669185e895SchristosDAG cards normally do not have IP or link layer addresses assigned as 679185e895Schristosthey are used to passively monitor links. 689185e895Schristos 699185e895Schristospcap_breakloop() is supported. 709185e895Schristos 719185e895Schristospcap_datalink() and pcap_list_datalinks() are supported. The DAG card does 729185e895Schristosnot attempt to set the correct datalink type automatically where more than 739185e895Schristosone type is possible. 749185e895Schristos 759185e895Schristospcap_stats() is supported. ps_drop is the number of packets dropped due to 769185e895SchristosRX stream buffer overflow, this count is before filters are applied (it will 779185e895Schristosinclude packets that would have been dropped by the filter). The RX stream 789185e895Schristosbuffer size is user configurable outside libpcap, typically 16-512MB. 799185e895Schristos 809185e895Schristospcap_get_selectable_fd() is not supported, as DAG cards do not support 819185e895Schristospoll/select methods. 829185e895Schristos 839185e895Schristospcap_inject() and pcap_sendpacket() are not supported. 849185e895Schristos 859185e895SchristosSome DAG cards now support capturing to multiple virtual interfaces, called 869185e895Schristosstreams. Capture streams have even numbers. These are available via libpcap 879185e895Schristosas separate interfaces, e.g. dag0:0, dag0:2, dag0:4 etc. dag0:0 is the same 889185e895Schristosas dag0. These are visible via pcap_findalldevs(). 899185e895Schristos 909185e895Schristoslibpcap now does NOT set the card's hardware snaplen (slen). This must now be 914a71e5f3Schristosset using the appropriate DAG configuration program, e.g. dagthree, dagfour, 929185e895Schristosdagsix, dagconfig. This is because the snaplen is currently shared between 939185e895Schristosall of the streams. In future this may change if per-stream slen is 949185e895Schristosimplemented. 959185e895Schristos 969185e895SchristosDAG cards by default capture entire packets including the L2 979185e895SchristosCRC/FCS. If the card is not configured to discard the CRC/FCS, this 989185e895Schristoscan confuse applications that use libpcap if they're not prepared for 999185e895Schristospackets to have an FCS. 1009185e895Schristos 1019185e895SchristosLibpcap now reads the environment variable ERF_FCS_BITS to determine 1029185e895Schristoshow many bits of CRC/FCS to strip from the end of the captured 1039185e895Schristosframe. This defaults to 32 for use with Ethernet. If the card is 1049185e895Schristosconfigured to strip the CRC/FCS, then set ERF_FCS_BITS=0. If used with 1059185e895Schristosa HDLC/PoS/PPP/Frame Relay link with 16 bit CRC/FCS, then set 1069185e895SchristosERF_FCS_BITS=16. 1079185e895Schristos 1089185e895SchristosIf you wish to create a pcap file that DOES contain the Ethernet FCS, 1099185e895Schristosspecify the environment variable ERF_DONT_STRIP_FCS. This will cause 1109185e895Schristosthe existing FCS to be captured into the pcap file. Note some 1119185e895Schristosapplications may incorrectly report capture errors or oversize packets 1129185e895Schristoswhen reading these files. 1139185e895Schristos 1149185e895Schristos---------------------------------------------------------------------- 1159185e895Schristos 1169185e895SchristosPlease submit bug reports via <support@endace.com>. 1179185e895Schristos 1189185e895SchristosPlease also visit our Web site at: 1199185e895Schristos 120*748408edSchristos https://www.endace.com/ 1219185e895Schristos 1229185e895SchristosFor more information about Endace DAG cards contact <sales@endace.com>. 123