* unknown types; we need to know their length ahead of time. Therefore, we abort
* if we find an unknown type.
*/
-static int eapsoh_mstlv(REQUEST *request, VALUE_PAIR *sohvp, const uint8_t *p, unsigned int data_len) {
+static int eapsoh_mstlv(VALUE_PAIR *sohvp, const uint8_t *p, unsigned int data_len) {
VALUE_PAIR *vp;
uint8_t c;
int t;
* MS-SOH section 2.2.4.1
*/
if (data_len < 18) {
- RDEBUG("insufficient data for MS-Machine-Inventory-Packet");
+ DEBUG("insufficient data for MS-Machine-Inventory-Packet");
return 0;
}
data_len -= 18;
/* MS-Packet-Info
* MS-SOH 2.2.4.3
*/
- RDEBUG("SoH MS-Packet-Info %s vers=%i", *p & 0x10 ? "request" : "response", *p & 0xf);
+ DEBUG("SoH MS-Packet-Info %s vers=%i", *p & 0x10 ? "request" : "response", *p & 0xf);
p++;
data_len--;
break;
break;
default:
- RDEBUG("SoH Unknown MS TV %i stopping", c);
+ DEBUG("SoH Unknown MS TV %i stopping", c);
return 0;
}
}
return NULL;
}
-int soh_verify(REQUEST *request, VALUE_PAIR *sohvp, const uint8_t *data, unsigned int data_len) {
+int soh_verify(VALUE_PAIR *sohvp, const uint8_t *data, unsigned int data_len) {
VALUE_PAIR *vp;
eap_soh hdr;
soh_response resp;
soh_mode_subheader mode;
soh_tlv tlv;
- int i, curr_shid=-1, curr_shid_c=-1, curr_hc=-1;
+ int curr_shid=-1, curr_shid_c=-1, curr_hc=-1;
hdr.tlv_type = soh_pull_be_16(data); data += 2;
hdr.tlv_len = soh_pull_be_16(data); data += 2;
hdr.tlv_vendor = soh_pull_be_32(data); data += 4;
if (hdr.tlv_type != 7 || hdr.tlv_vendor != 0x137) {
- RDEBUG("SoH payload is %i %08x not a ms-vendor packet", hdr.tlv_type, hdr.tlv_vendor);
+ fr_strerror_printf("SoH payload is %i %08x not a ms-vendor packet", hdr.tlv_type, hdr.tlv_vendor);
return -1;
}
hdr.soh_type = soh_pull_be_16(data); data += 2;
hdr.soh_len = soh_pull_be_16(data); data += 2;
if (hdr.soh_type != 1) {
- RDEBUG("SoH tlv %04x is not a response", hdr.soh_type);
+ fr_strerror_printf("SoH tlv %04x is not a response", hdr.soh_type);
return -1;
}
if (resp.outer_type!=7 || resp.vendor != 0x137) {
- RDEBUG("SoH response outer type %i/vendor %08x not recognised", resp.outer_type, resp.vendor);
+ fr_strerror_printf("SoH response outer type %i/vendor %08x not recognised", resp.outer_type, resp.vendor);
return -1;
}
switch (resp.inner_type) {
case 1:
/* no mode sub-header */
- RDEBUG("SoH without mode subheader");
+ fr_strerror_printf("SoH without mode subheader");
break;
case 2:
mode.outer_type = soh_pull_be_16(data); data += 2;
data += 2;
if (mode.outer_type != 7 || mode.vendor != 0x137 || mode.content_type != 0) {
- RDEBUG("SoH mode subheader outer type %i/vendor %08x/content type %i invalid", mode.outer_type, mode.vendor, mode.content_type);
+ fr_strerror_printf("SoH mode subheader outer type %i/vendor %08x/content type %i invalid", mode.outer_type, mode.vendor, mode.content_type);
return -1;
}
- RDEBUG("SoH with mode subheader");
+ DEBUG("SoH with mode subheader");
break;
default:
- RDEBUG("SoH invalid inner type %i", resp.inner_type);
+ fr_strerror_printf("SoH invalid inner type %i", resp.inner_type);
return -1;
}
*/
curr_shid = soh_pull_be_24(data);
curr_shid_c = data[3];
- RDEBUG2("SoH System-Health-ID vendor %08x component=%i", curr_shid, curr_shid_c);
+ DEBUG("SoH System-Health-ID vendor %08x component=%i", curr_shid, curr_shid_c);
break;
case 7:
* N bytes payload; for Microsoft component#0 this is the MS TV stuff
*/
if (curr_shid==0x137 && curr_shid_c==0) {
- RDEBUG2("SoH MS type-value payload");
- eapsoh_mstlv(request, sohvp, data + 4, tlv.tlv_len - 4);
+ DEBUG("SoH MS type-value payload");
+ eapsoh_mstlv(sohvp, data + 4, tlv.tlv_len - 4);
} else {
- RDEBUG2("SoH unhandled vendor-specific TLV %08x/component=%i %i bytes payload", curr_shid, curr_shid_c, tlv.tlv_len);
+ fr_strerror_printf("SoH unhandled vendor-specific TLV %08x/component=%i %i bytes payload", curr_shid, curr_shid_c, tlv.tlv_len);
}
break;
*
* 1 byte integer
*/
- RDEBUG2("SoH Health-Class %i", data[0]);
+ DEBUG("SoH Health-Class %i", data[0]);
curr_hc = data[0];
break;
*
* 1 byte integer
*/
- RDEBUG2("SoH Software-Version %i", data[0]);
+ DEBUG("SoH Software-Version %i", data[0]);
break;
case 11:
* 1 bit - 1==product up-to-date
* 1 bit - 1==product enabled
*/
- RDEBUG2("SoH Health-Class-Status - current shid=%08x component=%i", curr_shid, curr_shid_c);
+ DEBUG("SoH Health-Class-Status - current shid=%08x component=%i", curr_shid, curr_shid_c);
if (curr_shid==0x137 && curr_shid_c==128) {
const char *s, *t;
uint32_t hcstatus = soh_pull_be_32(data);
- RDEBUG2("SoH Health-Class-Status microsoft DWORD=%08x", hcstatus);
+ DEBUG("SoH Health-Class-Status microsoft DWORD=%08x", hcstatus);
vp = pairmake("SoH-MS-Windows-Health-Status", NULL, T_OP_EQ);
switch (curr_hc) {
break;
default:
- RDEBUG2("SoH Unknown TLV %i len=%i", tlv.tlv_type, tlv.tlv_len);
+ DEBUG("SoH Unknown TLV %i len=%i", tlv.tlv_type, tlv.tlv_len);
break;
}