diff options
author | Jörg Mayer <jmayer@loplof.de> | 2012-06-20 18:42:45 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2012-06-20 18:42:45 +0000 |
commit | d2b4825558d8c3f04be75a0c1277d3ec087ec5a4 (patch) | |
tree | e29aa11bf4cbb2ca5e7c146bd0a121bd45bdce95 /capture_sync.c | |
parent | 5f156576cbfb4ea45c65b20cb57b9cc6794d5547 (diff) |
Comment back in the body of tb80211_do_set_channel to avoid warnings about
unused parameters. Add the missing functions by applying the skipped patches
to capture_sync.[hc]
svn path=/trunk/; revision=43414
Diffstat (limited to 'capture_sync.c')
-rw-r--r-- | capture_sync.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/capture_sync.c b/capture_sync.c index 100990c551..c99f8e5f1e 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -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. * |