FossilOrigin-Name: 217e296749868ee2ce3f88a770071e5832e635bf0db3f119665ed14c0ef3d20f
This commit is contained in:
7u83@mail.ru 2016-03-25 17:13:13 +00:00
commit 7f7a66e4ca
5 changed files with 43 additions and 25 deletions

View File

@ -21,6 +21,8 @@ const char CW_ITEM_WTP_HARDWARE_VENDOR=
const char CW_ITEM_WTP_HARDWARE_VERSION[]="wtp_hardware_version"; const char CW_ITEM_WTP_HARDWARE_VERSION[]="wtp_hardware_version";
const char CW_ITEM_WTP_SOFTWARE_VERSION[]="wtp_software_version"; const char CW_ITEM_WTP_SOFTWARE_VERSION[]="wtp_software_version";
const char CW_ITEM_WTP_BOOT_VERSION[]="wtp_boot_version";
const char CW_ITEM_WTP_OTHER_VERSION[]="wtp_other_version";
/* /*
const char CW_ITEM_WTP_SOFTWARE_VENDOR, const char CW_ITEM_WTP_SOFTWARE_VENDOR,
@ -86,7 +88,7 @@ const char CW_ITEM_RADIO_OPER_STATE[]="radio_oper_state";
const char CW_ITEM_WTP_BOARD_VENDOR[]="vendor_id"; const char CW_ITEM_WTP_BOARD_VENDOR[]="vendor_id";
const char CW_ITEM_WTP_BOARD_MODELNO[]="model_no"; const char CW_ITEM_WTP_BOARD_MODELNO[]="model_no";
const char CW_ITEM_WTP_BOARD_MACADDRESS[]="wtp_board_macadddress"; const char CW_ITEM_WTP_BOARD_MACADDRESS[]="wtp_board_macaddress";
const char CW_ITEM_WTP_BOARD_ID[]="wtp_board_id"; const char CW_ITEM_WTP_BOARD_ID[]="wtp_board_id";
const char CW_ITEM_WTP_BOARD_REVISION[]="wtp_board_revision"; const char CW_ITEM_WTP_BOARD_REVISION[]="wtp_board_revision";
const char CW_ITEM_WTP_BOARD_SERIALNO[]="serial_no"; const char CW_ITEM_WTP_BOARD_SERIALNO[]="serial_no";
@ -105,6 +107,8 @@ struct cw_itemdef capwap_itemdefs[] = {
{CW_ITEM_LOCATION_DATA,CW_ITEM_NONE,MBAG_STR}, {CW_ITEM_LOCATION_DATA,CW_ITEM_NONE,MBAG_STR},
{CW_ITEM_WTP_HARDWARE_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR}, {CW_ITEM_WTP_HARDWARE_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
{CW_ITEM_WTP_SOFTWARE_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR}, {CW_ITEM_WTP_SOFTWARE_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
{CW_ITEM_WTP_BOOT_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
{CW_ITEM_WTP_OTHER_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
{CW_ITEM_WTP_GROUP_NAME,CW_ITEM_NONE,MBAG_STR}, {CW_ITEM_WTP_GROUP_NAME,CW_ITEM_NONE,MBAG_STR},
{CW_ITEM_MAXIMUM_MESSAGE_LENGTH,CW_ITEM_NONE,MBAG_WORD}, {CW_ITEM_MAXIMUM_MESSAGE_LENGTH,CW_ITEM_NONE,MBAG_WORD},
{CW_ITEM_STATISTICS_TIMER,CW_ITEM_NONE,MBAG_WORD}, {CW_ITEM_STATISTICS_TIMER,CW_ITEM_NONE,MBAG_WORD},
@ -154,9 +158,3 @@ struct cw_itemdef capwap_radiodefs[] = {
{CW_ITEM_NONE} {CW_ITEM_NONE}
}; };

View File

@ -165,6 +165,8 @@ extern const char CW_ITEM_WTP_BOARD_SERIALNO[];
extern const char CW_ITEM_WTP_SOFTWARE_VERSION[]; extern const char CW_ITEM_WTP_SOFTWARE_VERSION[];
extern const char CW_ITEM_WTP_HARDWARE_VERSION[]; extern const char CW_ITEM_WTP_HARDWARE_VERSION[];
extern const char CW_ITEM_WTP_BOOT_VERSION[];
extern const char CW_ITEM_WTP_OTHER_VERSION[];
extern const char CW_ITEM_WTP_BOOTLOADER_VERSION[]; extern const char CW_ITEM_WTP_BOOTLOADER_VERSION[];

View File

@ -29,6 +29,7 @@ int static check_len(struct conn *conn, struct cw_action_in *a, uint8_t * data,
} }
*/ */
#if 0
int static do_save(mbag_t itemstore, struct conn *conn, struct cw_action_in *a, int static do_save(mbag_t itemstore, struct conn *conn, struct cw_action_in *a,
uint8_t * data, int len, struct sockaddr *from) uint8_t * data, int len, struct sockaddr *from)
{ {
@ -92,6 +93,7 @@ int static do_save(mbag_t itemstore, struct conn *conn, struct cw_action_in *a,
} }
#endif
int cw_in_generic2(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len, int cw_in_generic2(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
struct sockaddr *from) struct sockaddr *from)

View File

@ -2,6 +2,7 @@
#include "cw.h" #include "cw.h"
#include "dbg.h" #include "dbg.h"
#include "log.h" #include "log.h"
#include "stravltree.h"
/** /**
* @file * @file

View File

@ -61,6 +61,21 @@ int cw_out_wtp_descriptor(struct conn *conn, struct cw_action_out *a, uint8_t *
cw_log(LOG_ERR, "Can't send Software Version in WTP descriptor, not set."); cw_log(LOG_ERR, "Can't send Software Version in WTP descriptor, not set.");
} }
i = mbag_get(mbag,CW_ITEM_WTP_BOOT_VERSION);
if ( i ) {
d += cw_put_version(d,CW_SUBELEM_WTP_BOOTLOADER_VERSION,i->data);
}
else {
cw_log(LOG_INFO, "Can't send Boot Version in WTP descriptor, not set.");
}
i = mbag_get(mbag,CW_ITEM_WTP_OTHER_VERSION);
if ( i ) {
d += cw_put_version(d,CW_SUBELEM_WTP_OTHERSOFTWARE_VERSION,i->data);
}
else {
cw_log(LOG_INFO, "Can't send Other Version in WTP descriptor, not set.");
}
int len = d-dst-4; int len = d-dst-4;
return len + cw_put_elem_hdr(dst,a->elem_id,len); return len + cw_put_elem_hdr(dst,a->elem_id,len);