Sign in Join
Wiki copytemporary

pcap: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: pcap

OldNewLine
1+The PCAP libraries, libpcap and winpcap provide a portable framework for low-level network monitoring on Linux and Windows operating systems, respectively. This package provides a header-unit for PCAP libraries.
2+
3+## Supported Functions and Procedures
4+
5+- Column 'pcap.pp': Whether this PCAP function is included in the pcap.pp headers
6+- Column 'libpcap': Whether this function is applies to libpcap or not
7+- Column 'winpcap': Whether this function is applies to winpcap or not
8+
9+| | | | | |
10+|:--:|:--:|:--:|:--:|:--:|
11+| **pcap.pp** | **libpcap** | **winpcap** | **Name** | **Description** |
12+| X | X | X | pcap_breakloop | Set a flag that will force pcap_dispatch() or pcap_loop() to return rather than looping. |
13+| X | X | X | pcap_close | Close the files associated with p and deallocates resources. |
14+| X | X | X | pcap_compile | Compile a packet filter, converting an high level filtering expression (see Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine. |
15+| X | X | X | pcap_compile_nopcap | Compile a packet filter without the need of opening an adapter. This function converts an high level filtering expression (see Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine. |
16+| | | X | pcap_createsrcstr | Accept a set of strings (host name, port, ...), and it returns the complete source string according to the new format (e.g. 'rpcap://1.2.3.4/eth0'). |
17+| X | X | X | pcap_datalink | Return the link layer of an adapter. |
18+| X | X | X | pcap_datalink_name_to_val | Translates a data link type name, which is a DLT_ name with the DLT_ removed, to the corresponding data link type value. The translation is case-insensitive. -1 is returned on failure. |
19+| X | X | X | pcap_datalink_val_to_description | Translates a data link type value to a short description of that data link type. NULL is returned on failure. |
20+| X | X | X | pcap_datalink_val_to_name | Translates a data link type value to the corresponding data link type name. NULL is returned on failure. |
21+| X | X | X | pcap_dispatch | Collect a group of packets. |
22+| X | X | X | pcap_dump | Save a packet to disk. |
23+| X | X | X | pcap_dump_close | Closes a savefile. |
24+| Commented Out | X | X | pcap_dump_file | Return the standard I/O stream of the 'savefile' opened by pcap_dump_open(). |
25+| X | X | X | pcap_dump_flush | Flushes the output buffer to the \`\`savefile,*so that any packets written with pcap_dump() but not yet written to the \`\`savefile* will be written. -1 is returned on error, 0 on success. |
26+| X | X | | pcap_dump_fopen | Open a file to which to write packets |
27+| X | X | X | pcap_dump_ftell | Return the file position for a "savefile". |
28+| X | X | X | pcap_dump_open | Open a file to write packets. |
29+| Commented Out | X | X | pcap_file | Return the standard stream of an offline capture. Deprecated. |
30+| X | | | pcap_fileno | NOTE: Does not exist in current libpcap or winpcap documentation. |
31+| X | X | X | pcap_findalldevs | Construct a list of network devices that can be opened with pcap_open_live(). |
32+| | | X | pcap_findalldevs_ex | Create a list of network devices that can be opened with pcap_open(). |
33+| X | X | X | pcap_freealldevs | Free an interface list returned by pcap_findalldevs(). |
34+| X | X | X | pcap_freecode | Free a filter. |
35+| | | X | pcap_get_airpcap_handle | Returns the AirPcap handler associated with an adapter. This handler can be used to change the wireless-related settings of the CACE Technologies AirPcap wireless capture adapters. |
36+| X | X | X | pcap_geterr | Return the error text pertaining to the last pcap library error. |
37+| | | X | pcap_getevent | Return the handle of the event associated with the interface p. |
38+| X | X | X | pcap_getnonblock | Get the "non-blocking" state of an interface. |
39+| X | X | | pcap_inject | Transmit a packet |
40+| X | X | X | pcap_is_swapped | Returns true if the current savefile uses a different byte order than the current system. |
41+| X | X | X | pcap_lib_version | Returns a pointer to a string giving information about the version of the libpcap library being used; note that it contains more information than just a version number. |
42+| X | X | X | pcap_list_datalinks | List datalinks |
43+| | | X | pcap_live_dump | Save a capture to file. |
44+| | | X | pcap_live_dump_ended | Return the status of the kernel dump process, i.e. tells if one of the limits defined with pcap_live_dump() has been reached. |
45+| X | X | X | pcap_lookupdev | Return the first valid device in the system. Deprecated. |
46+| X | X | X | pcap_lookupnet | Return the subnet and netmask of an interface. Deprecated. |
47+| X | X | X | pcap_loop | Collect a group of packets. |
48+| X | X | X | pcap_major_version | Return the major version number of the pcap library used to write the savefile. |
49+| X | X | X | pcap_minor_version | Return the minor version number of the pcap library used to write the savefile. |
50+| X | X | X | pcap_next | Return the next available packet. |
51+| X | X | X | pcap_next_ex | Read a packet from an interface or from an offline capture. |
52+| | | X | pcap_offline_filter | Returns if a given filter applies to an offline packet. |
53+| | | X | pcap_open | Open a generic source in order to capture / send (WinPcap only) traffic. |
54+| X | X | X | pcap_open_dead | Create a pcap_t structure without starting a capture. |
55+| X | X | X | pcap_open_live | Open a live capture from the network. |
56+| X | X | X | pcap_open_offline | Open a savefile in the tcpdump/libpcap format to read packets. |
57+| | | X | pcap_parsesrcstr | Parse the source string and returns the pieces in which the source can be split. |
58+| X | X | X | pcap_perror | Print the text of the last pcap library error on stderr, prefixed by prefix. |
59+| | | X | pcap_remoteact_accept | Block until a network connection is accepted (active mode only). |
60+| | | X | pcap_remoteact_cleanup | Clean the socket that is currently used in waiting active connections. |
61+| | | X | pcap_remoteact_close | Drop an active connection (active mode only). |
62+| | | X | pcap_remoteact_list | Return the hostname of the host that have an active connection with us (active mode only). |
63+| X | X | X | pcap_sendpacket | Send a raw packet. |
64+| | | X | pcap_sendqueue_alloc | Allocate a send queue. |
65+| | | X | pcap_sendqueue_destroy | Destroy a send queue. |
66+| | | X | pcap_sendqueue_queue | Add a packet to a send queue. |
67+| | | X | pcap_sendqueue_transmit | Send a queue of raw packets to the network. |
68+| X | X | X | pcap_set_datalink | Set the current data link type of the pcap descriptor to the type specified by dlt. -1 is returned on failure. |
69+| X | | X | pcap_setbuff | Set the size of the kernel buffer associated with an adapter. |
70+| X | X | | pcap_setdirection | Set the direction for which packets will be captured. Appears to be no longer supported in either library. |
71+| X | X | X | pcap_setfilter | Associate a filter to a capture. |
72+| X | | X | pcap_setmintocopy | Set the minumum amount of data received by the kernel in a single call. |
73+| X | | X | pcap_setmode | Set the working mode of the interface p to mode. |
74+| X | X | X | pcap_setnonblock | Switch between blocking and nonblocking mode. |
75+| | | X | pcap_setsampling | Define a sampling method for packet capture. |
76+| X | X | X | pcap_snapshot | Return the dimension of the packet portion (in bytes) that is delivered to the application. |
77+| X | X | X | pcap_stats | Return statistics on current capture. |
78+| | | X | pcap_stats_ex | Return statistics on current capture. |
79+| X | X | X | pcap_strerror | Provided in case strerror() isn't available. |
80+| | | | | |
81+
82+## Example Programs
83+
84+(This is a WIP - jdlinke 4 June 2015)
85+
86+---
87+*From the Free Pascal wiki, page "pcap", as it stood on 2019-07-01 after a change by Skalogryz, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
88+Category: Networking

Back to history