From 3cf0fd04d50d459a193d57dd93dfa4c797977c3e Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sun, 27 Mar 2016 02:50:04 +0000 Subject: [PATCH] Calls msg_start and msg_end. FossilOrigin-Name: c5c7514bcb9aaf1f6827e652c6b1a93780238fdec1ca1738478ccefafbdffd9e --- src/cw/conn_process_packet.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/cw/conn_process_packet.c b/src/cw/conn_process_packet.c index 754b4437..2cb8d8c3 100644 --- a/src/cw/conn_process_packet.c +++ b/src/cw/conn_process_packet.c @@ -92,12 +92,16 @@ void cw_init_request(struct conn *conn, int msg_id) cw_set_msg_elems_len(msgptr, 0); } -void cw_init_keepalive(struct conn *conn) +void cw_init_data_msg(struct conn *conn) { uint8_t *buffer = conn->req_buffer; cw_put_dword(buffer + 0, 0); cw_put_dword(buffer + 4, 0); + /* unencrypted */ + cw_set_hdr_preamble(buffer, CAPWAP_VERSION << 4 | 0); + + } @@ -202,7 +206,7 @@ static struct cw_actiondef *load_mods(struct conn *conn, uint8_t * rawmsg, int l cw_dbg(DBG_INFO, "Mods deteced: %s,%s", cmod->name, bmod->name); - struct cw_actiondef *ad = mod_cache_add(cmod, bmod); + struct cw_actiondef *ad = mod_cache_add(conn,cmod, bmod); return ad; @@ -297,7 +301,7 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len, //struct mod_ac *mod; struct cw_actiondef *ad = load_mods(conn, rawmsg, len, elems_len, from); if (!ad) { - cw_log(LOG_ERR, "Eror"); + cw_log(LOG_ERR, "Error"); errno = EAGAIN; return -1; } @@ -353,6 +357,10 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len, return -1; } + + if (conn->msg_start){ + conn->msg_start(conn, afm, rawmsg, len, from); + } /* Execute start processor for message */ if (afm->start) { @@ -424,6 +432,9 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len, result_code = afm->end(conn, afm, rawmsg, len, from); } + if (conn->msg_end){ + conn->msg_end(conn, afm, rawmsg, len, from); + } } if (unrecognized) {