(* WARNING: This file and the corresponding mli (interface) are * automatically generated by the extract/codegen/ program. * * Any edits you make to this file will be lost. * * To update this file from the latest kernel database, it is recommended * that you do 'make update-kernel-structs'. *) open Printf;; module StringMap = Map.Make(String);; module AddrMap = Map.Make(Int64);; exception ParseError of string * string * string;; let match_err = "failed to match kernel structure";; let unknown_kernel_version version struct_name = invalid_arg (sprintf "%s: unknown kernel version or struct %s is not supported in this kernel. Try a newer version of virt-mem, or if the guest is not from a supported Linux distribution, see this page about adding support: http://et.redhat.com/~rjones/virt-mem/faq.html " version struct_name);; type kernel_version = string;; type load_fn = string -> Virt_mem_mmap.addr -> int -> Bitstring.bitstring;; let zero = 0;; type task_struct = { task_struct_comm : string; task_struct_normal_prio : int64; task_struct_pid : int64; task_struct_prio : int64; task_struct_run_list'next : Virt_mem_mmap.addr option; task_struct_run_list'next_offset : int; task_struct_run_list'next_adjustment : int; task_struct_run_list'prev : Virt_mem_mmap.addr option; task_struct_state : int64; task_struct_static_prio : int64; task_struct_tasks'next : Virt_mem_mmap.addr; task_struct_tasks'next_offset : int; task_struct_tasks'next_adjustment : int; task_struct_tasks'prev : Virt_mem_mmap.addr };; type net_device = { net_device_addr_len : int64; net_device_dev_list'next : Virt_mem_mmap.addr option; net_device_dev_list'next_offset : int; net_device_dev_list'next_adjustment : int; net_device_dev_list'prev : Virt_mem_mmap.addr option; net_device_flags : int64; net_device_ip6_ptr : Virt_mem_mmap.addr; net_device_ip_ptr : Virt_mem_mmap.addr; net_device_mtu : int64; net_device_name : string; net_device_next : Virt_mem_mmap.addr option; net_device_operstate : int64; net_device_perm_addr : string };; type net = { net_dev_base_head'next : Virt_mem_mmap.addr; net_dev_base_head'next_offset : int; net_dev_base_head'next_adjustment : int; net_dev_base_head'prev : Virt_mem_mmap.addr; net_dev_base_head'prev_offset : int; net_dev_base_head'prev_adjustment : int };; type in_device = { in_device_ifa_list : Virt_mem_mmap.addr };; type inet6_dev = { inet6_dev_addr_list : Virt_mem_mmap.addr };; type in_ifaddr = { in_ifaddr_ifa_address : int64; in_ifaddr_ifa_broadcast : int64; in_ifaddr_ifa_local : int64; in_ifaddr_ifa_mask : int64; in_ifaddr_ifa_next : Virt_mem_mmap.addr };; type inet6_ifaddr = { inet6_ifaddr_lst_next : Virt_mem_mmap.addr; inet6_ifaddr_prefix_len : int64 };; type kernel_struct = Task_struct of task_struct | Net_device of net_device | Net of net | In_device of in_device | Inet6_dev of inet6_dev | In_ifaddr of in_ifaddr | Inet6_ifaddr of inet6_ifaddr;; type addrmap = (string * ((int * Bitstring.bitstring * kernel_struct) option)) AddrMap.t;; let offset_of_net_device_dev_list'next = let map = StringMap.add "2.6.25.14-69.fc8.i686" 48 (StringMap.add "2.6.25.14-108.fc9.ppc" 48 (StringMap.add "2.6.25.11-97.fc9.i686" 48 (StringMap.add "2.6.25.14-69.fc8.ppc64" 72 (StringMap.add "2.6.25.14-69.fc8.i586" 48 (StringMap.add "2.6.25.11-97.fc9.x86_64" 72 (StringMap.add "2.6.25.14-108.fc9.x86_64" 72 (StringMap.add "2.6.25.14-69.fc8.ppc" 48 (StringMap.add "2.6.25.14-108.fc9.i686" 48 (StringMap.add "2.6.25.14-108.fc9.i586" 48 (StringMap.add "2.6.25.14-108.fc9.ppc64" 72 (StringMap.add "2.6.25.14-69.fc8.x86_64" 72 StringMap.empty))))))))))) in fun kernel_version -> StringMap.find kernel_version map;; let task_struct_parser_1 kernel_version bits = bitmatch bits with | { state : zero+64 : offset(0), littleendian; prio : zero+32 : offset(224), littleendian; static_prio : zero+32 : offset(256), littleendian; normal_prio : zero+32 : offset(288), littleendian; tasks'next : zero+64 : offset(3840), littleendian; tasks'prev : zero+64 : offset(3904), littleendian; pid : zero+32 : offset(4352), littleendian; comm : 128 : offset(8392), string } -> { task_struct_comm = comm; task_struct_normal_prio = normal_prio; task_struct_pid = pid; task_struct_prio = prio; task_struct_run_list'next = None; task_struct_run_list'next_offset = -1; task_struct_run_list'next_adjustment = -1; task_struct_run_list'prev = None; task_struct_state = state; task_struct_static_prio = static_prio; task_struct_tasks'next = tasks'next; task_struct_tasks'next_offset = 480; task_struct_tasks'next_adjustment = 480; task_struct_tasks'prev = tasks'prev } | { _ } -> raise (ParseError ("task_struct", "task_struct_parser_1", match_err));; let task_struct_parser_2 kernel_version bits = bitmatch bits with | { state : zero+64 : offset(0), bigendian; prio : zero+32 : offset(224), bigendian; static_prio : zero+32 : offset(256), bigendian; normal_prio : zero+32 : offset(288), bigendian; tasks'next : zero+64 : offset(3840), bigendian; tasks'prev : zero+64 : offset(3904), bigendian; pid : zero+32 : offset(4352), bigendian; comm : 128 : offset(8392), string } -> { task_struct_comm = comm; task_struct_normal_prio = normal_prio; task_struct_pid = pid; task_struct_prio = prio; task_struct_run_list'next = None; task_struct_run_list'next_offset = -1; task_struct_run_list'next_adjustment = -1; task_struct_run_list'prev = None; task_struct_state = state; task_struct_static_prio = static_prio; task_struct_tasks'next = tasks'next; task_struct_tasks'next_offset = 480; task_struct_tasks'next_adjustment = 480; task_struct_tasks'prev = tasks'prev } | { _ } -> raise (ParseError ("task_struct", "task_struct_parser_2", match_err));; let task_struct_parser_3 kernel_version bits = bitmatch bits with | { state : zero+32 : offset(0), littleendian; prio : zero+32 : offset(160), littleendian; static_prio : zero+32 : offset(192), littleendian; normal_prio : zero+32 : offset(224), littleendian; tasks'next : zero+32 : offset(3200), littleendian; tasks'prev : zero+32 : offset(3232), littleendian; pid : zero+32 : offset(3552), littleendian; comm : 128 : offset(5896), string } -> { task_struct_comm = comm; task_struct_normal_prio = normal_prio; task_struct_pid = pid; task_struct_prio = prio; task_struct_run_list'next = None; task_struct_run_list'next_offset = -1; task_struct_run_list'next_adjustment = -1; task_struct_run_list'prev = None; task_struct_state = state; task_struct_static_prio = static_prio; task_struct_tasks'next = tasks'next; task_struct_tasks'next_offset = 400; task_struct_tasks'next_adjustment = 400; task_struct_tasks'prev = tasks'prev } | { _ } -> raise (ParseError ("task_struct", "task_struct_parser_3", match_err));; let task_struct_parser_4 kernel_version bits = bitmatch bits with | { state : zero+32 : offset(0), littleendian; prio : zero+32 : offset(160), littleendian; static_prio : zero+32 : offset(192), littleendian; normal_prio : zero+32 : offset(224), littleendian; tasks'next : zero+32 : offset(3232), littleendian; tasks'prev : zero+32 : offset(3264), littleendian; pid : zero+32 : offset(3584), littleendian; comm : 128 : offset(5928), string } -> { task_struct_comm = comm; task_struct_normal_prio = normal_prio; task_struct_pid = pid; task_struct_prio = prio; task_struct_run_list'next = None; task_struct_run_list'next_offset = -1; task_struct_run_list'next_adjustment = -1; task_struct_run_list'prev = None; task_struct_state = state; task_struct_static_prio = static_prio; task_struct_tasks'next = tasks'next; task_struct_tasks'next_offset = 404; task_struct_tasks'next_adjustment = 404; task_struct_tasks'prev = tasks'prev } | { _ } -> raise (ParseError ("task_struct", "task_struct_parser_4", match_err));; let task_struct_parser_5 kernel_version bits = bitmatch bits with | { state : zero+32 : offset(0), bigendian; prio : zero+32 : offset(160), bigendian; static_prio : zero+32 : offset(192), bigendian; normal_prio : zero+32 : offset(224), bigendian; tasks'next : zero+32 : offset(3328), bigendian; tasks'prev : zero+32 : offset(3360), bigendian; pid : zero+32 : offset(3680), bigendian; comm : 128 : offset(6056), string } -> { task_struct_comm = comm; task_struct_normal_prio = normal_prio; task_struct_pid = pid; task_struct_prio = prio; task_struct_run_list'next = None; task_struct_run_list'next_offset = -1; task_struct_run_list'next_adjustment = -1; task_struct_run_list'prev = None; task_struct_state = state; task_struct_static_prio = static_prio; task_struct_tasks'next = tasks'next; task_struct_tasks'next_offset = 416; task_struct_tasks'next_adjustment = 416; task_struct_tasks'prev = tasks'prev } | { _ } -> raise (ParseError ("task_struct", "task_struct_parser_5", match_err));; let task_struct_parser_6 kernel_version bits = bitmatch bits with | { state : zero+32 : offset(0), bigendian; prio : zero+32 : offset(192), bigendian; static_prio : zero+32 : offset(224), bigendian; normal_prio : zero+32 : offset(256), bigendian; run_list'next : zero+32 : offset(288), bigendian; run_list'prev : zero+32 : offset(320), bigendian; tasks'next : zero+32 : offset(1024), bigendian; tasks'prev : zero+32 : offset(1056), bigendian; pid : zero+32 : offset(1376), bigendian; comm : 128 : offset(3264), string } -> { task_struct_comm = comm; task_struct_normal_prio = normal_prio; task_struct_pid = pid; task_struct_prio = prio; task_struct_run_list'next = Some run_list'next; task_struct_run_list'next_offset = 36; task_struct_run_list'next_adjustment = 36; task_struct_run_list'prev = Some run_list'prev; task_struct_state = state; task_struct_static_prio = static_prio; task_struct_tasks'next = tasks'next; task_struct_tasks'next_offset = 128; task_struct_tasks'next_adjustment = 128; task_struct_tasks'prev = tasks'prev } | { _ } -> raise (ParseError ("task_struct", "task_struct_parser_6", match_err));; let task_struct_parser_7 kernel_version bits = bitmatch bits with | { state : zero+64 : offset(0), littleendian; prio : zero+32 : offset(320), littleendian; static_prio : zero+32 : offset(352), littleendian; normal_prio : zero+32 : offset(384), littleendian; run_list'next : zero+64 : offset(448), littleendian; run_list'prev : zero+64 : offset(512), littleendian; tasks'next : zero+64 : offset(1536), littleendian; tasks'prev : zero+64 : offset(1600), littleendian; pid : zero+32 : offset(2144), littleendian; comm : 128 : offset(5440), string } -> { task_struct_comm = comm; task_struct_normal_prio = normal_prio; task_struct_pid = pid; task_struct_prio = prio; task_struct_run_list'next = Some run_list'next; task_struct_run_list'next_offset = 56; task_struct_run_list'next_adjustment = 56; task_struct_run_list'prev = Some run_list'prev; task_struct_state = state; task_struct_static_prio = static_prio; task_struct_tasks'next = tasks'next; task_struct_tasks'next_offset = 192; task_struct_tasks'next_adjustment = 192; task_struct_tasks'prev = tasks'prev } | { _ } -> raise (ParseError ("task_struct", "task_struct_parser_7", match_err));; let task_struct_parser_8 kernel_version bits = bitmatch bits with | { state : zero+32 : offset(0), littleendian; prio : zero+32 : offset(192), littleendian; static_prio : zero+32 : offset(224), littleendian; normal_prio : zero+32 : offset(256), littleendian; run_list'next : zero+32 : offset(288), littleendian; run_list'prev : zero+32 : offset(320), littleendian; tasks'next : zero+32 : offset(992), littleendian; tasks'prev : zero+32 : offset(1024), littleendian; pid : zero+32 : offset(1344), littleendian; comm : 128 : offset(3232), string } -> { task_struct_comm = comm; task_struct_normal_prio = normal_prio; task_struct_pid = pid; task_struct_prio = prio; task_struct_run_list'next = Some run_list'next; task_struct_run_list'next_offset = 36; task_struct_run_list'next_adjustment = 36; task_struct_run_list'prev = Some run_list'prev; task_struct_state = state; task_struct_static_prio = static_prio; task_struct_tasks'next = tasks'next; task_struct_tasks'next_offset = 124; task_struct_tasks'next_adjustment = 124; task_struct_tasks'prev = tasks'prev } | { _ } -> raise (ParseError ("task_struct", "task_struct_parser_8", match_err));; let task_struct_parser_9 kernel_version bits = bitmatch bits with | { state : zero+64 : offset(0), bigendian; prio : zero+32 : offset(320), bigendian; static_prio : zero+32 : offset(352), bigendian; normal_prio : zero+32 : offset(384), bigendian; run_list'next : zero+64 : offset(448), bigendian; run_list'prev : zero+64 : offset(512), bigendian; tasks'next : zero+64 : offset(1600), bigendian; tasks'prev : zero+64 : offset(1664), bigendian; pid : zero+32 : offset(2208), bigendian; comm : 128 : offset(5440), string } -> { task_struct_comm = comm; task_struct_normal_prio = normal_prio; task_struct_pid = pid; task_struct_prio = prio; task_struct_run_list'next = Some run_list'next; task_struct_run_list'next_offset = 56; task_struct_run_list'next_adjustment = 56; task_struct_run_list'prev = Some run_list'prev; task_struct_state = state; task_struct_static_prio = static_prio; task_struct_tasks'next = tasks'next; task_struct_tasks'next_offset = 200; task_struct_tasks'next_adjustment = 200; task_struct_tasks'prev = tasks'prev } | { _ } -> raise (ParseError ("task_struct", "task_struct_parser_9", match_err));; let net_device_parser_10 kernel_version bits = bitmatch bits with | { name : 128 : offset(0), string; dev_list'next : zero+64 : offset(576), littleendian; dev_list'prev : zero+64 : offset(640), littleendian; flags : zero+32 : offset(2880), littleendian; operstate : zero+8 : offset(2960), littleendian; mtu : zero+32 : offset(2976), littleendian; perm_addr : 256 : offset(3136), string; addr_len : zero+8 : offset(3392), littleendian; ip_ptr : zero+64 : offset(3840), littleendian; ip6_ptr : zero+64 : offset(3968), littleendian } -> { net_device_addr_len = addr_len; net_device_dev_list'next = Some dev_list'next; net_device_dev_list'next_offset = 72; net_device_dev_list'next_adjustment = 72; net_device_dev_list'prev = Some dev_list'prev; net_device_flags = flags; net_device_ip6_ptr = ip6_ptr; net_device_ip_ptr = ip_ptr; net_device_mtu = mtu; net_device_name = name; net_device_next = None; net_device_operstate = operstate; net_device_perm_addr = perm_addr } | { _ } -> raise (ParseError ("net_device", "net_device_parser_10", match_err));; let net_device_parser_11 kernel_version bits = bitmatch bits with | { name : 128 : offset(0), string; dev_list'next : zero+64 : offset(576), bigendian; dev_list'prev : zero+64 : offset(640), bigendian; flags : zero+32 : offset(2880), bigendian; operstate : zero+8 : offset(2960), bigendian; mtu : zero+32 : offset(2976), bigendian; perm_addr : 256 : offset(3136), string; addr_len : zero+8 : offset(3392), bigendian; ip_ptr : zero+64 : offset(3840), bigendian; ip6_ptr : zero+64 : offset(3968), bigendian } -> { net_device_addr_len = addr_len; net_device_dev_list'next = Some dev_list'next; net_device_dev_list'next_offset = 72; net_device_dev_list'next_adjustment = 72; net_device_dev_list'prev = Some dev_list'prev; net_device_flags = flags; net_device_ip6_ptr = ip6_ptr; net_device_ip_ptr = ip_ptr; net_device_mtu = mtu; net_device_name = name; net_device_next = None; net_device_operstate = operstate; net_device_perm_addr = perm_addr } | { _ } -> raise (ParseError ("net_device", "net_device_parser_11", match_err));; let net_device_parser_12 kernel_version bits = bitmatch bits with | { name : 128 : offset(0), string; dev_list'next : zero+32 : offset(384), littleendian; dev_list'prev : zero+32 : offset(416), littleendian; flags : zero+32 : offset(1568), littleendian; operstate : zero+8 : offset(1648), littleendian; mtu : zero+32 : offset(1664), littleendian; perm_addr : 256 : offset(1760), string; addr_len : zero+8 : offset(2016), littleendian; ip_ptr : zero+32 : offset(2304), littleendian; ip6_ptr : zero+32 : offset(2368), littleendian } -> { net_device_addr_len = addr_len; net_device_dev_list'next = Some dev_list'next; net_device_dev_list'next_offset = 48; net_device_dev_list'next_adjustment = 48; net_device_dev_list'prev = Some dev_list'prev; net_device_flags = flags; net_device_ip6_ptr = ip6_ptr; net_device_ip_ptr = ip_ptr; net_device_mtu = mtu; net_device_name = name; net_device_next = None; net_device_operstate = operstate; net_device_perm_addr = perm_addr } | { _ } -> raise (ParseError ("net_device", "net_device_parser_12", match_err));; let net_device_parser_13 kernel_version bits = bitmatch bits with | { name : 128 : offset(0), string; dev_list'next : zero+32 : offset(384), bigendian; dev_list'prev : zero+32 : offset(416), bigendian; flags : zero+32 : offset(1568), bigendian; operstate : zero+8 : offset(1648), bigendian; mtu : zero+32 : offset(1664), bigendian; perm_addr : 256 : offset(1760), string; addr_len : zero+8 : offset(2016), bigendian; ip_ptr : zero+32 : offset(2304), bigendian; ip6_ptr : zero+32 : offset(2368), bigendian } -> { net_device_addr_len = addr_len; net_device_dev_list'next = Some dev_list'next; net_device_dev_list'next_offset = 48; net_device_dev_list'next_adjustment = 48; net_device_dev_list'prev = Some dev_list'prev; net_device_flags = flags; net_device_ip6_ptr = ip6_ptr; net_device_ip_ptr = ip_ptr; net_device_mtu = mtu; net_device_name = name; net_device_next = None; net_device_operstate = operstate; net_device_perm_addr = perm_addr } | { _ } -> raise (ParseError ("net_device", "net_device_parser_13", match_err));; let net_device_parser_14 kernel_version bits = bitmatch bits with | { name : 128 : offset(0), string; next : zero+32 : offset(384), bigendian; flags : zero+32 : offset(704), bigendian; operstate : zero+8 : offset(784), bigendian; mtu : zero+32 : offset(800), bigendian; perm_addr : 256 : offset(896), string; addr_len : zero+8 : offset(1152), bigendian; ip_ptr : zero+32 : offset(1344), bigendian; ip6_ptr : zero+32 : offset(1408), bigendian } -> { net_device_addr_len = addr_len; net_device_dev_list'next = None; net_device_dev_list'next_offset = -1; net_device_dev_list'next_adjustment = -1; net_device_dev_list'prev = None; net_device_flags = flags; net_device_ip6_ptr = ip6_ptr; net_device_ip_ptr = ip_ptr; net_device_mtu = mtu; net_device_name = name; net_device_next = Some next; net_device_operstate = operstate; net_device_perm_addr = perm_addr } | { _ } -> raise (ParseError ("net_device", "net_device_parser_14", match_err));; let net_device_parser_15 kernel_version bits = bitmatch bits with | { name : 128 : offset(0), string; next : zero+64 : offset(576), littleendian; flags : zero+32 : offset(1152), littleendian; operstate : zero+8 : offset(1232), littleendian; mtu : zero+32 : offset(1248), littleendian; perm_addr : 256 : offset(1408), string; addr_len : zero+8 : offset(1664), littleendian; ip_ptr : zero+64 : offset(1984), littleendian; ip6_ptr : zero+64 : offset(2112), littleendian } -> { net_device_addr_len = addr_len; net_device_dev_list'next = None; net_device_dev_list'next_offset = -1; net_device_dev_list'next_adjustment = -1; net_device_dev_list'prev = None; net_device_flags = flags; net_device_ip6_ptr = ip6_ptr; net_device_ip_ptr = ip_ptr; net_device_mtu = mtu; net_device_name = name; net_device_next = Some next; net_device_operstate = operstate; net_device_perm_addr = perm_addr } | { _ } -> raise (ParseError ("net_device", "net_device_parser_15", match_err));; let net_device_parser_16 kernel_version bits = bitmatch bits with | { name : 128 : offset(0), string; next : zero+32 : offset(384), littleendian; flags : zero+32 : offset(704), littleendian; operstate : zero+8 : offset(784), littleendian; mtu : zero+32 : offset(800), littleendian; perm_addr : 256 : offset(896), string; addr_len : zero+8 : offset(1152), littleendian; ip_ptr : zero+32 : offset(1344), littleendian; ip6_ptr : zero+32 : offset(1408), littleendian } -> { net_device_addr_len = addr_len; net_device_dev_list'next = None; net_device_dev_list'next_offset = -1; net_device_dev_list'next_adjustment = -1; net_device_dev_list'prev = None; net_device_flags = flags; net_device_ip6_ptr = ip6_ptr; net_device_ip_ptr = ip_ptr; net_device_mtu = mtu; net_device_name = name; net_device_next = Some next; net_device_operstate = operstate; net_device_perm_addr = perm_addr } | { _ } -> raise (ParseError ("net_device", "net_device_parser_16", match_err));; let net_device_parser_17 kernel_version bits = bitmatch bits with | { name : 128 : offset(0), string; next : zero+64 : offset(576), bigendian; flags : zero+32 : offset(1152), bigendian; operstate : zero+8 : offset(1232), bigendian; mtu : zero+32 : offset(1248), bigendian; perm_addr : 256 : offset(1408), string; addr_len : zero+8 : offset(1664), bigendian; ip_ptr : zero+64 : offset(1984), bigendian; ip6_ptr : zero+64 : offset(2112), bigendian } -> { net_device_addr_len = addr_len; net_device_dev_list'next = None; net_device_dev_list'next_offset = -1; net_device_dev_list'next_adjustment = -1; net_device_dev_list'prev = None; net_device_flags = flags; net_device_ip6_ptr = ip6_ptr; net_device_ip_ptr = ip_ptr; net_device_mtu = mtu; net_device_name = name; net_device_next = Some next; net_device_operstate = operstate; net_device_perm_addr = perm_addr } | { _ } -> raise (ParseError ("net_device", "net_device_parser_17", match_err));; let net_parser_20 kernel_version bits = bitmatch bits with | { dev_base_head'next : zero+32 : offset(416), littleendian; dev_base_head'prev : zero+32 : offset(448), littleendian } -> { net_dev_base_head'next = dev_base_head'next; net_dev_base_head'next_offset = 52; net_dev_base_head'next_adjustment = offset_of_net_device_dev_list'next kernel_version; net_dev_base_head'prev = dev_base_head'prev; net_dev_base_head'prev_offset = 56; net_dev_base_head'prev_adjustment = offset_of_net_device_dev_list'next kernel_version } | { _ } -> raise (ParseError ("net", "net_parser_20", match_err));; let net_parser_21 kernel_version bits = bitmatch bits with | { dev_base_head'next : zero+32 : offset(416), bigendian; dev_base_head'prev : zero+32 : offset(448), bigendian } -> { net_dev_base_head'next = dev_base_head'next; net_dev_base_head'next_offset = 52; net_dev_base_head'next_adjustment = offset_of_net_device_dev_list'next kernel_version; net_dev_base_head'prev = dev_base_head'prev; net_dev_base_head'prev_offset = 56; net_dev_base_head'prev_adjustment = offset_of_net_device_dev_list'next kernel_version } | { _ } -> raise (ParseError ("net", "net_parser_21", match_err));; let net_parser_18 kernel_version bits = bitmatch bits with | { dev_base_head'next : zero+64 : offset(768), littleendian; dev_base_head'prev : zero+64 : offset(832), littleendian } -> { net_dev_base_head'next = dev_base_head'next; net_dev_base_head'next_offset = 96; net_dev_base_head'next_adjustment = offset_of_net_device_dev_list'next kernel_version; net_dev_base_head'prev = dev_base_head'prev; net_dev_base_head'prev_offset = 104; net_dev_base_head'prev_adjustment = offset_of_net_device_dev_list'next kernel_version } | { _ } -> raise (ParseError ("net", "net_parser_18", match_err));; let net_parser_19 kernel_version bits = bitmatch bits with | { dev_base_head'next : zero+64 : offset(768), bigendian; dev_base_head'prev : zero+64 : offset(832), bigendian } -> { net_dev_base_head'next = dev_base_head'next; net_dev_base_head'next_offset = 96; net_dev_base_head'next_adjustment = offset_of_net_device_dev_list'next kernel_version; net_dev_base_head'prev = dev_base_head'prev; net_dev_base_head'prev_offset = 104; net_dev_base_head'prev_adjustment = offset_of_net_device_dev_list'next kernel_version } | { _ } -> raise (ParseError ("net", "net_parser_19", match_err));; let in_device_parser_24 kernel_version bits = bitmatch bits with | { ifa_list : zero+32 : offset(96), littleendian } -> { in_device_ifa_list = ifa_list } | { _ } -> raise (ParseError ("in_device", "in_device_parser_24", match_err));; let in_device_parser_25 kernel_version bits = bitmatch bits with | { ifa_list : zero+32 : offset(96), bigendian } -> { in_device_ifa_list = ifa_list } | { _ } -> raise (ParseError ("in_device", "in_device_parser_25", match_err));; let in_device_parser_22 kernel_version bits = bitmatch bits with | { ifa_list : zero+64 : offset(128), littleendian } -> { in_device_ifa_list = ifa_list } | { _ } -> raise (ParseError ("in_device", "in_device_parser_22", match_err));; let in_device_parser_23 kernel_version bits = bitmatch bits with | { ifa_list : zero+64 : offset(128), bigendian } -> { in_device_ifa_list = ifa_list } | { _ } -> raise (ParseError ("in_device", "in_device_parser_23", match_err));; let inet6_dev_parser_28 kernel_version bits = bitmatch bits with | { addr_list : zero+32 : offset(32), littleendian } -> { inet6_dev_addr_list = addr_list } | { _ } -> raise (ParseError ("inet6_dev", "inet6_dev_parser_28", match_err));; let inet6_dev_parser_29 kernel_version bits = bitmatch bits with | { addr_list : zero+32 : offset(32), bigendian } -> { inet6_dev_addr_list = addr_list } | { _ } -> raise (ParseError ("inet6_dev", "inet6_dev_parser_29", match_err));; let inet6_dev_parser_26 kernel_version bits = bitmatch bits with | { addr_list : zero+64 : offset(64), littleendian } -> { inet6_dev_addr_list = addr_list } | { _ } -> raise (ParseError ("inet6_dev", "inet6_dev_parser_26", match_err));; let inet6_dev_parser_27 kernel_version bits = bitmatch bits with | { addr_list : zero+64 : offset(64), bigendian } -> { inet6_dev_addr_list = addr_list } | { _ } -> raise (ParseError ("inet6_dev", "inet6_dev_parser_27", match_err));; let in_ifaddr_parser_32 kernel_version bits = bitmatch bits with | { ifa_next : zero+32 : offset(0), littleendian; ifa_local : zero+32 : offset(128), littleendian; ifa_address : zero+32 : offset(160), littleendian; ifa_mask : zero+32 : offset(192), littleendian; ifa_broadcast : zero+32 : offset(224), littleendian } -> { in_ifaddr_ifa_address = ifa_address; in_ifaddr_ifa_broadcast = ifa_broadcast; in_ifaddr_ifa_local = ifa_local; in_ifaddr_ifa_mask = ifa_mask; in_ifaddr_ifa_next = ifa_next } | { _ } -> raise (ParseError ("in_ifaddr", "in_ifaddr_parser_32", match_err));; let in_ifaddr_parser_33 kernel_version bits = bitmatch bits with | { ifa_next : zero+32 : offset(0), bigendian; ifa_local : zero+32 : offset(128), bigendian; ifa_address : zero+32 : offset(160), bigendian; ifa_mask : zero+32 : offset(192), bigendian; ifa_broadcast : zero+32 : offset(224), bigendian } -> { in_ifaddr_ifa_address = ifa_address; in_ifaddr_ifa_broadcast = ifa_broadcast; in_ifaddr_ifa_local = ifa_local; in_ifaddr_ifa_mask = ifa_mask; in_ifaddr_ifa_next = ifa_next } | { _ } -> raise (ParseError ("in_ifaddr", "in_ifaddr_parser_33", match_err));; let in_ifaddr_parser_30 kernel_version bits = bitmatch bits with | { ifa_next : zero+64 : offset(0), littleendian; ifa_local : zero+32 : offset(256), littleendian; ifa_address : zero+32 : offset(288), littleendian; ifa_mask : zero+32 : offset(320), littleendian; ifa_broadcast : zero+32 : offset(352), littleendian } -> { in_ifaddr_ifa_address = ifa_address; in_ifaddr_ifa_broadcast = ifa_broadcast; in_ifaddr_ifa_local = ifa_local; in_ifaddr_ifa_mask = ifa_mask; in_ifaddr_ifa_next = ifa_next } | { _ } -> raise (ParseError ("in_ifaddr", "in_ifaddr_parser_30", match_err));; let in_ifaddr_parser_31 kernel_version bits = bitmatch bits with | { ifa_next : zero+64 : offset(0), bigendian; ifa_local : zero+32 : offset(256), bigendian; ifa_address : zero+32 : offset(288), bigendian; ifa_mask : zero+32 : offset(320), bigendian; ifa_broadcast : zero+32 : offset(352), bigendian } -> { in_ifaddr_ifa_address = ifa_address; in_ifaddr_ifa_broadcast = ifa_broadcast; in_ifaddr_ifa_local = ifa_local; in_ifaddr_ifa_mask = ifa_mask; in_ifaddr_ifa_next = ifa_next } | { _ } -> raise (ParseError ("in_ifaddr", "in_ifaddr_parser_31", match_err));; let inet6_ifaddr_parser_36 kernel_version bits = bitmatch bits with | { prefix_len : zero+32 : offset(128), littleendian; lst_next : zero+32 : offset(832), littleendian } -> { inet6_ifaddr_lst_next = lst_next; inet6_ifaddr_prefix_len = prefix_len } | { _ } -> raise (ParseError ("inet6_ifaddr", "inet6_ifaddr_parser_36", match_err));; let inet6_ifaddr_parser_34 kernel_version bits = bitmatch bits with | { prefix_len : zero+32 : offset(128), littleendian; lst_next : zero+64 : offset(1280), littleendian } -> { inet6_ifaddr_lst_next = lst_next; inet6_ifaddr_prefix_len = prefix_len } | { _ } -> raise (ParseError ("inet6_ifaddr", "inet6_ifaddr_parser_34", match_err));; let inet6_ifaddr_parser_35 kernel_version bits = bitmatch bits with | { prefix_len : zero+32 : offset(128), bigendian; lst_next : zero+64 : offset(1280), bigendian } -> { inet6_ifaddr_lst_next = lst_next; inet6_ifaddr_prefix_len = prefix_len } | { _ } -> raise (ParseError ("inet6_ifaddr", "inet6_ifaddr_parser_35", match_err));; let inet6_ifaddr_parser_37 kernel_version bits = bitmatch bits with | { prefix_len : zero+32 : offset(128), bigendian; lst_next : zero+32 : offset(800), bigendian } -> { inet6_ifaddr_lst_next = lst_next; inet6_ifaddr_prefix_len = prefix_len } | { _ } -> raise (ParseError ("inet6_ifaddr", "inet6_ifaddr_parser_37", match_err));; let inet6_ifaddr_parser_39 kernel_version bits = bitmatch bits with | { prefix_len : zero+32 : offset(128), littleendian; lst_next : zero+64 : offset(1216), littleendian } -> { inet6_ifaddr_lst_next = lst_next; inet6_ifaddr_prefix_len = prefix_len } | { _ } -> raise (ParseError ("inet6_ifaddr", "inet6_ifaddr_parser_39", match_err));; let inet6_ifaddr_parser_41 kernel_version bits = bitmatch bits with | { prefix_len : zero+32 : offset(128), bigendian; lst_next : zero+64 : offset(1216), bigendian } -> { inet6_ifaddr_lst_next = lst_next; inet6_ifaddr_prefix_len = prefix_len } | { _ } -> raise (ParseError ("inet6_ifaddr", "inet6_ifaddr_parser_41", match_err));; let inet6_ifaddr_parser_38 kernel_version bits = bitmatch bits with | { prefix_len : zero+32 : offset(128), bigendian; lst_next : zero+32 : offset(736), bigendian } -> { inet6_ifaddr_lst_next = lst_next; inet6_ifaddr_prefix_len = prefix_len } | { _ } -> raise (ParseError ("inet6_ifaddr", "inet6_ifaddr_parser_38", match_err));; let inet6_ifaddr_parser_40 kernel_version bits = bitmatch bits with | { prefix_len : zero+32 : offset(128), littleendian; lst_next : zero+32 : offset(736), littleendian } -> { inet6_ifaddr_lst_next = lst_next; inet6_ifaddr_prefix_len = prefix_len } | { _ } -> raise (ParseError ("inet6_ifaddr", "inet6_ifaddr_parser_40", match_err));; let size_of_task_struct = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" 2496 (StringMap.add "2.6.25.14-108.fc9.ppc64" 2524 (StringMap.add "2.6.25.14-108.fc9.i586" 1832 (StringMap.add "2.6.25.14-108.fc9.i686" 1832 (StringMap.add "2.6.25.14-69.fc8.ppc" 1952 (StringMap.add "2.6.25.14-108.fc9.x86_64" 2496 (StringMap.add "2.6.25.11-97.fc9.x86_64" 2496 (StringMap.add "2.6.25.14-69.fc8.i586" 1832 (StringMap.add "2.6.20-1.2933.fc6.ppc" 1592 (StringMap.add "2.6.20-1.2933.fc6.x86_64" 1920 (StringMap.add "2.6.25.14-69.fc8.ppc64" 2524 (StringMap.add "2.6.25.11-97.fc9.i686" 1832 (StringMap.add "2.6.20-1.2933.fc6.i686" 1400 (StringMap.add "2.6.20-1.2933.fc6.i586" 1400 (StringMap.add "2.6.25.14-108.fc9.ppc" 1952 (StringMap.add "2.6.20-1.2933.fc6.ppc64" 2112 (StringMap.add "2.6.25.14-69.fc8.i686" 1832 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "task_struct";; let size_of_net_device = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" 1752 (StringMap.add "2.6.25.14-108.fc9.ppc64" 1776 (StringMap.add "2.6.25.14-108.fc9.i586" 1212 (StringMap.add "2.6.25.14-108.fc9.i686" 1212 (StringMap.add "2.6.25.14-69.fc8.ppc" 904 (StringMap.add "2.6.25.14-108.fc9.x86_64" 1752 (StringMap.add "2.6.25.11-97.fc9.x86_64" 1752 (StringMap.add "2.6.25.14-69.fc8.i586" 1212 (StringMap.add "2.6.20-1.2933.fc6.ppc" 668 (StringMap.add "2.6.20-1.2933.fc6.x86_64" 1260 (StringMap.add "2.6.25.14-69.fc8.ppc64" 1776 (StringMap.add "2.6.25.11-97.fc9.i686" 1212 (StringMap.add "2.6.20-1.2933.fc6.i686" 912 (StringMap.add "2.6.20-1.2933.fc6.i586" 912 (StringMap.add "2.6.25.14-108.fc9.ppc" 904 (StringMap.add "2.6.20-1.2933.fc6.ppc64" 1260 (StringMap.add "2.6.25.14-69.fc8.i686" 1212 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "net_device";; let size_of_net = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" 488 (StringMap.add "2.6.25.14-108.fc9.ppc64" 488 (StringMap.add "2.6.25.14-108.fc9.i586" 284 (StringMap.add "2.6.25.14-108.fc9.i686" 284 (StringMap.add "2.6.25.14-69.fc8.ppc" 276 (StringMap.add "2.6.25.14-108.fc9.x86_64" 488 (StringMap.add "2.6.25.11-97.fc9.x86_64" 488 (StringMap.add "2.6.25.14-69.fc8.i586" 284 (StringMap.add "2.6.25.14-69.fc8.ppc64" 488 (StringMap.add "2.6.25.11-97.fc9.i686" 284 (StringMap.add "2.6.25.14-108.fc9.ppc" 276 (StringMap.add "2.6.25.14-69.fc8.i686" 284 StringMap.empty))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "net";; let size_of_in_device = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" 368 (StringMap.add "2.6.25.14-108.fc9.ppc64" 368 (StringMap.add "2.6.25.14-108.fc9.i586" 244 (StringMap.add "2.6.25.14-108.fc9.i686" 244 (StringMap.add "2.6.25.14-69.fc8.ppc" 236 (StringMap.add "2.6.25.14-108.fc9.x86_64" 368 (StringMap.add "2.6.25.11-97.fc9.x86_64" 368 (StringMap.add "2.6.25.14-69.fc8.i586" 244 (StringMap.add "2.6.20-1.2933.fc6.ppc" 212 (StringMap.add "2.6.20-1.2933.fc6.x86_64" 328 (StringMap.add "2.6.25.14-69.fc8.ppc64" 368 (StringMap.add "2.6.25.11-97.fc9.i686" 244 (StringMap.add "2.6.20-1.2933.fc6.i686" 216 (StringMap.add "2.6.20-1.2933.fc6.i586" 216 (StringMap.add "2.6.25.14-108.fc9.ppc" 236 (StringMap.add "2.6.20-1.2933.fc6.ppc64" 328 (StringMap.add "2.6.25.14-69.fc8.i686" 244 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "in_device";; let size_of_inet6_dev = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" 536 (StringMap.add "2.6.25.14-108.fc9.ppc64" 536 (StringMap.add "2.6.25.14-108.fc9.i586" 356 (StringMap.add "2.6.25.14-108.fc9.i686" 356 (StringMap.add "2.6.25.14-69.fc8.ppc" 348 (StringMap.add "2.6.25.14-108.fc9.x86_64" 536 (StringMap.add "2.6.25.11-97.fc9.x86_64" 536 (StringMap.add "2.6.25.14-69.fc8.i586" 356 (StringMap.add "2.6.20-1.2933.fc6.ppc" 284 (StringMap.add "2.6.20-1.2933.fc6.x86_64" 464 (StringMap.add "2.6.25.14-69.fc8.ppc64" 536 (StringMap.add "2.6.25.11-97.fc9.i686" 356 (StringMap.add "2.6.20-1.2933.fc6.i686" 292 (StringMap.add "2.6.20-1.2933.fc6.i586" 292 (StringMap.add "2.6.25.14-108.fc9.ppc" 348 (StringMap.add "2.6.20-1.2933.fc6.ppc64" 464 (StringMap.add "2.6.25.14-69.fc8.i686" 356 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "inet6_dev";; let size_of_in_ifaddr = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" 71 (StringMap.add "2.6.25.14-108.fc9.ppc64" 71 (StringMap.add "2.6.25.14-108.fc9.i586" 55 (StringMap.add "2.6.25.14-108.fc9.i686" 55 (StringMap.add "2.6.25.14-69.fc8.ppc" 55 (StringMap.add "2.6.25.14-108.fc9.x86_64" 71 (StringMap.add "2.6.25.11-97.fc9.x86_64" 71 (StringMap.add "2.6.25.14-69.fc8.i586" 55 (StringMap.add "2.6.20-1.2933.fc6.ppc" 55 (StringMap.add "2.6.20-1.2933.fc6.x86_64" 71 (StringMap.add "2.6.25.14-69.fc8.ppc64" 71 (StringMap.add "2.6.25.11-97.fc9.i686" 55 (StringMap.add "2.6.20-1.2933.fc6.i686" 55 (StringMap.add "2.6.20-1.2933.fc6.i586" 55 (StringMap.add "2.6.25.14-108.fc9.ppc" 55 (StringMap.add "2.6.20-1.2933.fc6.ppc64" 71 (StringMap.add "2.6.25.14-69.fc8.i686" 55 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "in_ifaddr";; let size_of_inet6_ifaddr = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" 200 (StringMap.add "2.6.25.14-108.fc9.ppc64" 200 (StringMap.add "2.6.25.14-108.fc9.i586" 128 (StringMap.add "2.6.25.14-108.fc9.i686" 128 (StringMap.add "2.6.25.14-69.fc8.ppc" 124 (StringMap.add "2.6.25.14-108.fc9.x86_64" 200 (StringMap.add "2.6.25.11-97.fc9.x86_64" 200 (StringMap.add "2.6.25.14-69.fc8.i586" 128 (StringMap.add "2.6.20-1.2933.fc6.ppc" 116 (StringMap.add "2.6.20-1.2933.fc6.x86_64" 192 (StringMap.add "2.6.25.14-69.fc8.ppc64" 200 (StringMap.add "2.6.25.11-97.fc9.i686" 128 (StringMap.add "2.6.20-1.2933.fc6.i686" 116 (StringMap.add "2.6.20-1.2933.fc6.i586" 116 (StringMap.add "2.6.25.14-108.fc9.ppc" 124 (StringMap.add "2.6.20-1.2933.fc6.ppc64" 192 (StringMap.add "2.6.25.14-69.fc8.i686" 128 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "inet6_ifaddr";; let parser_of_task_struct = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" task_struct_parser_1 (StringMap.add "2.6.25.14-108.fc9.ppc64" task_struct_parser_2 (StringMap.add "2.6.25.14-108.fc9.i586" task_struct_parser_3 (StringMap.add "2.6.25.14-108.fc9.i686" task_struct_parser_4 (StringMap.add "2.6.25.14-69.fc8.ppc" task_struct_parser_5 (StringMap.add "2.6.25.14-108.fc9.x86_64" task_struct_parser_1 (StringMap.add "2.6.25.11-97.fc9.x86_64" task_struct_parser_1 (StringMap.add "2.6.25.14-69.fc8.i586" task_struct_parser_3 (StringMap.add "2.6.20-1.2933.fc6.ppc" task_struct_parser_6 (StringMap.add "2.6.20-1.2933.fc6.x86_64" task_struct_parser_7 (StringMap.add "2.6.25.14-69.fc8.ppc64" task_struct_parser_2 (StringMap.add "2.6.25.11-97.fc9.i686" task_struct_parser_4 (StringMap.add "2.6.20-1.2933.fc6.i686" task_struct_parser_8 (StringMap.add "2.6.20-1.2933.fc6.i586" task_struct_parser_8 (StringMap.add "2.6.25.14-108.fc9.ppc" task_struct_parser_5 (StringMap.add "2.6.20-1.2933.fc6.ppc64" task_struct_parser_9 (StringMap.add "2.6.25.14-69.fc8.i686" task_struct_parser_4 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "task_struct";; let parser_of_net_device = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" net_device_parser_10 (StringMap.add "2.6.25.14-108.fc9.ppc64" net_device_parser_11 (StringMap.add "2.6.25.14-108.fc9.i586" net_device_parser_12 (StringMap.add "2.6.25.14-108.fc9.i686" net_device_parser_12 (StringMap.add "2.6.25.14-69.fc8.ppc" net_device_parser_13 (StringMap.add "2.6.25.14-108.fc9.x86_64" net_device_parser_10 (StringMap.add "2.6.25.11-97.fc9.x86_64" net_device_parser_10 (StringMap.add "2.6.25.14-69.fc8.i586" net_device_parser_12 (StringMap.add "2.6.20-1.2933.fc6.ppc" net_device_parser_14 (StringMap.add "2.6.20-1.2933.fc6.x86_64" net_device_parser_15 (StringMap.add "2.6.25.14-69.fc8.ppc64" net_device_parser_11 (StringMap.add "2.6.25.11-97.fc9.i686" net_device_parser_12 (StringMap.add "2.6.20-1.2933.fc6.i686" net_device_parser_16 (StringMap.add "2.6.20-1.2933.fc6.i586" net_device_parser_16 (StringMap.add "2.6.25.14-108.fc9.ppc" net_device_parser_13 (StringMap.add "2.6.20-1.2933.fc6.ppc64" net_device_parser_17 (StringMap.add "2.6.25.14-69.fc8.i686" net_device_parser_12 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "net_device";; let parser_of_net = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" net_parser_18 (StringMap.add "2.6.25.14-108.fc9.ppc64" net_parser_19 (StringMap.add "2.6.25.14-108.fc9.i586" net_parser_20 (StringMap.add "2.6.25.14-108.fc9.i686" net_parser_20 (StringMap.add "2.6.25.14-69.fc8.ppc" net_parser_21 (StringMap.add "2.6.25.14-108.fc9.x86_64" net_parser_18 (StringMap.add "2.6.25.11-97.fc9.x86_64" net_parser_18 (StringMap.add "2.6.25.14-69.fc8.i586" net_parser_20 (StringMap.add "2.6.25.14-69.fc8.ppc64" net_parser_19 (StringMap.add "2.6.25.11-97.fc9.i686" net_parser_20 (StringMap.add "2.6.25.14-108.fc9.ppc" net_parser_21 (StringMap.add "2.6.25.14-69.fc8.i686" net_parser_20 StringMap.empty))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "net";; let parser_of_in_device = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" in_device_parser_22 (StringMap.add "2.6.25.14-108.fc9.ppc64" in_device_parser_23 (StringMap.add "2.6.25.14-108.fc9.i586" in_device_parser_24 (StringMap.add "2.6.25.14-108.fc9.i686" in_device_parser_24 (StringMap.add "2.6.25.14-69.fc8.ppc" in_device_parser_25 (StringMap.add "2.6.25.14-108.fc9.x86_64" in_device_parser_22 (StringMap.add "2.6.25.11-97.fc9.x86_64" in_device_parser_22 (StringMap.add "2.6.25.14-69.fc8.i586" in_device_parser_24 (StringMap.add "2.6.20-1.2933.fc6.ppc" in_device_parser_25 (StringMap.add "2.6.20-1.2933.fc6.x86_64" in_device_parser_22 (StringMap.add "2.6.25.14-69.fc8.ppc64" in_device_parser_23 (StringMap.add "2.6.25.11-97.fc9.i686" in_device_parser_24 (StringMap.add "2.6.20-1.2933.fc6.i686" in_device_parser_24 (StringMap.add "2.6.20-1.2933.fc6.i586" in_device_parser_24 (StringMap.add "2.6.25.14-108.fc9.ppc" in_device_parser_25 (StringMap.add "2.6.20-1.2933.fc6.ppc64" in_device_parser_23 (StringMap.add "2.6.25.14-69.fc8.i686" in_device_parser_24 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "in_device";; let parser_of_inet6_dev = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" inet6_dev_parser_26 (StringMap.add "2.6.25.14-108.fc9.ppc64" inet6_dev_parser_27 (StringMap.add "2.6.25.14-108.fc9.i586" inet6_dev_parser_28 (StringMap.add "2.6.25.14-108.fc9.i686" inet6_dev_parser_28 (StringMap.add "2.6.25.14-69.fc8.ppc" inet6_dev_parser_29 (StringMap.add "2.6.25.14-108.fc9.x86_64" inet6_dev_parser_26 (StringMap.add "2.6.25.11-97.fc9.x86_64" inet6_dev_parser_26 (StringMap.add "2.6.25.14-69.fc8.i586" inet6_dev_parser_28 (StringMap.add "2.6.20-1.2933.fc6.ppc" inet6_dev_parser_29 (StringMap.add "2.6.20-1.2933.fc6.x86_64" inet6_dev_parser_26 (StringMap.add "2.6.25.14-69.fc8.ppc64" inet6_dev_parser_27 (StringMap.add "2.6.25.11-97.fc9.i686" inet6_dev_parser_28 (StringMap.add "2.6.20-1.2933.fc6.i686" inet6_dev_parser_28 (StringMap.add "2.6.20-1.2933.fc6.i586" inet6_dev_parser_28 (StringMap.add "2.6.25.14-108.fc9.ppc" inet6_dev_parser_29 (StringMap.add "2.6.20-1.2933.fc6.ppc64" inet6_dev_parser_27 (StringMap.add "2.6.25.14-69.fc8.i686" inet6_dev_parser_28 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "inet6_dev";; let parser_of_in_ifaddr = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" in_ifaddr_parser_30 (StringMap.add "2.6.25.14-108.fc9.ppc64" in_ifaddr_parser_31 (StringMap.add "2.6.25.14-108.fc9.i586" in_ifaddr_parser_32 (StringMap.add "2.6.25.14-108.fc9.i686" in_ifaddr_parser_32 (StringMap.add "2.6.25.14-69.fc8.ppc" in_ifaddr_parser_33 (StringMap.add "2.6.25.14-108.fc9.x86_64" in_ifaddr_parser_30 (StringMap.add "2.6.25.11-97.fc9.x86_64" in_ifaddr_parser_30 (StringMap.add "2.6.25.14-69.fc8.i586" in_ifaddr_parser_32 (StringMap.add "2.6.20-1.2933.fc6.ppc" in_ifaddr_parser_33 (StringMap.add "2.6.20-1.2933.fc6.x86_64" in_ifaddr_parser_30 (StringMap.add "2.6.25.14-69.fc8.ppc64" in_ifaddr_parser_31 (StringMap.add "2.6.25.11-97.fc9.i686" in_ifaddr_parser_32 (StringMap.add "2.6.20-1.2933.fc6.i686" in_ifaddr_parser_32 (StringMap.add "2.6.20-1.2933.fc6.i586" in_ifaddr_parser_32 (StringMap.add "2.6.25.14-108.fc9.ppc" in_ifaddr_parser_33 (StringMap.add "2.6.20-1.2933.fc6.ppc64" in_ifaddr_parser_31 (StringMap.add "2.6.25.14-69.fc8.i686" in_ifaddr_parser_32 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "in_ifaddr";; let parser_of_inet6_ifaddr = let map = StringMap.add "2.6.25.14-69.fc8.x86_64" inet6_ifaddr_parser_34 (StringMap.add "2.6.25.14-108.fc9.ppc64" inet6_ifaddr_parser_35 (StringMap.add "2.6.25.14-108.fc9.i586" inet6_ifaddr_parser_36 (StringMap.add "2.6.25.14-108.fc9.i686" inet6_ifaddr_parser_36 (StringMap.add "2.6.25.14-69.fc8.ppc" inet6_ifaddr_parser_37 (StringMap.add "2.6.25.14-108.fc9.x86_64" inet6_ifaddr_parser_34 (StringMap.add "2.6.25.11-97.fc9.x86_64" inet6_ifaddr_parser_34 (StringMap.add "2.6.25.14-69.fc8.i586" inet6_ifaddr_parser_36 (StringMap.add "2.6.20-1.2933.fc6.ppc" inet6_ifaddr_parser_38 (StringMap.add "2.6.20-1.2933.fc6.x86_64" inet6_ifaddr_parser_39 (StringMap.add "2.6.25.14-69.fc8.ppc64" inet6_ifaddr_parser_35 (StringMap.add "2.6.25.11-97.fc9.i686" inet6_ifaddr_parser_36 (StringMap.add "2.6.20-1.2933.fc6.i686" inet6_ifaddr_parser_40 (StringMap.add "2.6.20-1.2933.fc6.i586" inet6_ifaddr_parser_40 (StringMap.add "2.6.25.14-108.fc9.ppc" inet6_ifaddr_parser_37 (StringMap.add "2.6.20-1.2933.fc6.ppc64" inet6_ifaddr_parser_41 (StringMap.add "2.6.25.14-69.fc8.i686" inet6_ifaddr_parser_36 StringMap.empty)))))))))))))))) in fun kernel_version -> try StringMap.find kernel_version map with | Not_found -> unknown_kernel_version kernel_version "inet6_ifaddr";; let rec task_struct_follower kernel_version load map addr = if (addr <> 0L) && (not (AddrMap.mem addr map)) then (let parser_ = parser_of_task_struct kernel_version in let total_size = size_of_task_struct kernel_version in let bits = load "task_struct" addr total_size in let data = parser_ kernel_version bits in let map = AddrMap.add addr ("task_struct", (Some (total_size, bits, Task_struct data))) map in let map = match data.task_struct_run_list'next with | None -> map | Some dest_addr -> let offset = data.task_struct_run_list'next_offset and adj = data.task_struct_run_list'next_adjustment in let offset = Int64.of_int offset and adj = Int64.of_int adj in let map = if offset <> adj then (let addr = Int64.sub (Int64.add addr offset) adj in AddrMap.add addr ("task_struct", None) map) else map in let dest_addr = Int64.sub dest_addr adj in let map = task_struct_follower kernel_version load map dest_addr in map in let dest_addr = data.task_struct_tasks'next in let map = let offset = data.task_struct_tasks'next_offset and adj = data.task_struct_tasks'next_adjustment in let offset = Int64.of_int offset and adj = Int64.of_int adj in let map = if offset <> adj then (let addr = Int64.sub (Int64.add addr offset) adj in AddrMap.add addr ("task_struct", None) map) else map in let dest_addr = Int64.sub dest_addr adj in let map = task_struct_follower kernel_version load map dest_addr in map in map) else map and net_device_follower kernel_version load map addr = if (addr <> 0L) && (not (AddrMap.mem addr map)) then (let parser_ = parser_of_net_device kernel_version in let total_size = size_of_net_device kernel_version in let bits = load "net_device" addr total_size in let data = parser_ kernel_version bits in let map = AddrMap.add addr ("net_device", (Some (total_size, bits, Net_device data))) map in let map = match data.net_device_dev_list'next with | None -> map | Some dest_addr -> let offset = data.net_device_dev_list'next_offset and adj = data.net_device_dev_list'next_adjustment in let offset = Int64.of_int offset and adj = Int64.of_int adj in let map = if offset <> adj then (let addr = Int64.sub (Int64.add addr offset) adj in AddrMap.add addr ("net_device", None) map) else map in let dest_addr = Int64.sub dest_addr adj in let map = net_device_follower kernel_version load map dest_addr in map in let dest_addr = data.net_device_ip6_ptr in let map = let map = inet6_dev_follower kernel_version load map dest_addr in map in let dest_addr = data.net_device_ip_ptr in let map = let map = in_device_follower kernel_version load map dest_addr in map in let map = match data.net_device_next with | None -> map | Some dest_addr -> let map = net_device_follower kernel_version load map dest_addr in map in map) else map and net_follower kernel_version load map addr = if (addr <> 0L) && (not (AddrMap.mem addr map)) then (let parser_ = parser_of_net kernel_version in let total_size = size_of_net kernel_version in let bits = load "net" addr total_size in let data = parser_ kernel_version bits in let map = AddrMap.add addr ("net", (Some (total_size, bits, Net data))) map in let dest_addr = data.net_dev_base_head'next in let map = let offset = data.net_dev_base_head'next_offset and adj = data.net_dev_base_head'next_adjustment in let offset = Int64.of_int offset and adj = Int64.of_int adj in let map = if offset <> adj then (let addr = Int64.sub (Int64.add addr offset) adj in AddrMap.add addr ("net_device", None) map) else map in let dest_addr = Int64.sub dest_addr adj in let map = net_device_follower kernel_version load map dest_addr in map in let dest_addr = data.net_dev_base_head'prev in let map = let offset = data.net_dev_base_head'prev_offset and adj = data.net_dev_base_head'prev_adjustment in let offset = Int64.of_int offset and adj = Int64.of_int adj in let map = if offset <> adj then (let addr = Int64.sub (Int64.add addr offset) adj in AddrMap.add addr ("net_device", None) map) else map in let dest_addr = Int64.sub dest_addr adj in let map = net_device_follower kernel_version load map dest_addr in map in map) else map and in_device_follower kernel_version load map addr = if (addr <> 0L) && (not (AddrMap.mem addr map)) then (let parser_ = parser_of_in_device kernel_version in let total_size = size_of_in_device kernel_version in let bits = load "in_device" addr total_size in let data = parser_ kernel_version bits in let map = AddrMap.add addr ("in_device", (Some (total_size, bits, In_device data))) map in let dest_addr = data.in_device_ifa_list in let map = let map = in_ifaddr_follower kernel_version load map dest_addr in map in map) else map and inet6_dev_follower kernel_version load map addr = if (addr <> 0L) && (not (AddrMap.mem addr map)) then (let parser_ = parser_of_inet6_dev kernel_version in let total_size = size_of_inet6_dev kernel_version in let bits = load "inet6_dev" addr total_size in let data = parser_ kernel_version bits in let map = AddrMap.add addr ("inet6_dev", (Some (total_size, bits, Inet6_dev data))) map in let dest_addr = data.inet6_dev_addr_list in let map = let map = inet6_ifaddr_follower kernel_version load map dest_addr in map in map) else map and in_ifaddr_follower kernel_version load map addr = if (addr <> 0L) && (not (AddrMap.mem addr map)) then (let parser_ = parser_of_in_ifaddr kernel_version in let total_size = size_of_in_ifaddr kernel_version in let bits = load "in_ifaddr" addr total_size in let data = parser_ kernel_version bits in let map = AddrMap.add addr ("in_ifaddr", (Some (total_size, bits, In_ifaddr data))) map in let dest_addr = data.in_ifaddr_ifa_next in let map = let map = in_ifaddr_follower kernel_version load map dest_addr in map in map) else map and inet6_ifaddr_follower kernel_version load map addr = if (addr <> 0L) && (not (AddrMap.mem addr map)) then (let parser_ = parser_of_inet6_ifaddr kernel_version in let total_size = size_of_inet6_ifaddr kernel_version in let bits = load "inet6_ifaddr" addr total_size in let data = parser_ kernel_version bits in let map = AddrMap.add addr ("inet6_ifaddr", (Some (total_size, bits, Inet6_ifaddr data))) map in let dest_addr = data.inet6_ifaddr_lst_next in let map = let map = inet6_ifaddr_follower kernel_version load map dest_addr in map in map) else map;;