aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarryl Sokoloski <dsokoloski@clearfoundation.com>2017-10-26 21:07:00 -0400
committerDarryl Sokoloski <dsokoloski@clearfoundation.com>2017-10-26 21:07:00 -0400
commit169aa11adc67e18a21fd81ecbb0c1c0989b346c9 (patch)
tree82c982e5ac4c3066b6b586a11d26886640cee42c /src
parent7e38a4f79036982ee23c9d93866b07833c56d336 (diff)
Added DHCP class identifier support.
Diffstat (limited to 'src')
-rw-r--r--src/include/ndpi_typedefs.h1
-rw-r--r--src/lib/protocols/dhcp.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index 33043fde5..c79f57f4d 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -1031,6 +1031,7 @@ struct ndpi_flow_struct {
struct {
char fingerprint[48];
+ char class_ident[48];
} dhcp;
} protos;
diff --git a/src/lib/protocols/dhcp.c b/src/lib/protocols/dhcp.c
index cdf33947e..c46cc1c91 100644
--- a/src/lib/protocols/dhcp.c
+++ b/src/lib/protocols/dhcp.c
@@ -104,6 +104,13 @@ void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, stru
"%02X", dhcp->options[i+2+idx] & 0xFF);
offset += 2;
}
+ } else if(id == 60 /* Class Identifier */) {
+ char *name = (char*)&dhcp->options[i+2];
+ int j = 0;
+
+ j = ndpi_min(len, sizeof(flow->protos.dhcp.class_ident)-1);
+ strncpy((char*)flow->protos.dhcp.class_ident, name, j);
+ flow->protos.dhcp.class_ident[j] = '\0';
} else if(id == 12 /* Host Name */) {
char *name = (char*)&dhcp->options[i+2];
int j = 0;