II_WDEV,
};
+#define HANDLER_RET_USAGE 1
+#define HANDLER_RET_DONE 3
+
struct cmd {
const char *name;
const char *args;
const enum command_identify_by idby;
/*
* The handler should return a negative error code,
- * zero on success, 1 if the arguments were wrong
- * and the usage message should and 2 otherwise.
+ * zero on success, 1 if the arguments were wrong.
+ * Return 2 iff you provide the error message yourself.
*/
int (*handler)(struct nl80211_state *state,
- struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id);
const struct cmd *parent;
};
+struct chanmode {
+ const char *name;
+ unsigned int width;
+ int freq1_diff;
+ int chantype; /* for older kernel */
+};
+
#define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0]))
#define DIV_ROUND_UP(x, y) (((x) + (y - 1)) / (y))
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);
enum print_ie_type ptype);
void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen);
+void iw_hexdump(const char *prefix, const __u8 *data, size_t len);
+
+int get_cf1(const struct chanmode *chanmode, unsigned long freq);
+
+#define SCHED_SCAN_OPTIONS "[interval <in_msecs> | scan_plans [<interval_secs:iterations>*] <interval_secs>] " \
+ "[delay <in_secs>] [freqs <freq>+] [matches [ssid <ssid>]+]] [active [ssid <ssid>]+|passive] " \
+ "[randomise[=<addr>/<mask>]]"
+int parse_sched_scan(struct nl_msg *msg, int *argc, char ***argv);
DECLARE_SECTION(set);
DECLARE_SECTION(get);