From a1bfec65a26ad9a88a707e6b13add4f5b40efe87 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] Print device name and MTU. --- ifconfig/virt_ifconfig.ml | 4 +++- lib/.depend | 20 ++++++++++++++++++++ lib/virt_mem_net_devices.ml | 7 ++++++- lib/virt_mem_types.ml | 6 +++++- lib/virt_mem_types.mli | 6 +++++- 5 files changed, 39 insertions(+), 4 deletions(-) diff --git a/ifconfig/virt_ifconfig.ml b/ifconfig/virt_ifconfig.ml index 4c4d3ec..55da968 100644 --- a/ifconfig/virt_ifconfig.ml +++ b/ifconfig/virt_ifconfig.ml @@ -34,7 +34,9 @@ let run debug { domname = domname; mem = mem } { net_devices = net_devices } = List.iter ( fun netdev -> - printf "%s\n" netdev.netdev_name + printf "%5s mtu %Ld\n" + netdev.netdev_name + netdev.netdev_mtu ) net_devices let summary = s_"list network interfaces in virtual machine" diff --git a/lib/.depend b/lib/.depend index 3ce0334..8085316 100644 --- a/lib/.depend +++ b/lib/.depend @@ -1,3 +1,7 @@ +kernel_in_device.cmi: virt_mem_types.cmi virt_mem_mmap.cmi +kernel_inet6_dev.cmi: virt_mem_types.cmi virt_mem_mmap.cmi +kernel_inet6_ifaddr.cmi: virt_mem_types.cmi virt_mem_mmap.cmi +kernel_in_ifaddr.cmi: virt_mem_types.cmi virt_mem_mmap.cmi kernel_net_device.cmi: virt_mem_types.cmi virt_mem_mmap.cmi kernel_net.cmi: virt_mem_types.cmi virt_mem_mmap.cmi kernel_task_struct.cmi: virt_mem_types.cmi virt_mem_mmap.cmi @@ -10,6 +14,22 @@ virt_mem_net_devices.cmi: virt_mem_types.cmi virt_mem_tasks.cmi: virt_mem_types.cmi virt_mem_types.cmi: virt_mem_utils.cmo virt_mem_mmap.cmi virt_mem_utsname.cmi: virt_mem_types.cmi +kernel_in_device.cmo: virt_mem_types.cmi virt_mem_mmap.cmi \ + kernel_in_device.cmi +kernel_in_device.cmx: virt_mem_types.cmx virt_mem_mmap.cmx \ + kernel_in_device.cmi +kernel_inet6_dev.cmo: virt_mem_types.cmi virt_mem_mmap.cmi \ + kernel_inet6_dev.cmi +kernel_inet6_dev.cmx: virt_mem_types.cmx virt_mem_mmap.cmx \ + kernel_inet6_dev.cmi +kernel_inet6_ifaddr.cmo: virt_mem_types.cmi virt_mem_mmap.cmi \ + kernel_inet6_ifaddr.cmi +kernel_inet6_ifaddr.cmx: virt_mem_types.cmx virt_mem_mmap.cmx \ + kernel_inet6_ifaddr.cmi +kernel_in_ifaddr.cmo: virt_mem_types.cmi virt_mem_mmap.cmi \ + kernel_in_ifaddr.cmi +kernel_in_ifaddr.cmx: virt_mem_types.cmx virt_mem_mmap.cmx \ + kernel_in_ifaddr.cmi kernel_net_device.cmo: virt_mem_types.cmi virt_mem_mmap.cmi \ kernel_net_device.cmi kernel_net_device.cmx: virt_mem_types.cmx virt_mem_mmap.cmx \ diff --git a/lib/virt_mem_net_devices.ml b/lib/virt_mem_net_devices.ml index 8ce8eb3..ad72662 100644 --- a/lib/virt_mem_net_devices.ml +++ b/lib/virt_mem_net_devices.ml @@ -98,7 +98,12 @@ supported Linux distribution, see this page about adding support: map kernel_version image addr ( fun netdev -> { netdev_name = truncate_c_string netdev.net_device_name; - netdev_dev_addr = netdev.net_device_dev_addr } + netdev_flags = netdev.net_device_flags; + netdev_operstate = netdev.net_device_operstate; + netdev_mtu = netdev.net_device_mtu; + netdev_perm_addr = netdev.net_device_perm_addr; + netdev_addr_len = netdev.net_device_addr_len; + } ) in image, Some netdevs diff --git a/lib/virt_mem_types.ml b/lib/virt_mem_types.ml index 556a3c7..2167314 100644 --- a/lib/virt_mem_types.ml +++ b/lib/virt_mem_types.ml @@ -60,7 +60,11 @@ type task = { type net_device = { netdev_name : string; - netdev_dev_addr : string; + netdev_flags : int64; + netdev_operstate : int64; + netdev_mtu : int64; + netdev_perm_addr : string; + netdev_addr_len : int64; } type kdata = { diff --git a/lib/virt_mem_types.mli b/lib/virt_mem_types.mli index 9792f03..ff4f147 100644 --- a/lib/virt_mem_types.mli +++ b/lib/virt_mem_types.mli @@ -90,7 +90,11 @@ type task = { type net_device = { netdev_name : string; (** Device name. *) - netdev_dev_addr : string; (** Interface network address. *) + netdev_flags : int64; + netdev_operstate : int64; + netdev_mtu : int64; + netdev_perm_addr : string; + netdev_addr_len : int64; } (** Internal version of the kernel [net_device] (network device struct). *) -- 1.8.3.1