@@ -668,6 +668,46 @@ static void parse_new_peer_candidate(struct nlattr **attrs)
printf("\n");
}
+static void parse_set_interface(struct nlattr **attrs)
+{
+ printf("set interface");
+
+ if (attrs[NL80211_ATTR_IFTYPE]) {
+ printf(" type ");
+ switch (nla_get_u32(attrs[NL80211_ATTR_IFTYPE])) {
+ case NL80211_IFTYPE_STATION:
+ printf("station");
+ break;
+ case NL80211_IFTYPE_AP:
+ printf("access point");
+ break;
+ case NL80211_IFTYPE_MESH_POINT:
+ printf("mesh point");
+ break;
+ case NL80211_IFTYPE_ADHOC:
+ printf("ad-hoc");
+ break;
+ case NL80211_IFTYPE_MONITOR:
+ printf("monitor");
+ break;
+ default:
+ printf("unknown");
+ }
+ }
+
+ if (attrs[NL80211_ATTR_MESH_ID]) {
+ printf(" meshid ");
+ print_ssid_escaped(nla_len(attrs[NL80211_ATTR_MESH_ID]),
+ nla_data(attrs[NL80211_ATTR_MESH_ID]));
+ }
+
+ if (attrs[NL80211_ATTR_4ADDR]) {
+ printf(" use 4addr %i", nla_get_u8(attrs[NL80211_ATTR_4ADDR]));
+ }
+
+ printf("\n");
+}
+
static int print_event(struct nl_msg *msg, void *arg)
{
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
@@ -1011,6 +1051,10 @@ static int print_event(struct nl_msg *msg, void *arg)
parse_new_peer_candidate(tb);
break;
}
+ case NL80211_CMD_SET_INTERFACE: {
+ parse_set_interface(tb);
+ break;
+ }
default:
printf("unknown event %d (%s)\n",
gnlh->cmd, command_name(gnlh->cmd));
This patch adds support for CMD_SET_INTERFACE which is called when switching to mesh or ap mode. Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de> --- event.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+)