diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2009-03-21 22:58:08 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2009-03-21 22:58:08 +0000 |
commit | 3f19af99adb541ff811a6faaaae340e24ad313c5 (patch) | |
tree | 41d4ee124e8dc2938aa5559c6f422a7b778c807f /contrib/libpcap/nametoaddr.c | |
parent | b0069d00e9ca6c9d90eb18267d0949527c0249e5 (diff) | |
parent | d8d18f6fbdf4f16ae4382f3d0a2d97953edd9b2c (diff) | |
download | FreeBSD-src-3f19af99adb541ff811a6faaaae340e24ad313c5.zip FreeBSD-src-3f19af99adb541ff811a6faaaae340e24ad313c5.tar.gz |
Merge libpcap 1.0.0.
Diffstat (limited to 'contrib/libpcap/nametoaddr.c')
-rw-r--r-- | contrib/libpcap/nametoaddr.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/contrib/libpcap/nametoaddr.c b/contrib/libpcap/nametoaddr.c index 791c281..479f1fd 100644 --- a/contrib/libpcap/nametoaddr.c +++ b/contrib/libpcap/nametoaddr.c @@ -26,7 +26,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.77.2.4 2007/06/11 09:52:05 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.82.2.1 2008/02/06 10:21:47 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -82,7 +82,7 @@ struct rtentry; /* declarations in <net/if.h> */ #include "pcap-int.h" #include "gencode.h" -#include <pcap-namedb.h> +#include <pcap/namedb.h> #ifdef HAVE_OS_PROTO_H #include "os-proto.h" @@ -409,7 +409,15 @@ __pcap_atodn(const char *s, bpf_u_int32 *addr) } /* - * Convert 's' which has the form "xx:xx:xx:xx:xx:xx" into a new + * Convert 's', which can have the one of the forms: + * + * "xx:xx:xx:xx:xx:xx" + * "xx.xx.xx.xx.xx.xx" + * "xx-xx-xx-xx-xx-xx" + * "xxxx.xxxx.xxxx" + * "xxxxxxxxxxxx" + * + * (or various mixes of ':', '.', and '-') into a new * ethernet address. Assumes 's' is well formed. */ u_char * @@ -421,7 +429,7 @@ pcap_ether_aton(const char *s) e = ep = (u_char *)malloc(6); while (*s) { - if (*s == ':') + if (*s == ':' || *s == '.' || *s == '-') s += 1; d = xdtoi(*s++); if (isxdigit((unsigned char)*s)) { |