1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-04 13:49:03 +00:00

Upgrade our included libpcap to 1.1.1.

This commit is contained in:
david
2010-04-21 04:39:45 +00:00
parent e34bd54d68
commit 4ac98563ab
160 changed files with 11540 additions and 8247 deletions

View File

@@ -17,7 +17,7 @@
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/libpcap/pcap-dag.c,v 1.31.2.8 2008-04-14 20:41:51 guy Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/pcap-dag.c,v 1.39 2008-04-14 20:40:58 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -368,6 +368,10 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
case TYPE_MC_AAL5:
case TYPE_MC_ATM:
case TYPE_MC_HDLC:
case TYPE_MC_RAW_CHANNEL:
case TYPE_MC_RAW:
case TYPE_MC_AAL2:
case TYPE_COLOR_MC_HDLC_POS:
packet_len += 4; /* MC header */
break;
@@ -487,6 +491,7 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
break;
case TYPE_IPV4:
case TYPE_IPV6:
packet_len = ntohs(header->wlen);
caplen = rlen - dag_record_size;
if (caplen > packet_len) {
@@ -494,6 +499,14 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
}
break;
/* These types have no matching 'native' DLT, but can be used with DLT_ERF above */
case TYPE_MC_RAW:
case TYPE_MC_RAW_CHANNEL:
case TYPE_IP_COUNTER:
case TYPE_TCP_FLOW_COUNTER:
case TYPE_INFINIBAND:
case TYPE_RAW_LINK:
case TYPE_INFINIBAND_LINK:
default:
/* Unhandled ERF type.
* Ignore rather than generating error
@@ -790,6 +803,7 @@ static int dag_activate(pcap_t* handle)
handle->cleanup_op = dag_platform_cleanup;
handle->md.stat.ps_drop = 0;
handle->md.stat.ps_recv = 0;
handle->md.stat.ps_ifdrop = 0;
return 0;
#ifdef HAVE_DAG_STREAMS_API
@@ -1089,6 +1103,7 @@ dag_get_datalink(pcap_t *p)
break;
case TYPE_IPV4:
case TYPE_IPV6:
if(!p->linktype)
p->linktype = DLT_RAW;
break;
@@ -1099,10 +1114,11 @@ dag_get_datalink(pcap_t *p)
case TYPE_IP_COUNTER:
case TYPE_TCP_FLOW_COUNTER:
case TYPE_INFINIBAND:
case TYPE_IPV6:
case TYPE_RAW_LINK:
case TYPE_INFINIBAND_LINK:
default:
/* Libpcap cannot deal with these types yet */
/* Add no DLTs, but still covered by DLT_ERF */
/* Add no 'native' DLTs, but still covered by DLT_ERF */
break;
} /* switch */