aboutsummaryrefslogtreecommitdiffstats
path: root/capture_loop.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-02-06 21:20:35 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-02-06 21:20:35 +0000
commit3a63719e389bd9fd1f27a1a467501c8d7fe3eb69 (patch)
tree0ed850112dc342fd11812f8dba14fa2cb1a08b33 /capture_loop.c
parenta6694a746ff0ff2402e3989dfb3cf135122cf821 (diff)
another two steps towards privilege seperation:
move another two capture related fields (iface and cfilter) from cfile to capture_opts also move the handling of capture related command line options from main.c to capture.c, that way a future privilege seperated capture program can use the same code to parse it's command line than Ethereal. It might be even possible to share this parser code even with Tethereal, didn't took a closer look at this. svn path=/trunk/; revision=13320
Diffstat (limited to 'capture_loop.c')
-rw-r--r--capture_loop.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/capture_loop.c b/capture_loop.c
index 7d4d8cd204..cd8776c926 100644
--- a/capture_loop.c
+++ b/capture_loop.c
@@ -558,7 +558,7 @@ static int capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
if they succeed; to tell if that's happened, we have to clear
the error buffer, and check if it's still a null string. */
open_err_str[0] = '\0';
- ld->pcap_h = pcap_open_live(cf_get_iface(capture_opts->cf),
+ ld->pcap_h = pcap_open_live(capture_opts->iface,
capture_opts->has_snaplen ? capture_opts->snaplen :
WTAP_MAX_PACKET_SIZE,
capture_opts->promisc_mode, CAP_READ_TIMEOUT,
@@ -582,7 +582,7 @@ static int capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
/* setting the data link type only works on real interfaces */
if (capture_opts->linktype != -1) {
- set_linktype_err_str = set_pcap_linktype(ld->pcap_h, cf_get_iface(capture_opts->cf),
+ set_linktype_err_str = set_pcap_linktype(ld->pcap_h, capture_opts->iface,
capture_opts->linktype);
if (set_linktype_err_str != NULL) {
g_snprintf(errmsg, errmsg_len, "Unable to set data link type (%s).",
@@ -782,7 +782,7 @@ static int capture_loop_open_wiretap_output(capture_options *capture_opts, loop_
} else
#endif
{
- pcap_encap = get_pcap_linktype(ld->pcap_h, cf_get_iface(capture_opts->cf));
+ pcap_encap = get_pcap_linktype(ld->pcap_h, capture_opts->iface);
file_snaplen = pcap_snapshot(ld->pcap_h);
}
@@ -1023,7 +1023,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
}
/* init the input filter from the network interface (capture pipe will do nothing) */
- if (!capture_loop_init_filter(&ld, cf_get_iface(capture_opts->cf), cf_get_cfilter(capture_opts->cf), errmsg, sizeof(errmsg))) {
+ if (!capture_loop_init_filter(&ld, capture_opts->iface, capture_opts->cfilter, errmsg, sizeof(errmsg))) {
goto error;
}
@@ -1075,7 +1075,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
if(show_info) {
capture_ui.callback_data = &ld;
capture_ui.counts = &ld.counts;
- capture_info_create(&capture_ui, cf_get_iface(capture_opts->cf));
+ capture_info_create(&capture_ui, capture_opts->iface);
}
/* init the time values */