-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrule.ts
More file actions
57 lines (52 loc) · 1.71 KB
/
rule.ts
File metadata and controls
57 lines (52 loc) · 1.71 KB
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
import type { listable, network, network_type, sniff_protocol } from './types.ts'
interface rule {
invert?: boolean
}
export interface base_default_rule extends rule {
type?: 'default'
network?: listable<network>
domain?: listable<string>
domain_suffix?: listable<string>
domain_keyword?: listable<string>
domain_regex?: listable<string>
source_ip_cidr?: listable<string>
ip_cidr?: listable<string>
source_port?: listable<number>
source_port_range?: listable<string>
port?: listable<number>
port_range?: listable<string>
process_name?: listable<string>
process_path?: listable<string>
process_path_regex?: listable<string>
package_name?: listable<string>
wifi_ssid?: listable<string>
wifi_bssid?: listable<string>
network_type?: listable<network_type>
network_is_expensive?: boolean
network_is_constrained?: boolean
interface_address?: Record<string, listable<string>>
network_interface_address?: Record<network_type, listable<string>>
default_interface_address?: listable<string>
}
export interface base_logical_rule extends rule {
type: 'logical'
mode: 'and' | 'or'
}
export interface default_rule_with_metadata<I extends string, RS extends string> extends base_default_rule {
inbound?: listable<I>
ip_version?: 4 | 6
auth_user?: listable<string>
protocol?: listable<sniff_protocol>
ip_is_private?: boolean
source_ip_is_private?: boolean
user?: listable<string>
user_id?: listable<number>
clash_mode?: string
rule_set?: listable<RS>
rule_set_ip_cidr_match_source?: boolean
}
export interface action_reject {
action: 'reject'
method?: 'default' | 'drop' | 'reply'
no_drop?: boolean
}