Work on State machine

FossilOrigin-Name: 87d98b73010c7316cb9b53b5ba8c3dfdddca06042630cf8437ea506e1c424c70
This commit is contained in:
7u83@mail.ru
2018-05-04 22:36:19 +00:00
parent 7d1ef1ff01
commit 9d3e24df52
25 changed files with 317 additions and 227 deletions

View File

@ -10,7 +10,6 @@ int changestate(struct conn * conn)
{
/* Update operational states, so they will be included
in the change Change State Event Request message. */
/*// cw_radio_update_oper_states(conn->radios,0);*/

View File

@ -148,7 +148,7 @@ static int run_discovery(struct conn *conn, struct cw_DiscoveryResult * dis)
}
conn->capwap_state = CAPWAP_STATE_DISCOVERY;
conn->capwap_transition = CAPWAP_STATE_DISCOVERY;
/* create and send a discovery request message */
@ -164,7 +164,7 @@ static int run_discovery(struct conn *conn, struct cw_DiscoveryResult * dis)
while (!cw_timer_timeout(timer)
&& conn->capwap_state == CAPWAP_STATE_DISCOVERY) {
&& conn->capwap_transition == CAPWAP_STATE_DISCOVERY) {
int rc;
char addr_str[SOCK_ADDR_BUFSIZE];

View File

@ -11,7 +11,7 @@
int image_update()
{
struct conn *conn = get_conn();
if (conn->capwap_state != CW_STATE_CONFIGURE) {
if (conn->capwap_state != CAPWAP_STATE_CONFIGURE) {
cw_log(LOG_ERR, "Current state not image update");
return 0;
}

View File

@ -116,7 +116,7 @@ int run_join_d(struct conn * conn, struct sockaddr *sa)
}
/* setup a socket */
conn->capwap_state = CAPWAP_STATE_JOIN;
conn->capwap_transition = CAPWAP_STATE_JOIN;
sockfd = socket(sa->sa_family, SOCK_DGRAM, 0);
if (sockfd == -1) {
cw_log(LOG_ERR, "Can't create socket: %s\n", strerror(errno));

View File

@ -140,7 +140,7 @@ int run(struct conn * conn)
conn->capwap_state = CAPWAP_STATE_RUN;
conn->capwap_transition = CAPWAP_STATE_RUN;
/* conn->msg_end=handle_update_req;*/
@ -156,7 +156,7 @@ int run(struct conn * conn)
while (!cw_timer_timeout(timer) && conn->capwap_state == CAPWAP_STATE_RUN) {
while (!cw_timer_timeout(timer) && conn->capwap_transition == CAPWAP_STATE_RUN) {
mavl_del_all(conn->remote_cfg);
rc = cw_read_messages(conn);
if (rc < 0 && errno == EAGAIN) {
@ -196,7 +196,7 @@ int run(struct conn * conn)
} while (conn->capwap_state == CAPWAP_STATE_RUN);
} while (conn->capwap_transition == CAPWAP_STATE_RUN);
/*