aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-util.c
Commit message (Collapse)AuthorAgeFilesLines
* Use _WIN32 rather than WIN32 to determine if we're compiling on Win32;Guy Harris2004-09-111-1/+1
| | | | | | according to Gisle Vanem, WIN32 isn't a built-in in MSVC, but _WIN32 is. svn path=/trunk/; revision=11972
* Pull the address (and port and circuit type) stuff out ofGuy Harris2004-07-191-2/+2
| | | | | | | | | "epan/packet_info.h" and put it in "epan/address.h". Use the AT_ values from "epan/address.h" for address types in the interface lists rather than having our own FAM_ enums. svn path=/trunk/; revision=11427
* Revert the IPv6 code, as we did with the IPv4 code, and use INET6 as anGuy Harris2004-07-191-2/+7
| | | | | | | indicator of whether we have enough IPv6 support to handle IPv6 addresses. svn path=/trunk/; revision=11425
* "struct sockaddr_in"s and "struct sockaddr_in6"s are sufficient to serveGuy Harris2004-07-181-2/+4
| | | | | | | | | as transport endpoint addresses, so the "sa_data" field includes port numbers. Revert the IPv4 code; we'll fix the IPv6 code later (we'll have to check whether "struct sockaddr_in6" is defined, and not support IPv6 addresses if it's not, even if AF_INET6 is defined). svn path=/trunk/; revision=11420
* Just because AF_INET6 is defined, that doesn't mean "structGuy Harris2004-07-181-10/+3
| | | | | | | | sockaddr_in6" is defined - the former, but not the latter, is defined in FreeBSD 3.4. Just copy the appropriate number of bytes from the "sa_data" field of a "struct sockaddr". svn path=/trunk/; revision=11413
* Add support for IPv6 addresses for interfaces.Guy Harris2004-07-181-6/+23
| | | | svn path=/trunk/; revision=11411
* Get IPv4 addresses and the loopback flag if we don't haveGuy Harris2004-07-181-29/+35
| | | | | | | | | "pcap_findalldevs()". "if_info_ip()" is used - and can be compiled - only if libpcap has "pcap_findalldevs()". svn path=/trunk/; revision=11402
* Set the svn:eol-style property on all text files to "native", so thatGuy Harris2004-07-181-410/+410
| | | | | | | | | they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. svn path=/trunk/; revision=11400
* if using the get_interface_list function, try to get the IP addresses tooUlf Lamping2004-07-171-363/+410
| | | | svn path=/trunk/; revision=11395
* Squelch a compiler warning.Guy Harris2004-02-241-2/+6
| | | | svn path=/trunk/; revision=10211
* removed some MSVC warnings (moved pcap.h before glib.h)Ulf Lamping2003-12-211-3/+3
| | | | svn path=/trunk/; revision=9393
* From Jaime Fournier: fix a typo.Guy Harris2003-11-261-2/+2
| | | | svn path=/trunk/; revision=9093
* Maybe the problem is that the compilers used on AIX weren't definingGuy Harris2003-11-211-4/+4
| | | | | | | "AIX", and that code was never compiled. Libpcap uses "_AIX" to conditionally compile in the extra AIX BPF support; we'll do the same. svn path=/trunk/; revision=9056
* Pass "strncmp()" the right number of arguments. (Why hasn't anybodyGuy Harris2003-11-211-4/+4
| | | | | | | | reported this as a problem when compiling on AIX? Doesn't any compiler complain that "strncmp()" isn't being passed enough arguments? GCC sure did in a test program I built on FreeBSD 3.4....) svn path=/trunk/; revision=9055
* Based on a patch from Brian Fundakowski Feldman, add support for settingGuy Harris2003-11-011-1/+126
| | | | | | | link-layer type when capturing, using the "pcap_set_datalink()" and related APIs. svn path=/trunk/; revision=8848
* Use "pcap_findalldevs()" if present.Guy Harris2003-10-101-357/+19
| | | | svn path=/trunk/; revision=8655
* Fix a compile error on Windows.Guy Harris2003-09-101-2/+2
| | | | svn path=/trunk/; revision=8441
* Have "get_interface_list()" return a list of "if_info_t" structuresGuy Harris2003-09-101-51/+100
| | | | | | | | | | | | containing a pointer to an interface name and possibly a pointer to an interface description (although that pointer might be null if no description is available), rather than having the Windows version glue together the name and description into a single string. Supply for the Linux "any" device the same description that libpcap's "pcap_findalldevs()" returns. svn path=/trunk/; revision=8440
* From Nathan Jennings:Guy Harris2003-09-081-2/+1
| | | | | | | | | | | support for user-supplied interface descriptions; support for hiding interfaces in drop-down list in capture dialog. Clean up comments written to preferences file. svn path=/trunk/; revision=8419
* From Nathan Jennings: "g_list_remove_link()" doesn't free the list itemGuy Harris2003-07-061-9/+5
| | | | | | | | | | | | | itself, so we leaked memory when freeing the interface list; in "free_interface_list()", use "g_list_foreach()", calling a list free routine, to free the data items in the list, and then use "g_list_free()" to free the list. Use "free_interface_list()" in "get_interface_list()" to free the list if we have an error, as it now does what the code that use to be there did. svn path=/trunk/; revision=7965
* Fix by Gerald Combs to a braino of mine.Guy Harris2003-06-131-2/+2
| | | | svn path=/trunk/; revision=7866
* Handle the case of an empty interface list on Windows the same way weGuy Harris2003-06-101-11/+14
| | | | | | | | | handle it on UNIX. Check for an empty interface name (which indicates the end of the interface list) at the beginning of the loop, so that if the first interface name is empty (meaning an empty interface list) we don't put a bogus entry into the list with just a colon. svn path=/trunk/; revision=7828
* AIX's BPF, and thus its tcpdump, appears to use 24 as the link-layerGuy Harris2003-03-251-1/+14
| | | | | | | | type for loopback devices; map it to DLT_NULL when reading libpcap files with a major version of 2 and a minor version of 2, and when capturing from an "loN" device on AIX. svn path=/trunk/; revision=7361
* Removed trailing whitespaces from .h and .c files using theJörg Mayer2002-08-281-39/+39
| | | | | | | winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
* Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer2002-08-021-5/+1
| | | | | | | | equivalents for the toplevel directory. The removal of winsock2.h will hopefully not cause any problems under MSVC++, as those files using struct timeval still include wtap.h, which still includes winsock2.h. svn path=/trunk/; revision=5932
* Update tethereal to handle the "<description> : <device ID>" interfaceGerald Combs2002-06-271-2/+9
| | | | | | | | names that are generated under Windows. Note in pcap-util.c that we may want to separate interface device names and descriptions in the future. svn path=/trunk/; revision=5770
* In the Windows capture dialog, place the interface description before theGerald Combs2002-05-181-32/+41
| | | | | | interface name. svn path=/trunk/; revision=5499
* Put in incomplete definitions of "struct mbuf" and "struct rtentry" toGuy Harris2002-04-251-1/+6
| | | | | | eliminate compiler warnings on Digital UNIX. svn path=/trunk/; revision=5251
* From Andrew Feren: on Windows, in the drop-down list for the "Interface"Guy Harris2002-04-011-2/+45
| | | | | | | field in the "Capture Options" dialog, put the descriptive name of the device in parentheses after the actual device path. svn path=/trunk/; revision=5069
* From Joerg Mayer: mark function arguments as unused.Guy Harris2002-03-311-3/+7
| | | | svn path=/trunk/; revision=5052
* Fixes from Kazushi Sugyo:Guy Harris2001-11-091-2/+5
| | | | | | | | | | | | | | 1) print the payload length in AH headers correctly (the field's value is length of the payload, minus 2, divided by 2, so we have to add 2 before multiplying by 2); 2) correctly handle, in an SIOCGIFCONF list, entries whose address has an "sa_len" field less than the size of a "struct sockaddr" (the length of the address in an entry is the maximum of the real length and the size of a "struct sockaddr"). svn path=/trunk/; revision=4186
* Put in an XXX note indicating that if we conclude we're using the AIXGuy Harris2001-11-091-1/+7
| | | | | | | libpcap, we may also want to return a flag indicating that we have to map seconds/nanoseconds in the packet header to seconds/microseconds. svn path=/trunk/; revision=4185
* Wrap calls to "pcap_datalink()" in a routine that attempts to compensateGuy Harris2001-11-091-0/+439
for AIX 5.x's non-standard libpcap, where "pcap_datalink()" doesn't return DLT_ values, it returns RFC 1573 ifType values. Put that wrapper, and the routine to get the interface list, in a separate file, for packet-capture utility routines, so not everybody who includes "util.h" needs to include <pcap.h>. Fix up the Wiretap hack for dealing with said incompatibility to use the correct ifType value for Token Ring. svn path=/trunk/; revision=4184