Reading wtp descriptor works now - at least cisco
FossilOrigin-Name: ee2e8a3fdf9d353237161a0af0148367afc20e8020315108c02154d9df521938
This commit is contained in:
parent
4c0bae244c
commit
2055a0d644
@ -319,6 +319,9 @@
|
|||||||
<File Name="src/cw/cw_types_mavl_delete.c"/>
|
<File Name="src/cw/cw_types_mavl_delete.c"/>
|
||||||
<File Name="src/cw/cw_format_scan_hex_bytes.c"/>
|
<File Name="src/cw/cw_format_scan_hex_bytes.c"/>
|
||||||
<File Name="src/cw/cw_type_version.c"/>
|
<File Name="src/cw/cw_type_version.c"/>
|
||||||
|
<File Name="src/cw/cw_dbg_elem.c"/>
|
||||||
|
<File Name="src/cw/cw_kvstore_mavl_delete.c"/>
|
||||||
|
<File Name="src/cw/cw_format_version.c"/>
|
||||||
</VirtualDirectory>
|
</VirtualDirectory>
|
||||||
</VirtualDirectory>
|
</VirtualDirectory>
|
||||||
<Description/>
|
<Description/>
|
||||||
|
@ -216,7 +216,7 @@ int cw_in_check_generic(struct conn *conn, struct cw_action_in *a, uint8_t * dat
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void cw_read_elem(struct cw_ElemHandler * handler, struct conn * conn,
|
void cw_read_elem(struct cw_ElemHandler * handler, struct conn * conn,
|
||||||
uint8_t * elem_data, int elem_len, struct sockaddr * from){
|
uint8_t * elem_data, int elem_len, struct sockaddr * from){
|
||||||
mavldata_t data, *result;
|
mavldata_t data, *result;
|
||||||
@ -226,8 +226,10 @@ void cw_read_elem(struct cw_ElemHandler * handler, struct conn * conn,
|
|||||||
|
|
||||||
handler->type->to_str(result,str,30);
|
handler->type->to_str(result,str,30);
|
||||||
printf("Read %d-%s: %s %s\n", handler->id, handler->name, handler->key, str);
|
printf("Read %d-%s: %s %s\n", handler->id, handler->name, handler->key, str);
|
||||||
/*mavl_add(conn->remote_cfg*/
|
//mavl_add(conn->remote_cfg
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
|
static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
|
||||||
struct sockaddr *from)
|
struct sockaddr *from)
|
||||||
@ -399,8 +401,8 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
|
|||||||
|
|
||||||
elem_len = cw_get_elem_len(elem);
|
elem_len = cw_get_elem_len(elem);
|
||||||
|
|
||||||
printf ("Would start elem processing now %d - %s\n",handler->id, handler->name);
|
/*printf ("Would start elem processing now %d - %s\n",handler->id, handler->name);
|
||||||
|
*/
|
||||||
handler->get(conn, handler, cw_get_elem_data(elem), elem_len, from);
|
handler->get(conn, handler, cw_get_elem_data(elem), elem_len, from);
|
||||||
|
|
||||||
|
|
||||||
|
@ -311,7 +311,7 @@ struct cw_DescriptorSubelemDef {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern int cw_read_descriptor_subelems(mavl_t store, uint8_t * data, int len,
|
extern int cw_read_descriptor_subelems(mavl_t store, const char * key, uint8_t * data, int len,
|
||||||
struct cw_DescriptorSubelemDef *elems);
|
struct cw_DescriptorSubelemDef *elems);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
61
src/cw/cw_dbg_elem.c
Normal file
61
src/cw/cw_dbg_elem.c
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "dbg.h"
|
||||||
|
#include "format.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* print debug info for message elements
|
||||||
|
*/
|
||||||
|
|
||||||
|
void cw_dbg_elem_x(int level, struct conn *conn, int msg, int msgelem,
|
||||||
|
const uint8_t * msgbuf, int len)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
const char *elemname;
|
||||||
|
char vendorname[256];
|
||||||
|
char vendor_details[265];
|
||||||
|
|
||||||
|
if (!cw_dbg_is_level(level))
|
||||||
|
return;
|
||||||
|
|
||||||
|
*vendor_details = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
/// TODO XXXX
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (msgelem == CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
|
||||||
|
uint32_t vendor_id = ntohl(*((uint32_t *) msgbuf));
|
||||||
|
int type = ntohs(*((uint16_t *) (msgbuf + 4)));
|
||||||
|
cw_format_vendor(vendor_details, vendor_id, type, msgbuf);
|
||||||
|
// sprintf(vendorname, "%s/%s/%s",
|
||||||
|
// cw_strelemp(conn->actions, msgelem),
|
||||||
|
// (char *) cw_strvendor(vendor_id), vendor_details);
|
||||||
|
|
||||||
|
elemname = vendorname;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// elemname = cw_strelemp(conn->actions, msgelem);
|
||||||
|
|
||||||
|
elemname=0;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*&
|
||||||
|
if (!cw_dbg_is_level(DBG_ELEM_DMP)) {
|
||||||
|
cw_dbg(DBG_ELEM, "%d (%s), len=%d", msgelem, elemname, len);
|
||||||
|
} else {
|
||||||
|
char *dmp;
|
||||||
|
dmp = cw_format_dump(msgbuf,len,NULL);
|
||||||
|
|
||||||
|
cw_dbg(DBG_ELEM, "%d (%s), len=%d%s%s",
|
||||||
|
msgelem, elemname, len, get_dbg_color_ontext(DBG_ELEM_DMP), dmp);
|
||||||
|
|
||||||
|
free(dmp);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
44
src/cw/cw_format_version.c
Normal file
44
src/cw/cw_format_version.c
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include "format.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Format a version element
|
||||||
|
* @param s
|
||||||
|
* @param version
|
||||||
|
* @param len
|
||||||
|
* @return number of bytes written
|
||||||
|
*/
|
||||||
|
int cw_format_version(char *s, const uint8_t * version, int len)
|
||||||
|
{
|
||||||
|
int dot,rs,i;;
|
||||||
|
|
||||||
|
rs = 0;
|
||||||
|
|
||||||
|
if (format_is_utf8(version, len)) {
|
||||||
|
if (len != 0)
|
||||||
|
rs += sprintf(s + rs, "%.*s", len, version);
|
||||||
|
else
|
||||||
|
rs += sprintf(s + rs, "''");
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < len && i < 20; i++) {
|
||||||
|
rs += sprintf(s + rs, "%02X", version[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
dot = 0;
|
||||||
|
|
||||||
|
rs += sprintf(s + rs, " (");
|
||||||
|
for (i = 0; i < len && i < 20; i++) {
|
||||||
|
if (dot)
|
||||||
|
rs += sprintf(s + rs, ".");
|
||||||
|
dot = 1;
|
||||||
|
rs += sprintf(s + rs, "%d", version[i]);
|
||||||
|
}
|
||||||
|
rs += sprintf(s + rs, ")");
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
vendor = bstrv_get_vendor_id(ver);
|
||||||
|
rs += sprintf(s + rs, ", Vendor Id: %d, %s", vendor, cw_strvendor(vendor));
|
||||||
|
*/
|
||||||
|
return rs;
|
||||||
|
}
|
||||||
|
|
@ -36,7 +36,7 @@ int cw_in_ac_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * dat
|
|||||||
{0,0, NULL,0, 0}
|
{0,0, NULL,0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
cw_read_descriptor_subelems(conn->config, data + 12, len - 12, allowed);
|
cw_read_descriptor_subelems(conn->config,"ackey" , data + 12, len - 12, allowed);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,8 @@ int cw_in_generic(struct conn * conn, struct cw_ElemHandler * handler,
|
|||||||
result->kv.key = strdup(handler->key);
|
result->kv.key = strdup(handler->key);
|
||||||
|
|
||||||
handler->type->to_str(result,str,30);
|
handler->type->to_str(result,str,30);
|
||||||
printf("Read %d-%s: %s %s\n", handler->id, handler->name, handler->key, str);
|
/* printf("Read %d-%s: %s %s\n", handler->id, handler->name, handler->key, str);
|
||||||
|
*/
|
||||||
mavl_add(conn->remote_cfg, result);
|
mavl_add(conn->remote_cfg, result);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
#include "cw_types.h"
|
|
||||||
|
|
||||||
void cw_types_mavl_delete(mavldata_t *data){
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "cw_types.h"
|
||||||
|
#include "kvstore.h"
|
||||||
|
|
||||||
|
void cw_types_kvstore_mavl_delete(mavldata_t *data){
|
||||||
const struct cw_Type * type = data->kv.priv;
|
const struct cw_Type * type = data->kv.priv;
|
||||||
if (type->del)
|
if (type->del)
|
||||||
type->del(data);
|
type->del(data);
|
||||||
free(data->kv.key);
|
free(data->kv.key);
|
||||||
}
|
}
|
||||||
|
|
@ -34,7 +34,7 @@ int cw_read_ac_descriptor(mbag_t store, uint8_t *data, int len,
|
|||||||
if (!allowed)
|
if (!allowed)
|
||||||
allowed=allowed_default;
|
allowed=allowed_default;
|
||||||
|
|
||||||
return cw_read_descriptor_subelems(store, data + 12, len - 12, allowed);
|
return cw_read_descriptor_subelems(store, "key", data + 12, len - 12, allowed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,29 +17,29 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cw.h"
|
#include "cw.h"
|
||||||
|
#include "cw_types.h"
|
||||||
#include "dbg.h"
|
#include "dbg.h"
|
||||||
|
#include "keys.h"
|
||||||
|
|
||||||
int cw_read_descriptor_subelems(mavl_t store, uint8_t * data, int len,
|
int cw_read_descriptor_subelems(mavl_t cfg, const char * parent_key,
|
||||||
|
uint8_t * data, int len,
|
||||||
struct cw_DescriptorSubelemDef *elems)
|
struct cw_DescriptorSubelemDef *elems)
|
||||||
{
|
{
|
||||||
|
uint32_t vendor_id;
|
||||||
printf("sub reader\n");
|
int sublen,subtype;
|
||||||
|
|
||||||
|
|
||||||
int errors = 0;
|
int errors = 0;
|
||||||
int success = 0;
|
int success = 0;
|
||||||
int sub = 0;
|
int sub = 0;
|
||||||
while (sub < len) {
|
while (sub < len) {
|
||||||
|
int i;
|
||||||
|
|
||||||
if (len - sub < 8) {
|
if (len - sub < 8) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
uint32_t vendor_id = cw_get_dword(data + sub);
|
vendor_id = cw_get_dword(data + sub);
|
||||||
int sublen = cw_get_word(data + sub + 6);
|
sublen = cw_get_word(data + sub + 6);
|
||||||
int subtype = cw_get_word(data + sub + 4);
|
subtype = cw_get_word(data + sub + 4);
|
||||||
|
|
||||||
bstrv_t vstr = NULL;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/* search sub-element */
|
/* search sub-element */
|
||||||
for (i = 0; elems[i].maxlen; i++) {
|
for (i = 0; elems[i].maxlen; i++) {
|
||||||
@ -49,15 +49,15 @@ int cw_read_descriptor_subelems(mavl_t store, uint8_t * data, int len,
|
|||||||
|
|
||||||
|
|
||||||
if (!elems[i].maxlen) {
|
if (!elems[i].maxlen) {
|
||||||
vstr = bstrv_create(vendor_id, data + sub + 8, sublen);
|
|
||||||
if (vstr) {
|
|
||||||
cw_dbg_version_subelem(DBG_ELEM_ERR, "Not allowed",
|
cw_dbg_version_subelem(DBG_ELEM_ERR, "Not allowed",
|
||||||
subtype, vstr);
|
subtype, vendor_id, data+sub+8, sublen);
|
||||||
free(vstr);
|
|
||||||
}
|
|
||||||
errors++;
|
errors++;
|
||||||
} else {
|
} else {
|
||||||
int l = sublen;
|
int l = sublen;
|
||||||
|
mavldata_t mdata, *mdata_result;
|
||||||
|
char dbgstr[1048];
|
||||||
|
char key[1024];
|
||||||
|
|
||||||
if (elems[i].maxlen < sublen) {
|
if (elems[i].maxlen < sublen) {
|
||||||
cw_dbg(DBG_ELEM_ERR,
|
cw_dbg(DBG_ELEM_ERR,
|
||||||
"SubType %d Too long (truncating), len = %d,max. len=%d",
|
"SubType %d Too long (truncating), len = %d,max. len=%d",
|
||||||
@ -65,13 +65,24 @@ int cw_read_descriptor_subelems(mavl_t store, uint8_t * data, int len,
|
|||||||
l = elems[i].maxlen;
|
l = elems[i].maxlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
vstr =
|
|
||||||
mbag_set_bstrv(store, elems[i].key, vendor_id,
|
|
||||||
data + sub + 8, l);
|
|
||||||
|
|
||||||
char dbgstr[128];
|
/* vendor */
|
||||||
|
sprintf(key,"%s/%s/%s",parent_key,elems[i].key,CW_KEY_VENDOR);
|
||||||
|
mdata.kv.key = strdup(key);
|
||||||
|
mdata.kv.val.dword = vendor_id;
|
||||||
|
mdata.kv.priv=CW_TYPE_DWORD;
|
||||||
|
mavl_add(cfg,&mdata);
|
||||||
|
|
||||||
|
|
||||||
|
/* version */
|
||||||
|
sprintf(key,"%s/%s/%s",parent_key,elems[i].key,CW_KEY_VERSION);
|
||||||
|
mdata_result = cw_type_version.get(&mdata,data+sub+8,l);
|
||||||
|
mdata.kv.key = strdup(key);
|
||||||
|
mavl_add(cfg,mdata_result);
|
||||||
|
|
||||||
|
cw_type_version.to_str(mdata_result,dbgstr,90);
|
||||||
sprintf(dbgstr, "Storing '%s'", elems[i].key);
|
sprintf(dbgstr, "Storing '%s'", elems[i].key);
|
||||||
cw_dbg_version_subelem(DBG_SUBELEM, dbgstr, subtype, vstr);
|
cw_dbg_version_subelem(DBG_SUBELEM, dbgstr, subtype, vendor_id, data+sub+8,l);
|
||||||
success++;
|
success++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +93,5 @@ int cw_read_descriptor_subelems(mavl_t store, uint8_t * data, int len,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
@ -59,5 +59,5 @@ int cw_read_wtp_descriptor(mavl_t cfg, struct conn *conn,
|
|||||||
allowed=allowed_default;
|
allowed=allowed_default;
|
||||||
}
|
}
|
||||||
printf("call read subelems\n");
|
printf("call read subelems\n");
|
||||||
return cw_read_descriptor_subelems(cfg, data + pos, len - pos, allowed);
|
return cw_read_descriptor_subelems(cfg,eh->key , data + pos, len - pos, allowed);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,18 @@
|
|||||||
#include "capwap.h"
|
#include "capwap.h"
|
||||||
#include "capwap_items.h"
|
#include "capwap_items.h"
|
||||||
#include "cw_types.h"
|
#include "cw_types.h"
|
||||||
|
#include "keys.h"
|
||||||
|
|
||||||
|
|
||||||
|
static struct cw_DescriptorSubelemDef allowed_default[] = {
|
||||||
|
{-1,CW_SUBELEM_WTP_HARDWARE_VERSION, CW_KEY_HARDWARE, 1024,0},
|
||||||
|
{-1,CW_SUBELEM_WTP_SOFTWARE_VERSION, CW_KEY_SOFTWARE, 1024.0},
|
||||||
|
{-1,CW_SUBELEM_WTP_BOOTLOADER_VERSION, CW_KEY_BOOTLOADER, 1024,0},
|
||||||
|
{-1,CW_SUBELEM_WTP_OTHERSOFTWARE_VERSION, CW_KEY_OTHER_SOFTWARE, 1024,0},
|
||||||
|
{0,0, NULL, 0,0}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read WTP Descriptor in Cisco-Style (Draft 7)
|
* Read WTP Descriptor in Cisco-Style (Draft 7)
|
||||||
@ -30,20 +42,13 @@ int cw_read_wtp_descriptor_7(mavl_t cfg, struct conn *conn,
|
|||||||
pos = 2;
|
pos = 2;
|
||||||
|
|
||||||
/* Encryption element, for now dumy XXX */
|
/* Encryption element, for now dumy XXX */
|
||||||
//cw_get_word(data + pos + 2);
|
/* //cw_get_word(data + pos + 2);*/
|
||||||
pos += 2;
|
pos += 2;
|
||||||
|
|
||||||
|
|
||||||
static struct cw_DescriptorSubelemDef allowed_default[] = {
|
|
||||||
{-1,CW_SUBELEM_WTP_HARDWARE_VERSION, CW_ITEM_WTP_HARDWARE_VERSION, 1024,0},
|
|
||||||
{-1,CW_SUBELEM_WTP_SOFTWARE_VERSION, CW_ITEM_WTP_SOFTWARE_VERSION, 1024.0},
|
|
||||||
{-1,CW_SUBELEM_WTP_BOOTLOADER_VERSION, CW_ITEM_WTP_SOFTWARE_VERSION, 1024,0},
|
|
||||||
{-1,CW_SUBELEM_WTP_OTHERSOFTWARE_VERSION, CW_ITEM_WTP_SOFTWARE_VERSION, 1024,0},
|
|
||||||
{0,0, NULL, 0,0}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!allowed)
|
if (!allowed)
|
||||||
allowed=allowed_default;
|
allowed=allowed_default;
|
||||||
|
|
||||||
return cw_read_descriptor_subelems(cfg, data + pos, len - pos, allowed);
|
return cw_read_descriptor_subelems(cfg, eh->key, data + pos, len - pos, allowed);
|
||||||
}
|
}
|
||||||
|
@ -53,4 +53,3 @@ const struct cw_Type cw_type_byte = {
|
|||||||
to_str, /* to_str */
|
to_str, /* to_str */
|
||||||
from_str /* from_str */
|
from_str /* from_str */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -34,15 +34,12 @@ struct cw_Type{
|
|||||||
|
|
||||||
|
|
||||||
extern const struct cw_Type cw_type_byte;
|
extern const struct cw_Type cw_type_byte;
|
||||||
#define CW_TYPE_BYTE (&cw_type_byte)
|
|
||||||
|
|
||||||
extern const struct cw_Type cw_type_word;
|
extern const struct cw_Type cw_type_word;
|
||||||
extern const struct cw_Type cw_type_dword;
|
extern const struct cw_Type cw_type_dword;
|
||||||
extern const struct cw_Type cw_type_version;
|
extern const struct cw_Type cw_type_version;
|
||||||
|
|
||||||
void cw_types_mavl_delete(mavldata_t *data);
|
#define CW_TYPE_BYTE (&cw_type_byte)
|
||||||
|
#define CW_TYPE_DWORD (&cw_type_dword)
|
||||||
#define cw_types_mavl_create()\
|
#define CW_TYPE_VERSION (&cw_type_version)
|
||||||
mavl_create(mavl_cmp_kv, cw_types_mavl_delete)
|
|
||||||
|
|
||||||
#endif /* __CW_TYPES_H */
|
#endif /* __CW_TYPES_H */
|
||||||
|
60
src/cw/dbg.c
60
src/cw/dbg.c
@ -472,63 +472,23 @@ int cw_format_item(char *dst, mbag_item_t * item)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cw_format_version(char *s, bstrv_t ver, char *def)
|
|
||||||
|
|
||||||
|
void cw_dbg_version_subelem(int level, const char *context, int subtype,
|
||||||
|
uint32_t vendor_id, const uint8_t * vstr, int len)
|
||||||
{
|
{
|
||||||
int dot;
|
char v[2048];
|
||||||
uint8_t *version;
|
int n;
|
||||||
int len,rs,i;
|
|
||||||
uint32_t vendor;
|
|
||||||
|
|
||||||
if (!ver)
|
|
||||||
return sprintf(s, "%s", def);
|
|
||||||
|
|
||||||
|
|
||||||
version = bstrv_data(ver);
|
|
||||||
len = bstrv_len(ver);
|
|
||||||
|
|
||||||
rs = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (format_is_utf8(version, len)) {
|
|
||||||
if (len != 0)
|
|
||||||
rs += sprintf(s + rs, "%.*s", len, version);
|
|
||||||
else
|
|
||||||
rs += sprintf(s + rs, "''");
|
|
||||||
} else {
|
|
||||||
for (i = 0; i < len && i < 20; i++) {
|
|
||||||
rs += sprintf(s + rs, "%02X", version[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
dot = 0;
|
|
||||||
|
|
||||||
rs += sprintf(s + rs, " (");
|
|
||||||
for (i = 0; i < len && i < 20; i++) {
|
|
||||||
if (dot)
|
|
||||||
rs += sprintf(s + rs, ".");
|
|
||||||
dot = 1;
|
|
||||||
rs += sprintf(s + rs, "%d", version[i]);
|
|
||||||
}
|
|
||||||
rs += sprintf(s + rs, ")");
|
|
||||||
}
|
|
||||||
|
|
||||||
vendor = bstrv_get_vendor_id(ver);
|
|
||||||
rs += sprintf(s + rs, ", Vendor Id: %d, %s", vendor, cw_strvendor(vendor));
|
|
||||||
return rs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void cw_dbg_version_subelem(int level, const char *context, int subtype, bstrv_t vstr)
|
|
||||||
{
|
|
||||||
char v[256];
|
|
||||||
if (!cw_dbg_is_level(level))
|
if (!cw_dbg_is_level(level))
|
||||||
return;
|
return;
|
||||||
if (!vstr)
|
if (!vstr)
|
||||||
return;
|
return;
|
||||||
cw_format_version(v, vstr, "");
|
n = cw_format_version(v, vstr, len);
|
||||||
cw_dbg(level, "%s: SubType %d, %s", context, subtype, v);
|
|
||||||
|
|
||||||
|
sprintf(v + n, ", Vendor Id: %d, %s", vendor_id, cw_strvendor(vendor_id));
|
||||||
|
|
||||||
|
cw_dbg(level, "%s: SubType %d, %s", context, subtype, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,7 +121,8 @@ void cw_dbg_pkt_nc(int level,struct netconn *nc, uint8_t * packet, int len,struc
|
|||||||
|
|
||||||
void cw_dbg_msg(int level,struct conn *conn, uint8_t * packet, int len,struct sockaddr *from);
|
void cw_dbg_msg(int level,struct conn *conn, uint8_t * packet, int len,struct sockaddr *from);
|
||||||
char * cw_dbg_mkdmp(const uint8_t * data, int len);
|
char * cw_dbg_mkdmp(const uint8_t * data, int len);
|
||||||
void cw_dbg_version_subelem(int level,const char*context,int subtype,bstrv_t vstr);
|
void cw_dbg_version_subelem(int level, const char *context, int subtype,
|
||||||
|
uint32_t vendor_id, const uint8_t * vstr, int len);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,7 +81,7 @@ struct avltree;
|
|||||||
int format_hdr_flags(char *dst, uint8_t * th);
|
int format_hdr_flags(char *dst, uint8_t * th);
|
||||||
|
|
||||||
|
|
||||||
int format_is_utf8(unsigned char *str, size_t len);
|
int format_is_utf8(const unsigned char *str, size_t len);
|
||||||
|
|
||||||
int format_dot11_fc(char *dst, uint16_t fc);
|
int format_dot11_fc(char *dst, uint16_t fc);
|
||||||
|
|
||||||
@ -109,6 +109,7 @@ char *cw_format_dump(const uint8_t * data, int len,
|
|||||||
void cw_format_get_dump_defaults(struct cw_FormatDumpSettings * settings);
|
void cw_format_get_dump_defaults(struct cw_FormatDumpSettings * settings);
|
||||||
int cw_format_pkt_hdr(char *dst, int incomming, uint8_t * packet, int len,
|
int cw_format_pkt_hdr(char *dst, int incomming, uint8_t * packet, int len,
|
||||||
struct sockaddr *from);
|
struct sockaddr *from);
|
||||||
|
int cw_format_version(char *s, const uint8_t * version, int len);
|
||||||
|
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* @return 0 if the string is not in UTF8 format, otherwise it is UTF8.
|
* @return 0 if the string is not in UTF8 format, otherwise it is UTF8.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int format_is_utf8(unsigned char *str, size_t len)
|
int format_is_utf8(const unsigned char *str, size_t len)
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
size_t bytes = 0;
|
size_t bytes = 0;
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct mavl_KeyVal{
|
struct mavl_KeyVal{
|
||||||
const char *key;
|
char *key;
|
||||||
const void *priv;
|
const void *priv;
|
||||||
union{
|
union{
|
||||||
void * ptr;
|
void * ptr;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "cw/keys.h"
|
||||||
#include "cw/cw.h"
|
#include "cw/cw.h"
|
||||||
#include "cw/vendors.h"
|
#include "cw/vendors.h"
|
||||||
#include "cw/capwap_items.h"
|
#include "cw/capwap_items.h"
|
||||||
@ -27,15 +27,15 @@ int cisco_in_wtp_descriptor(struct conn *conn, struct cw_ElemHandler *eh, uint8_
|
|||||||
{
|
{
|
||||||
|
|
||||||
static struct cw_DescriptorSubelemDef allowed[] = {
|
static struct cw_DescriptorSubelemDef allowed[] = {
|
||||||
{CW_VENDOR_ID_CISCO,CW_SUBELEM_WTP_HARDWARE_VERSION, CW_ITEM_WTP_HARDWARE_VERSION, 1024,0},
|
{CW_VENDOR_ID_CISCO,CW_SUBELEM_WTP_HARDWARE_VERSION, CW_KEY_HARDWARE, 1024,0},
|
||||||
{CW_VENDOR_ID_CISCO,CW_SUBELEM_WTP_SOFTWARE_VERSION, CW_ITEM_WTP_SOFTWARE_VERSION, 1024.0},
|
{CW_VENDOR_ID_CISCO,CW_SUBELEM_WTP_SOFTWARE_VERSION, CW_KEY_SOFTWARE, 1024.0},
|
||||||
{CW_VENDOR_ID_CISCO,CW_SUBELEM_WTP_BOOTLOADER_VERSION, CW_ITEM_WTP_BOOTLOADER_VERSION, 1024.0},
|
{CW_VENDOR_ID_CISCO,CW_SUBELEM_WTP_BOOTLOADER_VERSION, CW_KEY_BOOTLOADER, 1024.0},
|
||||||
{CW_VENDOR_ID_CISCO,CW_SUBELEM_WTP_OTHERSOFTWARE_VERSION, "other", 1024.0},
|
{CW_VENDOR_ID_CISCO,CW_SUBELEM_WTP_OTHERSOFTWARE_VERSION, CW_KEY_OTHER_SOFTWARE, 1024.0},
|
||||||
{0,0, NULL, 0,0}
|
{0,0, NULL, 0,0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return cw_read_wtp_descriptor_7(conn->incomming, conn, eh, data, len, allowed);
|
return cw_read_wtp_descriptor_7(conn->remote_cfg, conn, eh, data, len, allowed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user