-
Notifications
You must be signed in to change notification settings - Fork 92
/
config.h
63 lines (49 loc) · 1.78 KB
/
config.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
// SPDX-License-Identifier: GPL-3.0-only
/*
* Copyright (c) 2023 Dengfeng Liu <[email protected]>
*/
#ifndef XFRPC_CONFIG_H
#define XFRPC_CONFIG_H
#include "client.h"
#include "common.h"
// Default port definitions
// Remote Desktop ports
#define DEFAULT_MSTSC_PORT 3389
// Proxy ports
#define DEFAULT_SOCKS5_PORT 1980
// Plugin service ports
#define XFRPC_PLUGIN_TELNETD_PORT 23
#define XFRPC_PLUGIN_HTTPD_PORT 8000
#define XFRPC_PLUGIN_HTTPD_REMOTE_PORT 8001
#define XFRPC_PLUGIN_INSTALOADER_PORT 10000
#define XFRPC_PLUGIN_INSTALOADER_REMOTE_PORT 10001
#define XFRPC_PLUGIN_YOUTUBEDL_PORT 20002
#define XFRPC_PLUGIN_YOUTUBEDL_REMOTE_PORT 20003
// FTP related definitions
#define FTP_RMT_CTL_PROXY_SUFFIX "_ftp_remote_ctl_proxy"
/**
* Common configuration structure for the client
*/
struct common_conf {
/* Server settings */
char *server_addr; /* default 127.0.0.1 */
int server_port; /* default 7000 */
char *auth_token;
/* Connection settings */
int heartbeat_interval; /* default 10 */
int heartbeat_timeout; /* default 30 */
int tcp_mux; /* default 0 */
/* Environment settings */
int is_router; /* indicates if running on router (OpenWrt/LEDE) */
};
/* Configuration management functions */
struct common_conf *get_common_config(void);
void free_common_config(void);
void load_config(const char *confile);
/* Proxy service management functions */
struct proxy_service *get_proxy_service(const char *proxy_name);
struct proxy_service *get_all_proxy_services(void);
int validate_proxy(struct proxy_service *ps);
/* FTP specific functions */
char *get_ftp_data_proxy_name(const char *ftp_proxy_name);
#endif //XFRPC_CONFIG_H