From e6529f04e4135efbe726a7ee034c5086de220818 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] Generated files to parse some kernel structures. --- lib/.depend | 4 + lib/kernel_net_device.ml | 218 +++++++++++++++++++++++++++++++++++++++++++ lib/kernel_net_device.mli | 6 ++ lib/kernel_task_struct.ml | 227 +++++++++++++++++++++++++++++++++++++++++++++ lib/kernel_task_struct.mli | 10 ++ 5 files changed, 465 insertions(+) create mode 100644 lib/kernel_net_device.ml create mode 100644 lib/kernel_net_device.mli create mode 100644 lib/kernel_task_struct.ml create mode 100644 lib/kernel_task_struct.mli diff --git a/lib/.depend b/lib/.depend index 9d1784c..230aebf 100644 --- a/lib/.depend +++ b/lib/.depend @@ -4,6 +4,10 @@ virt_mem.cmi: virt_mem_types.cmi virt_mem_mmap.cmi: virt_mem_utils.cmo virt_mem_types.cmi: virt_mem_utils.cmo virt_mem_mmap.cmi virt_mem_utsname.cmi: virt_mem_types.cmi +kernel_net_device.cmo: kernel_net_device.cmi +kernel_net_device.cmx: kernel_net_device.cmi +kernel_task_struct.cmo: kernel_task_struct.cmi +kernel_task_struct.cmx: kernel_task_struct.cmi test_mmap.cmo: virt_mem_mmap.cmi test_mmap.cmx: virt_mem_mmap.cmx virt_mem_capture.cmo: virt_mem_types.cmi virt_mem_gettext.cmo virt_mem.cmi diff --git a/lib/kernel_net_device.ml b/lib/kernel_net_device.ml new file mode 100644 index 0000000..47e8253 --- /dev/null +++ b/lib/kernel_net_device.ml @@ -0,0 +1,218 @@ +let warning = + "This code is automatically generated from the kernel database by kerneldb-to-parser program. Any edits you make will be lost.";; +exception ParseError of string;; +type t = { dev_addr : string; name : string };; +let parser_1 bits = "parser_1";; +let parser_2 bits = "parser_2";; +let parser_3 bits = "parser_3";; +let parser_4 bits = "parser_4";; +let parser_5 bits = "parser_5";; +let parser_6 bits = "parser_6";; +let parser_7 bits = "parser_7";; +let parser_8 bits = "parser_8";; +let parser_9 bits = "parser_9";; +let parser_10 bits = "parser_10";; +let parser_11 bits = "parser_11";; +let parser_12 bits = "parser_12";; +let parser_13 bits = "parser_13";; +let parser_14 bits = "parser_14";; +let parser_15 bits = "parser_15";; +let parser_16 bits = "parser_16";; +let parser_17 bits = "parser_17";; +module StringMap = Map.Make(String);; +let map = StringMap.empty;; +let v = (parser_1, 1284);; +let map = StringMap.add "2.6.21-1.3128.fc7.i586" v map;; +let v = (parser_2, 1092);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.ppc" v map;; +let v = (parser_1, 1284);; +let map = StringMap.add "2.6.21-1.3128.fc7.i686" v map;; +let v = (parser_2, 1092);; +let map = StringMap.add "2.6.21-1.3236.fc8.ppc" v map;; +let v = (parser_1, 1116);; +let map = StringMap.add "2.6.21-1.3228.fc7.i586" v map;; +let v = (parser_3, 1108);; +let map = StringMap.add "2.6.18-1.2798.fc6.x86_64" v map;; +let v = (parser_4, 2316);; +let map = StringMap.add "2.6.21-1.3236.fc8.x86_64" v map;; +let v = (parser_5, 1684);; +let map = StringMap.add "2.6.21-1.3228.fc7.ppc64" v map;; +let v = (parser_3, 1404);; +let map = StringMap.add "2.6.21-1.3228.fc7.x86_64" v map;; +let v = (parser_4, 2316);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.x86_64" v map;; +let v = (parser_5, 1924);; +let map = StringMap.add "2.6.21-1.3144.fc7.ppc64" v map;; +let v = (parser_6, 2044);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.ppc64" v map;; +let v = (parser_7, 1408);; +let map = StringMap.add "2.6.21-1.3236.fc8.i686" v map;; +let v = (parser_1, 1116);; +let map = StringMap.add "2.6.21-1.3228.fc7.i686" v map;; +let v = (parser_8, 2288);; +let map = StringMap.add "2.6.24-9.fc9.x86_64" v map;; +let v = (parser_6, 2044);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.ppc64" v map;; +let v = (parser_1, 912);; +let map = StringMap.add "2.6.18-1.2798.fc6.i586" v map;; +let v = (parser_9, 1020);; +let map = StringMap.add "2.6.21-1.3132.fc7.ppc" v map;; +let v = (parser_1, 912);; +let map = StringMap.add "2.6.18-1.2798.fc6.i686" v map;; +let v = (parser_8, 1752);; +let map = StringMap.add "2.6.25.11-97.fc9.x86_64" v map;; +let v = (parser_10, 672);; +let map = StringMap.add "2.6.18-1.2798.fc6.i686" v map;; +let v = (parser_11, 1244);; +let map = StringMap.add "2.6.24-9.fc9.i686" v map;; +let v = (parser_7, 1408);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.i686" v map;; +let v = (parser_6, 2044);; +let map = StringMap.add "2.6.21-1.3236.fc8.ppc64" v map;; +let v = (parser_2, 1116);; +let map = StringMap.add "2.6.21-1.3209.fc8.ppc" v map;; +let v = (parser_6, 2044);; +let map = StringMap.add "2.6.21-1.3236.fc8.ppc64" v map;; +let v = (parser_5, 1684);; +let map = StringMap.add "2.6.21-1.3228.fc7.ppc64" v map;; +let v = (parser_5, 1924);; +let map = StringMap.add "2.6.21-1.3128.fc7.ppc64" v map;; +let v = (parser_7, 1408);; +let map = StringMap.add "2.6.21-1.3209.fc8.i686" v map;; +let v = (parser_12, 2196);; +let map = StringMap.add "2.6.21-1.3132.fc7.x86_64" v map;; +let v = (parser_12, 2196);; +let map = StringMap.add "2.6.21-1.3228.fc7.x86_64" v map;; +let v = (parser_13, 1072);; +let map = StringMap.add "2.6.24-9.fc9.ppc" v map;; +let v = (parser_9, 672);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc" v map;; +let v = (parser_9, 1020);; +let map = StringMap.add "2.6.21-1.3128.fc7.ppc" v map;; +let v = (parser_7, 1408);; +let map = StringMap.add "2.6.21-1.3209.fc8.i686" v map;; +let v = (parser_12, 1540);; +let map = StringMap.add "2.6.20-1.2933.fc6.x86_64" v map;; +let v = (parser_9, 1020);; +let map = StringMap.add "2.6.21-1.3144.fc7.ppc" v map;; +let v = (parser_5, 1924);; +let map = StringMap.add "2.6.21-1.3144.fc7.ppc64" v map;; +let v = (parser_14, 1984);; +let map = StringMap.add "2.6.24-9.fc9.ppc64" v map;; +let v = (parser_9, 996);; +let map = StringMap.add "2.6.21-1.3128.fc7.ppc" v map;; +let v = (parser_12, 1260);; +let map = StringMap.add "2.6.18-1.2798.fc6.x86_64" v map;; +let v = (parser_9, 996);; +let map = StringMap.add "2.6.21-1.3132.fc7.ppc" v map;; +let v = (parser_9, 936);; +let map = StringMap.add "2.6.21-1.3228.fc7.ppc" v map;; +let v = (parser_14, 1984);; +let map = StringMap.add "2.6.24-9.fc9.ppc64" v map;; +let v = (parser_5, 1260);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc64" v map;; +let v = (parser_3, 2124);; +let map = StringMap.add "2.6.21-1.3128.fc7.x86_64" v map;; +let v = (parser_1, 912);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_12, 2196);; +let map = StringMap.add "2.6.21-1.3144.fc7.x86_64" v map;; +let v = (parser_5, 1260);; +let map = StringMap.add "2.6.20-1.2933.fc6.ppc64" v map;; +let v = (parser_2, 1116);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.ppc" v map;; +let v = (parser_2, 1092);; +let map = StringMap.add "2.6.21-1.3209.fc8.ppc" v map;; +let v = (parser_12, 1260);; +let map = StringMap.add "2.6.20-1.2933.fc6.x86_64" v map;; +let v = (parser_1, 1284);; +let map = StringMap.add "2.6.21-1.3132.fc7.i586" v map;; +let v = (parser_1, 1284);; +let map = StringMap.add "2.6.21-1.3144.fc7.i586" v map;; +let v = (parser_12, 1660);; +let map = StringMap.add "2.6.21-1.3228.fc7.x86_64" v map;; +let v = (parser_5, 1260);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc64iseries" v map;; +let v = (parser_15, 668);; +let map = StringMap.add "2.6.20-1.2933.fc6.ppc" v map;; +let v = (parser_1, 1284);; +let map = StringMap.add "2.6.21-1.3144.fc7.i686" v map;; +let v = (parser_1, 1116);; +let map = StringMap.add "2.6.21-1.3228.fc7.i686" v map;; +let v = (parser_7, 1408);; +let map = StringMap.add "2.6.21-1.3209.fc8.i586" v map;; +let v = (parser_5, 1260);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc64iseries" v map;; +let v = (parser_1, 1284);; +let map = StringMap.add "2.6.21-1.3144.fc7.i686" v map;; +let v = (parser_16, 1100);; +let map = StringMap.add "2.6.20-1.2933.fc6.x86_64" v map;; +let v = (parser_12, 1260);; +let map = StringMap.add "2.6.20-1.2933.fc6.x86_64" v map;; +let v = (parser_12, 1260);; +let map = StringMap.add "2.6.18-1.2798.fc6.x86_64" v map;; +let v = (parser_3, 2124);; +let map = StringMap.add "2.6.21-1.3144.fc7.x86_64" v map;; +let v = (parser_9, 688);; +let map = StringMap.add "2.6.20-1.2933.fc6.ppc" v map;; +let v = (parser_11, 1244);; +let map = StringMap.add "2.6.24-9.fc9.i686" v map;; +let v = (parser_1, 924);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_11, 1212);; +let map = StringMap.add "2.6.25.11-97.fc9.i686" v map;; +let v = (parser_1, 1284);; +let map = StringMap.add "2.6.21-1.3228.fc7.i686" v map;; +let v = (parser_1, 1284);; +let map = StringMap.add "2.6.21-1.3228.fc7.i686" v map;; +let v = (parser_1, 1284);; +let map = StringMap.add "2.6.21-1.3128.fc7.i686" v map;; +let v = (parser_9, 996);; +let map = StringMap.add "2.6.21-1.3144.fc7.ppc" v map;; +let v = (parser_1, 912);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_4, 2316);; +let map = StringMap.add "2.6.21-1.3209.fc8.x86_64" v map;; +let v = (parser_1, 912);; +let map = StringMap.add "2.6.20-1.2933.fc6.i586" v map;; +let v = (parser_3, 2124);; +let map = StringMap.add "2.6.21-1.3132.fc7.x86_64" v map;; +let v = (parser_1, 912);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_5, 1260);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc64" v map;; +let v = (parser_1, 912);; +let map = StringMap.add "2.6.18-1.2798.fc6.i686" v map;; +let v = (parser_9, 836);; +let map = StringMap.add "2.6.21-1.3228.fc7.ppc" v map;; +let v = (parser_7, 1408);; +let map = StringMap.add "2.6.21-1.3236.fc8.i686" v map;; +let v = (parser_2, 1116);; +let map = StringMap.add "2.6.21-1.3236.fc8.ppc" v map;; +let v = (parser_17, 668);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_11, 1244);; +let map = StringMap.add "2.6.24-9.fc9.i586" v map;; +let v = (parser_12, 2196);; +let map = StringMap.add "2.6.21-1.3128.fc7.x86_64" v map;; +let v = (parser_5, 1260);; +let map = StringMap.add "2.6.20-1.2933.fc6.ppc64" v map;; +let v = (parser_13, 1048);; +let map = StringMap.add "2.6.24-9.fc9.ppc" v map;; +let v = (parser_5, 1924);; +let map = StringMap.add "2.6.21-1.3128.fc7.ppc64" v map;; +let v = (parser_6, 2044);; +let map = StringMap.add "2.6.21-1.3209.fc8.ppc64" v map;; +let v = (parser_9, 688);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc" v map;; +let v = (parser_7, 1408);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.i686" v map;; +let v = (parser_1, 924);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_6, 2044);; +let map = StringMap.add "2.6.21-1.3209.fc8.ppc64" v map;; +type kernel_version = string;; +let known version = StringMap.mem version map;; +let size version = let (_, size) = StringMap.find version map in size;; +let get version bits = + let (parsefn, _) = StringMap.find version map in parsefn bits;; diff --git a/lib/kernel_net_device.mli b/lib/kernel_net_device.mli new file mode 100644 index 0000000..ea72dc9 --- /dev/null +++ b/lib/kernel_net_device.mli @@ -0,0 +1,6 @@ +exception ParseError of string;; +type t = { dev_addr : string; name : string };; +type kernel_version = string;; +val known : kernel_version -> bool;; +val size : kernel_version -> int;; +val get : kernel_version -> Bitstring.bitstring -> t;; diff --git a/lib/kernel_task_struct.ml b/lib/kernel_task_struct.ml new file mode 100644 index 0000000..e87a928 --- /dev/null +++ b/lib/kernel_task_struct.ml @@ -0,0 +1,227 @@ +let warning = + "This code is automatically generated from the kernel database by kerneldb-to-parser program. Any edits you make will be lost.";; +exception ParseError of string;; +type t = + { comm : string; normal_prio : int; prio : int; state : int; + static_prio : int; tasks'next : [ | `list_head ] int64; + tasks'prev : [ | `list_head ] int64 + };; +let parser_1 bits = "parser_1";; +let parser_2 bits = "parser_2";; +let parser_3 bits = "parser_3";; +let parser_4 bits = "parser_4";; +let parser_5 bits = "parser_5";; +let parser_6 bits = "parser_6";; +let parser_7 bits = "parser_7";; +let parser_8 bits = "parser_8";; +let parser_9 bits = "parser_9";; +let parser_10 bits = "parser_10";; +let parser_11 bits = "parser_11";; +let parser_12 bits = "parser_12";; +let parser_13 bits = "parser_13";; +let parser_14 bits = "parser_14";; +let parser_15 bits = "parser_15";; +let parser_16 bits = "parser_16";; +let parser_17 bits = "parser_17";; +let parser_18 bits = "parser_18";; +let parser_19 bits = "parser_19";; +let parser_20 bits = "parser_20";; +let parser_21 bits = "parser_21";; +let parser_22 bits = "parser_22";; +module StringMap = Map.Make(String);; +let map = StringMap.empty;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.21-1.3128.fc7.i586" v map;; +let v = (parser_2, 1756);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.ppc" v map;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.21-1.3128.fc7.i686" v map;; +let v = (parser_3, 1780);; +let map = StringMap.add "2.6.21-1.3236.fc8.ppc" v map;; +let v = (parser_1, 1376);; +let map = StringMap.add "2.6.21-1.3228.fc7.i586" v map;; +let v = (parser_4, 1856);; +let map = StringMap.add "2.6.18-1.2798.fc6.x86_64" v map;; +let v = (parser_5, 3948);; +let map = StringMap.add "2.6.21-1.3236.fc8.x86_64" v map;; +let v = (parser_6, 2072);; +let map = StringMap.add "2.6.21-1.3228.fc7.ppc64" v map;; +let v = (parser_7, 1832);; +let map = StringMap.add "2.6.21-1.3228.fc7.x86_64" v map;; +let v = (parser_8, 3932);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.x86_64" v map;; +let v = (parser_6, 2132);; +let map = StringMap.add "2.6.21-1.3144.fc7.ppc64" v map;; +let v = (parser_9, 2292);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.ppc64" v map;; +let v = (parser_10, 2880);; +let map = StringMap.add "2.6.21-1.3236.fc8.i686" v map;; +let v = (parser_1, 1376);; +let map = StringMap.add "2.6.21-1.3228.fc7.i686" v map;; +let v = (parser_11, 4684);; +let map = StringMap.add "2.6.24-9.fc9.x86_64" v map;; +let v = (parser_9, 2292);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.ppc64" v map;; +let v = (parser_1, 1384);; +let map = StringMap.add "2.6.18-1.2798.fc6.i586" v map;; +let v = (parser_12, 1620);; +let map = StringMap.add "2.6.21-1.3132.fc7.ppc" v map;; +let v = (parser_1, 1384);; +let map = StringMap.add "2.6.18-1.2798.fc6.i686" v map;; +let v = (parser_13, 2496);; +let map = StringMap.add "2.6.25.11-97.fc9.x86_64" v map;; +let v = (parser_1, 1368);; +let map = StringMap.add "2.6.18-1.2798.fc6.i686" v map;; +let v = (parser_14, 3540);; +let map = StringMap.add "2.6.24-9.fc9.i686" v map;; +let v = (parser_15, 2856);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.i686" v map;; +let v = (parser_16, 2308);; +let map = StringMap.add "2.6.21-1.3236.fc8.ppc64" v map;; +let v = (parser_12, 1628);; +let map = StringMap.add "2.6.21-1.3209.fc8.ppc" v map;; +let v = (parser_16, 2308);; +let map = StringMap.add "2.6.21-1.3236.fc8.ppc64" v map;; +let v = (parser_6, 2072);; +let map = StringMap.add "2.6.21-1.3228.fc7.ppc64" v map;; +let v = (parser_6, 2132);; +let map = StringMap.add "2.6.21-1.3128.fc7.ppc64" v map;; +let v = (parser_1, 2712);; +let map = StringMap.add "2.6.21-1.3209.fc8.i686" v map;; +let v = (parser_7, 3772);; +let map = StringMap.add "2.6.21-1.3132.fc7.x86_64" v map;; +let v = (parser_7, 3772);; +let map = StringMap.add "2.6.21-1.3228.fc7.x86_64" v map;; +let v = (parser_17, 1948);; +let map = StringMap.add "2.6.24-9.fc9.ppc" v map;; +let v = (parser_12, 1576);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc" v map;; +let v = (parser_12, 1620);; +let map = StringMap.add "2.6.21-1.3128.fc7.ppc" v map;; +let v = (parser_1, 2712);; +let map = StringMap.add "2.6.21-1.3209.fc8.i686" v map;; +let v = (parser_7, 3772);; +let map = StringMap.add "2.6.20-1.2933.fc6.x86_64" v map;; +let v = (parser_12, 1620);; +let map = StringMap.add "2.6.21-1.3144.fc7.ppc" v map;; +let v = (parser_6, 2132);; +let map = StringMap.add "2.6.21-1.3144.fc7.ppc64" v map;; +let v = (parser_18, 2492);; +let map = StringMap.add "2.6.24-9.fc9.ppc64" v map;; +let v = (parser_12, 1604);; +let map = StringMap.add "2.6.21-1.3128.fc7.ppc" v map;; +let v = (parser_19, 1928);; +let map = StringMap.add "2.6.18-1.2798.fc6.x86_64" v map;; +let v = (parser_12, 1604);; +let map = StringMap.add "2.6.21-1.3132.fc7.ppc" v map;; +let v = (parser_12, 1584);; +let map = StringMap.add "2.6.21-1.3228.fc7.ppc" v map;; +let v = (parser_18, 2492);; +let map = StringMap.add "2.6.24-9.fc9.ppc64" v map;; +let v = (parser_6, 2104);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc64" v map;; +let v = (parser_7, 3780);; +let map = StringMap.add "2.6.21-1.3128.fc7.x86_64" v map;; +let v = (parser_1, 1400);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_7, 3772);; +let map = StringMap.add "2.6.21-1.3144.fc7.x86_64" v map;; +let v = (parser_6, 2112);; +let map = StringMap.add "2.6.20-1.2933.fc6.ppc64" v map;; +let v = (parser_2, 1772);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.ppc" v map;; +let v = (parser_12, 1612);; +let map = StringMap.add "2.6.21-1.3209.fc8.ppc" v map;; +let v = (parser_7, 1920);; +let map = StringMap.add "2.6.20-1.2933.fc6.x86_64" v map;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.21-1.3132.fc7.i586" v map;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.21-1.3144.fc7.i586" v map;; +let v = (parser_7, 1880);; +let map = StringMap.add "2.6.21-1.3228.fc7.x86_64" v map;; +let v = (parser_6, 2088);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc64iseries" v map;; +let v = (parser_12, 1592);; +let map = StringMap.add "2.6.20-1.2933.fc6.ppc" v map;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.21-1.3144.fc7.i686" v map;; +let v = (parser_1, 1376);; +let map = StringMap.add "2.6.21-1.3228.fc7.i686" v map;; +let v = (parser_1, 2712);; +let map = StringMap.add "2.6.21-1.3209.fc8.i586" v map;; +let v = (parser_6, 2088);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc64iseries" v map;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.21-1.3144.fc7.i686" v map;; +let v = (parser_7, 1880);; +let map = StringMap.add "2.6.20-1.2933.fc6.x86_64" v map;; +let v = (parser_7, 1920);; +let map = StringMap.add "2.6.20-1.2933.fc6.x86_64" v map;; +let v = (parser_19, 1928);; +let map = StringMap.add "2.6.18-1.2798.fc6.x86_64" v map;; +let v = (parser_7, 3780);; +let map = StringMap.add "2.6.21-1.3144.fc7.x86_64" v map;; +let v = (parser_12, 1608);; +let map = StringMap.add "2.6.20-1.2933.fc6.ppc" v map;; +let v = (parser_14, 3540);; +let map = StringMap.add "2.6.24-9.fc9.i686" v map;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_20, 1832);; +let map = StringMap.add "2.6.25.11-97.fc9.i686" v map;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.21-1.3228.fc7.i686" v map;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.21-1.3228.fc7.i686" v map;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.21-1.3128.fc7.i686" v map;; +let v = (parser_12, 1604);; +let map = StringMap.add "2.6.21-1.3144.fc7.ppc" v map;; +let v = (parser_1, 1400);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_21, 3756);; +let map = StringMap.add "2.6.21-1.3209.fc8.x86_64" v map;; +let v = (parser_1, 1400);; +let map = StringMap.add "2.6.20-1.2933.fc6.i586" v map;; +let v = (parser_7, 3780);; +let map = StringMap.add "2.6.21-1.3132.fc7.x86_64" v map;; +let v = (parser_1, 1400);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_6, 2104);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc64" v map;; +let v = (parser_1, 1384);; +let map = StringMap.add "2.6.18-1.2798.fc6.i686" v map;; +let v = (parser_12, 1560);; +let map = StringMap.add "2.6.21-1.3228.fc7.ppc" v map;; +let v = (parser_10, 2880);; +let map = StringMap.add "2.6.21-1.3236.fc8.i686" v map;; +let v = (parser_3, 1796);; +let map = StringMap.add "2.6.21-1.3236.fc8.ppc" v map;; +let v = (parser_1, 1384);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_14, 3540);; +let map = StringMap.add "2.6.24-9.fc9.i586" v map;; +let v = (parser_7, 3772);; +let map = StringMap.add "2.6.21-1.3128.fc7.x86_64" v map;; +let v = (parser_6, 2112);; +let map = StringMap.add "2.6.20-1.2933.fc6.ppc64" v map;; +let v = (parser_17, 1936);; +let map = StringMap.add "2.6.24-9.fc9.ppc" v map;; +let v = (parser_6, 2132);; +let map = StringMap.add "2.6.21-1.3128.fc7.ppc64" v map;; +let v = (parser_22, 2116);; +let map = StringMap.add "2.6.21-1.3209.fc8.ppc64" v map;; +let v = (parser_12, 1592);; +let map = StringMap.add "2.6.18-1.2798.fc6.ppc" v map;; +let v = (parser_15, 2856);; +let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.i686" v map;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; +let v = (parser_22, 2116);; +let map = StringMap.add "2.6.21-1.3209.fc8.ppc64" v map;; +type kernel_version = string;; +let known version = StringMap.mem version map;; +let size version = let (_, size) = StringMap.find version map in size;; +let get version bits = + let (parsefn, _) = StringMap.find version map in parsefn bits;; diff --git a/lib/kernel_task_struct.mli b/lib/kernel_task_struct.mli new file mode 100644 index 0000000..e600878 --- /dev/null +++ b/lib/kernel_task_struct.mli @@ -0,0 +1,10 @@ +exception ParseError of string;; +type t = + { comm : string; normal_prio : int; prio : int; state : int; + static_prio : int; tasks'next : [ | `list_head ] int64; + tasks'prev : [ | `list_head ] int64 + };; +type kernel_version = string;; +val known : kernel_version -> bool;; +val size : kernel_version -> int;; +val get : kernel_version -> Bitstring.bitstring -> t;; -- 1.8.3.1