line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Linux::SocketFilter; |
2
|
|
|
|
|
|
|
# This module was generated automatically by ExtUtils::H2PM from lib/Linux/SocketFilter_const.pm.PL |
3
|
|
|
|
|
|
|
|
4
|
5
|
|
|
5
|
|
30
|
use Carp; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
595
|
|
5
|
|
|
|
|
|
|
push @EXPORT_OK, 'SO_ATTACH_FILTER', 'SO_DETACH_FILTER', 'pack_sock_filter', 'unpack_sock_filter', 'BPF_LD', 'BPF_LDX', 'BPF_ST', 'BPF_STX', 'BPF_ALU', 'BPF_JMP', 'BPF_RET', 'BPF_MISC', 'BPF_W', 'BPF_H', 'BPF_B', 'BPF_IMM', 'BPF_ABS', 'BPF_IND', 'BPF_MEM', 'BPF_LEN', 'BPF_MSH', 'BPF_ADD', 'BPF_SUB', 'BPF_MUL', 'BPF_DIV', 'BPF_OR', 'BPF_AND', 'BPF_LSH', 'BPF_RSH', 'BPF_NEG', 'BPF_JA', 'BPF_JEQ', 'BPF_JGT', 'BPF_JGE', 'BPF_JSET', 'BPF_K', 'BPF_X', 'BPF_A', 'BPF_TAX', 'BPF_TXA', 'SKF_AD_OFF', 'SKF_AD_PROTOCOL', 'SKF_AD_PKTTYPE', 'SKF_AD_IFINDEX', 'SKF_NET_OFF', 'SKF_LL_OFF'; |
6
|
5
|
|
|
5
|
|
28
|
use constant SO_ATTACH_FILTER => 26; |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
399
|
|
7
|
5
|
|
|
5
|
|
26
|
use constant SO_DETACH_FILTER => 27; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
688
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub pack_sock_filter |
10
|
|
|
|
|
|
|
{ |
11
|
30
|
50
|
|
30
|
1
|
468
|
@_ == 4 or croak "usage: pack_sock_filter(code, jt, jf, k)"; |
12
|
30
|
|
|
|
|
66
|
my @v = @_; |
13
|
30
|
|
|
|
|
622
|
pack "S C C L ", @v; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub unpack_sock_filter |
17
|
|
|
|
|
|
|
{ |
18
|
24
|
50
|
|
24
|
1
|
2177
|
length $_[0] == 8 or croak "unpack_sock_filter: expected 8 bytes, got " . length $_[0]; |
19
|
24
|
|
|
|
|
93
|
my @v = unpack "S C C L ", $_[0]; |
20
|
24
|
|
|
|
|
124
|
@v; |
21
|
|
|
|
|
|
|
} |
22
|
5
|
|
|
5
|
|
27
|
use constant BPF_LD => 0; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
228
|
|
23
|
5
|
|
|
5
|
|
24
|
use constant BPF_LDX => 1; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
190
|
|
24
|
5
|
|
|
5
|
|
24
|
use constant BPF_ST => 2; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
182
|
|
25
|
5
|
|
|
5
|
|
22
|
use constant BPF_STX => 3; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
209
|
|
26
|
5
|
|
|
5
|
|
22
|
use constant BPF_ALU => 4; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
185
|
|
27
|
5
|
|
|
5
|
|
24
|
use constant BPF_JMP => 5; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
185
|
|
28
|
5
|
|
|
5
|
|
23
|
use constant BPF_RET => 6; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
178
|
|
29
|
5
|
|
|
5
|
|
21
|
use constant BPF_MISC => 7; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
167
|
|
30
|
5
|
|
|
5
|
|
22
|
use constant BPF_W => 0; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
173
|
|
31
|
5
|
|
|
5
|
|
22
|
use constant BPF_H => 8; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
234
|
|
32
|
5
|
|
|
5
|
|
24
|
use constant BPF_B => 16; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
171
|
|
33
|
5
|
|
|
5
|
|
23
|
use constant BPF_IMM => 0; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
180
|
|
34
|
5
|
|
|
5
|
|
23
|
use constant BPF_ABS => 32; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
178
|
|
35
|
5
|
|
|
5
|
|
22
|
use constant BPF_IND => 64; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
224
|
|
36
|
5
|
|
|
5
|
|
23
|
use constant BPF_MEM => 96; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
177
|
|
37
|
5
|
|
|
5
|
|
43
|
use constant BPF_LEN => 128; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
207
|
|
38
|
5
|
|
|
5
|
|
24
|
use constant BPF_MSH => 160; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
181
|
|
39
|
5
|
|
|
5
|
|
32
|
use constant BPF_ADD => 0; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
174
|
|
40
|
5
|
|
|
5
|
|
24
|
use constant BPF_SUB => 16; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
198
|
|
41
|
5
|
|
|
5
|
|
23
|
use constant BPF_MUL => 32; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
220
|
|
42
|
5
|
|
|
5
|
|
23
|
use constant BPF_DIV => 48; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
188
|
|
43
|
5
|
|
|
5
|
|
55
|
use constant BPF_OR => 64; |
|
5
|
|
|
|
|
17
|
|
|
5
|
|
|
|
|
181
|
|
44
|
5
|
|
|
5
|
|
74
|
use constant BPF_AND => 80; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
174
|
|
45
|
5
|
|
|
5
|
|
21
|
use constant BPF_LSH => 96; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
186
|
|
46
|
5
|
|
|
5
|
|
20
|
use constant BPF_RSH => 112; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
177
|
|
47
|
5
|
|
|
5
|
|
22
|
use constant BPF_NEG => 128; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
187
|
|
48
|
5
|
|
|
5
|
|
23
|
use constant BPF_JA => 0; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
172
|
|
49
|
5
|
|
|
5
|
|
23
|
use constant BPF_JEQ => 16; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
3661
|
|
50
|
5
|
|
|
5
|
|
199
|
use constant BPF_JGT => 32; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
1617
|
|
51
|
5
|
|
|
5
|
|
24
|
use constant BPF_JGE => 48; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
949
|
|
52
|
5
|
|
|
5
|
|
22
|
use constant BPF_JSET => 64; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
210
|
|
53
|
5
|
|
|
5
|
|
25
|
use constant BPF_K => 0; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
187
|
|
54
|
5
|
|
|
5
|
|
20
|
use constant BPF_X => 8; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
180
|
|
55
|
5
|
|
|
5
|
|
22
|
use constant BPF_A => 16; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
208
|
|
56
|
5
|
|
|
5
|
|
22
|
use constant BPF_TAX => 0; |
|
5
|
|
|
|
|
24
|
|
|
5
|
|
|
|
|
178
|
|
57
|
5
|
|
|
5
|
|
22
|
use constant BPF_TXA => 128; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
207
|
|
58
|
5
|
|
|
5
|
|
23
|
use constant SKF_AD_OFF => -4096; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
199
|
|
59
|
5
|
|
|
5
|
|
28
|
use constant SKF_AD_PROTOCOL => 0; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
209
|
|
60
|
5
|
|
|
5
|
|
24
|
use constant SKF_AD_PKTTYPE => 4; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
198
|
|
61
|
5
|
|
|
5
|
|
23
|
use constant SKF_AD_IFINDEX => 8; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
184
|
|
62
|
5
|
|
|
5
|
|
24
|
use constant SKF_NET_OFF => -1048576; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
225
|
|
63
|
5
|
|
|
5
|
|
22
|
use constant SKF_LL_OFF => -2097152; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
273
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |