2015-03-28 12:51:34 +01:00
|
|
|
|
2018-04-09 09:27:38 +02:00
|
|
|
|
|
|
|
|
2016-03-03 19:51:42 +01:00
|
|
|
#include "cw/capwap.h"
|
|
|
|
#include "cw/conn.h"
|
2016-03-05 10:31:09 +01:00
|
|
|
#include "cw/log.h"
|
2018-04-09 09:27:38 +02:00
|
|
|
#include "cw/dbg.h"
|
2016-03-05 10:31:09 +01:00
|
|
|
|
2015-03-23 07:48:27 +01:00
|
|
|
#include "wtp_interface.h"
|
2016-03-05 22:32:52 +01:00
|
|
|
#include "cfg.h"
|
2014-07-19 13:25:42 +02:00
|
|
|
|
2016-03-07 18:56:02 +01:00
|
|
|
|
2018-04-09 09:27:38 +02:00
|
|
|
int configure(struct conn * conn)
|
|
|
|
{
|
|
|
|
char sockbuff[SOCK_ADDR_BUFSIZE];
|
|
|
|
|
|
|
|
cw_dbg_ktv_dump(conn->local_cfg,DBG_INFO,"KTV DUMP ----------------","LOCAL:", "DUMP done -------");
|
|
|
|
|
|
|
|
int rc;
|
|
|
|
rc = cw_send_request(conn, CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST);
|
2016-03-07 18:56:02 +01:00
|
|
|
|
2018-03-09 15:38:21 +01:00
|
|
|
if (!cw_result_is_ok(rc)) {
|
2016-03-05 10:31:09 +01:00
|
|
|
if (rc > 0) {
|
2016-03-05 11:22:10 +01:00
|
|
|
cw_log(LOG_ERR,
|
|
|
|
"Error sending Configuration Status Request to AC at %s, AC said: %d - %s.",
|
2018-04-09 09:27:38 +02:00
|
|
|
sock_addr2str(&conn->addr,sockbuff), rc, cw_strerror(rc));
|
2015-03-29 01:55:06 +01:00
|
|
|
|
2016-03-05 10:31:09 +01:00
|
|
|
} else {
|
2016-03-05 11:22:10 +01:00
|
|
|
cw_log(LOG_ERR,
|
|
|
|
"Error sending Configuration Status Request to AC at %s: %d - %s.",
|
2018-04-09 09:27:38 +02:00
|
|
|
sock_addr2str(&conn->addr,sockbuff), errno, cw_strerror(rc));
|
2016-03-05 10:31:09 +01:00
|
|
|
}
|
2016-03-05 22:32:52 +01:00
|
|
|
|
2018-04-09 09:27:38 +02:00
|
|
|
/*cfg_to_json();*/
|
2016-03-05 10:31:09 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2018-04-18 09:40:37 +02:00
|
|
|
|
|
|
|
cw_dbg_ktv_dump(conn->remote_cfg,DBG_INFO,"Config ***","CFG: ", "End config ***");
|
2015-03-29 01:55:06 +01:00
|
|
|
|
2016-03-05 10:31:09 +01:00
|
|
|
return 1;
|
2014-07-19 13:25:42 +02:00
|
|
|
}
|