2015-03-28 12:51:34 +01: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"
|
2016-03-07 18:56:02 +01:00
|
|
|
#include "cw/mbag.h"
|
2016-03-08 01:20:22 +01:00
|
|
|
#include "cw/capwap_items.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
|
|
|
|
|
|
|
int configure()
|
|
|
|
{
|
2015-04-18 11:20:24 +02:00
|
|
|
|
2016-03-05 11:22:10 +01:00
|
|
|
struct conn *conn = get_conn();
|
2016-03-07 18:56:02 +01:00
|
|
|
|
2016-03-19 12:57:47 +01:00
|
|
|
// mbag_del_all(conn->incomming);
|
|
|
|
conn->incomming=conn->config;
|
|
|
|
mbag_del(conn->incomming,CW_ITEM_RESULT_CODE);
|
2016-03-07 18:56:02 +01:00
|
|
|
|
2016-03-08 01:20:22 +01:00
|
|
|
mbag_set_str(conn->local,CW_ITEM_AC_NAME,"abc");
|
2016-04-18 07:40:30 +02:00
|
|
|
// mbag_set_byte(conn->config,CW_ITEM_WTP_MAC_TYPE,WTP_MAC_TYPE_BOTH);
|
|
|
|
// mbag_set_byte(conn->config,CW_ITEM_WTP_MAC_TYPE,CAPWAP_WTP_MAC_TYPE_SPLIT);
|
2016-03-08 01:20:22 +01:00
|
|
|
|
2016-04-12 07:47:55 +02:00
|
|
|
/* for config status request send the whole config */
|
|
|
|
mbag_t radios_upd = conn->radios_upd;
|
|
|
|
conn->radios_upd=conn->radios;
|
2014-07-19 13:25:42 +02:00
|
|
|
|
2018-02-23 17:36:11 +01:00
|
|
|
int rc = cw_send_request(conn, CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST);
|
2016-04-12 07:47:55 +02:00
|
|
|
conn->radios_upd=radios_upd;
|
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.",
|
2016-03-05 10:31:09 +01:00
|
|
|
sock_addr2str(&conn->addr), 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.",
|
2016-03-05 10:31:09 +01:00
|
|
|
sock_addr2str(&conn->addr), errno, cw_strerror(rc));
|
|
|
|
}
|
2016-03-05 22:32:52 +01:00
|
|
|
|
|
|
|
cfg_to_json();
|
2016-03-05 10:31:09 +01:00
|
|
|
return 0;
|
|
|
|
}
|
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
|
|
|
}
|