From 00c862e4056be43d91beb2c6b66b996140e5d280 Mon Sep 17 00:00:00 2001 From: Mikael Kanstrup Date: Wed, 14 Sep 2016 14:13:20 +0200 Subject: capchild: Support optional 802.11 channel parameters Document the the 802.11 set channel function and its parameters. Add support for optional parameters. Bug: 12896 Change-Id: I95966f99149aa9c1502d97b5707dcc8c2f5b26e8 Reviewed-on: https://code.wireshark.org/review/17699 Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- capchild/capture_sync.c | 6 +++++- capchild/capture_sync.h | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'capchild') diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c index eb3a1e0531..2c71d7ed55 100644 --- a/capchild/capture_sync.c +++ b/capchild/capture_sync.c @@ -1189,8 +1189,12 @@ sync_interface_set_80211_chan(const gchar *iface, const char *freq, const gchar argv = sync_pipe_add_arg(argv, &argc, "-i"); argv = sync_pipe_add_arg(argv, &argc, iface); - if (type) + if (center_freq2) opt = g_strdup_printf("%s,%s,%s,%s", freq, type, center_freq1, center_freq2); + else if (center_freq1) + opt = g_strdup_printf("%s,%s,%s", freq, type, center_freq1); + else if (type) + opt = g_strdup_printf("%s,%s", freq, type); else opt = g_strdup(freq); diff --git a/capchild/capture_sync.h b/capchild/capture_sync.h index 17dc35d347..e8ba98b3ad 100644 --- a/capchild/capture_sync.h +++ b/capchild/capture_sync.h @@ -63,7 +63,24 @@ sync_pipe_stop(capture_session *cap_session); extern void sync_pipe_kill(ws_process_id fork_child); -/** Set wireless channel using dumpcap */ +/** + * Set wireless channel using dumpcap + * On success, *data points to a buffer containing the dumpcap output, + * *primary_msg and *secondary_msg are NULL, and 0 is returned. *data + * must be freed with g_free(). + * + * On failure, *data is NULL, *primary_msg points to an error message, + * *secondary_msg either points to an additional error message or is + * NULL, and -1 or errno value is returned; *primary_msg, and + * *secondary_msg if not NULL must be freed with g_free(). + * + * @param iface (monitor) network interface name + * @param freq channel control frequency string (in MHz) + * @param type channel type string (or NULL if not used) + * @param center_freq1 VHT channel center frequency (or NULL if not used) + * @param center_freq2 VHT channel center frequency 2 (or NULL if not used) + * @return 0 on success + */ extern int sync_interface_set_80211_chan(const gchar *iface, const char *freq, const gchar *type, const gchar *center_freq1, const gchar *center_freq2, -- cgit v1.2.1