-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathskso.c
150 lines (123 loc) · 3.04 KB
/
skso.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/socket.h>
#include <linux/hash.h>
#include <linux/in.h>
#include <linux/net.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/fdtable.h>
#include <linux/version.h>
#include <net/tcp.h>
int struct_tcp_sock__copied_seq_offset(void)
{
return offsetof(typeof(struct tcp_sock), copied_seq);
}
int struct_tcp_sock__write_seq_offset(void)
{
return offsetof(typeof(struct tcp_sock), write_seq);
}
int struct_tcp_sock__snd_nxt_offset(void)
{
return offsetof(typeof(struct tcp_sock), snd_nxt);
}
int struct_task_struct__files_offset(void)
{
return offsetof(typeof(struct task_struct), files);
}
int struct_sock____sk_flags_offset_offset(void)
{
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0))
return offsetof(typeof(struct sock), __sk_flags_offset);
#else
return offsetof(typeof(struct sock), sk_pacing_shift) - 1;
#endif
}
int struct_files_struct_fdt_offset(void)
{
return offsetof(typeof(struct files_struct), fdt);
}
int STRUCT_FILES_PRIVATE_DATA_OFFSET(void)
{
return offsetof(typeof(struct file), private_data);
}
int struct_file__f_inode_offset(void)
{
return offsetof(typeof(struct file), f_inode);
}
int struct_inode__i_mode_offset(void)
{
return offsetof(typeof(struct inode), i_mode);
}
int struct_file__dentry__sum_offset(void)
{
return offsetof(typeof(struct file),
f_path) + offsetof(typeof(struct path), dentry);
}
int struct_file__f_pos__offset(void)
{
return offsetof(typeof(struct file), f_pos);
}
int struct_dentry_name__sum__offset(void)
{
return offsetof(typeof(struct dentry),
d_name) + offsetof(typeof(struct qstr), name);
}
int struct_dentry__d_parent__offset(void)
{
return offsetof(typeof(struct dentry), d_parent);
}
int struct_sock_common__skc_family_offset(void)
{
return offsetof(typeof(struct sock_common), skc_family);
}
int struct_sock_common__skc_rcv_saddr_offset(void)
{
return offsetof(typeof(struct sock_common), skc_rcv_saddr);
}
int struct_sock_common__skc_daddr_offset(void)
{
return offsetof(typeof(struct sock_common), skc_daddr);
}
int struct_sock_common__skc_v6_rcv_saddr_offset(void)
{
return offsetof(typeof(struct sock_common), skc_v6_rcv_saddr);
}
int struct_sock_common__skc_v6_daddr_offset(void)
{
return offsetof(typeof(struct sock_common), skc_v6_daddr);
}
int struct_sock_common__skc_dport_offset(void)
{
return offsetof(typeof(struct sock_common), skc_dport);
}
int struct_sock_common__skc_num_offset(void)
{
return offsetof(typeof(struct sock_common), skc_num);
}
int struct_sock_common__skc_state_offset(void)
{
return offsetof(typeof(struct sock_common), skc_state);
}
int struct_sock_common__skc_ipv6only_offset(void)
{
return offsetof(typeof(struct sock_common), skc_state) + 1;
}
int struct_task_struct__tls_offset(void)
{
return offsetof(typeof(struct task_struct),
thread) + offsetof(typeof(struct thread_struct),
fsbase);
}
static int init_skso(void)
{
return 0;
}
static void exit_skso(void)
{
return;
}
module_init(init_skso);
module_exit(exit_skso);
MODULE_LICENSE("Proprietary");