Initial commit.

FossilOrigin-Name: 33296e47c3fcf030eb51ae509b97e3a6082ad0eb989c55ee2245954168ce7f7f
This commit is contained in:
7u83@mail.ru 2014-08-23 07:36:18 +00:00
parent 2dc3469fc2
commit 346d8da30a
2 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,52 @@
#include <stdio.h>
#include "capwap.h"
#include "cw_log.h"
#include "cw_util.h"
struct eparm {
int * mand;
uint32_t result_code;
struct wtpinfo * wtpinfo;
};
static int readelem(void * eparm,int type,uint8_t* msgelem,int len)
{
struct eparm * e = (struct eparm*)eparm;
cw_dbg_msgelem(CWMSG_CHANGE_STATE_EVENT_REQUEST,type,msgelem,len);
return 0;
//foundX:
cw_mand_elem_found(e->mand,type);
return 1;
}
int cwread_wtp_event_request(struct wtpinfo * wtpinfo, uint8_t * msg, int len)
{
int mand[] = {
-1};
struct eparm eparm;
eparm.wtpinfo = wtpinfo;
eparm.mand=mand;
cw_dbg(DBG_CW_MSGELEM,"Reading wtp event request, len=%d",len);
cw_foreach_msgelem(msg,len,readelem,&eparm);
if (cw_is_missing_mand_elems(mand)){
char str[512];
cw_get_missing_mand_elems(str,mand);
cw_dbg(DBG_CW_RFC, "Missing msgelems in change state event request: %s",str);
}
return eparm.result_code;
}

View File

@ -0,0 +1,13 @@
#include "capwap.h"
#include "conn.h"
void cwsend_unknown_response(struct conn * conn,int seqnum, int unknown_request)
{
struct cwmsg * cwmsg = &conn->resp_msg;
cwmsg_init(cwmsg,conn->resp_buffer,unknown_request+1,seqnum,NULL);
cwmsg_addelem_result_code(cwmsg,19);
conn_send_response(conn,cwmsg,seqnum);
}