dhcp: Log Vendor Client Identifier (dhcp option 60)

* Log vendor client identifier (dhcp option 60) if extended dhcp
logging is turned on. This required the `vendor_client_identifier` to
be added to the json schema. Validation done using an SV Test
* Added `requested_ip` to the json schema as well, since it was
missed. My SV test failed without it.

Feature #4587
pull/9441/head
Yatin Kanetkar 2 years ago committed by Victor Julien
parent 5bdbc1a313
commit b67ff4badf

@ -560,12 +560,18 @@
"renewal_time": { "renewal_time": {
"type": "integer" "type": "integer"
}, },
"requested_ip":{
"type": "string"
},
"subnet_mask": { "subnet_mask": {
"type": "string" "type": "string"
}, },
"type": { "type": {
"type": "string" "type": "string"
}, },
"vendor_class_identifier":{
"type": "string"
},
"dns_servers": { "dns_servers": {
"type": "array", "type": "array",
"minItems": 1, "minItems": 1,

@ -42,6 +42,7 @@ pub const DHCP_OPT_TYPE: u8 = 53;
pub const DHCP_OPT_PARAMETER_LIST: u8 = 55; pub const DHCP_OPT_PARAMETER_LIST: u8 = 55;
pub const DHCP_OPT_RENEWAL_TIME: u8 = 58; pub const DHCP_OPT_RENEWAL_TIME: u8 = 58;
pub const DHCP_OPT_REBINDING_TIME: u8 = 59; pub const DHCP_OPT_REBINDING_TIME: u8 = 59;
pub const DHCP_OPT_VENDOR_CLASS_ID: u8 = 60;
pub const DHCP_OPT_CLIENT_ID: u8 = 61; pub const DHCP_OPT_CLIENT_ID: u8 = 61;
pub const DHCP_OPT_END: u8 = 255; pub const DHCP_OPT_END: u8 = 255;

@ -168,6 +168,12 @@ impl DHCPLogger {
self.log_opt_routers(js, option)?; self.log_opt_routers(js, option)?;
} }
} }
DHCP_OPT_VENDOR_CLASS_ID => {
if self.extended && !option.data.is_empty(){
js.set_string_from_bytes("vendor_class_identifier",
&option.data)?;
}
}
_ => {} _ => {}
} }
} }

Loading…
Cancel
Save