2015-04-05 02:11:49 +02:00
|
|
|
|
|
|
|
#include "action.h"
|
|
|
|
#include "cw_log.h"
|
|
|
|
#include "itemstore.h"
|
2015-04-07 07:42:36 +02:00
|
|
|
#include "capwap.h"
|
2015-04-05 02:11:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int cw_in_generic(struct conn *conn,struct cw_action_in * a,uint8_t *data,int len)
|
|
|
|
{
|
|
|
|
if (len<a->min_len) {
|
|
|
|
cw_dbg(DBG_ELEM_ERR,"Message element too short, %d < %d", len,a->min_len);
|
|
|
|
return 0;
|
|
|
|
}
|
2015-04-07 07:42:36 +02:00
|
|
|
if (len>a->max_len) {
|
|
|
|
cw_dbg(DBG_ELEM_ERR,"Message element too big, %d > %d", len,a->max_len);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-04-05 02:11:49 +02:00
|
|
|
|
2015-04-05 20:27:17 +02:00
|
|
|
cw_itemstore_set(conn->remote,a->item_id,a->itemtype,data,len);
|
2015-04-07 07:42:36 +02:00
|
|
|
|
2015-04-05 02:11:49 +02:00
|
|
|
return 0;
|
|
|
|
}
|