Some work on WTP.

FossilOrigin-Name: 6ec1370311c5b83dc78adbfb75f8241e0916b171a9c0f939d24ec28ebdf908c8
This commit is contained in:
7u83@mail.ru
2015-04-19 14:44:20 +00:00
parent 5a71654ebd
commit fdc6b0e4a0
36 changed files with 496 additions and 61 deletions

View File

@ -14,6 +14,80 @@
#include "wtp_conf.h"
#include "capwap/timer.h"
#include "capwap/capwap.h"
#include "capwap/conn.h"
#include "wtp_interface.h"
int run()
{
struct conn *conn = get_conn();
conn->capwap_state = CW_STATE_RUN;
do {
time_t timer = cw_timer_start(25);
int rc;
while (!cw_timer_timeout(timer) && conn->capwap_state == CW_STATE_RUN) {
rc = cw_read_messages(conn);
if (rc < 0 && errno == EAGAIN) {
continue;
}
if ( !cw_rcok(rc))
break;
}
if (rc<0 && errno == EAGAIN){
rc = cw_send_request(conn,CW_MSG_ECHO_REQUEST);
if (!cw_rcok(rc)) {
cw_log(LOG_ERR,"Error in run state: %d %s",rc,cw_strrc(rc));
break;
}
continue;
}
if (!cw_rcok(rc)) {
cw_log(LOG_ERR,"Error in run state: %d %s",rc,cw_strrc(rc));
break;
}
} while (conn->capwap_state == CW_STATE_RUN);
// int rc = cw_send_request(conn,CW_MSG_CHANGE_STATE_EVENT_REQUEST);
// if ( !cw_rcok(rc) ) {
// cw_strresult(rc);
// }
}
/*
static int echo_interval_timer;