MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ieee80211_ies_init

Function ieee80211_ies_init

freebsd/net80211/ieee80211_node.c:1088–1110  ·  view source on GitHub ↗

* Initialize an ie blob with the specified data. If previous * data exists re-use the data block. As a side effect we clear * all references to specific ie's; the caller is required to * recalculate them. */

Source from the content-addressed store, hash-verified

1086 * recalculate them.
1087 */
1088int
1089ieee80211_ies_init(struct ieee80211_ies *ies, const uint8_t *data, int len)
1090{
1091 /* NB: assumes data+len are the last fields */
1092 memset(ies, 0, offsetof(struct ieee80211_ies, data));
1093 if (ies->data != NULL && ies->len != len) {
1094 /* data size changed */
1095 IEEE80211_FREE(ies->data, M_80211_NODE_IE);
1096 ies->data = NULL;
1097 }
1098 if (ies->data == NULL) {
1099 ies->data = (uint8_t *) IEEE80211_MALLOC(len, M_80211_NODE_IE,
1100 IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
1101 if (ies->data == NULL) {
1102 ies->len = 0;
1103 /* NB: pointers have already been zero'd above */
1104 return 0;
1105 }
1106 }
1107 memcpy(ies->data, data, len);
1108 ies->len = len;
1109 return 1;
1110}
1111
1112/*
1113 * Reclaim storage for an ie blob.

Callers 4

sta_addFunction · 0.85
ieee80211_sta_joinFunction · 0.85
ieee80211_init_neighborFunction · 0.85
hostap_recv_mgmtFunction · 0.85

Calls 2

memsetFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected