Implicitly inserted capwap_outofmemory() into the capwap_alloc().
capwap_alloc() can never return NULL.
This commit is contained in:
parent
177e997d47
commit
d34e98fc2c
@ -310,10 +310,6 @@ static int ac_parsing_configuration_1_0(config_t* config) {
|
||||
desc->length = lengthValue;
|
||||
|
||||
desc->data = (uint8_t*)capwap_alloc(desc->length + 1);
|
||||
if (!desc->data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
strcpy((char*)desc->data, configValue);
|
||||
desc->data[desc->length] = 0;
|
||||
} else {
|
||||
|
@ -130,10 +130,6 @@ static struct ac_soap_response* ac_dfa_state_configure_parsing_request(struct ac
|
||||
/* Get JSON param and convert base64 */
|
||||
jsonmessage = json_object_to_json_string(jsonparam);
|
||||
base64confstatus = capwap_alloc(AC_BASE64_ENCODE_LENGTH(strlen(jsonmessage)));
|
||||
if (!base64confstatus) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
ac_base64_string_encode(jsonmessage, base64confstatus);
|
||||
|
||||
/* Send message */
|
||||
|
@ -70,10 +70,6 @@ static struct ac_soap_response* ac_dfa_state_datacheck_parsing_request(struct ac
|
||||
/* Get JSON param and convert base64 */
|
||||
jsonmessage = json_object_to_json_string(jsonparam);
|
||||
base64confstatus = capwap_alloc(AC_BASE64_ENCODE_LENGTH(strlen(jsonmessage)));
|
||||
if (!base64confstatus) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
ac_base64_string_encode(jsonmessage, base64confstatus);
|
||||
|
||||
/* Send message */
|
||||
|
@ -33,10 +33,6 @@ static struct ac_soap_response* ac_dfa_state_join_parsing_request(struct ac_sess
|
||||
/* Get JSON param and convert base64 */
|
||||
jsonmessage = json_object_to_json_string(jsonparam);
|
||||
base64confstatus = capwap_alloc(AC_BASE64_ENCODE_LENGTH(strlen(jsonmessage)));
|
||||
if (!base64confstatus) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
ac_base64_string_encode(jsonmessage, base64confstatus);
|
||||
|
||||
/* Send message */
|
||||
|
@ -155,11 +155,6 @@ char* ac_get_printable_wtpid(struct capwap_wtpboarddata_element* wtpboarddata) {
|
||||
if (wtpboarddatamacaddress != NULL) {
|
||||
if (wtpboarddatamacaddress->length == MACADDRESS_EUI48_LENGTH) {
|
||||
wtpid = capwap_alloc(18);
|
||||
if (!wtpid) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* */
|
||||
sprintf(wtpid, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
(unsigned char)wtpboarddatamacaddress->data[0],
|
||||
(unsigned char)wtpboarddatamacaddress->data[1],
|
||||
@ -169,11 +164,6 @@ char* ac_get_printable_wtpid(struct capwap_wtpboarddata_element* wtpboarddata) {
|
||||
(unsigned char)wtpboarddatamacaddress->data[5]);
|
||||
} else if (wtpboarddatamacaddress->length == MACADDRESS_EUI64_LENGTH) {
|
||||
wtpid = capwap_alloc(24);
|
||||
if (!wtpid) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* */
|
||||
sprintf(wtpid, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
(unsigned char)wtpboarddatamacaddress->data[0],
|
||||
(unsigned char)wtpboarddatamacaddress->data[1],
|
||||
@ -513,9 +503,6 @@ int ac_execute(void) {
|
||||
|
||||
/* Configure poll struct */
|
||||
fds = (struct pollfd*)capwap_alloc(sizeof(struct pollfd) * fdscount);
|
||||
if (!fds) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrive all socket for polling */
|
||||
fdscount = capwap_network_set_pollfd(&g_ac.net, fds, fdscount);
|
||||
|
@ -136,10 +136,6 @@ static int ac_soapclient_parsing_url(struct ac_http_soap_server* server, const c
|
||||
/* Retrieve hostname */
|
||||
hostlength = port - protocol;
|
||||
server->host = capwap_alloc(hostlength + 1);
|
||||
if (!server->host) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
strncpy(server->host, &url[protocol], hostlength);
|
||||
server->host[hostlength] = 0;
|
||||
|
||||
@ -165,10 +161,6 @@ static int ac_soapclient_parsing_url(struct ac_http_soap_server* server, const c
|
||||
}
|
||||
|
||||
server->path = capwap_alloc(pathlength + 1);
|
||||
if (!server->path) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
if (length == port) {
|
||||
strcpy(server->path, "/");
|
||||
} else {
|
||||
@ -216,9 +208,6 @@ static int ac_soapclient_send_http(struct ac_http_soap_request* httprequest, cha
|
||||
/* Calculate header length */
|
||||
headerlength = 150 + length + strlen(httprequest->server->path) + strlen(httprequest->server->host) + strlen(datetime) + strlen((soapaction ? soapaction : ""));
|
||||
buffer = capwap_alloc(headerlength);
|
||||
if (!buffer) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* HTTP headers */
|
||||
result = snprintf(buffer, headerlength,
|
||||
@ -429,10 +418,6 @@ struct ac_http_soap_server* ac_soapclient_create_server(const char* url) {
|
||||
|
||||
/* */
|
||||
server = (struct ac_http_soap_server*)capwap_alloc(sizeof(struct ac_http_soap_server));
|
||||
if (!server) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
memset(server, 0, sizeof(struct ac_http_soap_server));
|
||||
|
||||
/* */
|
||||
@ -473,10 +458,6 @@ struct ac_soap_request* ac_soapclient_create_request(char* method, char* uriname
|
||||
|
||||
/* */
|
||||
request = (struct ac_soap_request*)capwap_alloc(sizeof(struct ac_soap_request));
|
||||
if (!request) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
memset(request, 0, sizeof(struct ac_soap_request));
|
||||
|
||||
/* Build XML SOAP Request */
|
||||
@ -498,11 +479,6 @@ struct ac_soap_request* ac_soapclient_create_request(char* method, char* uriname
|
||||
|
||||
/* Create request */
|
||||
tagMethod = capwap_alloc(strlen(method) + 5);
|
||||
if (!tagMethod) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Append Request */
|
||||
sprintf(tagMethod, "tns:%s", method);
|
||||
request->xmlRequest = xmlNewChild(request->xmlBody, NULL, BAD_CAST tagMethod, NULL);
|
||||
capwap_free(tagMethod);
|
||||
@ -582,12 +558,9 @@ struct ac_http_soap_request* ac_soapclient_prepare_request(struct ac_soap_reques
|
||||
|
||||
/* */
|
||||
httprequest = (struct ac_http_soap_request*)capwap_alloc(sizeof(struct ac_http_soap_request));
|
||||
if (!httprequest) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(httprequest, 0, sizeof(struct ac_http_soap_request));
|
||||
|
||||
/* */
|
||||
memset(httprequest, 0, sizeof(struct ac_http_soap_request));
|
||||
httprequest->request = request;
|
||||
httprequest->server = server;
|
||||
httprequest->requesttimeout = SOAP_PROTOCOL_REQUEST_TIMEOUT;
|
||||
@ -683,10 +656,6 @@ struct ac_soap_response* ac_soapclient_recv_response(struct ac_http_soap_request
|
||||
|
||||
/* */
|
||||
response = (struct ac_soap_response*)capwap_alloc(sizeof(struct ac_soap_response));
|
||||
if (!response) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
memset(response, 0, sizeof(struct ac_soap_response));
|
||||
|
||||
/* Receive HTTP response into XML callback */
|
||||
@ -715,10 +684,6 @@ struct ac_soap_response* ac_soapclient_recv_response(struct ac_http_soap_request
|
||||
/* Retrieve response */
|
||||
if (response->responsecode == HTTP_RESULT_OK) {
|
||||
char* tagMethod = capwap_alloc(strlen(httprequest->request->method) + 9);
|
||||
if (!tagMethod) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
sprintf(tagMethod, "%sResponse", httprequest->request->method);
|
||||
response->xmlResponse = ac_xml_search_child(response->xmlBody, NULL, tagMethod);
|
||||
capwap_free(tagMethod);
|
||||
|
@ -542,10 +542,6 @@ static wifi_device_handle nl80211_device_init(wifi_global_handle handle, struct
|
||||
if (!strcmp(phyitem->name, params->ifname)) {
|
||||
/* Create device */
|
||||
devicehandle = (struct nl80211_device_handle*)capwap_alloc(sizeof(struct nl80211_device_handle));
|
||||
if (!devicehandle) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
memset(devicehandle, 0, sizeof(struct nl80211_device_handle));
|
||||
|
||||
/* */
|
||||
@ -680,10 +676,6 @@ static wifi_global_handle nl80211_global_init(void) {
|
||||
|
||||
/* */
|
||||
globalhandle = (struct nl80211_global_handle*)capwap_alloc(sizeof(struct nl80211_global_handle));
|
||||
if (!globalhandle) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
memset(globalhandle, 0, sizeof(struct nl80211_global_handle));
|
||||
globalhandle->sock_util = -1;
|
||||
|
||||
|
@ -138,11 +138,8 @@ char* capwap_duplicate_string(const char* source) {
|
||||
ASSERT(source != NULL);
|
||||
|
||||
clone = capwap_alloc(sizeof(char) * (strlen(source) + 1));
|
||||
if (!clone) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
strcpy(clone, source);
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
@ -154,10 +151,6 @@ void* capwap_clone(void* buffer, int buffersize) {
|
||||
ASSERT(buffersize > 0);
|
||||
|
||||
bufferclone = capwap_alloc(buffersize);
|
||||
if (!bufferclone) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
return memcpy(bufferclone, buffer, buffersize);
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,8 @@ struct capwap_array* capwap_array_create(unsigned short itemsize, unsigned long
|
||||
ASSERT(itemsize > 0);
|
||||
|
||||
array = (struct capwap_array*)capwap_alloc(sizeof(struct capwap_array));
|
||||
if (!array) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
memset(array, 0, sizeof(struct capwap_array));
|
||||
|
||||
array->itemsize = itemsize;
|
||||
array->zeroed = zeroed;
|
||||
if (initcount > 0) {
|
||||
@ -74,9 +71,6 @@ void capwap_array_resize(struct capwap_array* array, unsigned long count) {
|
||||
|
||||
if (count > 0) {
|
||||
newbuffer = capwap_alloc(array->itemsize * count);
|
||||
if (!newbuffer) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Zeroed new items */
|
||||
if (array->zeroed && (count > newcount)) {
|
||||
|
@ -281,10 +281,6 @@ int capwap_crypt_init() {
|
||||
/* Configure OpenSSL thread-safe */
|
||||
numlocks = CRYPTO_num_locks();
|
||||
l_mutex_buffer = (pthread_mutex_t*)capwap_alloc(numlocks * sizeof(pthread_mutex_t));
|
||||
if (!l_mutex_buffer) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
for (i = 0; i < numlocks; i++) {
|
||||
pthread_mutex_init(&l_mutex_buffer[i], NULL);
|
||||
}
|
||||
@ -410,10 +406,6 @@ static int create_cookie(SSL* ssl, unsigned char* cookie, unsigned int* cookie_l
|
||||
|
||||
/* */
|
||||
buffer = capwap_alloc(length);
|
||||
if (!buffer) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
if (peer.ss_family == AF_INET) {
|
||||
struct sockaddr_in* peeripv4 = (struct sockaddr_in*)&peer;
|
||||
|
||||
@ -746,12 +738,8 @@ int capwap_crypt_createsession(struct capwap_dtls* dtls, int sessiontype, struct
|
||||
|
||||
/* SSL session app data */
|
||||
appdata = (struct capwap_app_data*)capwap_alloc(sizeof(struct capwap_app_data));
|
||||
if (!appdata) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* */
|
||||
appdata->cookie = &dtlscontext->cookie[0];
|
||||
|
||||
SSL_set_ex_data((SSL*)dtls->sslsession, OPENSSL_EXDATA_APPLICATION, (void*)appdata);
|
||||
SSL_set_ex_data((SSL*)dtls->sslsession, OPENSSL_EXDATA_DTLSCONTEXT, (void*)dtlscontext);
|
||||
SSL_set_ex_data((SSL*)dtls->sslsession, OPENSSL_EXDATA_DTLS, (void*)dtls);
|
||||
|
@ -89,12 +89,9 @@ static void* capwap_80211_addwlan_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_addwlan_element*)capwap_alloc(sizeof(struct capwap_80211_addwlan_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_addwlan_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_addwlan_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->wlanid);
|
||||
|
||||
@ -115,10 +112,6 @@ static void* capwap_80211_addwlan_element_parsing(capwap_message_elements_handle
|
||||
|
||||
if (data->keylength > 0) {
|
||||
data->key = (uint8_t*)capwap_alloc(data->keylength);
|
||||
if (!data->key) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->key, data->keylength);
|
||||
}
|
||||
|
||||
|
@ -52,12 +52,9 @@ static void* capwap_80211_antenna_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_antenna_element*)capwap_alloc(sizeof(struct capwap_80211_antenna_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_antenna_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_antenna_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->diversity);
|
||||
func->read_u8(handle, &data->combiner);
|
||||
|
@ -42,12 +42,9 @@ static void* capwap_80211_assignbssid_element_parsing(capwap_message_elements_ha
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_assignbssid_element*)capwap_alloc(sizeof(struct capwap_80211_assignbssid_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_assignbssid_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_assignbssid_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->wlanid);
|
||||
func->read_block(handle, data->bssid, CAPWAP_ASSIGN_BSSID_LENGTH);
|
||||
|
@ -39,12 +39,9 @@ static void* capwap_80211_deletewlan_element_parsing(capwap_message_elements_han
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_deletewlan_element*)capwap_alloc(sizeof(struct capwap_80211_deletewlan_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_deletewlan_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_deletewlan_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->wlanid);
|
||||
|
||||
|
@ -45,12 +45,9 @@ static void* capwap_80211_directsequencecontrol_element_parsing(capwap_message_e
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_directsequencecontrol_element*)capwap_alloc(sizeof(struct capwap_80211_directsequencecontrol_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_directsequencecontrol_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_directsequencecontrol_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, NULL);
|
||||
func->read_u8(handle, &data->currentchannel);
|
||||
|
@ -46,20 +46,14 @@ static void* capwap_80211_ie_element_parsing(capwap_message_elements_handle hand
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_ie_element*)capwap_alloc(sizeof(struct capwap_80211_ie_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_ie_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_ie_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->wlanid);
|
||||
func->read_u8(handle, &data->flags);
|
||||
data->ielength = length;
|
||||
data->ie = (uint8_t*)capwap_alloc(data->ielength);
|
||||
if (!data->ie) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
func->read_block(handle, data->ie, data->ielength);
|
||||
|
||||
return data;
|
||||
|
@ -52,12 +52,9 @@ static void* capwap_80211_macoperation_element_parsing(capwap_message_elements_h
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_macoperation_element*)capwap_alloc(sizeof(struct capwap_80211_macoperation_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_macoperation_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_macoperation_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, NULL);
|
||||
func->read_u16(handle, &data->rtsthreshold);
|
||||
|
@ -42,12 +42,9 @@ static void* capwap_80211_miccountermeasures_element_parsing(capwap_message_elem
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_miccountermeasures_element*)capwap_alloc(sizeof(struct capwap_80211_miccountermeasures_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_miccountermeasures_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_miccountermeasures_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->wlanid);
|
||||
func->read_block(handle, data->address, CAPWAP_MIC_COUNTERMEASURES_MACADDRESS_LENGTH);
|
||||
|
@ -45,12 +45,9 @@ static void* capwap_80211_multidomaincapability_element_parsing(capwap_message_e
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_multidomaincapability_element*)capwap_alloc(sizeof(struct capwap_80211_multidomaincapability_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_multidomaincapability_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_multidomaincapability_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, NULL);
|
||||
func->read_u16(handle, &data->firstchannel);
|
||||
|
@ -45,12 +45,9 @@ static void* capwap_80211_ofdmcontrol_element_parsing(capwap_message_elements_ha
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_ofdmcontrol_element*)capwap_alloc(sizeof(struct capwap_80211_ofdmcontrol_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_ofdmcontrol_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_ofdmcontrol_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, NULL);
|
||||
func->read_u8(handle, &data->currentchannel);
|
||||
|
@ -47,12 +47,9 @@ static void* capwap_80211_rateset_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_rateset_element*)capwap_alloc(sizeof(struct capwap_80211_rateset_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_rateset_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_rateset_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
data->ratesetcount = length;
|
||||
func->read_block(handle, data->rateset, length);
|
||||
|
@ -67,12 +67,9 @@ static void* capwap_80211_rsnaerrorreport_element_parsing(capwap_message_element
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_rsnaerrorreport_element*)capwap_alloc(sizeof(struct capwap_80211_rsnaerrorreport_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_rsnaerrorreport_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_rsnaerrorreport_element));
|
||||
func->read_block(handle, data->client, CAPWAP_RSNA_ERROR_REPORT_CLIENT_LENGTH);
|
||||
func->read_block(handle, data->bssid, CAPWAP_RSNA_ERROR_REPORT_BSSID_LENGTH);
|
||||
func->read_u8(handle, &data->radioid);
|
||||
|
@ -58,12 +58,9 @@ static void* capwap_80211_station_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_station_element*)capwap_alloc(sizeof(struct capwap_80211_station_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_station_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_station_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u16(handle, &data->associationid);
|
||||
func->read_u8(handle, &data->flags);
|
||||
|
@ -54,18 +54,11 @@ static void* capwap_80211_stationkey_element_parsing(capwap_message_elements_han
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_stationkey_element*)capwap_alloc(sizeof(struct capwap_80211_stationkey_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
data->keylength = length - 20;
|
||||
data->key = (uint8_t*)capwap_alloc(data->keylength);
|
||||
if (!data->key) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_stationkey_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_stationkey_element));
|
||||
func->read_block(handle, data->address, CAPWAP_STATION_SESSION_KEY_ADDRESS_LENGTH);
|
||||
func->read_u16(handle, &data->flags);
|
||||
func->read_block(handle, data->pairwisetsc, CAPWAP_STATION_SESSION_KEY_PAIRWISE_TSC_LENGTH);
|
||||
|
@ -42,12 +42,9 @@ static void* capwap_80211_stationqos_element_parsing(capwap_message_elements_han
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_stationqos_element*)capwap_alloc(sizeof(struct capwap_80211_stationqos_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_stationqos_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_stationqos_element));
|
||||
func->read_block(handle, data->address, CAPWAP_STATION_QOS_ADDRESS_LENGTH);
|
||||
func->read_u8(handle, NULL);
|
||||
func->read_u8(handle, &data->priority);
|
||||
|
@ -97,12 +97,9 @@ static void* capwap_80211_statistics_element_parsing(capwap_message_elements_han
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_statistics_element*)capwap_alloc(sizeof(struct capwap_80211_statistics_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_statistics_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_statistics_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_block(handle, NULL, 3);
|
||||
func->read_u32(handle, &data->txfragment);
|
||||
|
@ -47,12 +47,9 @@ static void* capwap_80211_supportedrates_element_parsing(capwap_message_elements
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_supportedrates_element*)capwap_alloc(sizeof(struct capwap_80211_supportedrates_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_supportedrates_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_supportedrates_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
data->supportedratescount = length;
|
||||
func->read_block(handle, data->supportedrates, length);
|
||||
|
@ -41,12 +41,9 @@ static void* capwap_80211_txpower_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_txpower_element*)capwap_alloc(sizeof(struct capwap_80211_txpower_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_txpower_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_txpower_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, NULL);
|
||||
func->read_u16(handle, &data->currenttxpower);
|
||||
|
@ -52,12 +52,9 @@ static void* capwap_80211_txpowerlevel_element_parsing(capwap_message_elements_h
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_txpowerlevel_element*)capwap_alloc(sizeof(struct capwap_80211_txpowerlevel_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_txpowerlevel_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_txpowerlevel_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->numlevels);
|
||||
|
||||
|
@ -53,12 +53,9 @@ static void* capwap_80211_updatestationqos_element_parsing(capwap_message_elemen
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_updatestationqos_element*)capwap_alloc(sizeof(struct capwap_80211_updatestationqos_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_updatestationqos_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_updatestationqos_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_block(handle, data->address, CAPWAP_ASSIGN_BSSID_LENGTH);
|
||||
for (i = 0; i < CAPWAP_UPDATE_STATION_QOS_SUBELEMENTS; i++) {
|
||||
|
@ -67,13 +67,9 @@ static void* capwap_80211_updatewlan_element_parsing(capwap_message_elements_han
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_updatewlan_element*)capwap_alloc(sizeof(struct capwap_80211_updatewlan_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_updatewlan_element));
|
||||
|
||||
/* Retrieve data */
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->wlanid);
|
||||
func->read_u16(handle, &data->capability);
|
||||
@ -87,10 +83,6 @@ static void* capwap_80211_updatewlan_element_parsing(capwap_message_elements_han
|
||||
return NULL;
|
||||
} else if (data->keylength > 0) {
|
||||
data->key = (uint8_t*)capwap_alloc(data->keylength);
|
||||
if (!data->key) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->key, data->keylength);
|
||||
}
|
||||
|
||||
|
@ -57,12 +57,9 @@ static void* capwap_80211_wtpqos_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_wtpqos_element*)capwap_alloc(sizeof(struct capwap_80211_wtpqos_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_wtpqos_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_wtpqos_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->taggingpolicy);
|
||||
for (i = 0; i < CAPWAP_UPDATE_STATION_QOS_SUBELEMENTS; i++) {
|
||||
|
@ -50,12 +50,9 @@ static void* capwap_80211_wtpradioconf_element_parsing(capwap_message_elements_h
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_wtpradioconf_element*)capwap_alloc(sizeof(struct capwap_80211_wtpradioconf_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_wtpradioconf_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_wtpradioconf_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->shortpreamble);
|
||||
func->read_u8(handle, &data->maxbssid);
|
||||
|
@ -41,12 +41,9 @@ static void* capwap_80211_wtpradiofailalarm_element_parsing(capwap_message_eleme
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_wtpradiofailalarm_element*)capwap_alloc(sizeof(struct capwap_80211_wtpradiofailalarm_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_wtpradiofailalarm_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_wtpradiofailalarm_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->type);
|
||||
func->read_u8(handle, &data->status);
|
||||
|
@ -42,12 +42,9 @@ static void* capwap_80211_wtpradioinformation_element_parsing(capwap_message_ele
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_wtpradioinformation_element*)capwap_alloc(sizeof(struct capwap_80211_wtpradioinformation_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_80211_wtpradioinformation_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_wtpradioinformation_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u32(handle, &data->radiotype);
|
||||
|
||||
|
@ -100,10 +100,6 @@ static void* capwap_acdescriptor_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_acdescriptor_element*)capwap_alloc(sizeof(struct capwap_acdescriptor_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
memset(data, 0, sizeof(struct capwap_acdescriptor_element));
|
||||
data->descsubelement = capwap_array_create(sizeof(struct capwap_acdescriptor_desc_subelement), 0, 1);
|
||||
|
||||
|
@ -42,13 +42,8 @@ static void* capwap_acipv4list_element_parsing(capwap_message_elements_handle ha
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_acipv4list_element*)capwap_alloc(sizeof(struct capwap_acipv4list_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_acipv4list_element*)capwap_alloc(sizeof(struct capwap_acipv4list_element));
|
||||
data->addresses = capwap_array_create(sizeof(struct in_addr), 0, 0);
|
||||
while (length > 0) {
|
||||
struct in_addr* address = (struct in_addr*)capwap_array_get_item_pointer(data->addresses, data->addresses->count);
|
||||
|
@ -48,13 +48,8 @@ static void* capwap_acipv6list_element_parsing(capwap_message_elements_handle ha
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_acipv6list_element*)capwap_alloc(sizeof(struct capwap_acipv6list_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_acipv6list_element*)capwap_alloc(sizeof(struct capwap_acipv6list_element));
|
||||
data->addresses = capwap_array_create(sizeof(struct in6_addr), 0, 0);
|
||||
while (length > 0) {
|
||||
struct in6_addr* address = (struct in6_addr*)capwap_array_get_item_pointer(data->addresses, data->addresses->count);
|
||||
|
@ -39,18 +39,9 @@ static void* capwap_acname_element_parsing(capwap_message_elements_handle handle
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_acname_element*)capwap_alloc(sizeof(struct capwap_acname_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
data->name = (uint8_t*)capwap_alloc(length + 1);
|
||||
if (!data->name) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_acname_element*)capwap_alloc(sizeof(struct capwap_acname_element));
|
||||
data->name = (uint8_t*)capwap_alloc(length + 1);
|
||||
func->read_block(handle, data->name, length);
|
||||
data->name[length] = 0;
|
||||
|
||||
|
@ -39,18 +39,9 @@ static void* capwap_acnamepriority_element_parsing(capwap_message_elements_handl
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_acnamepriority_element*)capwap_alloc(sizeof(struct capwap_acnamepriority_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
data->name = (uint8_t*)capwap_alloc(length + 1);
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_acnamepriority_element*)capwap_alloc(sizeof(struct capwap_acnamepriority_element));
|
||||
data->name = (uint8_t*)capwap_alloc(length + 1);
|
||||
func->read_u8(handle, &data->priority);
|
||||
func->read_block(handle, data->name, length);
|
||||
data->name[length] = 0;
|
||||
|
@ -37,13 +37,8 @@ static void* capwap_actimestamp_element_parsing(capwap_message_elements_handle h
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_actimestamp_element*)capwap_alloc(sizeof(struct capwap_actimestamp_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_actimestamp_element*)capwap_alloc(sizeof(struct capwap_actimestamp_element));
|
||||
func->read_u32(handle, &data->timestamp);
|
||||
|
||||
return data;
|
||||
|
@ -59,12 +59,9 @@ static void* capwap_addmacacl_element_parsing(capwap_message_elements_handle han
|
||||
|
||||
/* */
|
||||
data = (struct capwap_addmacacl_element*)capwap_alloc(sizeof(struct capwap_addmacacl_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_addmacacl_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_addmacacl_element));
|
||||
func->read_u8(handle, &data->entry);
|
||||
func->read_u8(handle, &data->length);
|
||||
|
||||
@ -85,10 +82,6 @@ static void* capwap_addmacacl_element_parsing(capwap_message_elements_handle han
|
||||
}
|
||||
|
||||
data->address = (uint8_t*)capwap_alloc(length);
|
||||
if (!data->address) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->address, length);
|
||||
|
||||
return data;
|
||||
|
@ -72,12 +72,9 @@ static void* capwap_addstation_element_parsing(capwap_message_elements_handle ha
|
||||
|
||||
/* */
|
||||
data = (struct capwap_addstation_element*)capwap_alloc(sizeof(struct capwap_addstation_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_addstation_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_addstation_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->length);
|
||||
|
||||
@ -92,20 +89,12 @@ static void* capwap_addstation_element_parsing(capwap_message_elements_handle ha
|
||||
}
|
||||
|
||||
data->address = (uint8_t*)capwap_alloc(data->length);
|
||||
if (!data->address) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->address, data->length);
|
||||
length -= data->length;
|
||||
|
||||
if (length > 0) {
|
||||
if (length <= CAPWAP_ADDSTATION_VLAN_MAX_LENGTH) {
|
||||
data->vlan = (uint8_t*)capwap_alloc(length + 1);
|
||||
if (!data->vlan) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->vlan, length);
|
||||
data->vlan[length] = 0;
|
||||
} else {
|
||||
|
@ -40,13 +40,8 @@ static void* capwap_controlipv4_element_parsing(capwap_message_elements_handle h
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_controlipv4_element*)capwap_alloc(sizeof(struct capwap_controlipv4_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_controlipv4_element*)capwap_alloc(sizeof(struct capwap_controlipv4_element));
|
||||
func->read_block(handle, (uint8_t*)&data->address, sizeof(struct in_addr));
|
||||
func->read_u16(handle, &data->wtpcount);
|
||||
|
||||
|
@ -46,13 +46,8 @@ static void* capwap_controlipv6_element_parsing(capwap_message_elements_handle h
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_controlipv6_element*)capwap_alloc(sizeof(struct capwap_controlipv6_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_controlipv6_element*)capwap_alloc(sizeof(struct capwap_controlipv6_element));
|
||||
func->read_block(handle, (uint8_t*)&data->address, sizeof(struct in6_addr));
|
||||
func->read_u16(handle, &data->wtpcount);
|
||||
|
||||
|
@ -63,12 +63,9 @@ static void* capwap_datatransferdata_element_parsing(capwap_message_elements_han
|
||||
|
||||
/* */
|
||||
data = (struct capwap_datatransferdata_element*)capwap_alloc(sizeof(struct capwap_datatransferdata_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_datatransferdata_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_datatransferdata_element));
|
||||
func->read_u8(handle, &data->type);
|
||||
func->read_u8(handle, &data->mode);
|
||||
func->read_u16(handle, &data->length);
|
||||
@ -88,10 +85,6 @@ static void* capwap_datatransferdata_element_parsing(capwap_message_elements_han
|
||||
}
|
||||
|
||||
data->data = (uint8_t*)capwap_alloc(length);
|
||||
if (!data->data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->data, length);
|
||||
|
||||
return data;
|
||||
|
@ -45,13 +45,8 @@ static void* capwap_datatransfermode_element_parsing(capwap_message_elements_han
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_datatransfermode_element*)capwap_alloc(sizeof(struct capwap_datatransfermode_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_datatransfermode_element*)capwap_alloc(sizeof(struct capwap_datatransfermode_element));
|
||||
func->read_u8(handle, &data->mode);
|
||||
if ((data->mode != CAPWAP_DATATRANSFERMODE_MODE_CRASH_DUMP) && (data->mode != CAPWAP_DATATRANSFERMODE_MODE_MEMORY_DUMP)) {
|
||||
capwap_datatransfermode_element_free((void*)data);
|
||||
|
@ -61,12 +61,9 @@ static void* capwap_decrypterrorreport_element_parsing(capwap_message_elements_h
|
||||
|
||||
/* */
|
||||
data = (struct capwap_decrypterrorreport_element*)capwap_alloc(sizeof(struct capwap_decrypterrorreport_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_decrypterrorreport_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_decrypterrorreport_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->entry);
|
||||
func->read_u8(handle, &data->length);
|
||||
@ -92,10 +89,6 @@ static void* capwap_decrypterrorreport_element_parsing(capwap_message_elements_h
|
||||
}
|
||||
|
||||
data->address = (uint8_t*)capwap_alloc(length);
|
||||
if (!data->address) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->address, length);
|
||||
|
||||
return data;
|
||||
|
@ -46,13 +46,8 @@ static void* capwap_decrypterrorreportperiod_element_parsing(capwap_message_elem
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_decrypterrorreportperiod_element*)capwap_alloc(sizeof(struct capwap_decrypterrorreportperiod_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_decrypterrorreportperiod_element*)capwap_alloc(sizeof(struct capwap_decrypterrorreportperiod_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u16(handle, &data->interval);
|
||||
|
||||
|
@ -59,12 +59,9 @@ static void* capwap_deletemacacl_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_deletemacacl_element*)capwap_alloc(sizeof(struct capwap_deletemacacl_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_deletemacacl_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_deletemacacl_element));
|
||||
func->read_u8(handle, &data->entry);
|
||||
func->read_u8(handle, &data->length);
|
||||
|
||||
@ -85,10 +82,6 @@ static void* capwap_deletemacacl_element_parsing(capwap_message_elements_handle
|
||||
}
|
||||
|
||||
data->address = (uint8_t*)capwap_alloc(length);
|
||||
if (!data->address) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->address, length);
|
||||
|
||||
return data;
|
||||
|
@ -59,12 +59,9 @@ static void* capwap_deletestation_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_deletestation_element*)capwap_alloc(sizeof(struct capwap_deletestation_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_deletestation_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_deletestation_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->length);
|
||||
|
||||
@ -79,10 +76,6 @@ static void* capwap_deletestation_element_parsing(capwap_message_elements_handle
|
||||
}
|
||||
|
||||
data->address = (uint8_t*)capwap_alloc(data->length);
|
||||
if (!data->address) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->address, data->length);
|
||||
|
||||
return data;
|
||||
|
@ -47,13 +47,8 @@ static void* capwap_discoverytype_element_parsing(capwap_message_elements_handle
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_discoverytype_element*)capwap_alloc(sizeof(struct capwap_discoverytype_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_discoverytype_element*)capwap_alloc(sizeof(struct capwap_discoverytype_element));
|
||||
func->read_u8(handle, &data->type);
|
||||
if ((data->type != CAPWAP_DISCOVERYTYPE_TYPE_UNKNOWN) && (data->type != CAPWAP_DISCOVERYTYPE_TYPE_STATIC) &&
|
||||
(data->type != CAPWAP_DISCOVERYTYPE_TYPE_DHCP) && (data->type != CAPWAP_DISCOVERYTYPE_TYPE_DNS) &&
|
||||
|
@ -62,12 +62,9 @@ static void* capwap_duplicateipv4_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_duplicateipv4_element*)capwap_alloc(sizeof(struct capwap_duplicateipv4_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_duplicateipv4_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_duplicateipv4_element));
|
||||
func->read_block(handle, (uint8_t*)&data->address, sizeof(struct in_addr));
|
||||
func->read_u8(handle, &data->status);
|
||||
func->read_u8(handle, &data->length);
|
||||
@ -83,10 +80,6 @@ static void* capwap_duplicateipv4_element_parsing(capwap_message_elements_handle
|
||||
}
|
||||
|
||||
data->macaddress = (uint8_t*)capwap_alloc(data->length);
|
||||
if (!data->macaddress) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->macaddress, data->length);
|
||||
|
||||
return data;
|
||||
|
@ -68,12 +68,9 @@ static void* capwap_duplicateipv6_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_duplicateipv6_element*)capwap_alloc(sizeof(struct capwap_duplicateipv6_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_duplicateipv6_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_duplicateipv6_element));
|
||||
func->read_block(handle, (uint8_t*)&data->address, sizeof(struct in6_addr));
|
||||
func->read_u8(handle, &data->status);
|
||||
func->read_u8(handle, &data->length);
|
||||
@ -89,10 +86,6 @@ static void* capwap_duplicateipv6_element_parsing(capwap_message_elements_handle
|
||||
}
|
||||
|
||||
data->macaddress = (uint8_t*)capwap_alloc(data->length);
|
||||
if (!data->macaddress) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->macaddress, data->length);
|
||||
|
||||
return data;
|
||||
|
@ -45,13 +45,8 @@ static void* capwap_ecnsupport_element_parsing(capwap_message_elements_handle ha
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_ecnsupport_element*)capwap_alloc(sizeof(struct capwap_ecnsupport_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_ecnsupport_element*)capwap_alloc(sizeof(struct capwap_ecnsupport_element));
|
||||
func->read_u8(handle, &data->flag);
|
||||
|
||||
if ((data->flag != CAPWAP_LIMITED_ECN_SUPPORT) && (data->flag != CAPWAP_FULL_ECN_SUPPORT)) {
|
||||
|
@ -36,13 +36,8 @@ static void* capwap_idletimeout_element_parsing(capwap_message_elements_handle h
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_idletimeout_element*)capwap_alloc(sizeof(struct capwap_idletimeout_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_idletimeout_element*)capwap_alloc(sizeof(struct capwap_idletimeout_element));
|
||||
func->read_u32(handle, &data->timeout);
|
||||
|
||||
return data;
|
||||
|
@ -60,14 +60,10 @@ static void* capwap_imagedata_element_parsing(capwap_message_elements_handle han
|
||||
|
||||
/* */
|
||||
data = (struct capwap_imagedata_element*)capwap_alloc(sizeof(struct capwap_imagedata_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_imagedata_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_imagedata_element));
|
||||
func->read_u8(handle, &data->type);
|
||||
|
||||
if ((data->type != CAPWAP_IMAGEDATA_TYPE_DATA_IS_INCLUDED) && (data->type != CAPWAP_IMAGEDATA_TYPE_DATA_EOF) && (data->type != CAPWAP_IMAGEDATA_TYPE_ERROR)) {
|
||||
capwap_imagedata_element_free((void*)data);
|
||||
capwap_logging_debug("Invalid Image Data element: underbuffer: invalid type");
|
||||
@ -87,10 +83,6 @@ static void* capwap_imagedata_element_parsing(capwap_message_elements_handle han
|
||||
data->data = NULL;
|
||||
} else {
|
||||
data->data = (uint8_t*)capwap_alloc(length);
|
||||
if (!data->data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->data, length);
|
||||
}
|
||||
|
||||
|
@ -64,18 +64,9 @@ static void* capwap_imageidentifier_element_parsing(capwap_message_elements_hand
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_imageidentifier_element*)capwap_alloc(sizeof(struct capwap_imageidentifier_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
data->name = (uint8_t*)capwap_alloc(length + 1);
|
||||
if (!data->name) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_imageidentifier_element*)capwap_alloc(sizeof(struct capwap_imageidentifier_element));
|
||||
data->name = (uint8_t*)capwap_alloc(length + 1);
|
||||
func->read_u32(handle, &data->vendor);
|
||||
func->read_block(handle, data->name, length);
|
||||
data->name[length] = 0;
|
||||
|
@ -52,13 +52,8 @@ static void* capwap_imageinfo_element_parsing(capwap_message_elements_handle han
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_imageinfo_element*)capwap_alloc(sizeof(struct capwap_imageinfo_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_imageinfo_element*)capwap_alloc(sizeof(struct capwap_imageinfo_element));
|
||||
func->read_u32(handle, &data->length);
|
||||
func->read_block(handle, data->hash, CAPWAP_IMAGEINFO_HASH_LENGTH);
|
||||
|
||||
|
@ -25,13 +25,8 @@ static void* capwap_initdownload_element_parsing(capwap_message_elements_handle
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_initdownload_element*)capwap_alloc(sizeof(struct capwap_initdownload_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_initdownload_element*)capwap_alloc(sizeof(struct capwap_initdownload_element));
|
||||
memset(data, 0, sizeof(struct capwap_initdownload_element));
|
||||
|
||||
return data;
|
||||
|
@ -37,13 +37,8 @@ static void* capwap_localipv4_element_parsing(capwap_message_elements_handle han
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_localipv4_element*)capwap_alloc(sizeof(struct capwap_localipv4_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_localipv4_element*)capwap_alloc(sizeof(struct capwap_localipv4_element));
|
||||
func->read_block(handle, (uint8_t*)&data->address, sizeof(struct in_addr));
|
||||
|
||||
return data;
|
||||
|
@ -42,13 +42,8 @@ static void* capwap_localipv6_element_parsing(capwap_message_elements_handle han
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_localipv6_element*)capwap_alloc(sizeof(struct capwap_localipv6_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_localipv6_element*)capwap_alloc(sizeof(struct capwap_localipv6_element));
|
||||
func->read_block(handle, (uint8_t*)&data->address, sizeof(struct in6_addr));
|
||||
|
||||
return data;
|
||||
|
@ -55,18 +55,9 @@ static void* capwap_location_element_parsing(capwap_message_elements_handle hand
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_location_element*)capwap_alloc(sizeof(struct capwap_location_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
data->value = (uint8_t*)capwap_alloc(length + 1);
|
||||
if (!data->value) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_location_element*)capwap_alloc(sizeof(struct capwap_location_element));
|
||||
data->value = (uint8_t*)capwap_alloc(length + 1);
|
||||
func->read_block(handle, data->value, length);
|
||||
data->value[length] = 0;
|
||||
|
||||
|
@ -37,13 +37,8 @@ static void* capwap_maximumlength_element_parsing(capwap_message_elements_handle
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_maximumlength_element*)capwap_alloc(sizeof(struct capwap_maximumlength_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_maximumlength_element*)capwap_alloc(sizeof(struct capwap_maximumlength_element));
|
||||
func->read_u16(handle, &data->length);
|
||||
|
||||
return data;
|
||||
|
@ -44,13 +44,8 @@ static void* capwap_mtudiscovery_element_parsing(capwap_message_elements_handle
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_mtudiscovery_element*)capwap_alloc(sizeof(struct capwap_mtudiscovery_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_mtudiscovery_element*)capwap_alloc(sizeof(struct capwap_mtudiscovery_element));
|
||||
data->length = length;
|
||||
func->read_block(handle, NULL, length);
|
||||
|
||||
|
@ -47,13 +47,8 @@ static void* capwap_radioadmstate_element_parsing(capwap_message_elements_handle
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_radioadmstate_element*)capwap_alloc(sizeof(struct capwap_radioadmstate_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_radioadmstate_element*)capwap_alloc(sizeof(struct capwap_radioadmstate_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->state);
|
||||
|
||||
|
@ -50,13 +50,8 @@ static void* capwap_radiooprstate_element_parsing(capwap_message_elements_handle
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_radiooprstate_element*)capwap_alloc(sizeof(struct capwap_radiooprstate_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_radiooprstate_element*)capwap_alloc(sizeof(struct capwap_radiooprstate_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->state);
|
||||
func->read_u8(handle, &data->cause);
|
||||
|
@ -45,13 +45,8 @@ static void* capwap_resultcode_element_parsing(capwap_message_elements_handle ha
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_resultcode_element*)capwap_alloc(sizeof(struct capwap_resultcode_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_resultcode_element*)capwap_alloc(sizeof(struct capwap_resultcode_element));
|
||||
func->read_u32(handle, &data->code);
|
||||
if ((data->code < CAPWAP_RESULTCODE_FIRST) || (data->code > CAPWAP_RESULTCODE_LAST)) {
|
||||
capwap_resultcode_element_free((void*)data);
|
||||
|
@ -64,12 +64,9 @@ static void* capwap_returnedmessage_element_parsing(capwap_message_elements_hand
|
||||
|
||||
/* */
|
||||
data = (struct capwap_returnedmessage_element*)capwap_alloc(sizeof(struct capwap_returnedmessage_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
memset(data, 0, sizeof(struct capwap_returnedmessage_element));
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_returnedmessage_element));
|
||||
func->read_u8(handle, &data->reason);
|
||||
func->read_u8(handle, &data->length);
|
||||
|
||||
@ -87,10 +84,6 @@ static void* capwap_returnedmessage_element_parsing(capwap_message_elements_hand
|
||||
}
|
||||
|
||||
data->message = (uint8_t*)capwap_alloc(data->length);
|
||||
if (!data->message) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->message, data->length);
|
||||
|
||||
return data;
|
||||
|
@ -69,13 +69,8 @@ static void* capwap_sessionid_element_parsing(capwap_message_elements_handle han
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_sessionid_element*)capwap_alloc(sizeof(struct capwap_sessionid_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_sessionid_element*)capwap_alloc(sizeof(struct capwap_sessionid_element));
|
||||
func->read_block(handle, data->id, 16);
|
||||
|
||||
return data;
|
||||
|
@ -37,13 +37,8 @@ static void* capwap_statisticstimer_element_parsing(capwap_message_elements_hand
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_statisticstimer_element*)capwap_alloc(sizeof(struct capwap_statisticstimer_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_statisticstimer_element*)capwap_alloc(sizeof(struct capwap_statisticstimer_element));
|
||||
func->read_u16(handle, &data->timer);
|
||||
|
||||
return data;
|
||||
|
@ -38,13 +38,8 @@ static void* capwap_timers_element_parsing(capwap_message_elements_handle handle
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_timers_element*)capwap_alloc(sizeof(struct capwap_timers_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_timers_element*)capwap_alloc(sizeof(struct capwap_timers_element));
|
||||
func->read_u8(handle, &data->discovery);
|
||||
func->read_u8(handle, &data->echorequest);
|
||||
|
||||
|
@ -45,13 +45,8 @@ static void* capwap_transport_element_parsing(capwap_message_elements_handle han
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_transport_element*)capwap_alloc(sizeof(struct capwap_transport_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_transport_element*)capwap_alloc(sizeof(struct capwap_transport_element));
|
||||
func->read_u8(handle, &data->type);
|
||||
if ((data->type != CAPWAP_UDPLITE_TRANSPORT) && (data->type != CAPWAP_UDP_TRANSPORT)) {
|
||||
capwap_transport_element_free((void*)data);
|
||||
|
@ -62,18 +62,9 @@ static void* capwap_vendorpayload_element_parsing(capwap_message_elements_handle
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_vendorpayload_element*)capwap_alloc(sizeof(struct capwap_vendorpayload_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
data->data = (uint8_t*)capwap_alloc(length);
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_vendorpayload_element*)capwap_alloc(sizeof(struct capwap_vendorpayload_element));
|
||||
data->data = (uint8_t*)capwap_alloc(length);
|
||||
func->read_u32(handle, &data->vendorid);
|
||||
func->read_u16(handle, &data->elementid);
|
||||
data->datalength = length;
|
||||
|
@ -86,10 +86,6 @@ static void* capwap_wtpboarddata_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_wtpboarddata_element*)capwap_alloc(sizeof(struct capwap_wtpboarddata_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
data->boardsubelement = capwap_array_create(sizeof(struct capwap_wtpboarddata_board_subelement), 0, 1);
|
||||
|
||||
/* Retrieve data */
|
||||
@ -124,10 +120,6 @@ static void* capwap_wtpboarddata_element_parsing(capwap_message_elements_handle
|
||||
}
|
||||
|
||||
desc->data = (uint8_t*)capwap_alloc(desc->length);
|
||||
if (!desc->data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, desc->data, desc->length);
|
||||
}
|
||||
|
||||
|
@ -112,10 +112,6 @@ static void* capwap_wtpdescriptor_element_parsing(capwap_message_elements_handle
|
||||
|
||||
/* */
|
||||
data = (struct capwap_wtpdescriptor_element*)capwap_alloc(sizeof(struct capwap_wtpdescriptor_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
data->encryptsubelement = capwap_array_create(sizeof(struct capwap_wtpdescriptor_encrypt_subelement), 0, 0);
|
||||
data->descsubelement = capwap_array_create(sizeof(struct capwap_wtpdescriptor_desc_subelement), 0, 1);
|
||||
|
||||
|
@ -45,13 +45,8 @@ static void* capwap_wtpfallback_element_parsing(capwap_message_elements_handle h
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_wtpfallback_element*)capwap_alloc(sizeof(struct capwap_wtpfallback_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_wtpfallback_element*)capwap_alloc(sizeof(struct capwap_wtpfallback_element));
|
||||
func->read_u8(handle, &data->mode);
|
||||
if ((data->mode != CAPWAP_WTP_FALLBACK_ENABLED) && (data->mode != CAPWAP_WTP_FALLBACK_DISABLED)) {
|
||||
capwap_wtpfallback_element_free((void*)data);
|
||||
|
@ -45,13 +45,8 @@ static void* capwap_wtpframetunnelmode_element_parsing(capwap_message_elements_h
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_wtpframetunnelmode_element*)capwap_alloc(sizeof(struct capwap_wtpframetunnelmode_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_wtpframetunnelmode_element*)capwap_alloc(sizeof(struct capwap_wtpframetunnelmode_element));
|
||||
func->read_u8(handle, &data->mode);
|
||||
if ((data->mode & CAPWAP_WTP_FRAME_TUNNEL_MODE_MASK) != data->mode) {
|
||||
capwap_wtpframetunnelmode_element_free((void*)data);
|
||||
|
@ -45,13 +45,8 @@ static void* capwap_wtpmactype_element_parsing(capwap_message_elements_handle ha
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_wtpmactype_element*)capwap_alloc(sizeof(struct capwap_wtpmactype_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_wtpmactype_element*)capwap_alloc(sizeof(struct capwap_wtpmactype_element));
|
||||
func->read_u8(handle, &data->type);
|
||||
if ((data->type != CAPWAP_LOCALMAC) && (data->type != CAPWAP_SPLITMAC) && (data->type != CAPWAP_LOCALANDSPLITMAC)) {
|
||||
capwap_wtpmactype_element_free((void*)data);
|
||||
|
@ -42,18 +42,9 @@ static void* capwap_wtpname_element_parsing(capwap_message_elements_handle handl
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_wtpname_element*)capwap_alloc(sizeof(struct capwap_wtpname_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
data->name = (uint8_t*)capwap_alloc(length + 1);
|
||||
if (!data->name) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_wtpname_element*)capwap_alloc(sizeof(struct capwap_wtpname_element));
|
||||
data->name = (uint8_t*)capwap_alloc(length + 1);
|
||||
func->read_block(handle, data->name, length);
|
||||
data->name[length] = 0;
|
||||
|
||||
|
@ -63,13 +63,8 @@ static void* capwap_wtpradiostat_element_parsing(capwap_message_elements_handle
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_wtpradiostat_element*)capwap_alloc(sizeof(struct capwap_wtpradiostat_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_wtpradiostat_element*)capwap_alloc(sizeof(struct capwap_wtpradiostat_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
if (!IS_VALID_RADIOID(data->radioid)) {
|
||||
capwap_wtpradiostat_element_free((void*)data);
|
||||
|
@ -50,13 +50,8 @@ static void* capwap_wtprebootstat_element_parsing(capwap_message_elements_handle
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_wtprebootstat_element*)capwap_alloc(sizeof(struct capwap_wtprebootstat_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_wtprebootstat_element*)capwap_alloc(sizeof(struct capwap_wtprebootstat_element));
|
||||
func->read_u16(handle, &data->rebootcount);
|
||||
func->read_u16(handle, &data->acinitiatedcount);
|
||||
func->read_u16(handle, &data->linkfailurecount);
|
||||
|
@ -46,13 +46,8 @@ static void* capwap_wtpstaticipaddress_element_parsing(capwap_message_elements_h
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_wtpstaticipaddress_element*)capwap_alloc(sizeof(struct capwap_wtpstaticipaddress_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
data = (struct capwap_wtpstaticipaddress_element*)capwap_alloc(sizeof(struct capwap_wtpstaticipaddress_element));
|
||||
func->read_block(handle, (uint8_t*)&data->address, sizeof(struct in_addr));
|
||||
func->read_block(handle, (uint8_t*)&data->netmask, sizeof(struct in_addr));
|
||||
func->read_block(handle, (uint8_t*)&data->gateway, sizeof(struct in_addr));
|
||||
|
@ -6,11 +6,8 @@ struct capwap_list* capwap_list_create(void) {
|
||||
struct capwap_list* list;
|
||||
|
||||
list = (struct capwap_list*)capwap_alloc(sizeof(struct capwap_list));
|
||||
if (!list) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
memset(list, 0, sizeof(struct capwap_list));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -46,11 +43,8 @@ struct capwap_list_item* capwap_itemlist_create_with_item(void* item, int size)
|
||||
struct capwap_list_item* itemlist;
|
||||
|
||||
itemlist = (struct capwap_list_item*)capwap_alloc(sizeof(struct capwap_list_item));
|
||||
if (!itemlist) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
memset(itemlist, 0, sizeof(struct capwap_list_item));
|
||||
|
||||
itemlist->item = item;
|
||||
itemlist->itemsize = size;
|
||||
itemlist->autodelete = 1;
|
||||
@ -65,10 +59,6 @@ struct capwap_list_item* capwap_itemlist_create(int size) {
|
||||
ASSERT(size > 0);
|
||||
|
||||
item = capwap_alloc(size);
|
||||
if (!item) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
return capwap_itemlist_create_with_item(item, size);
|
||||
}
|
||||
|
||||
|
@ -487,12 +487,8 @@ static struct capwap_packet_txmng* capwap_packet_txmng_create(struct capwap_head
|
||||
|
||||
/* */
|
||||
txmngpacket = (struct capwap_packet_txmng*)capwap_alloc(sizeof(struct capwap_packet_txmng));
|
||||
if (!txmngpacket) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* */
|
||||
memset(txmngpacket, 0, sizeof(struct capwap_packet_txmng));
|
||||
|
||||
txmngpacket->mtu = mtu;
|
||||
|
||||
/* Fragment bucket */
|
||||
@ -796,12 +792,8 @@ struct capwap_packet_rxmng* capwap_packet_rxmng_create_message(int isctrlpacket)
|
||||
|
||||
/* */
|
||||
rxmngpacket = (struct capwap_packet_rxmng*)capwap_alloc(sizeof(struct capwap_packet_rxmng));
|
||||
if (!rxmngpacket) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* */
|
||||
memset(rxmngpacket, 0, sizeof(struct capwap_packet_rxmng));
|
||||
|
||||
rxmngpacket->isctrlpacket = isctrlpacket;
|
||||
|
||||
/* Fragment bucket */
|
||||
|
@ -208,13 +208,8 @@ struct capwap_socket_ssl* capwap_socket_ssl_connect(int sock, void* sslcontext,
|
||||
ASSERT(sock >= 0);
|
||||
ASSERT(sslcontext != NULL);
|
||||
|
||||
/* */
|
||||
sslsock = capwap_alloc(sizeof(struct capwap_socket_ssl));
|
||||
if (!sslsock) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Create SSL session */
|
||||
sslsock = capwap_alloc(sizeof(struct capwap_socket_ssl));
|
||||
sslsock->sock = sock;
|
||||
sslsock->sslcontext = sslcontext;
|
||||
sslsock->sslsession = (void*)SSL_new((SSL_CTX*)sslcontext);
|
||||
|
@ -357,9 +357,6 @@ int wtp_dfa_running(void) {
|
||||
/* Configure poll struct */
|
||||
fdscount = CAPWAP_MAX_SOCKETS * 2;
|
||||
fds = (struct pollfd*)capwap_alloc(sizeof(struct pollfd) * fdscount);
|
||||
if (!fds) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrive all socket for polling */
|
||||
fdscount = capwap_network_set_pollfd(&g_wtp.net, fds, fdscount);
|
||||
|
Loading…
Reference in New Issue
Block a user