#define VHT_ARGC_MAX 100
static int handle_bitrates(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
SECTION(coalesce);
-static int handle_coalesce_enable(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_coalesce_enable(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
"match '43:34:00:12' after 18 bytes of offset in Rx packet.\n");
static int
-handle_coalesce_disable(struct nl80211_state *state, struct nl_cb *cb,
+handle_coalesce_disable(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
return NL_SKIP;
}
-static int handle_coalesce_show(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_coalesce_show(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
- print_coalesce_handler, NULL);
+ register_handler(print_coalesce_handler, NULL);
return 0;
}
#include "nl80211.h"
#include "iw.h"
-static int iw_conn(struct nl80211_state *state, struct nl_cb *cb,
+static int iw_conn(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
}
static int disconnect(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
NL80211_CMD_DISCONNECT, 0, CIB_NETDEV, disconnect,
"Disconnect from the current network.");
-static int iw_connect(struct nl80211_state *state, struct nl_cb *cb,
+static int iw_connect(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
"With -w, wait for the connect to finish or fail.");
HIDDEN(connect, establish, "", NL80211_CMD_CONNECT, 0, CIB_NETDEV, iw_conn);
-static int iw_auth(struct nl80211_state *state, struct nl_cb *cb,
+static int iw_auth(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
#include "nl80211.h"
#include "iw.h"
-static int iw_cqm_rssi(struct nl80211_state *state, struct nl_cb *cb,
+static int iw_cqm_rssi(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
/* no sequence checking for multicast messages */
nl_cb_set(cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, no_seq_check, NULL);
+ nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, valid_handler, NULL);
if (n_waits && waits) {
wait_ev.cmds = waits;
wait_ev.n_cmds = n_waits;
wait_ev.pargs = args;
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, wait_event, &wait_ev);
+ register_handler(wait_event, &wait_ev);
} else
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_event, args);
+ register_handler(print_event, args);
wait_ev.cmd = 0;
}
static int print_events(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
return NL_SKIP;
}
-static int handle_hwsim_getps(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_hwsim_getps(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
nla_nest_end(msg, tmdata);
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
- print_hwsim_ps_handler, NULL);
+ register_handler(print_hwsim_ps_handler, NULL);
return 0;
nla_put_failure:
return -ENOBUFS;
}
COMMAND(hwsim, getps, "", NL80211_CMD_TESTMODE, 0, CIB_PHY, handle_hwsim_getps, "");
-static int handle_hwsim_setps(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_hwsim_setps(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
nla_nest_end(msg, tmdata);
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
- print_hwsim_ps_handler, NULL);
+ register_handler(print_hwsim_ps_handler, NULL);
return 0;
nla_put_failure:
return -ENOBUFS;
}
COMMAND(hwsim, setps, "<value>", NL80211_CMD_TESTMODE, 0, CIB_PHY, handle_hwsim_setps, "");
-static int handle_hwsim_stop_queues(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_hwsim_stop_queues(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
}
COMMAND(hwsim, stopqueues, "", NL80211_CMD_TESTMODE, 0, CIB_PHY, handle_hwsim_stop_queues, "");
-static int handle_hwsim_wake_queues(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_hwsim_wake_queues(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
SECTION(ibss);
static int join_ibss(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
}
static int leave_ibss(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
static bool nl80211_has_split_wiphy = false;
static int handle_info(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
nlmsg_hdr(msg)->nlmsg_flags |= NLM_F_DUMP;
}
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_phy_handler, NULL);
+ register_handler(print_phy_handler, NULL);
return 0;
}
"List all wireless devices and their capabilities.");
TOPLEVEL(phy, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, NULL);
-static int handle_commands(struct nl80211_state *state,
- struct nl_cb *cb, struct nl_msg *msg,
+static int handle_commands(struct nl80211_state *state, struct nl_msg *msg,
int argc, char **argv, enum id_input id)
{
int i;
return NL_SKIP;
}
-static int handle_features(struct nl80211_state *state,
- struct nl_cb *cb, struct nl_msg *msg,
+static int handle_features(struct nl80211_state *state, struct nl_msg *msg,
int argc, char **argv, enum id_input id)
{
unsigned long print = argc == 0 || strcmp(argv[0], "-q");
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_feature_handler, (void *)print);
+ register_handler(print_feature_handler, (void *)print);
return 0;
}
}
static int handle_interface_add(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
NL80211_CMD_NEW_INTERFACE, 0, CIB_NETDEV, handle_interface_add, NULL);
static int handle_interface_del(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
}
static int handle_interface_info(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_iface_handler, NULL);
+ register_handler(print_iface_handler, NULL);
return 0;
}
TOPLEVEL(info, NULL, NL80211_CMD_GET_INTERFACE, 0, CIB_NETDEV, handle_interface_info,
"Show information for this interface.");
static int handle_interface_set(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
VALID_FLAGS);
static int handle_interface_meshid(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
static unsigned int dev_dump_wiphy;
static int handle_dev_dump(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
dev_dump_wiphy = -1;
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_iface_handler, &dev_dump_wiphy);
+ register_handler(print_iface_handler, &dev_dump_wiphy);
return 0;
}
TOPLEVEL(dev, NULL, NL80211_CMD_GET_INTERFACE, NLM_F_DUMP, CIB_NONE, handle_dev_dump,
"List all network interfaces for wireless hardware.");
static int handle_interface_type(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
IFACE_TYPES);
static int handle_interface_4addr(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
"Set interface 4addr (WDS) mode.");
static int handle_interface_noack_map(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
static int handle_interface_wds_peer(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
"Set interface WDS peer.");
static int set_mcast_rate(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
}
static int print_help(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
return NL_STOP;
}
+static int (*registered_handler)(struct nl_msg *, void *);
+static void *registered_handler_data;
+
+void register_handler(int (*handler)(struct nl_msg *, void *), void *data)
+{
+ registered_handler = handler;
+ registered_handler_data = data;
+}
+
+int valid_handler(struct nl_msg *msg, void *arg)
+{
+ if (registered_handler)
+ return registered_handler(msg, registered_handler_data);
+
+ return NL_OK;
+}
+
static int __handle_cmd(struct nl80211_state *state, enum id_input idby,
int argc, char **argv, const struct cmd **cmdout)
{
if (!cmd->cmd) {
argc = o_argc;
argv = o_argv;
- return cmd->handler(state, NULL, NULL, argc, argv, idby);
+ return cmd->handler(state, NULL, argc, argv, idby);
}
msg = nlmsg_alloc();
break;
}
- err = cmd->handler(state, cb, msg, argc, argv, idby);
+ err = cmd->handler(state, msg, argc, argv, idby);
if (err)
goto out;
nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &err);
nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, &err);
nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, ack_handler, &err);
+ nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, valid_handler, NULL);
while (err > 0)
nl_recvmsgs(state->nl_sock, cb);
* and the usage message should and 2 otherwise.
*/
int (*handler)(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id);
const int n_waits, const __u32 *waits,
struct print_event_args *args);
+int valid_handler(struct nl_msg *msg, void *arg);
+void register_handler(int (*handler)(struct nl_msg *, void *), void *data);
int mac_addr_a2n(unsigned char *mac_addr, char *arg);
void mac_addr_n2a(char *mac_addr, unsigned char *arg);
}
static int handle_scan_for_link(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
if (argc > 0)
return 1;
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, link_bss_handler, &lr);
+ register_handler(link_bss_handler, &lr);
return 0;
}
}
static int handle_link_sta(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr);
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_link_sta, NULL);
+ register_handler(print_link_sta, NULL);
return 0;
nla_put_failure:
return -ENOBUFS;
}
-static int handle_link(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_link(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
/* Setter */
static int set_interface_meshparam(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
}
static int get_interface_meshparam(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
return 2;
}
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
- print_mesh_param_handler, (void *)mdescr);
+ register_handler(print_mesh_param_handler, (void *)mdescr);
return 0;
}
NL80211_CMD_GET_MESH_PARAMS, 0, CIB_NETDEV, get_interface_meshparam,
"Retrieve mesh parameter (run command without any to see available ones).");
-static int join_mesh(struct nl80211_state *state, struct nl_cb *cb,
+static int join_mesh(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
if (!argc)
return 0;
- return set_interface_meshparam(state, cb, msg, argc, argv, id);
+ return set_interface_meshparam(state, msg, argc, argv, id);
nla_put_failure:
return -ENOBUFS;
}
"mcast-rate and mesh parameters. Basic-rates are applied only if\n"
"frequency is provided.");
-static int leave_mesh(struct nl80211_state *state, struct nl_cb *cb,
+static int leave_mesh(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
}
static int handle_mpath_get(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, dst);
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpath_handler, NULL);
+ register_handler(print_mpath_handler, NULL);
return 0;
nla_put_failure:
"Remove the mesh path to the given node.");
static int handle_mpath_set(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, dst);
NLA_PUT(msg, NL80211_ATTR_MPATH_NEXT_HOP, ETH_ALEN, next_hop);
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpath_handler, NULL);
+ register_handler(print_mpath_handler, NULL);
return 0;
nla_put_failure:
return -ENOBUFS;
"Set an existing mesh path's next hop.");
static int handle_mpath_dump(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
printf("DEST ADDR NEXT HOP IFACE\tSN\tMETRIC\tQLEN\t"
"EXPTIME\t\tDTIM\tDRET\tFLAGS\n");
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpath_handler, NULL);
+ register_handler(print_mpath_handler, NULL);
return 0;
}
COMMAND(mpath, dump, NULL,
}
static int handle_mpp_get(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, dst);
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpp_handler, NULL);
+ register_handler(print_mpp_handler, NULL);
return 0;
nla_put_failure:
"Get information on mesh proxy path to the given node.");
static int handle_mpp_dump(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
printf("DEST ADDR PROXY NODE IFACE\n");
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpp_handler, NULL);
+ register_handler(print_mpp_handler, NULL);
return 0;
}
COMMAND(mpp, dump, NULL,
SECTION(ocb);
-static int join_ocb(struct nl80211_state *state, struct nl_cb *cb,
+static int join_ocb(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
NL80211_CMD_JOIN_OCB, 0, CIB_NETDEV, join_ocb,
"Join the OCB mode network.");
-static int leave_ocb(struct nl80211_state *state, struct nl_cb *cb,
+static int leave_ocb(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
#include "nl80211.h"
#include "iw.h"
-static int offchannel(struct nl80211_state *state, struct nl_cb *cb,
+static int offchannel(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
SECTION(p2p);
-static int handle_p2p_start(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_p2p_start(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
}
COMMAND(p2p, start, "", NL80211_CMD_START_P2P_DEVICE, 0, CIB_WDEV, handle_p2p_start, "");
-static int handle_p2p_stop(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_p2p_stop(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
#include "iw.h"
static int handle_name(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
return -ENOBUFS;
}
-static int handle_freq(struct nl80211_state *state,
- struct nl_cb *cb, struct nl_msg *msg,
+static int handle_freq(struct nl80211_state *state, struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
"<control freq> [20|40|80|80+80|160] [<center freq 1>] [<center freq 2>]",
NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq, NULL);
-static int handle_chan(struct nl80211_state *state,
- struct nl_cb *cb, struct nl_msg *msg,
+static int handle_chan(struct nl80211_state *state, struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_chan, NULL);
static int handle_fragmentation(struct nl80211_state *state,
- struct nl_cb *cb, struct nl_msg *msg,
+ struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
"Set fragmentation threshold.");
static int handle_rts(struct nl80211_state *state,
- struct nl_cb *cb, struct nl_msg *msg,
+ struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
"Set rts threshold.");
static int handle_retry(struct nl80211_state *state,
- struct nl_cb *cb, struct nl_msg *msg,
+ struct nl_msg *msg,
int argc, char **argv, enum id_input id)
{
unsigned int retry_short = 0, retry_long = 0;
}
static int handle_netns(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
" or by absolute path (man ip-netns)\n");
static int handle_coverage(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
"Valid values: 0 - 255.");
static int handle_distance(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
"Valid values: 0 - 114750");
static int handle_txpower(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
"Specify transmit power level and setting type.");
static int handle_antenna(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
#include "iw.h"
static int set_power_save(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
}
static int get_power_save(struct nl80211_state *state,
- struct nl_cb *cb,
- struct nl_msg *msg,
- int argc, char **argv,
- enum id_input id)
+ struct nl_msg *msg,
+ int argc, char **argv,
+ enum id_input id)
{
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
- print_power_save_handler, NULL);
+ register_handler(print_power_save_handler, NULL);
return 0;
}
}
static int handle_reg_set(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
}
static int handle_reg_dump(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_reg_handler, NULL);
+ register_handler(print_reg_handler, NULL);
return 0;
}
static int handle_reg_get(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
err = handle_cmd(state, CIB_NONE, 2, dump_args);
/* dump might fail since it's not supported on older kernels */
if (err == -EOPNOTSUPP) {
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_reg_handler,
+ register_handler(print_reg_handler,
NULL);
return 0;
}
SECTION(roc);
-static int handle_roc_start(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_roc_start(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
}
static int handle_scan(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
static struct scan_params scan_params;
static int handle_scan_dump(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
scan_params.type = PRINT_SCAN;
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_bss_handler,
+ register_handler(print_bss_handler,
&scan_params);
return 0;
}
static int handle_scan_combined(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
static int handle_start_sched_scan(struct nl80211_state *state,
- struct nl_cb *cb, struct nl_msg *msg,
+ struct nl_msg *msg,
int argc, char **argv, enum id_input id)
{
return parse_sched_scan(msg, &argc, &argv);
}
-static int handle_stop_sched_scan(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_stop_sched_scan(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
}
static int handle_station_get(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr);
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_sta_handler, NULL);
+ register_handler(print_sta_handler, NULL);
return 0;
nla_put_failure:
}
static int handle_station_set_plink(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
select_station_cmd, station_set_plink);
static int handle_station_set_vlan(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
select_station_cmd, station_set_vlan);
static int handle_station_set_mesh_power_mode(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
select_station_cmd, station_set_mesh_power_mode);
static int handle_station_dump(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_sta_handler, NULL);
+ register_handler(print_sta_handler, NULL);
return 0;
}
COMMAND(station, dump, NULL,
}
static int handle_survey_dump(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_survey_handler, NULL);
+ register_handler(print_survey_handler, NULL);
return 0;
}
COMMAND(survey, dump, NULL,
return argc;
}
-static int handle_vendor(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_vendor(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
return err;
}
-static int handle_wowlan_enable(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_wowlan_enable(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
" iw phy0 wowlan enable net-detect interval 5000 delay 30 freqs 2412 2422 matches ssid foo ssid bar");
-static int handle_wowlan_disable(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_wowlan_disable(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
return NL_SKIP;
}
-static int handle_wowlan_show(struct nl80211_state *state, struct nl_cb *cb,
+static int handle_wowlan_show(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
- nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
- print_wowlan_handler, NULL);
+ register_handler(print_wowlan_handler, NULL);
return 0;
}