aboutsummaryrefslogtreecommitdiffstats
path: root/capture_ui_utils.c
diff options
context:
space:
mode:
authorIrene RĂ¼ngeler <I.Ruengeler@fh-muenster.de>2013-03-13 12:38:08 +0000
committerIrene RĂ¼ngeler <I.Ruengeler@fh-muenster.de>2013-03-13 12:38:08 +0000
commit44e6a88b134b0b35ea6c7d76dd76647f357b86c0 (patch)
tree1116fe96aa640a09d11e2b82901c030a1e410e62 /capture_ui_utils.c
parent27fc641a791f6132f13521697ea4c3dc47f8bc7e (diff)
Add interface options preferences.
svn path=/trunk/; revision=48275
Diffstat (limited to 'capture_ui_utils.c')
-rw-r--r--capture_ui_utils.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/capture_ui_utils.c b/capture_ui_utils.c
index 6f525f108e..06b3268bfa 100644
--- a/capture_ui_utils.c
+++ b/capture_ui_utils.c
@@ -223,6 +223,31 @@ capture_dev_user_hassnap_find(const gchar *if_name)
return (gboolean)hassnap;
}
+gboolean
+capture_dev_user_pmode_find(const gchar *if_name)
+{
+ gchar *p, *next;
+ gboolean pmode;
+
+ if ((prefs.capture_devices_pmode == NULL) ||
+ (*prefs.capture_devices_pmode == '\0')) {
+ /* There is no promiscuous mode defined */
+ return -1;
+ }
+
+ if ((p = strstr(prefs.capture_devices_pmode, if_name)) == NULL) {
+ /* There are, but there isn't one for this interface. */
+ return -1;
+ }
+
+ p += strlen(if_name) + 1;
+ pmode = (gboolean)strtol(p, &next, 10);
+ if (next == p || *next != ')') {
+ /* Syntax error */
+ return -1;
+ }
+ return (gboolean)pmode;
+}
/*
* Return as descriptive a name for an interface as we can get.