remove dependencies to pcap.h, so getting an idea what needs to be done by dumpcap in addition to the things already done now
various dumpcap related code cleanup: mainly #include's and capture engine related stuff svn path=/trunk/; revision=17327
This commit is contained in:
parent
58d9f6c3b1
commit
79053183c5
@ -430,4 +430,20 @@ set_pcap_linktype(pcap_t *pch, char *devname
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_PCAP_DATALINK_VAL_TO_NAME
|
||||||
|
const char *
|
||||||
|
linktype_val_to_name(int dlt)
|
||||||
|
{
|
||||||
|
return pcap_datalink_val_to_name(dlt);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_PCAP_DATALINK_NAME_TO_VAL
|
||||||
|
int linktype_name_to_val(const char *linktype)
|
||||||
|
{
|
||||||
|
return pcap_datalink_name_to_val(linktype);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* HAVE_LIBPCAP */
|
#endif /* HAVE_LIBPCAP */
|
||||||
|
@ -33,6 +33,12 @@ extern "C" {
|
|||||||
|
|
||||||
#include <epan/address.h>
|
#include <epan/address.h>
|
||||||
|
|
||||||
|
#include <pcap.h>
|
||||||
|
|
||||||
|
/* declaration of pcap_t here, to reduce pcap dependencies */
|
||||||
|
/*typedef struct pcap pcap_t;*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX - this is also the traditional default snapshot size in
|
* XXX - this is also the traditional default snapshot size in
|
||||||
* tcpdump - but, if IPv6 is enabled, it defaults to 96, to get an
|
* tcpdump - but, if IPv6 is enabled, it defaults to 96, to get an
|
||||||
@ -43,27 +49,28 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define MIN_PACKET_SIZE 68 /* minimum amount of packet data we can read */
|
#define MIN_PACKET_SIZE 68 /* minimum amount of packet data we can read */
|
||||||
|
|
||||||
#define MAX_WIN_IF_NAME_LEN 511
|
/* XXX - this must be optimized, removing the dependency!!! */
|
||||||
|
#define CAPTURE_PCAP_ERRBUF_SIZE PCAP_ERRBUF_SIZE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The list of interfaces returned by "get_interface_list()" is
|
* The list of interfaces returned by "get_interface_list()" is
|
||||||
* a list of these structures.
|
* a list of these structures.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name;
|
char *name; /* e.g. "eth0" */
|
||||||
char *description;
|
char *description; /* from OS, e.g. "Local Area Connection" or NULL */
|
||||||
GSList *ip_addr; /* containing address values */
|
GSList *ip_addr; /* containing address values of if_addr_t */
|
||||||
gboolean loopback;
|
gboolean loopback; /* TRUE if loopback, FALSE otherwise */
|
||||||
} if_info_t;
|
} if_info_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* An address in the "ip_addr" list.
|
* An address in the "ip_addr" list.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
address_type type;
|
address_type type; /* AF_INET or AF_INET6 */
|
||||||
union {
|
union {
|
||||||
guint32 ip4_addr;
|
guint32 ip4_addr; /* 4 byte IP V4 address, or */
|
||||||
guint8 ip6_addr[16];
|
guint8 ip6_addr[16];/* 16 byte IP V6 address */
|
||||||
} ip_addr;
|
} ip_addr;
|
||||||
} if_addr_t;
|
} if_addr_t;
|
||||||
|
|
||||||
@ -86,16 +93,27 @@ gchar *cant_get_if_list_error_message(const char *err_str);
|
|||||||
* a list of these structures.
|
* a list of these structures.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int dlt;
|
int dlt; /* e.g. DLT_EN10MB (which is 1) */
|
||||||
char *name;
|
char *name; /* e.g. "EN10MB" or "DLT 1" */
|
||||||
char *description;
|
char *description; /* descriptive name from wiretap e.g. "Ethernet", NULL if unknown */
|
||||||
} data_link_info_t;
|
} data_link_info_t;
|
||||||
|
|
||||||
int get_pcap_linktype(pcap_t *pch, const char *devname);
|
|
||||||
GList *get_pcap_linktype_list(const char *devname, char *err_buf);
|
GList *get_pcap_linktype_list(const char *devname, char *err_buf);
|
||||||
void free_pcap_linktype_list(GList *linktype_list);
|
void free_pcap_linktype_list(GList *linktype_list);
|
||||||
|
|
||||||
|
/* get/set the link type of an interface */
|
||||||
|
/* (only used in capture_loop.c / capture-pcap-util.c) */
|
||||||
|
int get_pcap_linktype(pcap_t *pch, const char *devname);
|
||||||
const char *set_pcap_linktype(pcap_t *pch, char *devname, int dlt);
|
const char *set_pcap_linktype(pcap_t *pch, char *devname, int dlt);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_PCAP_DATALINK_VAL_TO_NAME
|
||||||
|
const char *linktype_val_to_name(int dlt);
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_PCAP_DATALINK_NAME_TO_VAL
|
||||||
|
int linktype_name_to_val(const char *linktype);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
@ -41,6 +41,10 @@
|
|||||||
/* XXX - yes, I know, I should move cppmagic.h to a generic location. */
|
/* XXX - yes, I know, I should move cppmagic.h to a generic location. */
|
||||||
#include "tools/lemon/cppmagic.h"
|
#include "tools/lemon/cppmagic.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define MAX_WIN_IF_NAME_LEN 511
|
||||||
|
|
||||||
|
|
||||||
gboolean has_wpcap = FALSE;
|
gboolean has_wpcap = FALSE;
|
||||||
|
|
||||||
#ifdef HAVE_LIBPCAP
|
#ifdef HAVE_LIBPCAP
|
||||||
|
@ -43,8 +43,6 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <pcap.h>
|
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#include <epan/packet.h>
|
#include <epan/packet.h>
|
||||||
|
@ -1086,6 +1086,7 @@ capture_loop_open_output(capture_options *capture_opts, int *save_file_fd,
|
|||||||
static void
|
static void
|
||||||
capture_loop_stop_signal_handler(int signo _U_)
|
capture_loop_stop_signal_handler(int signo _U_)
|
||||||
{
|
{
|
||||||
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Signal: Stop capture");
|
||||||
capture_loop_stop();
|
capture_loop_stop();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1096,35 +1097,6 @@ capture_loop_stop_signal_handler(int signo _U_)
|
|||||||
#define TIME_GET() time(NULL)
|
#define TIME_GET() time(NULL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
static gboolean
|
|
||||||
signal_pipe_stopped(void)
|
|
||||||
{
|
|
||||||
/* any news from our parent (stdin)? -> just stop the capture */
|
|
||||||
HANDLE handle;
|
|
||||||
DWORD avail = 0;
|
|
||||||
gboolean result;
|
|
||||||
|
|
||||||
|
|
||||||
handle = (HANDLE) GetStdHandle(STD_INPUT_HANDLE);
|
|
||||||
result = PeekNamedPipe(handle, NULL, 0, NULL, &avail, NULL);
|
|
||||||
|
|
||||||
if(!result || avail > 0) {
|
|
||||||
/* peek failed or some bytes really available */
|
|
||||||
|
|
||||||
/* XXX - if not piping from stdin this fails */
|
|
||||||
/*g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG,
|
|
||||||
"Signal pipe: handle: %x result: %u avail: %u", handle, result, avail);
|
|
||||||
return FALSE;*/
|
|
||||||
return TRUE;
|
|
||||||
} else {
|
|
||||||
/* pipe ok and no bytes available */
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Do the low-level work of a capture.
|
/* Do the low-level work of a capture.
|
||||||
Returns TRUE if it succeeds, FALSE otherwise. */
|
Returns TRUE if it succeeds, FALSE otherwise. */
|
||||||
int
|
int
|
||||||
@ -1178,7 +1150,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
|
|||||||
signal(SIGUSR1, capture_loop_stop_signal_handler);
|
signal(SIGUSR1, capture_loop_stop_signal_handler);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Capture child starting ...");
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Capture loop starting ...");
|
||||||
capture_opts_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, capture_opts);
|
capture_opts_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, capture_opts);
|
||||||
|
|
||||||
/* open the output file (temporary/specified name/ringbuffer) */
|
/* open the output file (temporary/specified name/ringbuffer) */
|
||||||
@ -1241,7 +1213,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
|
|||||||
start_time = TIME_GET();
|
start_time = TIME_GET();
|
||||||
upd_time = TIME_GET();
|
upd_time = TIME_GET();
|
||||||
|
|
||||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Capture child running!");
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Capture loop running!");
|
||||||
|
|
||||||
/* WOW, everything is prepared! */
|
/* WOW, everything is prepared! */
|
||||||
/* please fasten your seat belts, we will enter now the actual capture loop */
|
/* please fasten your seat belts, we will enter now the actual capture loop */
|
||||||
@ -1250,10 +1222,8 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
|
|||||||
inpkts = capture_loop_dispatch(capture_opts, &ld, errmsg, sizeof(errmsg));
|
inpkts = capture_loop_dispatch(capture_opts, &ld, errmsg, sizeof(errmsg));
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
/*fprintf(stderr, "signal pipe ret: %u\n", signal_pipe_stopped());*/
|
|
||||||
|
|
||||||
/* any news from our parent (signal pipe)? -> just stop the capture */
|
/* any news from our parent (signal pipe)? -> just stop the capture */
|
||||||
if (signal_pipe_stopped()) {
|
if (!signal_pipe_check_running()) {
|
||||||
ld.go = FALSE;
|
ld.go = FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1280,8 +1250,9 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
|
|||||||
cnd_reset(cnd_file_duration);
|
cnd_reset(cnd_file_duration);
|
||||||
}
|
}
|
||||||
wtap_dump_flush(ld.wtap_pdh);
|
wtap_dump_flush(ld.wtap_pdh);
|
||||||
sync_pipe_filename_to_parent(capture_opts->save_file);
|
sync_pipe_packet_count_to_parent(inpkts_to_sync_pipe);
|
||||||
inpkts_to_sync_pipe = 0;
|
inpkts_to_sync_pipe = 0;
|
||||||
|
sync_pipe_filename_to_parent(capture_opts->save_file);
|
||||||
} else {
|
} else {
|
||||||
/* File switch failed: stop here */
|
/* File switch failed: stop here */
|
||||||
ld.go = FALSE;
|
ld.go = FALSE;
|
||||||
@ -1347,8 +1318,9 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
|
|||||||
if(cnd_autostop_size)
|
if(cnd_autostop_size)
|
||||||
cnd_reset(cnd_autostop_size);
|
cnd_reset(cnd_autostop_size);
|
||||||
wtap_dump_flush(ld.wtap_pdh);
|
wtap_dump_flush(ld.wtap_pdh);
|
||||||
sync_pipe_filename_to_parent(capture_opts->save_file);
|
sync_pipe_packet_count_to_parent(inpkts_to_sync_pipe);
|
||||||
inpkts_to_sync_pipe = 0;
|
inpkts_to_sync_pipe = 0;
|
||||||
|
sync_pipe_filename_to_parent(capture_opts->save_file);
|
||||||
} else {
|
} else {
|
||||||
/* File switch failed: stop here */
|
/* File switch failed: stop here */
|
||||||
ld.go = FALSE;
|
ld.go = FALSE;
|
||||||
@ -1364,7 +1336,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
|
|||||||
|
|
||||||
} /* while (ld.go) */
|
} /* while (ld.go) */
|
||||||
|
|
||||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Capture child stopping ...");
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Capture loop stopping ...");
|
||||||
|
|
||||||
/* delete stop conditions */
|
/* delete stop conditions */
|
||||||
if (cnd_file_duration != NULL)
|
if (cnd_file_duration != NULL)
|
||||||
@ -1400,6 +1372,13 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
|
|||||||
/* close the wiretap (output) file */
|
/* close the wiretap (output) file */
|
||||||
close_ok = capture_loop_close_output(capture_opts, &ld, &err_close);
|
close_ok = capture_loop_close_output(capture_opts, &ld, &err_close);
|
||||||
|
|
||||||
|
/* there might be packets not yet notified to the parent */
|
||||||
|
/* (do this after closing the file, so all packets are already flushed) */
|
||||||
|
if(inpkts_to_sync_pipe) {
|
||||||
|
sync_pipe_packet_count_to_parent(inpkts_to_sync_pipe);
|
||||||
|
inpkts_to_sync_pipe = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* If we've displayed a message about a write error, there's no point
|
/* If we've displayed a message about a write error, there's no point
|
||||||
in displaying another message about an error on close. */
|
in displaying another message about an error on close. */
|
||||||
if (!close_ok && write_ok) {
|
if (!close_ok && write_ok) {
|
||||||
@ -1437,7 +1416,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
|
|||||||
/* close the input file (pcap or capture pipe) */
|
/* close the input file (pcap or capture pipe) */
|
||||||
capture_loop_close_input(&ld);
|
capture_loop_close_input(&ld);
|
||||||
|
|
||||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Capture child stopped!");
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Capture loop stopped!");
|
||||||
|
|
||||||
/* ok, if the write and the close were successful. */
|
/* ok, if the write and the close were successful. */
|
||||||
return write_ok && close_ok;
|
return write_ok && close_ok;
|
||||||
@ -1462,7 +1441,7 @@ error:
|
|||||||
/* close the input file (pcap or cap_pipe) */
|
/* close the input file (pcap or cap_pipe) */
|
||||||
capture_loop_close_input(&ld);
|
capture_loop_close_input(&ld);
|
||||||
|
|
||||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Capture child stopped with error");
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "Capture loop stopped with error");
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include <pcap.h>
|
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#include <epan/packet.h>
|
#include <epan/packet.h>
|
||||||
@ -44,7 +42,6 @@
|
|||||||
#include "cmdarg_err.h"
|
#include "cmdarg_err.h"
|
||||||
|
|
||||||
#include "capture-pcap-util.h"
|
#include "capture-pcap-util.h"
|
||||||
#include "capture_ui_utils.h"
|
|
||||||
#include <wiretap/file_util.h>
|
#include <wiretap/file_util.h>
|
||||||
|
|
||||||
|
|
||||||
@ -239,7 +236,7 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg)
|
|||||||
GList *if_list;
|
GList *if_list;
|
||||||
if_info_t *if_info;
|
if_info_t *if_info;
|
||||||
int err;
|
int err;
|
||||||
gchar err_str[PCAP_ERRBUF_SIZE];
|
gchar err_str[CAPTURE_PCAP_ERRBUF_SIZE];
|
||||||
gchar *cant_get_if_list_errstr;
|
gchar *cant_get_if_list_errstr;
|
||||||
|
|
||||||
|
|
||||||
@ -369,7 +366,7 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg,
|
|||||||
break;
|
break;
|
||||||
case 'y': /* Set the pcap data link type */
|
case 'y': /* Set the pcap data link type */
|
||||||
#ifdef HAVE_PCAP_DATALINK_NAME_TO_VAL
|
#ifdef HAVE_PCAP_DATALINK_NAME_TO_VAL
|
||||||
capture_opts->linktype = pcap_datalink_name_to_val(optarg);
|
capture_opts->linktype = linktype_name_to_val(optarg);
|
||||||
if (capture_opts->linktype == -1) {
|
if (capture_opts->linktype == -1) {
|
||||||
cmdarg_err("The specified data link type \"%s\" isn't valid",
|
cmdarg_err("The specified data link type \"%s\" isn't valid",
|
||||||
optarg);
|
optarg);
|
||||||
@ -391,7 +388,7 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg,
|
|||||||
|
|
||||||
int capture_opts_list_link_layer_types(capture_options *capture_opts)
|
int capture_opts_list_link_layer_types(capture_options *capture_opts)
|
||||||
{
|
{
|
||||||
gchar err_str[PCAP_ERRBUF_SIZE];
|
gchar err_str[CAPTURE_PCAP_ERRBUF_SIZE];
|
||||||
GList *lt_list, *lt_entry;
|
GList *lt_list, *lt_entry;
|
||||||
data_link_info_t *data_link_info;
|
data_link_info_t *data_link_info;
|
||||||
|
|
||||||
@ -399,11 +396,11 @@ int capture_opts_list_link_layer_types(capture_options *capture_opts)
|
|||||||
lt_list = get_pcap_linktype_list(capture_opts->iface, err_str);
|
lt_list = get_pcap_linktype_list(capture_opts->iface, err_str);
|
||||||
if (lt_list == NULL) {
|
if (lt_list == NULL) {
|
||||||
if (err_str[0] != '\0') {
|
if (err_str[0] != '\0') {
|
||||||
cmdarg_err("The list of data link types for the capture device could not be obtained (%s)."
|
cmdarg_err("The list of data link types for the capture device \"%s\" could not be obtained (%s)."
|
||||||
"Please check to make sure you have sufficient permissions, and that\n"
|
"Please check to make sure you have sufficient permissions, and that\n"
|
||||||
"you have the proper interface or pipe specified.\n", err_str);
|
"you have the proper interface or pipe specified.\n", capture_opts->iface, err_str);
|
||||||
} else
|
} else
|
||||||
cmdarg_err("The capture device has no data link types.");
|
cmdarg_err("The capture device \"%s\" has no data link types.", capture_opts->iface);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
cmdarg_err_cont("Data link types (use option -y to set):");
|
cmdarg_err_cont("Data link types (use option -y to set):");
|
||||||
@ -429,7 +426,7 @@ int capture_opts_list_interfaces()
|
|||||||
GList *if_entry;
|
GList *if_entry;
|
||||||
if_info_t *if_info;
|
if_info_t *if_info;
|
||||||
int err;
|
int err;
|
||||||
gchar err_str[PCAP_ERRBUF_SIZE];
|
gchar err_str[CAPTURE_PCAP_ERRBUF_SIZE];
|
||||||
gchar *cant_get_if_list_errstr;
|
gchar *cant_get_if_list_errstr;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -491,7 +488,7 @@ gboolean capture_opts_trim_iface(capture_options *capture_opts, const char *capt
|
|||||||
GList *if_list;
|
GList *if_list;
|
||||||
if_info_t *if_info;
|
if_info_t *if_info;
|
||||||
int err;
|
int err;
|
||||||
gchar err_str[PCAP_ERRBUF_SIZE];
|
gchar err_str[CAPTURE_PCAP_ERRBUF_SIZE];
|
||||||
gchar *cant_get_if_list_errstr;
|
gchar *cant_get_if_list_errstr;
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,8 +28,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_LIBPCAP
|
#ifdef HAVE_LIBPCAP
|
||||||
|
|
||||||
#include <pcap.h>
|
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -41,10 +39,16 @@
|
|||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_WAIT_H
|
#ifdef HAVE_SYS_WAIT_H
|
||||||
# include <sys/wait.h>
|
# include <sys/wait.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "capture-pcap-util.h"
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
/*
|
/*
|
||||||
* Define various POSIX macros (and, in the case of WCOREDUMP, non-POSIX
|
* Define various POSIX macros (and, in the case of WCOREDUMP, non-POSIX
|
||||||
@ -353,7 +357,7 @@ sync_pipe_start(capture_options *capture_opts) {
|
|||||||
if (capture_opts->linktype != -1) {
|
if (capture_opts->linktype != -1) {
|
||||||
argv = sync_pipe_add_arg(argv, &argc, "-y");
|
argv = sync_pipe_add_arg(argv, &argc, "-y");
|
||||||
#ifdef HAVE_PCAP_DATALINK_VAL_TO_NAME
|
#ifdef HAVE_PCAP_DATALINK_VAL_TO_NAME
|
||||||
g_snprintf(ssnap, ARGV_NUMBER_LEN, "%s",pcap_datalink_val_to_name(capture_opts->linktype));
|
g_snprintf(ssnap, ARGV_NUMBER_LEN, "%s",linktype_val_to_name(capture_opts->linktype));
|
||||||
#else
|
#else
|
||||||
/* XXX - just treat it as a number */
|
/* XXX - just treat it as a number */
|
||||||
g_snprintf(ssnap, ARGV_NUMBER_LEN, "%d",capture_opts->linktype);
|
g_snprintf(ssnap, ARGV_NUMBER_LEN, "%d",capture_opts->linktype);
|
||||||
@ -472,6 +476,7 @@ sync_pipe_start(capture_options *capture_opts) {
|
|||||||
si.hStdInput = signal_pipe_read;
|
si.hStdInput = signal_pipe_read;
|
||||||
si.hStdOutput = sync_pipe_write;
|
si.hStdOutput = sync_pipe_write;
|
||||||
si.hStdError = sync_pipe_write;
|
si.hStdError = sync_pipe_write;
|
||||||
|
/*si.hStdError = (HANDLE) _get_osfhandle(2);*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_string_append(args, exename);
|
g_string_append(args, exename);
|
||||||
|
@ -94,4 +94,10 @@ extern void
|
|||||||
sync_pipe_errmsg_to_parent(const char *errmsg);
|
sync_pipe_errmsg_to_parent(const char *errmsg);
|
||||||
|
|
||||||
|
|
||||||
|
/** does the parent signalled the child to stop */
|
||||||
|
#ifdef _WIN32
|
||||||
|
extern gboolean
|
||||||
|
signal_pipe_check_running(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* capture_sync.h */
|
#endif /* capture_sync.h */
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_LIBPCAP
|
#ifdef HAVE_LIBPCAP
|
||||||
|
|
||||||
#include <pcap.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
@ -110,7 +109,7 @@ get_interface_descriptive_name(const char *if_name)
|
|||||||
GList *if_entry;
|
GList *if_entry;
|
||||||
if_info_t *if_info;
|
if_info_t *if_info;
|
||||||
int err;
|
int err;
|
||||||
char err_buf[PCAP_ERRBUF_SIZE];
|
char err_buf[CAPTURE_PCAP_ERRBUF_SIZE];
|
||||||
|
|
||||||
/* Do we have a user-supplied description? */
|
/* Do we have a user-supplied description? */
|
||||||
descr = capture_dev_user_descr_find(if_name);
|
descr = capture_dev_user_descr_find(if_name);
|
||||||
|
156
dumpcap.c
156
dumpcap.c
@ -81,8 +81,6 @@ void exit_main(int err) __attribute__ ((noreturn));
|
|||||||
void exit_main(int err);
|
void exit_main(int err);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *get_basename(const char *path);
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_usage(gboolean print_ver) {
|
print_usage(gboolean print_ver) {
|
||||||
@ -152,44 +150,50 @@ show_version(GString *comp_info_str, GString *runtime_info_str)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Report an error in command-line arguments.
|
* Report an error in command-line arguments.
|
||||||
* Creates a console on Windows.
|
|
||||||
* XXX - pop this up in a window of some sort on UNIX+X11 if the controlling
|
|
||||||
* terminal isn't the standard error?
|
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
cmdarg_err(const char *fmt, ...)
|
cmdarg_err(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
if(capture_child) {
|
||||||
fprintf(stderr, "dumpcap: ");
|
/* XXX - convert to g_log */
|
||||||
vfprintf(stderr, fmt, ap);
|
} else {
|
||||||
fprintf(stderr, "\n");
|
va_start(ap, fmt);
|
||||||
va_end(ap);
|
fprintf(stderr, "dumpcap: ");
|
||||||
|
vfprintf(stderr, fmt, ap);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
va_end(ap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Report additional information for an error in command-line arguments.
|
* Report additional information for an error in command-line arguments.
|
||||||
* Creates a console on Windows.
|
|
||||||
* XXX - pop this up in a window of some sort on UNIX+X11 if the controlling
|
|
||||||
* terminal isn't the standard error?
|
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
cmdarg_err_cont(const char *fmt, ...)
|
cmdarg_err_cont(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
if(capture_child) {
|
||||||
vfprintf(stderr, fmt, ap);
|
/* XXX - convert to g_log */
|
||||||
fprintf(stderr, "\n");
|
} else {
|
||||||
va_end(ap);
|
va_start(ap, fmt);
|
||||||
|
vfprintf(stderr, fmt, ap);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
va_end(ap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
BOOL WINAPI ConsoleCtrlHandlerRoutine(DWORD dwCtrlType)
|
BOOL WINAPI ConsoleCtrlHandlerRoutine(DWORD dwCtrlType)
|
||||||
{
|
{
|
||||||
/*printf("Event: %u", dwCtrlType);*/
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO,
|
||||||
|
"Console: Ctrl+C");
|
||||||
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG,
|
||||||
|
"Console: Ctrl+C CtrlType: %u", dwCtrlType);
|
||||||
|
|
||||||
capture_loop_stop();
|
capture_loop_stop();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -415,13 +419,8 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Let the user know what interface was chosen. */
|
/* Let the user know what interface was chosen. */
|
||||||
/* descr = get_interface_descriptive_name(capture_opts.iface);
|
/* get_interface_descriptive_name() is not available! */
|
||||||
fprintf(stderr, "Capturing on %s\n", descr);
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_MESSAGE, "Interface: %s\n", capture_opts->iface);
|
||||||
g_free(descr);*/
|
|
||||||
|
|
||||||
if(!capture_child) {
|
|
||||||
fprintf(stderr, "Capturing on %s\n", capture_opts->iface);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (list_link_layer_types) {
|
if (list_link_layer_types) {
|
||||||
status = capture_opts_list_link_layer_types(capture_opts);
|
status = capture_opts_list_link_layer_types(capture_opts);
|
||||||
@ -462,6 +461,10 @@ console_log_handler(const char *log_domain, GLogLevelFlags log_level,
|
|||||||
const char *level;
|
const char *level;
|
||||||
|
|
||||||
|
|
||||||
|
if(capture_child) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* ignore log message, if log_level isn't interesting */
|
/* ignore log message, if log_level isn't interesting */
|
||||||
if( !(log_level & G_LOG_LEVEL_MASK & ~(G_LOG_LEVEL_DEBUG|G_LOG_LEVEL_INFO))) {
|
if( !(log_level & G_LOG_LEVEL_MASK & ~(G_LOG_LEVEL_DEBUG|G_LOG_LEVEL_INFO))) {
|
||||||
#ifndef DEBUG_DUMPCAP
|
#ifndef DEBUG_DUMPCAP
|
||||||
@ -498,15 +501,25 @@ console_log_handler(const char *log_domain, GLogLevelFlags log_level,
|
|||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* don't use printf (stdout), as the capture child uses stdout for it's sync_pipe */
|
/* don't use printf (stdout), in child mode we're using stdout for the sync_pipe */
|
||||||
fprintf(stderr, "%02u:%02u:%02u %8s %s %s\n",
|
if(log_level & G_LOG_LEVEL_MESSAGE) {
|
||||||
today->tm_hour, today->tm_min, today->tm_sec,
|
/* normal user messages without additional infos */
|
||||||
log_domain != NULL ? log_domain : "",
|
fprintf(stderr, "%s\n", message);
|
||||||
level, message);
|
fflush(stderr);
|
||||||
|
} else {
|
||||||
|
/* info/debug messages with additional infos */
|
||||||
|
fprintf(stderr, "%02u:%02u:%02u %8s %s %s\n",
|
||||||
|
today->tm_hour, today->tm_min, today->tm_sec,
|
||||||
|
log_domain != NULL ? log_domain : "",
|
||||||
|
level, message);
|
||||||
|
fflush(stderr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************************************/
|
/****************************************************************************************************************/
|
||||||
/* sync_pipe stubs */
|
/* sync_pipe handling */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Maximum length of sync pipe message data. Must be < 2^24, as the
|
* Maximum length of sync pipe message data. Must be < 2^24, as the
|
||||||
@ -529,10 +542,6 @@ pipe_write_block(int pipe, char indicator, int len, const char *msg)
|
|||||||
|
|
||||||
/*g_warning("write %d enter", pipe);*/
|
/*g_warning("write %d enter", pipe);*/
|
||||||
|
|
||||||
/* if we're not a capture child, we don't have to tell our none existing parent anything */
|
|
||||||
if(!capture_child)
|
|
||||||
return;
|
|
||||||
|
|
||||||
g_assert(indicator < '0' || indicator > '9');
|
g_assert(indicator < '0' || indicator > '9');
|
||||||
g_assert(len <= SP_MAX_MSG_LEN);
|
g_assert(len <= SP_MAX_MSG_LEN);
|
||||||
|
|
||||||
@ -569,41 +578,39 @@ sync_pipe_packet_count_to_parent(int packet_count)
|
|||||||
static int count = 0;
|
static int count = 0;
|
||||||
|
|
||||||
|
|
||||||
if(!capture_child) {
|
if(capture_child) {
|
||||||
|
g_snprintf(tmp, sizeof(tmp), "%d", packet_count);
|
||||||
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, "Packets: %s", tmp);
|
||||||
|
pipe_write_block(1, SP_PACKET_COUNT, strlen(tmp)+1, tmp);
|
||||||
|
} else {
|
||||||
count += packet_count;
|
count += packet_count;
|
||||||
fprintf(stderr, "\r%u", count);
|
fprintf(stderr, "\rPackets: %u ", count);
|
||||||
/* stderr could be line buffered */
|
/* stderr could be line buffered */
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_snprintf(tmp, sizeof(tmp), "%d", packet_count);
|
|
||||||
|
|
||||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, "sync_pipe_packet_count_to_parent: %s", tmp);
|
|
||||||
|
|
||||||
pipe_write_block(1, SP_PACKET_COUNT, strlen(tmp)+1, tmp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sync_pipe_filename_to_parent(const char *filename)
|
sync_pipe_filename_to_parent(const char *filename)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!capture_child) {
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_MESSAGE, "File: %s", filename);
|
||||||
fprintf(stderr, "\nFile: %s\n", filename);
|
|
||||||
/* stderr could be line buffered */
|
if(capture_child) {
|
||||||
fflush(stderr);
|
pipe_write_block(1, SP_FILE, strlen(filename)+1, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO, "File: %s", filename);
|
|
||||||
|
|
||||||
pipe_write_block(1, SP_FILE, strlen(filename)+1, filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sync_pipe_errmsg_to_parent(const char *errmsg)
|
sync_pipe_errmsg_to_parent(const char *errmsg)
|
||||||
{
|
{
|
||||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, "sync_pipe_errmsg_to_parent: %s", errmsg);
|
|
||||||
|
|
||||||
pipe_write_block(1, SP_ERROR_MSG, strlen(errmsg)+1, errmsg);
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_MESSAGE, "Error: %s", errmsg);
|
||||||
|
|
||||||
|
if(capture_child) {
|
||||||
|
pipe_write_block(1, SP_ERROR_MSG, strlen(errmsg)+1, errmsg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -613,13 +620,51 @@ sync_pipe_drops_to_parent(int drops)
|
|||||||
|
|
||||||
|
|
||||||
g_snprintf(tmp, sizeof(tmp), "%d", drops);
|
g_snprintf(tmp, sizeof(tmp), "%d", drops);
|
||||||
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_MESSAGE, "Packets dropped: %s", tmp);
|
||||||
|
|
||||||
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, "sync_pipe_drops_to_parent: %s", tmp);
|
if(capture_child) {
|
||||||
|
pipe_write_block(1, SP_DROPS, strlen(tmp)+1, tmp);
|
||||||
pipe_write_block(1, SP_DROPS, strlen(tmp)+1, tmp);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/****************************************************************************************************************/
|
||||||
|
/* signal_pipe handling */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
gboolean
|
||||||
|
signal_pipe_check_running(void)
|
||||||
|
{
|
||||||
|
/* any news from our parent (stdin)? -> just stop the capture */
|
||||||
|
HANDLE handle;
|
||||||
|
DWORD avail = 0;
|
||||||
|
gboolean result;
|
||||||
|
|
||||||
|
|
||||||
|
/* if we are running standalone, no check required */
|
||||||
|
if(!capture_child) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
handle = (HANDLE) GetStdHandle(STD_INPUT_HANDLE);
|
||||||
|
result = PeekNamedPipe(handle, NULL, 0, NULL, &avail, NULL);
|
||||||
|
|
||||||
|
if(!result || avail > 0) {
|
||||||
|
/* peek failed or some bytes really available */
|
||||||
|
/* (if not piping from stdin this would fail) */
|
||||||
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_INFO,
|
||||||
|
"Signal pipe: Stop capture");
|
||||||
|
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG,
|
||||||
|
"Signal pipe: handle: %x result: %u avail: %u", handle, result, avail);
|
||||||
|
return FALSE;
|
||||||
|
} else {
|
||||||
|
/* pipe ok and no bytes available */
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************************************/
|
/****************************************************************************************************************/
|
||||||
/* simple_dialog stubs */
|
/* simple_dialog stubs */
|
||||||
@ -652,6 +697,7 @@ simple_dialog_format_message(const char *msg)
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************************************/
|
/****************************************************************************************************************/
|
||||||
/* Stub functions */
|
/* Stub functions */
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_LIBPCAP
|
#ifdef HAVE_LIBPCAP
|
||||||
|
|
||||||
#include <pcap.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
@ -159,7 +158,7 @@ set_link_type_list(GtkWidget *linktype_om, GtkWidget *entry)
|
|||||||
if_info_t *if_info;
|
if_info_t *if_info;
|
||||||
GList *lt_list;
|
GList *lt_list;
|
||||||
int err;
|
int err;
|
||||||
char err_buf[PCAP_ERRBUF_SIZE];
|
char err_buf[CAPTURE_PCAP_ERRBUF_SIZE];
|
||||||
GtkWidget *lt_menu, *lt_menu_item;
|
GtkWidget *lt_menu, *lt_menu_item;
|
||||||
GList *lt_entry;
|
GList *lt_entry;
|
||||||
data_link_info_t *data_link_info;
|
data_link_info_t *data_link_info;
|
||||||
@ -525,7 +524,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||||||
GList *if_list, *combo_list, *cfilter_list;
|
GList *if_list, *combo_list, *cfilter_list;
|
||||||
int err;
|
int err;
|
||||||
int row;
|
int row;
|
||||||
char err_str[PCAP_ERRBUF_SIZE];
|
char err_str[CAPTURE_PCAP_ERRBUF_SIZE];
|
||||||
gchar *cant_get_if_list_errstr;
|
gchar *cant_get_if_list_errstr;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
GtkAdjustment *buffer_size_adj;
|
GtkAdjustment *buffer_size_adj;
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include <pcap.h>
|
|
||||||
#include "capture.h"
|
#include "capture.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "dlg_utils.h"
|
#include "dlg_utils.h"
|
||||||
|
@ -33,8 +33,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <pcap.h>
|
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
@ -160,7 +158,7 @@ capture_details_cb(GtkWidget *details_bt _U_, gpointer if_data)
|
|||||||
static void
|
static void
|
||||||
open_if(gchar *name, if_dlg_data_t *if_dlg_data)
|
open_if(gchar *name, if_dlg_data_t *if_dlg_data)
|
||||||
{
|
{
|
||||||
gchar open_err_str[PCAP_ERRBUF_SIZE];
|
gchar open_err_str[CAPTURE_PCAP_ERRBUF_SIZE];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX - on systems with BPF, the number of BPF devices limits the
|
* XXX - on systems with BPF, the number of BPF devices limits the
|
||||||
@ -328,7 +326,7 @@ capture_if_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||||||
#endif
|
#endif
|
||||||
GtkTooltips *tooltips;
|
GtkTooltips *tooltips;
|
||||||
int err;
|
int err;
|
||||||
char err_str[PCAP_ERRBUF_SIZE];
|
char err_str[CAPTURE_PCAP_ERRBUF_SIZE];
|
||||||
gchar *cant_get_if_list_errstr;
|
gchar *cant_get_if_list_errstr;
|
||||||
int row;
|
int row;
|
||||||
if_dlg_data_t *if_dlg_data;
|
if_dlg_data_t *if_dlg_data;
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_LIBPCAP
|
#ifdef HAVE_LIBPCAP
|
||||||
|
|
||||||
#include <pcap.h>
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include "gtk/compat_macros.h"
|
#include "gtk/compat_macros.h"
|
||||||
|
|
||||||
@ -38,7 +37,6 @@
|
|||||||
|
|
||||||
#include <epan/packet.h>
|
#include <epan/packet.h>
|
||||||
#include "capture.h"
|
#include "capture.h"
|
||||||
#include "capture_loop.h"
|
|
||||||
#include "capture_info.h"
|
#include "capture_info.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "capture_ui_utils.h"
|
#include "capture_ui_utils.h"
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_LIBPCAP
|
#ifdef HAVE_LIBPCAP
|
||||||
|
|
||||||
#include <pcap.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
@ -85,7 +84,7 @@ capture_prefs_show(void)
|
|||||||
GtkWidget *ifopts_lb, *ifopts_bt;
|
GtkWidget *ifopts_lb, *ifopts_bt;
|
||||||
GList *if_list, *combo_list;
|
GList *if_list, *combo_list;
|
||||||
int err;
|
int err;
|
||||||
char err_str[PCAP_ERRBUF_SIZE];
|
char err_str[CAPTURE_PCAP_ERRBUF_SIZE];
|
||||||
int row = 0;
|
int row = 0;
|
||||||
GtkTooltips *tooltips = gtk_tooltips_new();
|
GtkTooltips *tooltips = gtk_tooltips_new();
|
||||||
|
|
||||||
@ -695,7 +694,7 @@ ifopts_if_clist_add(void)
|
|||||||
{
|
{
|
||||||
GList *if_list;
|
GList *if_list;
|
||||||
int err;
|
int err;
|
||||||
char err_str[PCAP_ERRBUF_SIZE];
|
char err_str[CAPTURE_PCAP_ERRBUF_SIZE];
|
||||||
gchar *cant_get_if_list_errstr;
|
gchar *cant_get_if_list_errstr;
|
||||||
if_info_t *if_info;
|
if_info_t *if_info;
|
||||||
guint i;
|
guint i;
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include "cfilter_combo_utils.h"
|
#include "cfilter_combo_utils.h"
|
||||||
#include "recent.h"
|
#include "recent.h"
|
||||||
#ifdef HAVE_LIBPCAP
|
#ifdef HAVE_LIBPCAP
|
||||||
#include <pcap.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* XXX: use a preference for this setting! */
|
/* XXX: use a preference for this setting! */
|
||||||
|
@ -26,10 +26,6 @@
|
|||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBPCAP
|
|
||||||
#include <pcap.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
@ -91,7 +91,6 @@
|
|||||||
#include "merge.h"
|
#include "merge.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBPCAP
|
#ifdef HAVE_LIBPCAP
|
||||||
#include <pcap.h>
|
|
||||||
#include "capture-pcap-util.h"
|
#include "capture-pcap-util.h"
|
||||||
#include "capture.h"
|
#include "capture.h"
|
||||||
#include "capture_sync.h"
|
#include "capture_sync.h"
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#ifdef HAVE_LIBPCAP
|
#ifdef HAVE_LIBPCAP
|
||||||
#include <pcap.h>
|
|
||||||
#include "capture.h"
|
#include "capture.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#define __SUMMARY_H__
|
#define __SUMMARY_H__
|
||||||
|
|
||||||
#ifdef HAVE_LIBPCAP
|
#ifdef HAVE_LIBPCAP
|
||||||
#include <pcap.h>
|
|
||||||
#include "capture.h"
|
#include "capture.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -48,12 +48,6 @@
|
|||||||
#define eth_mkstemp mkstemp
|
#define eth_mkstemp mkstemp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* This has to come after the include of <pcap.h>, as the include of
|
|
||||||
* <pcap.h> might cause <winsock2.h> to be included, and if we've
|
|
||||||
* already included <winsock.h> as a result of including <windows.h>,
|
|
||||||
* we get a bunch of redefinitions.
|
|
||||||
*/
|
|
||||||
#ifdef HAVE_WINDOWS_H
|
#ifdef HAVE_WINDOWS_H
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
17
tethereal.c
17
tethereal.c
@ -2907,6 +2907,23 @@ sync_pipe_errmsg_to_parent(const char *errmsg)
|
|||||||
#endif /* HAVE_LIBPCAP */
|
#endif /* HAVE_LIBPCAP */
|
||||||
|
|
||||||
|
|
||||||
|
/****************************************************************************************************************/
|
||||||
|
/* signal pipe "dummies", needed for capture_loop.c */
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBPCAP
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
gboolean
|
||||||
|
signal_pipe_check_running(void)
|
||||||
|
{
|
||||||
|
/* currently, no check required */
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
|
#endif /* HAVE_LIBPCAP */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************************************/
|
/****************************************************************************************************************/
|
||||||
/* simple_dialog "dummies", needed for capture_loop.c */
|
/* simple_dialog "dummies", needed for capture_loop.c */
|
||||||
|
|
||||||
|
@ -40,10 +40,6 @@
|
|||||||
#include <pcre.h> /* to get the libpcre version number */
|
#include <pcre.h> /* to get the libpcre version number */
|
||||||
#endif /* HAVE_LIBPCRE */
|
#endif /* HAVE_LIBPCRE */
|
||||||
|
|
||||||
#ifdef HAVE_WINDOWS_H
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SOME_SNMP
|
#ifdef HAVE_SOME_SNMP
|
||||||
|
|
||||||
#ifdef HAVE_NET_SNMP
|
#ifdef HAVE_NET_SNMP
|
||||||
@ -65,6 +61,11 @@
|
|||||||
|
|
||||||
#include "svnversion.h"
|
#include "svnversion.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef SVNVERSION
|
#ifdef SVNVERSION
|
||||||
const char *svnversion = " (" SVNVERSION ")";
|
const char *svnversion = " (" SVNVERSION ")";
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user