more progress in new ktv storage
FossilOrigin-Name: a2c26a366de1946feb707439302b22de2e3d02f7621d0834fdf242852b28639c
This commit is contained in:
@ -1,52 +1,37 @@
|
||||
|
||||
#include "capwap.h"
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
|
||||
int cw_check_missing_mand(struct cw_MsgData *msgdata, mavl_t keys )
|
||||
{
|
||||
mlistelem_t * elem;
|
||||
char *mandkey, *result;
|
||||
mlist_t missing;
|
||||
int count;
|
||||
|
||||
missing = mlist_create_conststr();
|
||||
if (missing==NULL){
|
||||
cw_log(LOG_ERR, "Can't allocate memory for check of missing mand elems: %s", strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
|
||||
mlist_foreach(elem, msgdata->mand_keys){
|
||||
mandkey = mlistelem_get_str(elem);
|
||||
|
||||
result = mavl_get_str(keys,mandkey);
|
||||
if (result == NULL){
|
||||
printf("Missing\n");
|
||||
mlist_append_ptr(missing,mandkey);
|
||||
}
|
||||
else printf("Ok\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* cw_action_in_t as;
|
||||
|
||||
as.capwap_state = a->capwap_state;
|
||||
as.msg_id = a->msg_id;
|
||||
as.vendor_id = 0;
|
||||
as.elem_id = 0;
|
||||
as.proto=0;
|
||||
*/
|
||||
/// TODO XXXX
|
||||
/*
|
||||
DEFINE_AVLITER(it,conn->actions->in);
|
||||
int n=0;
|
||||
avliter_foreach_from(&it,&as) {
|
||||
cw_action_in_t * ai = avliter_get(&it);
|
||||
|
||||
if (ai->msg_id != as.msg_id || ai->capwap_state != as.capwap_state)
|
||||
break;
|
||||
if (!ai->mand)
|
||||
continue;
|
||||
|
||||
void * rc = mavl_get(conn->mand,(void*)ai->item_id);
|
||||
if (!rc) {
|
||||
out[n++]=ai;
|
||||
}
|
||||
|
||||
mlist_foreach(elem,missing){
|
||||
cw_dbg(DBG_RFC," Missing mandatory message element: %s", mlistelem_get_str(elem));
|
||||
}
|
||||
return n;
|
||||
*/
|
||||
|
||||
count = missing->count;
|
||||
mlist_destroy(missing);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user