Add WTP boot and other version

FossilOrigin-Name: 362fb901432f566738e486c02310d8df61e08c2b804e6d1d48fb966e890fa942
This commit is contained in:
alexis.lagoutte@gmail.com 2016-03-25 10:09:48 +00:00
parent 12aa9a55d9
commit 7d05035f60
3 changed files with 21 additions and 0 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_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,
@ -105,6 +107,8 @@ struct cw_itemdef capwap_itemdefs[] = {
{CW_ITEM_LOCATION_DATA,CW_ITEM_NONE,MBAG_STR},
{CW_ITEM_WTP_HARDWARE_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_MAXIMUM_MESSAGE_LENGTH,CW_ITEM_NONE,MBAG_WORD},
{CW_ITEM_STATISTICS_TIMER,CW_ITEM_NONE,MBAG_WORD},

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_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[];

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.");
}
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;
return len + cw_put_elem_hdr(dst,a->elem_id,len);