get function added.

FossilOrigin-Name: 43f0690533106e0c195cbace0380407747c0bbd4b261f4daf133345c0cbd73a7
This commit is contained in:
7u83@mail.ru 2016-03-28 14:45:20 +00:00
parent 1a718edfc7
commit 3769539bd8

View File

@ -89,12 +89,26 @@ static struct mbag_item * from_str(const char *src)
return item; return item;
} }
static struct mbag_item * get(const uint8_t *src,int len)
{
mbag_item_t * item = mbag_item_new(CAPWAP80211_TYPE_RATESET);
if (!item)
return NULL;
uint8_t *data = malloc(len+1);
*data=len;
memcpy(data+1,src,len);
item->data=data;
return item;
}
const struct mbag_typedef capwap80211_type_rateset = { const struct mbag_typedef capwap80211_type_rateset = {
.name = "802.11 Rate Set", .name = "802.11 Rate Set",
.del = free, .del = free,
.from_str = from_str, .from_str = from_str,
.to_str = to_str .to_str = to_str,
.get = get
}; };