-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopt.h
115 lines (95 loc) · 4.99 KB
/
opt.h
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
//
// Created by Administrator on 2023-10-05.
//
#ifndef QUIET_PRACTICE_OPT_H
#define QUIET_PRACTICE_OPT_H
/***********************************************************************************************************************
* General settings
**********************************************************************************************************************/
#define QUIET_PROFILE_PATH "quiet-profiles.json"
#define QUIET_PROFILE "cable-64k"
// if you want to test the proxy on local, set LOCAL_TEST.
/***********************************************************************************************************************
* Constants: DO NOT CHANGE
**********************************************************************************************************************/
#define INTERFACE_NATIVE 1
#define INTERFACE_LWIP 2
/***********************************************************************************************************************
* Proxy server settings
**********************************************************************************************************************/
// If you set LOCAL_TEST,
// it will use native socket.
#ifdef LOCAL_TEST
#define PROXY_SERVER_LISTENING_INTERFACE INTERFACE_NATIVE
#define PROXY_SERVER_LISTENING_INTERFACE_STR "INTERFACE_NATIVE"
#else
#define PROXY_SERVER_LISTENING_INTERFACE INTERFACE_LWIP
#define PROXY_SERVER_LISTENING_INTERFACE_STR "INTERFACE_LWIP"
#endif
// When you use INTERFACE_NATIVE,
// you use the following settings.
#define PROXY_SERVER_NATIVE_LISTENING_ADDRESS "127.0.0.1"
#define PROXY_SERVER_NATIVE_LISTENING_PORT 1080
// When you use INTERFACE_LWIP,
// you use the following settings.
#define PROXY_SERVER_LWIP_LISTENING_ADDRESS "192.168.0.8"
#define PROXY_SERVER_LWIP_LISTENING_PORT 1080
// This is a setting for the lwip interface.
// When you use INTERFACE_LWIP,
// you use the following settings.
#define PROXY_SERVER_LWIP_ADDRESS_U32 0xc0a80008 // 192.168.0.8
#define PROXY_SERVER_LWIP_NETMASK_U32 0xffffff00 // 255.255.255.0
#define PROXY_SERVER_LWIP_GATEWAY_U32 0xc0a80001 // 192.168.0.1
#define PROXY_SERVER_LWIP_MAC (uint8_t[]){0x01, 0x02, 0x03, 0x04, 0x05, 0x06}
// These values are automatically set
// according to the above settings.
#if PROXY_SERVER_LISTENING_INTERFACE == INTERFACE_NATIVE
#define PROXY_SERVER_LISTENING_ADDRESS PROXY_SERVER_NATIVE_LISTENING_ADDRESS
#define PROXY_SERVER_LISTENING_PORT PROXY_SERVER_NATIVE_LISTENING_PORT
#elif PROXY_SERVER_LISTENING_INTERFACE == INTERFACE_LWIP
#define PROXY_SERVER_LISTENING_ADDRESS PROXY_SERVER_LWIP_LISTENING_ADDRESS
#define PROXY_SERVER_LISTENING_PORT PROXY_SERVER_LWIP_LISTENING_PORT
#else
#error "PROXY_SERVER_LISTENING_INTERFACE must be INTERFACE_NATIVE or INTERFACE_LWIP"
#endif
/***********************************************************************************************************************
* Proxy client settings
**********************************************************************************************************************/
// If you set LOCAL_TEST,
// it will use native socket.
#ifdef LOCAL_TEST
#define PROXY_CLIENT_REMOTE_INTERFACE INTERFACE_NATIVE
#define PROXY_CLIENT_REMOTE_INTERFACE_STR "INTERFACE_NATIVE"
#else
#define PROXY_CLIENT_REMOTE_INTERFACE INTERFACE_LWIP
#define PROXY_CLIENT_REMOTE_INTERFACE_STR "INTERFACE_LWIP"
#endif
// Listening side settings.
#define PROXY_CLIENT_LISTENING_ADDRESS "127.0.0.1"
#define PROXY_CLIENT_LISTENING_PORT 2160
// When you use INTERFACE_NATIVE,
// you use the following settings.
#define PROXY_CLIENT_NATIVE_REMOTE_ADDRESS PROXY_SERVER_NATIVE_LISTENING_ADDRESS
#define PROXY_CLIENT_NATIVE_REMOTE_PORT PROXY_SERVER_NATIVE_LISTENING_PORT
// When you use INTERFACE_LWIP,
// you use the following settings.
#define PROXY_CLIENT_LWIP_REMOTE_ADDRESS PROXY_SERVER_LWIP_LISTENING_ADDRESS
#define PROXY_CLIENT_LWIP_REMOTE_PORT PROXY_SERVER_LWIP_LISTENING_PORT
// This is a setting for the lwip interface.
// When you use INTERFACE_LWIP,
// you use the following settings.
#define PROXY_CLIENT_LWIP_ADDRESS_U32 0xc0a80002; // 192.168.0.2
#define PROXY_CLIENT_LWIP_NETMASK_U32 0xffffff00; // 255.255.255.0
#define PROXY_CLIENT_LWIP_GATEWAY_U32 0xc0a80001; // 192.168.0.1
#define PROXY_CLIENT_LWIP_MAC (uint8_t[]){0x01, 0x02, 0x03, 0x04, 0x05, 0x07}
// These values are automatically set according to the above settings.
#if PROXY_CLIENT_REMOTE_INTERFACE == INTERFACE_NATIVE
#define PROXY_CLIENT_REMOTE_ADDRESS PROXY_CLIENT_NATIVE_REMOTE_ADDRESS
#define PROXY_CLIENT_REMOTE_PORT PROXY_CLIENT_NATIVE_REMOTE_PORT
#elif PROXY_CLIENT_REMOTE_INTERFACE == INTERFACE_LWIP
#define PROXY_CLIENT_REMOTE_ADDRESS PROXY_CLIENT_LWIP_REMOTE_ADDRESS
#define PROXY_CLIENT_REMOTE_PORT PROXY_CLIENT_LWIP_REMOTE_PORT
#else
#error "PROXY_CLIENT_REQUESTING_INTERFACE must be INTERFACE_NATIVE or INTERFACE_LWIP"
#endif
#endif //QUIET_PRACTICE_OPT_H