]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - event.c
add P2P Device handling primitives
[thirdparty/iw.git] / event.c
diff --git a/event.c b/event.c
index 18cde45fbc5c65bd9beaa90a504ceb9bb85d2aab..bacecc9c3b8a413a16722e2dd641882721dbf398 100644 (file)
--- a/event.c
+++ b/event.c
@@ -218,9 +218,15 @@ static int print_event(struct nl_msg *msg, void *arg)
        if (tb[NL80211_ATTR_IFINDEX] && tb[NL80211_ATTR_WIPHY]) {
                if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), ifname);
                printf("%s (phy #%d): ", ifname, nla_get_u32(tb[NL80211_ATTR_WIPHY]));
+       } else if (tb[NL80211_ATTR_WDEV] && tb[NL80211_ATTR_WIPHY]) {
+               printf("wdev 0x%llx (phy #%d): ",
+                       (unsigned long long)nla_get_u64(tb[NL80211_ATTR_WDEV]),
+                       nla_get_u32(tb[NL80211_ATTR_WIPHY]));
        } else if (tb[NL80211_ATTR_IFINDEX]) {
                if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), ifname);
                printf("%s: ", ifname);
+       } else if (tb[NL80211_ATTR_WDEV]) {
+               printf("wdev 0x%llx: ", (unsigned long long)nla_get_u64(tb[NL80211_ATTR_WDEV]));
        } else if (tb[NL80211_ATTR_WIPHY]) {
                printf("phy #%d: ", nla_get_u32(tb[NL80211_ATTR_WIPHY]));
        }
@@ -321,6 +327,10 @@ static int print_event(struct nl_msg *msg, void *arg)
                mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
                printf("new station %s\n", macbuf);
                break;
+       case NL80211_CMD_DEL_STATION:
+               mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
+               printf("del station %s\n", macbuf);
+               break;
        case NL80211_CMD_JOIN_IBSS:
                mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
                printf("IBSS %s joined\n", macbuf);
@@ -548,7 +558,8 @@ __u32 listen_events(struct nl80211_state *state,
 static int print_events(struct nl80211_state *state,
                        struct nl_cb *cb,
                        struct nl_msg *msg,
-                       int argc, char **argv)
+                       int argc, char **argv,
+                       enum id_input id)
 {
        struct print_event_args args;
        int ret;