Search Linux Wireless

Re: [PATCH 1/2] iw: event: add new peer candidate command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/10/19 3:42 PM, Markus Theil wrote:
> This patch prints information about mesh peering candidates.
>
> Signed-off-by: Markus Theil <markus.theil@xxxxxxxxxxxxx>
> ---
>  event.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/event.c b/event.c
> index 4a932d1..f17e78e 100644
> --- a/event.c
> +++ b/event.c
> @@ -650,6 +650,24 @@ static void parse_nan_match(struct nlattr **attrs)
>  	printf("\n");
>  }
>  
> +static void parse_new_peer_candidate(struct nlattr **attrs)
> +{
> +	char macbuf[ETH_ALEN * 3];
> +	int32_t sig_dbm;
> +
> +	printf("new peer candidate");
> +	if (attrs[NL80211_ATTR_MAC]) {
> +		mac_addr_n2a(macbuf, nla_data(attrs[NL80211_ATTR_MAC]));
> +		printf(" %s", macbuf);
> +	}
> +	if (attrs[NL80211_ATTR_RX_SIGNAL_DBM]) {
> +		sig_dbm = nla_get_u32(attrs[NL80211_ATTR_RX_SIGNAL_DBM]);
> +		printf(" %i dBm", sig_dbm);
> +	}
> +
> +	printf("\n");
> +}
> +
>  static int print_event(struct nl_msg *msg, void *arg)
>  {
>  	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
> @@ -989,6 +1007,10 @@ static int print_event(struct nl_msg *msg, void *arg)
>  		parse_nan_match(tb);
>  		break;
>  	}
> +	case NL80211_CMD_NEW_PEER_CANDIDATE: {
> +		parse_new_peer_candidate(tb);
> +		break;
> +	}
>  	default:
>  		printf("unknown event %d (%s)\n",
>  		       gnlh->cmd, command_name(gnlh->cmd));
Sorry, I accidentally sent this again :(

-- 
Markus Theil

Technische Universität Ilmenau, Fachgebiet Telematik/Rechnernetze
Postfach 100565
98684 Ilmenau, Germany

Phone: +49 3677 69-4582
Email: markus[dot]theil[at]tu-ilmenau[dot]de
Web: http://www.tu-ilmenau.de/telematik




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux