]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - iw.h
iw: bump version to 4.7
[thirdparty/iw.git] / iw.h
diff --git a/iw.h b/iw.h
index 317f0a6e1372ec9666c8edfc35bfed32e6ec3d18..b58e8395bce60b809bf4524a17550e4e3cc21926 100644 (file)
--- a/iw.h
+++ b/iw.h
@@ -38,6 +38,9 @@ enum id_input {
        II_WDEV,
 };
 
+#define HANDLER_RET_USAGE 1
+#define HANDLER_RET_DONE 3
+
 struct cmd {
        const char *name;
        const char *args;
@@ -48,11 +51,10 @@ struct cmd {
        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);
@@ -60,6 +62,13 @@ struct cmd {
        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))
 
@@ -130,6 +139,8 @@ __u32 __do_listen_events(struct nl80211_state *state,
                         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);
@@ -171,6 +182,14 @@ void print_ies(unsigned char *ie, int ielen, bool unknown,
               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);