update dio to dio: ^5.5.0+1
update dio to dio: ^5.5.0+1
This commit is contained in:
Vendored
BIN
Binary file not shown.
@@ -9,7 +9,7 @@
|
||||
/* Begin PBXBuildFile section */
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
2FD21F1125A363E300F556E0 /* PacketTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FD21F1025A363E300F556E0 /* PacketTunnelProvider.swift */; };
|
||||
2FD21F1625A363E300F556E0 /* PacketTunnel.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 2FD21F0D25A363E300F556E0 /* PacketTunnel.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
2FD21F1625A363E300F556E0 /* PacketTunnel.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 2FD21F0D25A363E300F556E0 /* PacketTunnel.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
2FD21F2425A364B700F556E0 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2FD21EF825A363AA00F556E0 /* NetworkExtension.framework */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
3E06F985293FACBB00E04D92 /* PacketTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FD21F1025A363E300F556E0 /* PacketTunnelProvider.swift */; };
|
||||
@@ -34,8 +34,10 @@
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
C09C70752C3E5685000F6E01 /* leaf.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0CB10F52C3275EE00A1F217 /* leaf.xcframework */; };
|
||||
C09C70762C3E5685000F6E01 /* leaf.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C0CB10F52C3275EE00A1F217 /* leaf.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
C09CB0812C50A09A0028C461 /* TESWT.m in Sources */ = {isa = PBXBuildFile; fileRef = C09CB0802C50A09A0028C461 /* TESWT.m */; };
|
||||
C0CB10F62C3275EE00A1F217 /* leaf.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0CB10F52C3275EE00A1F217 /* leaf.xcframework */; };
|
||||
DBC6F25A26C78B1D91884CE1 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A9C0075B77637136AF52D8B /* Pods_Runner.framework */; };
|
||||
E2B5FEC68AAAE043A3080A59 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A9C0075B77637136AF52D8B /* Pods_Runner.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -49,15 +51,15 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
2FD21F0625A363AA00F556E0 /* Embed App Extensions */ = {
|
||||
2FD21F0625A363AA00F556E0 /* Embed Foundation Extensions */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 12;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 13;
|
||||
files = (
|
||||
2FD21F1625A363E300F556E0 /* PacketTunnel.appex in Embed App Extensions */,
|
||||
2FD21F1625A363E300F556E0 /* PacketTunnel.appex in Embed Foundation Extensions */,
|
||||
);
|
||||
name = "Embed App Extensions";
|
||||
name = "Embed Foundation Extensions";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
||||
@@ -122,7 +124,9 @@
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
C00A39D82C3E5F9D004E31E4 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
C09CB07F2C50A09A0028C461 /* TESWT.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TESWT.h; sourceTree = "<group>"; };
|
||||
C09CB0802C50A09A0028C461 /* TESWT.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TESWT.m; sourceTree = "<group>"; };
|
||||
C09CB0832C50A0DD0028C461 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
C0CB10F52C3275EE00A1F217 /* leaf.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = leaf.xcframework; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
@@ -143,6 +147,7 @@
|
||||
C0CB10F62C3275EE00A1F217 /* leaf.xcframework in Frameworks */,
|
||||
2FD21F2425A364B700F556E0 /* NetworkExtension.framework in Frameworks */,
|
||||
DBC6F25A26C78B1D91884CE1 /* Pods_Runner.framework in Frameworks */,
|
||||
E2B5FEC68AAAE043A3080A59 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -235,7 +240,9 @@
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
|
||||
C00A39D82C3E5F9D004E31E4 /* Runner-Bridging-Header.h */,
|
||||
C09CB0832C50A0DD0028C461 /* Runner-Bridging-Header.h */,
|
||||
C09CB07F2C50A09A0028C461 /* TESWT.h */,
|
||||
C09CB0802C50A09A0028C461 /* TESWT.m */,
|
||||
);
|
||||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
@@ -277,7 +284,7 @@
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
4A4528B4E4B302F57B5EDB65 /* [CP] Check Pods Manifest.lock */,
|
||||
2FD21F0625A363AA00F556E0 /* Embed App Extensions */,
|
||||
2FD21F0625A363AA00F556E0 /* Embed Foundation Extensions */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
@@ -302,6 +309,7 @@
|
||||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastSwiftUpdateCheck = 1230;
|
||||
LastUpgradeCheck = 1510;
|
||||
ORGANIZATIONNAME = "";
|
||||
@@ -454,6 +462,7 @@
|
||||
3EA6B280293F6AB900B2BABC /* URL+Helpers.swift in Sources */,
|
||||
3EA6B27F293F6AB500B2BABC /* FileManager+Helpers.swift in Sources */,
|
||||
3EA6B27C293F68B500B2BABC /* VPNManager.swift in Sources */,
|
||||
C09CB0812C50A09A0028C461 /* TESWT.m in Sources */,
|
||||
3E06F989293FAFC600E04D92 /* LeafAdapter.swift in Sources */,
|
||||
3E06F985293FACBB00E04D92 /* PacketTunnelProvider.swift in Sources */,
|
||||
3E06F98C293FB8F600E04D92 /* TunnelConfiguration.swift in Sources */,
|
||||
@@ -514,6 +523,7 @@
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
@@ -525,6 +535,7 @@
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
@@ -582,7 +593,6 @@
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
|
||||
SWIFT_INCLUDE_PATHS = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
@@ -735,6 +745,7 @@
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
@@ -746,6 +757,7 @@
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
@@ -793,6 +805,7 @@
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
@@ -804,6 +817,7 @@
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
@@ -863,7 +877,6 @@
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
|
||||
SWIFT_INCLUDE_PATHS = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
@@ -909,7 +922,6 @@
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
|
||||
SWIFT_INCLUDE_PATHS = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = 1;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,12 +1 @@
|
||||
//
|
||||
// Runner-Bridging-Header.h
|
||||
// Runner
|
||||
//
|
||||
// Created by Zeus on 2024/7/10.
|
||||
//
|
||||
|
||||
#ifndef Runner_Bridging_Header_h
|
||||
#define Runner_Bridging_Header_h
|
||||
|
||||
#import "GeneratedPluginRegistrant.h"
|
||||
#endif /* Runner_Bridging_Header_h */
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// TESWT.h
|
||||
// Runner
|
||||
//
|
||||
// Created by Zeus on 2024/7/24.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TESWT : NSObject
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// TESWT.m
|
||||
// Runner
|
||||
//
|
||||
// Created by Zeus on 2024/7/24.
|
||||
//
|
||||
|
||||
#import "TESWT.h"
|
||||
|
||||
@implementation TESWT
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,119 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* No error.
|
||||
*/
|
||||
#define ERR_OK 0
|
||||
|
||||
/**
|
||||
* Config path error.
|
||||
*/
|
||||
#define ERR_CONFIG_PATH 1
|
||||
|
||||
/**
|
||||
* Config parsing error.
|
||||
*/
|
||||
#define ERR_CONFIG 2
|
||||
|
||||
/**
|
||||
* IO error.
|
||||
*/
|
||||
#define ERR_IO 3
|
||||
|
||||
/**
|
||||
* Config file watcher error.
|
||||
*/
|
||||
#define ERR_WATCHER 4
|
||||
|
||||
/**
|
||||
* Async channel send error.
|
||||
*/
|
||||
#define ERR_ASYNC_CHANNEL_SEND 5
|
||||
|
||||
/**
|
||||
* Sync channel receive error.
|
||||
*/
|
||||
#define ERR_SYNC_CHANNEL_RECV 6
|
||||
|
||||
/**
|
||||
* Runtime manager error.
|
||||
*/
|
||||
#define ERR_RUNTIME_MANAGER 7
|
||||
|
||||
/**
|
||||
* No associated config file.
|
||||
*/
|
||||
#define ERR_NO_CONFIG_FILE 8
|
||||
|
||||
/**
|
||||
* Starts leaf with options, on a successful start this function blocks the current
|
||||
* thread.
|
||||
*
|
||||
* @note This is not a stable API, parameters will change from time to time.
|
||||
*
|
||||
* @param rt_id A unique ID to associate this leaf instance, this is required when
|
||||
* calling subsequent FFI functions, e.g. reload, shutdown.
|
||||
* @param config_path The path of the config file, must be a file with suffix .conf
|
||||
* or .json, according to the enabled features.
|
||||
* @param auto_reload Enabls auto reloading when config file changes are detected,
|
||||
* takes effect only when the "auto-reload" feature is enabled.
|
||||
* @param multi_thread Whether to use a multi-threaded runtime.
|
||||
* @param auto_threads Sets the number of runtime worker threads automatically,
|
||||
* takes effect only when multi_thread is true.
|
||||
* @param threads Sets the number of runtime worker threads, takes effect when
|
||||
* multi_thread is true, but can be overridden by auto_threads.
|
||||
* @param stack_size Sets stack size of the runtime worker threads, takes effect when
|
||||
* multi_thread is true.
|
||||
* @return ERR_OK on finish running, any other errors means a startup failure.
|
||||
*/
|
||||
int32_t leaf_run_with_options(uint16_t rt_id,
|
||||
const char *config_path,
|
||||
bool auto_reload,
|
||||
bool multi_thread,
|
||||
bool auto_threads,
|
||||
int32_t threads,
|
||||
int32_t stack_size);
|
||||
|
||||
/**
|
||||
* Starts leaf with a single-threaded runtime, on a successful start this function
|
||||
* blocks the current thread.
|
||||
*
|
||||
* @param rt_id A unique ID to associate this leaf instance, this is required when
|
||||
* calling subsequent FFI functions, e.g. reload, shutdown.
|
||||
* @param config_path The path of the config file, must be a file with suffix .conf
|
||||
* or .json, according to the enabled features.
|
||||
* @return ERR_OK on finish running, any other errors means a startup failure.
|
||||
*/
|
||||
int32_t leaf_run(uint16_t rt_id, const char *config_path);
|
||||
|
||||
int32_t leaf_run_with_config_string(uint16_t rt_id, const char *config);
|
||||
|
||||
/**
|
||||
* Reloads DNS servers, outbounds and routing rules from the config file.
|
||||
*
|
||||
* @param rt_id The ID of the leaf instance to reload.
|
||||
*
|
||||
* @return Returns ERR_OK on success.
|
||||
*/
|
||||
int32_t leaf_reload(uint16_t rt_id);
|
||||
|
||||
/**
|
||||
* Shuts down leaf.
|
||||
*
|
||||
* @param rt_id The ID of the leaf instance to reload.
|
||||
*
|
||||
* @return Returns true on success, false otherwise.
|
||||
*/
|
||||
bool leaf_shutdown(uint16_t rt_id);
|
||||
|
||||
/**
|
||||
* Tests the configuration.
|
||||
*
|
||||
* @param config_path The path of the config file, must be a file with suffix .conf
|
||||
* or .json, according to the enabled features.
|
||||
* @return Returns ERR_OK on success, i.e no syntax error.
|
||||
*/
|
||||
int32_t leaf_test_config(const char *config_path);
|
||||
@@ -0,0 +1,4 @@
|
||||
module leaf {
|
||||
header "leaf.h"
|
||||
export *
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b096d095e15e182038fc425ded251522c6a8baa2eb2668d4636df54f5c9915e1
|
||||
size 244040104
|
||||
@@ -0,0 +1,119 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* No error.
|
||||
*/
|
||||
#define ERR_OK 0
|
||||
|
||||
/**
|
||||
* Config path error.
|
||||
*/
|
||||
#define ERR_CONFIG_PATH 1
|
||||
|
||||
/**
|
||||
* Config parsing error.
|
||||
*/
|
||||
#define ERR_CONFIG 2
|
||||
|
||||
/**
|
||||
* IO error.
|
||||
*/
|
||||
#define ERR_IO 3
|
||||
|
||||
/**
|
||||
* Config file watcher error.
|
||||
*/
|
||||
#define ERR_WATCHER 4
|
||||
|
||||
/**
|
||||
* Async channel send error.
|
||||
*/
|
||||
#define ERR_ASYNC_CHANNEL_SEND 5
|
||||
|
||||
/**
|
||||
* Sync channel receive error.
|
||||
*/
|
||||
#define ERR_SYNC_CHANNEL_RECV 6
|
||||
|
||||
/**
|
||||
* Runtime manager error.
|
||||
*/
|
||||
#define ERR_RUNTIME_MANAGER 7
|
||||
|
||||
/**
|
||||
* No associated config file.
|
||||
*/
|
||||
#define ERR_NO_CONFIG_FILE 8
|
||||
|
||||
/**
|
||||
* Starts leaf with options, on a successful start this function blocks the current
|
||||
* thread.
|
||||
*
|
||||
* @note This is not a stable API, parameters will change from time to time.
|
||||
*
|
||||
* @param rt_id A unique ID to associate this leaf instance, this is required when
|
||||
* calling subsequent FFI functions, e.g. reload, shutdown.
|
||||
* @param config_path The path of the config file, must be a file with suffix .conf
|
||||
* or .json, according to the enabled features.
|
||||
* @param auto_reload Enabls auto reloading when config file changes are detected,
|
||||
* takes effect only when the "auto-reload" feature is enabled.
|
||||
* @param multi_thread Whether to use a multi-threaded runtime.
|
||||
* @param auto_threads Sets the number of runtime worker threads automatically,
|
||||
* takes effect only when multi_thread is true.
|
||||
* @param threads Sets the number of runtime worker threads, takes effect when
|
||||
* multi_thread is true, but can be overridden by auto_threads.
|
||||
* @param stack_size Sets stack size of the runtime worker threads, takes effect when
|
||||
* multi_thread is true.
|
||||
* @return ERR_OK on finish running, any other errors means a startup failure.
|
||||
*/
|
||||
int32_t leaf_run_with_options(uint16_t rt_id,
|
||||
const char *config_path,
|
||||
bool auto_reload,
|
||||
bool multi_thread,
|
||||
bool auto_threads,
|
||||
int32_t threads,
|
||||
int32_t stack_size);
|
||||
|
||||
/**
|
||||
* Starts leaf with a single-threaded runtime, on a successful start this function
|
||||
* blocks the current thread.
|
||||
*
|
||||
* @param rt_id A unique ID to associate this leaf instance, this is required when
|
||||
* calling subsequent FFI functions, e.g. reload, shutdown.
|
||||
* @param config_path The path of the config file, must be a file with suffix .conf
|
||||
* or .json, according to the enabled features.
|
||||
* @return ERR_OK on finish running, any other errors means a startup failure.
|
||||
*/
|
||||
int32_t leaf_run(uint16_t rt_id, const char *config_path);
|
||||
|
||||
int32_t leaf_run_with_config_string(uint16_t rt_id, const char *config);
|
||||
|
||||
/**
|
||||
* Reloads DNS servers, outbounds and routing rules from the config file.
|
||||
*
|
||||
* @param rt_id The ID of the leaf instance to reload.
|
||||
*
|
||||
* @return Returns ERR_OK on success.
|
||||
*/
|
||||
int32_t leaf_reload(uint16_t rt_id);
|
||||
|
||||
/**
|
||||
* Shuts down leaf.
|
||||
*
|
||||
* @param rt_id The ID of the leaf instance to reload.
|
||||
*
|
||||
* @return Returns true on success, false otherwise.
|
||||
*/
|
||||
bool leaf_shutdown(uint16_t rt_id);
|
||||
|
||||
/**
|
||||
* Tests the configuration.
|
||||
*
|
||||
* @param config_path The path of the config file, must be a file with suffix .conf
|
||||
* or .json, according to the enabled features.
|
||||
* @return Returns ERR_OK on success, i.e no syntax error.
|
||||
*/
|
||||
int32_t leaf_test_config(const char *config_path);
|
||||
@@ -0,0 +1,4 @@
|
||||
module leaf {
|
||||
header "leaf.h"
|
||||
export *
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ac6fe5534179bc17f4c486b3964a06e99e6a4902247694137ff1ea534472ac36
|
||||
size 246092480
|
||||
Reference in New Issue
Block a user