2014-08-25 01:04:35 +02:00
|
|
|
/*
|
|
|
|
This file is part of libcapwap.
|
|
|
|
|
|
|
|
libcapwap is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
libcapwap is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2018-03-17 17:29:09 +01:00
|
|
|
|
2014-08-25 01:04:35 +02:00
|
|
|
#include "capwap.h"
|
|
|
|
#include "lwapp.h"
|
2014-08-26 07:42:56 +02:00
|
|
|
|
2018-03-01 20:11:37 +01:00
|
|
|
/*
|
2014-08-25 01:04:35 +02:00
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
int conn_prepare_image_data_request(struct conn *conn, struct cwimage_data *data,
|
2015-01-08 21:20:14 +01:00
|
|
|
struct image_identifier *id)
|
2014-08-25 01:04:35 +02:00
|
|
|
{
|
2015-01-08 21:20:14 +01:00
|
|
|
struct cwmsg *cwmsg = &conn->req_msg;
|
2015-03-29 01:55:06 +01:00
|
|
|
cwmsg_init(cwmsg, conn->req_buffer, CW_MSG_IMAGE_DATA_REQUEST, conn_get_next_seqnum(conn),
|
2015-01-08 21:20:14 +01:00
|
|
|
0);
|
2014-08-25 01:04:35 +02:00
|
|
|
|
2015-01-08 21:20:14 +01:00
|
|
|
if (!data)
|
|
|
|
return 0;
|
2014-08-25 01:04:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-01 20:11:37 +01:00
|
|
|
// for Cisco APs send image data in "LWAPP format"
|
|
|
|
if (conn->capwap_mode == CWMODE_CISCO) {
|
2015-01-08 21:20:14 +01:00
|
|
|
uint8_t type = 3;
|
|
|
|
uint16_t checksum = htons(lw_checksum(data->data, data->len));
|
2015-03-29 09:35:11 +02:00
|
|
|
cwmsg_vaddelem(cwmsg, CW_ELEM_IMAGE_DATA,
|
2015-03-19 20:45:03 +01:00
|
|
|
&type, 1,
|
|
|
|
&checksum, 2,
|
|
|
|
data->data, data->len,
|
|
|
|
NULL);
|
2015-01-08 21:20:14 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2014-08-25 01:04:35 +02:00
|
|
|
|
2018-03-01 20:11:37 +01:00
|
|
|
|
|
|
|
// standard capwap operation
|
2014-08-25 01:04:35 +02:00
|
|
|
|
2015-03-29 09:35:11 +02:00
|
|
|
cwmsg_vaddelem(cwmsg,CW_ELEM_IMAGE_DATA,
|
2015-01-08 21:20:14 +01:00
|
|
|
&data->type, sizeof(data->type),
|
2015-03-19 20:45:03 +01:00
|
|
|
data->data, data->len,
|
|
|
|
NULL
|
2015-01-08 21:20:14 +01:00
|
|
|
);
|
2014-08-25 01:04:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2018-03-01 20:11:37 +01:00
|
|
|
|
|
|
|
*/
|