From 586f89e23a7579471be0dfaa02a826b9b268598d Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Mon, 28 Mar 2016 08:51:45 +0000 Subject: [PATCH] Inital commit. FossilOrigin-Name: 8049880904fb77e1edbc659b4592ce1b218aa42a8cb4f30cebae9495c8d0f937 --- src/cw/cw_out_80211_supported_rates.c | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/cw/cw_out_80211_supported_rates.c diff --git a/src/cw/cw_out_80211_supported_rates.c b/src/cw/cw_out_80211_supported_rates.c new file mode 100644 index 00000000..99b01639 --- /dev/null +++ b/src/cw/cw_out_80211_supported_rates.c @@ -0,0 +1,35 @@ +#include "cw.h" +#include "capwap80211.h" +#include "radio.h" + + +int cw_put_elem_80211_supported_rates(uint8_t*dst,int radio_id,mbag_t radio) +{ + + struct mbag_item * sr = mbag_get(radio,CW_RADIO_SUPPORTED_RATES); + if (!sr) + return 0; + + int n = cw_put_byte(dst+4,radio_id); + + n+=cw_put_mbag_item(dst+5,sr); + return 5 + cw_put_elem_hdr(dst,CW_ELEM80211_SUPPORTED_RATES,5); +} + + +int cw_out_80211_supported_rates(struct conn *conn, struct cw_action_out *a, uint8_t * dst) +{ + + int l=0; + MAVLITER_DEFINE(it,conn->radios); + mavliter_foreach(&it){ + struct mbag_item *i = mavliter_get(&it); + if ( i->type != MBAG_MBAG ) { + continue; + } + l+=cw_put_elem_80211_supported_rates(dst+l,i->iid,i->data); + } + return l; +} + +