Add a capture_pktap() routine and use it.

That way, the packet counts are will be valid when capturing.

Change-Id: I0a21cc817d918e7f849620db5ca6dfd84bd2cd87
Reviewed-on: https://code.wireshark.org/review/936
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2014-04-02 23:45:11 -07:00
parent 04c05a21e3
commit 618c27b5e6
4 changed files with 36 additions and 0 deletions

View File

@ -57,6 +57,7 @@
#include <epan/dissectors/packet-enc.h>
#include <epan/dissectors/packet-i2c.h>
#include <epan/dissectors/packet-ax25-kiss.h>
#include <epan/dissectors/packet-pktap.h>
#include <wsutil/filesystem.h>
@ -361,6 +362,9 @@ capture_info_packet(packet_counts *counts, gint wtap_linktype, const guchar *pd,
/* XXX - some ATM drivers on FreeBSD might prepend a 4-byte ATM
pseudo-header to DLT_ATM_RFC1483, with LLC header following;
we might have to implement that at some point. */
case WTAP_ENCAP_PKTAP:
capture_pktap(pd, caplen, counts);
break;
}
}

View File

@ -1542,6 +1542,7 @@ DISSECTOR_INCLUDES = \
packet-pkixtsp.h \
packet-pkinit.h \
packet-pktc.h \
packet-pktap.h \
packet-portmap.h \
packet-ppi.h \
packet-ppi-geolocation-common.h \

View File

@ -34,6 +34,7 @@
#include "packet-frame.h"
#include "packet-eth.h"
#include "packet-pktap.h"
/* Needed for wtap_pcap_encap_to_wtap_encap(). */
#include <wiretap/pcap-encap.h>

View File

@ -0,0 +1,30 @@
/* packet-pktap.h
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __PACKET_PKTAP_H__
#define __PACKET_PKTAP_H__
#include "ws_symbol_export.h"
WS_DLL_PUBLIC
void capture_pktap(const guchar *, int, packet_counts *);
#endif