DHCP fingerprint is now in human readeable format
This commit is contained in:
@@ -104,10 +104,15 @@ void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
u_int idx, offset = 0;
|
u_int idx, offset = 0;
|
||||||
|
|
||||||
for(idx = 0; idx < len && offset < sizeof(flow->protos.dhcp.fingerprint) - 2; idx++) {
|
for(idx = 0; idx < len && offset < sizeof(flow->protos.dhcp.fingerprint) - 2; idx++) {
|
||||||
snprintf((char*)&flow->protos.dhcp.fingerprint[offset],
|
#if 1
|
||||||
sizeof(flow->protos.dhcp.fingerprint) - offset,
|
offset += snprintf((char*)&flow->protos.dhcp.fingerprint[offset],
|
||||||
"%02X", dhcp->options[i+2+idx] & 0xFF);
|
sizeof(flow->protos.dhcp.fingerprint) - offset,
|
||||||
offset += 2;
|
"%s%u", (idx > 0) ? "," : "", dhcp->options[i+2+idx] & 0xFF);
|
||||||
|
#else
|
||||||
|
offset += snprintf((char*)&flow->protos.dhcp.fingerprint[offset],
|
||||||
|
sizeof(flow->protos.dhcp.fingerprint) - offset,
|
||||||
|
"%02X", dhcp->options[i+2+idx] & 0xFF);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
flow->protos.dhcp.fingerprint[sizeof(flow->protos.dhcp.fingerprint) - 1] = '\0';
|
flow->protos.dhcp.fingerprint[sizeof(flow->protos.dhcp.fingerprint) - 1] = '\0';
|
||||||
|
|||||||
Reference in New Issue
Block a user