Add .gitignore file for git.
[virt-mem.git] / lib / kernel.mli
1 module AddrMap :
2   sig
3     type key = Virt_mem_mmap.addr;;
4     type 'a t = 'a Map.Make(Int64).t;;
5     val empty : 'a t;;
6     val is_empty : 'a t -> bool;;
7     val add : key -> 'a -> 'a t -> 'a t;;
8     val find : key -> 'a t -> 'a;;
9     val remove : key -> 'a t -> 'a t;;
10     val mem : key -> 'a t -> bool;;
11     val iter : (key -> 'a -> unit) -> 'a t -> unit;;
12     val map : ('a -> 'b) -> 'a t -> 'b t;;
13     val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t;;
14     val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b;;
15     val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int;;
16     val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool;;
17   end;;
18 exception ParseError of string * string * string;;
19 type kernel_version = string;;
20 type load_fn = string -> Virt_mem_mmap.addr -> int -> Bitstring.bitstring;;
21 type task_struct =
22   { task_struct_comm : string; task_struct_normal_prio : int64;
23     task_struct_pid : int64; task_struct_prio : int64;
24     task_struct_run_list'next : Virt_mem_mmap.addr option;
25     task_struct_run_list'next_offset : int;
26     task_struct_run_list'next_adjustment : int;
27     task_struct_run_list'prev : Virt_mem_mmap.addr option;
28     task_struct_state : int64; task_struct_static_prio : int64;
29     task_struct_tasks'next : Virt_mem_mmap.addr;
30     task_struct_tasks'next_offset : int;
31     task_struct_tasks'next_adjustment : int;
32     task_struct_tasks'prev : Virt_mem_mmap.addr
33   };;
34 type net_device =
35   { net_device_addr_len : int64;
36     net_device_dev_list'next : Virt_mem_mmap.addr option;
37     net_device_dev_list'next_offset : int;
38     net_device_dev_list'next_adjustment : int;
39     net_device_dev_list'prev : Virt_mem_mmap.addr option;
40     net_device_flags : int64; net_device_ip6_ptr : Virt_mem_mmap.addr;
41     net_device_ip_ptr : Virt_mem_mmap.addr; net_device_mtu : int64;
42     net_device_name : string; net_device_next : Virt_mem_mmap.addr option;
43     net_device_operstate : int64; net_device_perm_addr : string
44   };;
45 type net =
46   { net_dev_base_head'next : Virt_mem_mmap.addr;
47     net_dev_base_head'next_offset : int;
48     net_dev_base_head'next_adjustment : int;
49     net_dev_base_head'prev : Virt_mem_mmap.addr;
50     net_dev_base_head'prev_offset : int;
51     net_dev_base_head'prev_adjustment : int
52   };;
53 type in_device = { in_device_ifa_list : Virt_mem_mmap.addr };;
54 type inet6_dev = { inet6_dev_addr_list : Virt_mem_mmap.addr };;
55 type in_ifaddr =
56   { in_ifaddr_ifa_address : int64; in_ifaddr_ifa_broadcast : int64;
57     in_ifaddr_ifa_local : int64; in_ifaddr_ifa_mask : int64;
58     in_ifaddr_ifa_next : Virt_mem_mmap.addr
59   };;
60 type inet6_ifaddr =
61   { inet6_ifaddr_lst_next : Virt_mem_mmap.addr;
62     inet6_ifaddr_prefix_len : int64
63   };;
64 type kernel_struct =
65   Task_struct of task_struct
66   | Net_device of net_device
67   | Net of net
68   | In_device of in_device
69   | Inet6_dev of inet6_dev
70   | In_ifaddr of in_ifaddr
71   | Inet6_ifaddr of inet6_ifaddr;;
72 type addrmap =
73   (string * ((int * Bitstring.bitstring * kernel_struct) option)) AddrMap.t;;
74
75
76
77 val task_struct_follower :
78   bool ->
79     kernel_version -> load_fn -> addrmap -> Virt_mem_mmap.addr -> addrmap;;
80 val net_device_follower :
81   bool ->
82     kernel_version -> load_fn -> addrmap -> Virt_mem_mmap.addr -> addrmap;;
83 val net_follower :
84   bool ->
85     kernel_version -> load_fn -> addrmap -> Virt_mem_mmap.addr -> addrmap;;
86 val in_device_follower :
87   bool ->
88     kernel_version -> load_fn -> addrmap -> Virt_mem_mmap.addr -> addrmap;;
89 val inet6_dev_follower :
90   bool ->
91     kernel_version -> load_fn -> addrmap -> Virt_mem_mmap.addr -> addrmap;;
92 val in_ifaddr_follower :
93   bool ->
94     kernel_version -> load_fn -> addrmap -> Virt_mem_mmap.addr -> addrmap;;
95 val inet6_ifaddr_follower :
96   bool ->
97     kernel_version -> load_fn -> addrmap -> Virt_mem_mmap.addr -> addrmap;;