path: root/nametoaddr.c
AgeCommit message (Collapse)AuthorFilesLines
2009-02-14From Gisle Vanem:Guy Harris1-7/+5
* nametoaddr.c with DECNETLIB defined needs <netdnet/dnetdb.h> included. And which again needs <sys/types.h>. * Remove "IP6_misc.h" since it's already included in pcap-stdinc.h (ref. my patch to pcap-stdinc.h).
2008-02-06From Arien Vijn: support various notions for MAC addresses.guy1-3/+11
2007-06-11Pick up changes from NetBSD:guy1-4/+4
several files: date: 2006/02/27 15:53:24; author: drochner; state: Exp; avoid shadowing globals, for WARNS=2 date: 2006/02/27 15:55:30; author: drochner; state: Exp; minor constification, good for WARNS=3 now date: 2006/02/27 15:57:17; author: drochner; state: Exp; NetBSD adaption: ... -const pcap_strerror() for consistency gencode.c: date: 2006/04/26 09:24:33; author: tron; state: Exp; Add missing "const" keywords to match declarations in "pcap.h". date: 2006/10/15 19:27:21; author: christos; state: Exp; add a volatile variable to prevent vfork/longjmp clobbering. optimize.c: date: 2006/05/17 17:48:36; author: drochner; state: Exp; Make the optimizer use unsigned numbers as the kernel does. While it is not agreed on that purely unsigned arithmetics is nice, different behaviour of optimized and unoptimized code is less desirable. pcap-bpf.c: date: 2006/02/27 15:51:38; author: drochner; state: Exp; pull in from NetBSD's libpcap: use cloning bpf device on NetBSD Have the configure script check for paths.h, so that we can include it only if we have it, and use the cloning BPF device only if we're on NetBSD *and* _PATH_BPF is defined (hopefully this will keep us from using it on versions of NetBSD that don't have a cloning BPF device; if, in the future, other OSes with BPF get cloning BPF devices, we can make this work for them as well).
2006-10-04Put the public libpcap headers into a pcap subdirectory in both theguy1-2/+2
source directory and the target include directory, and have include files at the top-level directory to include those headers, for backwards compatibility. Update the FILES and INSTALL.txt files to reflect current reality.
2005-04-20Some systems (*cough*Irix*cough) not only don't declareguy1-1/+6
"ether_hostton()" but don't even declare "struct ether_addr"; on those systems, declare "struct ether_addr".
2005-04-20<string.h> is the ANSI C standard header file to include for variousguy1-2/+2
routines, including malloc() and company - and for string routines used in this file, which aren't necessarily declared in <memory.h>, so include <string.h>.
2005-04-19From Patrick Marie <mycroft@virgaria.org>: add support for port rangesguy1-1/+46
in tests - "portrange X-Y" matches all ports in the range [X,Y]. Support added for port ranges with IPv6. Fix some comments.
2005-03-27Fix some typoes for "ether_hostton".guy1-4/+4
If we don't have ether_hostton(), don't bother checking NETINET_ETHER_H_DECLARES_ETHER_HOSTTON and including <netinet/ether.h> if it's defined.
2005-03-27If we don't get a declaration of ether_hostton() by includingguy1-1/+8
<netinet/if_ether.h>, try <netinet/ether.h>.
2005-03-26If we have ether_hostton(), check whether we have <netinet/if_ether.h>guy1-13/+3
and if including it declares ether_hostton(), and define HAVE_DECL_ETHER_HOSTTON appropriately, and use that to determine whether to define it ourselves, rather than having a set of OSes that don't need it, as that set can change over time. Make the default declaration of "ether_hostton()" declare its first argument as "const char *", as that's what it's *supposed* to be (although it's not declared as such in some OSes, so we still have to cast a "const char *" when passed as the first argument).
2005-03-17For "ether proto", allow LLC value names as well as Ethernet type valueguy1-1/+25
names, so that, as the tcpdump man page claims to be the case, "ether proto \{iso,stp,ipx,netbeui}" are equivalent to "{iso,stp,ipx,netbeui}".
2003-12-24some getaddrinfo(3) can return multiple address against SOCK_STREAM (like tcpitojun1-1/+2
adn sctp). hardcode to tcp for now. suz@kame
2003-11-19Typo fix from Brian Ginsbach.guy1-2/+2
2003-11-16From Brian Ginsbach <ginsbach@cray.com>: add UNICOS/mp to the list ofguy1-2/+3
OSes that declare "ether_hostton()" themselves.
2003-11-15Add _U_ to "rcsid[]" definitions, to eliminate "unused variable"guy1-2/+2
warnings from newer versions of GCC.
2003-02-25Only look up "tcp" and "udp" in pcap_nametoport(). This fixes thefenner1-24/+26
case in e.g. FreeBSD where /etc/services lists port 4 for the ddp "echo" service. Submitted by: Alan Bawden <Alan@LCS.MIT.EDU>
2002-08-02Include "IP6_misc.h" even on UNIX if __MINGW32__ is defined, as hadguy1-4/+11
been the case before the previous checkin.
2002-08-02Use <pcap-stdinc.h> only on Windows; on UNIX, selectively include, inguy1-1/+12
each source file, only the headers that file needs, and all the headers it needs in order to compile on various platforms and not to get any avoidable compiler warnings on those platforms (as well as any incomplete structure definitions needed to avoid those warnings). That also means that <pcap.h> doesn't include <pcap-stdinc.h> on UNIX; we don't want it to include <pcap-stdinc.h>, at least on UNIX, as doing so 1) would mean we'd have to install that, so that programs can build with libpcap and 2) would mean that programs including <pcap.h> would drag in a bunch of header files that they don't need. Put a newline at the end of "inet.c" - the Sun C compiler doesn't like it if the last line doesn't end with a newline.
2002-08-01Added support for Win32, based on WinPcap.risso1-8/+13
2002-06-11whitespace cleanupitojun1-2/+2
2002-04-09Indicate why we have incomplete definitions for "struct mbuf" andguy1-5/+7
"struct rtentry" (in <net/if.h> on some systems, e.g. Digital UNIX 4.0, there are prototypes for kernel functions that include "struct mbuf *" and "struct rtentry *" arguments, and they are included even if you're just user-mode code). We don't need to include <netinet/if_ether.h> unless we have "ether_hostton()", and we don't need to include <net/if.h> unless we're including <netinet/if_ether.h>, and we don't need to define "struct mbuf" or "struct rtentry" unless we're including <net/if.h>.
2002-04-07No need to include <sys/socket.h> twice.guy1-4/+1
2002-04-06There's no need to include <netdb.h> twice.guy1-3/+2
2001-07-28Cast the argument to <ctype.h> macros to "unsigned char", to eliminateguy1-2/+2
GCC warnings and to keep the macros from referring outside an array when handed bytes with the 8th bit set.
2001-06-27Put a "return (0);" into "__pcap_nametodnaddr()" to squelch complaintsguy1-1/+2
the Digital^H^H^H^H^H^H^HTru64 UNIX C compiler.
2001-01-17Sigh. Not all systems have <netinet/if_ether.h> - for example, at leastguy1-1/+3
some libc5 Linux systems don't - so we have to check whether it exists, and include it only if it does.
2000-12-18Put in a comment noting that we should, perhaps, declareguy1-1/+10
"ether_hostton()" in "lbl/os-XXX.h" files rather than in "nametoaddr.c".
2000-12-18As per many suggestions, the most recent in mail toguy1-2/+2
"patches@tcpdump.org" by Jonathan Wilkins <jwilkins@madscience.dyndns.org>, we don't declare "ether_hostton()" on FreeBSD - it's declared in <net/ethernet.h> in 3.0 and later, and is declared with the first argument as "const char *" in 4.0 and later so that if we declare it with the first argument as "char *" we get errors. (If we declare it with "const char *", you get errors on FreeBSD 3.x and other systems that *don't* declare it with "const char *".) XXX - should it go, instead, into "lbl/os-XXX.h" files, for those OS versions that don't declare it, and not be declared at all here?
2000-10-10Eliminate a warning with some compilers.guy1-2/+2
2000-07-11add config.h, remove gnuc.h. remove __deadassar1-2/+5
2000-07-01remove non-STDC code and malloc.hassar1-4/+1
2000-04-27revert renaming of pcap_nametoaddrinfo to pcap_nametoaddr. this getsitojun1-4/+4
painful when upgrading old libpcap to tcpdump.org pcap (function rename usually requires shlib major number bump, while api addition only require minor)
1999-11-25restrict result from getaddrinfo() by specifying hints.ai_socktype.itojun1-1/+2
otherwise, multiple answer may be returned for single numeric address (for SOCK_STREAM and SOCK_DGRAM, for example).
1999-10-19IPv6 packet filtering code.itojun1-1/+29
./configure --enable-ipv6 (requires getaddrinfo(3) and getnameinfo(3)). TODO: make it work even without getaddrinfo(3) or getnameinfo(3) (or, tcpdump/configure.in should provide alternative version by AC_REPLACE_FUNCS) TODO: make IPv6 filtering code work by default TODO: make "protochain" friendly with optimization
1999-10-17 removed prototype to permit building on NetBSDmcr1-5/+1
1999-10-07Initial revisionmcr1-0/+372