More Cisco stuff added

FossilOrigin-Name: e68d9b046b5b19112b8c37d63642202ba74c57d927cb4519d0da57e0b0e11698
This commit is contained in:
7u83@mail.ru
2018-04-22 07:00:55 +00:00
parent d316d956f8
commit d1363a2e14
14 changed files with 245 additions and 45 deletions

View File

@ -5,7 +5,7 @@ int cw_ktv_read_struct(mavl_t ktv,const cw_KTVStruct_t * stru, const char *pkey,
uint8_t * data, int len)
{
char key[CW_KTV_MAX_KEY_LEN];
int pos, i;
int pos, i,l;
cw_KTV_t * result;
@ -16,13 +16,22 @@ int cw_ktv_read_struct(mavl_t ktv,const cw_KTVStruct_t * stru, const char *pkey,
pos=stru[i].position;
sprintf(key,"%s/%s",pkey,stru[i].key);
result = cw_ktv_add(ktv,key,stru[i].type,data+pos,stru[i].len);
if (stru[i].len==-1)
l = len-pos;
else
l = stru[i].len;
result = cw_ktv_add(ktv,key,stru[i].type,data+pos,l);
stru[i].type->to_str(result,dbstr,100);
cw_dbg(DBG_ELEM_DETAIL, "Read (%d): %s: %s",pos,key,dbstr);
if (stru[i].len==-1)
l = result->type->len(result);
else
l = stru[i].len;
if(stru[i].position == -1)
pos+=stru[i].len;
pos+=l;
i++;
}