Constify a bunch of arguments and variables, to squelch compiler
warnings. Include "wiretap/libpcap.h" in "capture_loop.h", to get its declarations of data structures for headers in libpcap files. This lets us remove the includes of "wiretap/libpcap.h from files including "capture_loop.h". Make "log_func_ignore()" in "tethereal.c" static, and declare some of its arguments unused. Also get rid of an unused variable. Include <pcap.h> before including "wiretap/wtap-capture.h", to declare "struct pcap_pkthdr". svn path=/trunk/; revision=16791
This commit is contained in:
parent
1f5bf52d6b
commit
eaee2b68c5
|
@ -61,7 +61,7 @@
|
||||||
* rest-of-the-universe libpcap.
|
* rest-of-the-universe libpcap.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
get_pcap_linktype(pcap_t *pch, char *devname
|
get_pcap_linktype(pcap_t *pch, const char *devname
|
||||||
#ifndef _AIX
|
#ifndef _AIX
|
||||||
_U_
|
_U_
|
||||||
#endif
|
#endif
|
||||||
|
@ -69,7 +69,7 @@ get_pcap_linktype(pcap_t *pch, char *devname
|
||||||
{
|
{
|
||||||
int linktype;
|
int linktype;
|
||||||
#ifdef _AIX
|
#ifdef _AIX
|
||||||
char *ifacename;
|
const char *ifacename;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
linktype = pcap_datalink(pch);
|
linktype = pcap_datalink(pch);
|
||||||
|
@ -348,7 +348,7 @@ create_data_link_info(int dlt)
|
||||||
}
|
}
|
||||||
|
|
||||||
GList *
|
GList *
|
||||||
get_pcap_linktype_list(char *devname, char *err_buf)
|
get_pcap_linktype_list(const char *devname, char *err_buf)
|
||||||
{
|
{
|
||||||
GList *linktype_list = NULL;
|
GList *linktype_list = NULL;
|
||||||
pcap_t *pch;
|
pcap_t *pch;
|
||||||
|
|
|
@ -91,8 +91,8 @@ typedef struct {
|
||||||
char *description;
|
char *description;
|
||||||
} data_link_info_t;
|
} data_link_info_t;
|
||||||
|
|
||||||
int get_pcap_linktype(pcap_t *pch, char *devname);
|
int get_pcap_linktype(pcap_t *pch, const char *devname);
|
||||||
GList *get_pcap_linktype_list(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);
|
||||||
const char *set_pcap_linktype(pcap_t *pch, char *devname, int dlt);
|
const char *set_pcap_linktype(pcap_t *pch, char *devname, int dlt);
|
||||||
|
|
||||||
|
|
|
@ -66,12 +66,11 @@
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
#include <pcap.h>
|
||||||
|
|
||||||
#include "wiretap/wtap.h"
|
#include "wiretap/wtap.h"
|
||||||
#include "wiretap/wtap-capture.h"
|
#include "wiretap/wtap-capture.h"
|
||||||
#include "wiretap/libpcap.h"
|
|
||||||
|
|
||||||
|
|
||||||
#include <pcap.h>
|
|
||||||
#include "capture-pcap-util.h"
|
#include "capture-pcap-util.h"
|
||||||
|
|
||||||
#include "capture.h"
|
#include "capture.h"
|
||||||
|
|
|
@ -32,6 +32,14 @@
|
||||||
#ifndef __CAPTURE_LOOP_H__
|
#ifndef __CAPTURE_LOOP_H__
|
||||||
#define __CAPTURE_LOOP_H__
|
#define __CAPTURE_LOOP_H__
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
/*
|
||||||
|
* Get information about libpcap format from "wiretap/libpcap.h".
|
||||||
|
* XXX - can we just use pcap_open_offline() to read the pipe?
|
||||||
|
*/
|
||||||
|
#include "wiretap/libpcap.h"
|
||||||
|
#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. */
|
||||||
extern int capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct pcap_stat *stats);
|
extern int capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct pcap_stat *stats);
|
||||||
|
|
|
@ -269,10 +269,10 @@ free_capture_combo_list(GList *combo_list)
|
||||||
* Given text that contains an interface name possibly prefixed by an
|
* Given text that contains an interface name possibly prefixed by an
|
||||||
* interface description, extract the interface name.
|
* interface description, extract the interface name.
|
||||||
*/
|
*/
|
||||||
char *
|
const char *
|
||||||
get_if_name(const char *if_text)
|
get_if_name(const char *if_text)
|
||||||
{
|
{
|
||||||
char *if_name;
|
const char *if_name;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -65,7 +65,7 @@ void free_capture_combo_list(GList *combo_list);
|
||||||
*
|
*
|
||||||
* @return The raw interface name, without description (must NOT be g_free'd later)
|
* @return The raw interface name, without description (must NOT be g_free'd later)
|
||||||
*/
|
*/
|
||||||
char *get_if_name(const char *if_text);
|
const char *get_if_name(const char *if_text);
|
||||||
|
|
||||||
/** Convert plain interface name to the displayed name in the combo box.
|
/** Convert plain interface name to the displayed name in the combo box.
|
||||||
*
|
*
|
||||||
|
|
|
@ -153,7 +153,7 @@ set_link_type_list(GtkWidget *linktype_om, GtkWidget *entry)
|
||||||
{
|
{
|
||||||
gchar *entry_text;
|
gchar *entry_text;
|
||||||
gchar *if_text;
|
gchar *if_text;
|
||||||
gchar *if_name;
|
const gchar *if_name;
|
||||||
GList *if_list;
|
GList *if_list;
|
||||||
GList *if_entry;
|
GList *if_entry;
|
||||||
if_info_t *if_info;
|
if_info_t *if_info;
|
||||||
|
@ -1178,7 +1178,7 @@ capture_start_confirmed(void) {
|
||||||
/* XXX - would better be doing this in main.c */
|
/* XXX - would better be doing this in main.c */
|
||||||
if(capture_opts->iface == NULL) {
|
if(capture_opts->iface == NULL) {
|
||||||
gchar *if_device;
|
gchar *if_device;
|
||||||
gchar *if_name;
|
const gchar *if_name;
|
||||||
|
|
||||||
/* did the user ever selected a capture interface before? */
|
/* did the user ever selected a capture interface before? */
|
||||||
if(prefs.capture_device == NULL) {
|
if(prefs.capture_device == NULL) {
|
||||||
|
@ -1301,7 +1301,7 @@ capture_dlg_prep(gpointer parent_w) {
|
||||||
#endif
|
#endif
|
||||||
gchar *entry_text;
|
gchar *entry_text;
|
||||||
gchar *if_text;
|
gchar *if_text;
|
||||||
gchar *if_name;
|
const gchar *if_name;
|
||||||
const gchar *filter_text;
|
const gchar *filter_text;
|
||||||
const gchar *g_save_file;
|
const gchar *g_save_file;
|
||||||
gchar *cf_name;
|
gchar *cf_name;
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
|
|
||||||
#include <epan/packet.h>
|
#include <epan/packet.h>
|
||||||
#include "capture.h"
|
#include "capture.h"
|
||||||
#include "wiretap/libpcap.h"
|
|
||||||
#include "capture_loop.h"
|
#include "capture_loop.h"
|
||||||
#include "capture_info.h"
|
#include "capture_info.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
|
@ -94,7 +94,6 @@
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include "capture-pcap-util.h"
|
#include "capture-pcap-util.h"
|
||||||
#include <wiretap/wtap-capture.h>
|
#include <wiretap/wtap-capture.h>
|
||||||
#include <wiretap/libpcap.h>
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "capture-wpcap.h"
|
#include "capture-wpcap.h"
|
||||||
#include "capture_errs.h"
|
#include "capture_errs.h"
|
||||||
|
@ -581,7 +580,9 @@ add_decode_as(const gchar *cl_param)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void log_func_ignore (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
|
static void
|
||||||
|
log_func_ignore (const gchar *log_domain _U_, GLogLevelFlags log_level _U_,
|
||||||
|
const gchar *message _U_, gpointer user_data _U_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1379,7 +1380,6 @@ capture(char *save_file, int out_file_type)
|
||||||
struct pcap_stat stats;
|
struct pcap_stat stats;
|
||||||
gboolean write_ok;
|
gboolean write_ok;
|
||||||
gboolean close_ok;
|
gboolean close_ok;
|
||||||
dfilter_t *rfcode = NULL;
|
|
||||||
int save_file_fd;
|
int save_file_fd;
|
||||||
|
|
||||||
/* Initialize all data structures used for dissection. */
|
/* Initialize all data structures used for dissection. */
|
||||||
|
|
Loading…
Reference in New Issue