actube/src/cw/cw_out_80211_supported_rates.c
7u83@mail.ru 586f89e23a Inital commit.
FossilOrigin-Name: 8049880904fb77e1edbc659b4592ce1b218aa42a8cb4f30cebae9495c8d0f937
2016-03-28 08:51:45 +00:00

36 lines
708 B
C

#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;
}