Comment back in the body of tb80211_do_set_channel to avoid warnings about
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 20 Jun 2012 18:42:45 +0000 (18:42 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 20 Jun 2012 18:42:45 +0000 (18:42 +0000)
unused parameters. Add the missing functions by applying the skipped patches
to capture_sync.[hc]

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@43414 f5534014-38df-0310-8fa8-9805f1628bb7

capture_sync.c
capture_sync.h
ui/gtk/main_80211_toolbar.c

index 100990c551fd2e47e3ccb5447b5f86436b8a2cd9..c99f8e5f1efed9d34274a9c69620e9519c5e6ef6 100644 (file)
@@ -1112,6 +1112,53 @@ sync_pipe_run_command(const char** argv, gchar **data, gchar **primary_msg,
     return ret;
 }
 
+int
+sync_interface_set_80211_chan(gchar *iface, char *freq, gchar *type,
+                              gchar **data, gchar **primary_msg,
+                              gchar **secondary_msg)
+{
+    int argc, ret;
+    const char **argv;
+    gchar *opt;
+
+    argv = init_pipe_args(&argc);
+
+    if (!argv) {
+        *primary_msg = g_strdup("We don't know where to find dumpcap.");
+        *secondary_msg = NULL;
+        *data = NULL;
+        return -1;
+    }
+
+    argv = sync_pipe_add_arg(argv, &argc, "-i");
+    argv = sync_pipe_add_arg(argv, &argc, iface);
+
+    if (type)
+        opt = g_strdup_printf("%s,%s", freq, type);
+    else
+        opt = g_strdup_printf("%s", freq);
+
+    if (!opt) {
+        *primary_msg = g_strdup("Out of mem.");
+        *secondary_msg = NULL;
+        *data = NULL;
+        return -1;
+    }
+
+    argv = sync_pipe_add_arg(argv, &argc, "-k");
+    argv = sync_pipe_add_arg(argv, &argc, opt);
+
+#ifndef DEBUG_CHILD
+    /* Run dumpcap in capture child mode */
+    argv = sync_pipe_add_arg(argv, &argc, "-Z");
+    argv = sync_pipe_add_arg(argv, &argc, SIGNAL_PIPE_CTRL_ID_NONE);
+#endif
+
+    ret = sync_pipe_run_command(argv, data, primary_msg, secondary_msg);
+    g_free(opt);
+    return ret;
+}
+
 /*
  * Get the list of interfaces using dumpcap.
  *
index d38e2ddd77d6cdf95f045af2c845764903038936..cb146dab96c82def3bf2a00fbf8d26f52d295327 100644 (file)
@@ -57,6 +57,12 @@ sync_pipe_stop(capture_options *capture_opts);
 extern void
 sync_pipe_kill(int fork_child);
 
+/** Set wireless channel using dumpcap */
+extern int
+sync_interface_set_80211_chan(gchar *iface, char *freq, gchar *type,
+                              gchar **data, gchar **primary_msg,
+                              gchar **secondary_msg);
+
 /** Get an interface list using dumpcap */
 extern int
 sync_interface_list_open(gchar **data, gchar **primary_msg,
index 4e5c822f5fe6706d88123dbf53449ff6bd9d81bb..ca72af01b046a026dc018cde00bbde1ca49fb70c 100644 (file)
@@ -166,7 +166,6 @@ int get_selected_channel_type(void)
 static int
 tb80211_do_set_channel(char *iface, int freq, int type)
 {
-#if 0
        gchar *freq_s, *type_s;
        gchar *data, *primary_msg, *secondary_msg;
        int ret;
@@ -185,8 +184,6 @@ tb80211_do_set_channel(char *iface, int freq, int type)
        g_free(secondary_msg);
        g_free(freq_s);
        return ret;
-#endif
-       return -1;;
 }
 
 /* Called on freq and type combo box change. */