Bläddra i källkod

1.去掉瑞云的相关信息

huangxiaodong 2 månader sedan
förälder
incheckning
7c78f6adb6
68 ändrade filer med 864 tillägg och 8691 borttagningar
  1. 1 8
      创维盒子/Podfile.lock
  2. 0 1
      创维盒子/Pods/Headers/Private/RayProxy/RaylinkProxy.h
  3. 0 1
      创维盒子/Pods/Headers/Public/RayProxy/RayProxy-umbrella.h
  4. 0 1
      创维盒子/Pods/Headers/Public/RayProxy/RayProxy.modulemap
  5. 0 1
      创维盒子/Pods/Headers/Public/RayProxy/RaylinkProxy.h
  6. 1 8
      创维盒子/Pods/Manifest.lock
  7. 822 1061
      创维盒子/Pods/Pods.xcodeproj/project.pbxproj
  8. 0 58
      创维盒子/Pods/Pods.xcodeproj/xcuserdata/xdh.xcuserdatad/xcschemes/RayProxy.xcscheme
  9. 0 5
      创维盒子/Pods/Pods.xcodeproj/xcuserdata/xdh.xcuserdatad/xcschemes/xcschememanagement.plist
  10. 5 5
      创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器.debug.xcconfig
  11. 5 5
      创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器.release.xcconfig
  12. 5 5
      创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护.debug.xcconfig
  13. 5 5
      创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护.release.xcconfig
  14. 0 5
      创维盒子/Pods/Target Support Files/RayProxy/RayProxy-dummy.m
  15. 0 12
      创维盒子/Pods/Target Support Files/RayProxy/RayProxy-prefix.pch
  16. 0 17
      创维盒子/Pods/Target Support Files/RayProxy/RayProxy-umbrella.h
  17. 0 14
      创维盒子/Pods/Target Support Files/RayProxy/RayProxy.debug.xcconfig
  18. 0 6
      创维盒子/Pods/Target Support Files/RayProxy/RayProxy.modulemap
  19. 0 14
      创维盒子/Pods/Target Support Files/RayProxy/RayProxy.release.xcconfig
  20. 0 50
      创维盒子/RayProxy/Classes/RaylinkProxy.h
  21. 0 323
      创维盒子/RayProxy/Classes/RaylinkProxy.mm
  22. 0 43
      创维盒子/RayProxy/RayProxy.podspec
  23. 0 696
      创维盒子/RayProxy/include/Typhoon.h
  24. 0 275
      创维盒子/RayProxy/include/TyphoonDefine.h
  25. 0 681
      创维盒子/RayProxy/include/TyphoonMultiSocks.h
  26. 0 37
      创维盒子/RayProxy/include/TyphoonProduct.h
  27. 0 148
      创维盒子/RayProxy/include/TyphoonServer.h
  28. 0 169
      创维盒子/RayProxy/include/Typhoon_C.h
  29. 0 84
      创维盒子/RayProxy/include/YyAuthenticationManageFile.h
  30. 0 52
      创维盒子/RayProxy/include/net_detection.h
  31. 0 1782
      创维盒子/RayProxy/include/uv.h
  32. 0 32
      创维盒子/RayProxy/include/uv/aix.h
  33. 0 54
      创维盒子/RayProxy/include/uv/android-ifaddrs.h
  34. 0 34
      创维盒子/RayProxy/include/uv/bsd.h
  35. 0 61
      创维盒子/RayProxy/include/uv/darwin.h
  36. 0 448
      创维盒子/RayProxy/include/uv/errno.h
  37. 0 34
      创维盒子/RayProxy/include/uv/linux.h
  38. 0 33
      创维盒子/RayProxy/include/uv/os390.h
  39. 0 31
      创维盒子/RayProxy/include/uv/posix.h
  40. 0 247
      创维盒子/RayProxy/include/uv/stdint-msvc2008.h
  41. 0 44
      创维盒子/RayProxy/include/uv/sunos.h
  42. 0 37
      创维盒子/RayProxy/include/uv/threadpool.h
  43. 0 768
      创维盒子/RayProxy/include/uv/tree.h
  44. 0 505
      创维盒子/RayProxy/include/uv/unix.h
  45. 0 43
      创维盒子/RayProxy/include/uv/version.h
  46. 0 691
      创维盒子/RayProxy/include/uv/win.h
  47. BIN
      创维盒子/RayProxy/libAuthentication.a
  48. BIN
      创维盒子/RayProxy/libEncryptAuth.a
  49. BIN
      创维盒子/RayProxy/libRaySync-Multi-Proxy-Client-Plus.a
  50. BIN
      创维盒子/RayProxy/libRaySync-Multi-Proxy-Client.a
  51. BIN
      创维盒子/RayProxy/libRaySync-Proxy-Common-Lib.a
  52. BIN
      创维盒子/RayProxy/libRaySync-Proxy-Server-Lib.a
  53. BIN
      创维盒子/RayProxy/libRaySync.a
  54. BIN
      创维盒子/RayProxy/libRvCommon.a
  55. BIN
      创维盒子/RayProxy/libcommon.a
  56. BIN
      创维盒子/RayProxy/libcrypto.a
  57. BIN
      创维盒子/RayProxy/libcurl.a
  58. BIN
      创维盒子/RayProxy/libjsoncpp.a
  59. BIN
      创维盒子/RayProxy/libnet_detection.a
  60. BIN
      创维盒子/RayProxy/libnet_detection_client.a
  61. BIN
      创维盒子/RayProxy/libspdlog.a
  62. BIN
      创维盒子/RayProxy/libssl.a
  63. BIN
      创维盒子/RayProxy/libuv.a
  64. BIN
      创维盒子/RayProxy/libxxhash.a
  65. BIN
      创维盒子/RayProxy/libzerotier-one.a
  66. BIN
      创维盒子/RayProxy/libzipCompress.a
  67. BIN
      创维盒子/RayProxy/libzstd.a
  68. 20 57
      创维盒子/code/connectDeviceManager/connectDeviceManager.m

+ 1 - 8
创维盒子/Podfile.lock

@@ -42,7 +42,6 @@ PODS:
   - MJExtension (3.4.1)
   - MJRefresh (3.7.5)
   - PLeakSniffer (0.1.0)
-  - RayProxy (0.0.1)
   - SDCycleScrollView (1.82):
     - SDWebImage (>= 5.0.0)
   - SDWebImage (5.13.0):
@@ -65,7 +64,6 @@ DEPENDENCIES:
   - MJExtension
   - MJRefresh
   - PLeakSniffer
-  - RayProxy (from `./RayProxy`)
   - SDCycleScrollView (>= 1.82)
   - SSZipArchive
   - TZImagePickerController
@@ -91,10 +89,6 @@ SPEC REPOS:
     - TZImagePickerController
     - WechatOpenSDK
 
-EXTERNAL SOURCES:
-  RayProxy:
-    :path: "./RayProxy"
-
 SPEC CHECKSUMS:
   AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce
   Bugly: afe841bba2ea6de6d432a3c125240a5e75949c55
@@ -107,7 +101,6 @@ SPEC CHECKSUMS:
   MJExtension: 21c5f6f8c4d5d8844b7ae8fbae08fed0b501f961
   MJRefresh: fdf5e979eb406a0341468932d1dfc8b7f9fce961
   PLeakSniffer: f7eb13cd3a36150e0a2fd5fe8a33ca83bd2646d4
-  RayProxy: 026b86d1bb05ccdc3eb294b4ff00a8d8b64313dd
   SDCycleScrollView: a0d74c3384caa72bdfc81470bdbc8c14b3e1fbcf
   SDWebImage: 0327043dbb9533e75f2eff8445b3df0f2ceca6ac
   SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
@@ -115,6 +108,6 @@ SPEC CHECKSUMS:
   TZImagePickerController: 679ae9fa11e189a9a81291ae96f0a4463be8edc1
   WechatOpenSDK: 290989072e87b79d52225a01bb4e5e58f6f88593
 
-PODFILE CHECKSUM: a1843bb30a9982a43a933b0450c630012277a482
+PODFILE CHECKSUM: 80fe906b64b05b8e7839ebe1fa2713663645b246
 
 COCOAPODS: 1.11.3

+ 0 - 1
创维盒子/Pods/Headers/Private/RayProxy/RaylinkProxy.h

@@ -1 +0,0 @@
-../../../../RayProxy/Classes/RaylinkProxy.h

+ 0 - 1
创维盒子/Pods/Headers/Public/RayProxy/RayProxy-umbrella.h

@@ -1 +0,0 @@
-../../../Target Support Files/RayProxy/RayProxy-umbrella.h

+ 0 - 1
创维盒子/Pods/Headers/Public/RayProxy/RayProxy.modulemap

@@ -1 +0,0 @@
-../../../Target Support Files/RayProxy/RayProxy.modulemap

+ 0 - 1
创维盒子/Pods/Headers/Public/RayProxy/RaylinkProxy.h

@@ -1 +0,0 @@
-../../../../RayProxy/Classes/RaylinkProxy.h

+ 1 - 8
创维盒子/Pods/Manifest.lock

@@ -42,7 +42,6 @@ PODS:
   - MJExtension (3.4.1)
   - MJRefresh (3.7.5)
   - PLeakSniffer (0.1.0)
-  - RayProxy (0.0.1)
   - SDCycleScrollView (1.82):
     - SDWebImage (>= 5.0.0)
   - SDWebImage (5.13.0):
@@ -65,7 +64,6 @@ DEPENDENCIES:
   - MJExtension
   - MJRefresh
   - PLeakSniffer
-  - RayProxy (from `./RayProxy`)
   - SDCycleScrollView (>= 1.82)
   - SSZipArchive
   - TZImagePickerController
@@ -91,10 +89,6 @@ SPEC REPOS:
     - TZImagePickerController
     - WechatOpenSDK
 
-EXTERNAL SOURCES:
-  RayProxy:
-    :path: "./RayProxy"
-
 SPEC CHECKSUMS:
   AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce
   Bugly: afe841bba2ea6de6d432a3c125240a5e75949c55
@@ -107,7 +101,6 @@ SPEC CHECKSUMS:
   MJExtension: 21c5f6f8c4d5d8844b7ae8fbae08fed0b501f961
   MJRefresh: fdf5e979eb406a0341468932d1dfc8b7f9fce961
   PLeakSniffer: f7eb13cd3a36150e0a2fd5fe8a33ca83bd2646d4
-  RayProxy: 026b86d1bb05ccdc3eb294b4ff00a8d8b64313dd
   SDCycleScrollView: a0d74c3384caa72bdfc81470bdbc8c14b3e1fbcf
   SDWebImage: 0327043dbb9533e75f2eff8445b3df0f2ceca6ac
   SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
@@ -115,6 +108,6 @@ SPEC CHECKSUMS:
   TZImagePickerController: 679ae9fa11e189a9a81291ae96f0a4463be8edc1
   WechatOpenSDK: 290989072e87b79d52225a01bb4e5e58f6f88593
 
-PODFILE CHECKSUM: a1843bb30a9982a43a933b0450c630012277a482
+PODFILE CHECKSUM: 80fe906b64b05b8e7839ebe1fa2713663645b246
 
 COCOAPODS: 1.11.3

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 822 - 1061
创维盒子/Pods/Pods.xcodeproj/project.pbxproj


+ 0 - 58
创维盒子/Pods/Pods.xcodeproj/xcuserdata/xdh.xcuserdatad/xcschemes/RayProxy.xcscheme

@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Scheme
-   LastUpgradeVersion = "1240"
-   version = "1.3">
-   <BuildAction
-      parallelizeBuildables = "YES"
-      buildImplicitDependencies = "YES">
-      <BuildActionEntries>
-         <BuildActionEntry
-            buildForTesting = "YES"
-            buildForRunning = "YES"
-            buildForProfiling = "YES"
-            buildForArchiving = "YES"
-            buildForAnalyzing = "YES">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "6C49FD1F1E09696FFCE1F5CDEE4BBEF7"
-               BuildableName = "libRayProxy.a"
-               BlueprintName = "RayProxy"
-               ReferencedContainer = "container:Pods.xcodeproj">
-            </BuildableReference>
-         </BuildActionEntry>
-      </BuildActionEntries>
-   </BuildAction>
-   <TestAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      shouldUseLaunchSchemeArgsEnv = "YES">
-      <Testables>
-      </Testables>
-   </TestAction>
-   <LaunchAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      launchStyle = "0"
-      useCustomWorkingDirectory = "NO"
-      ignoresPersistentStateOnLaunch = "NO"
-      debugDocumentVersioning = "YES"
-      debugServiceExtension = "internal"
-      allowLocationSimulation = "YES">
-   </LaunchAction>
-   <ProfileAction
-      buildConfiguration = "Release"
-      shouldUseLaunchSchemeArgsEnv = "YES"
-      savedToolIdentifier = ""
-      useCustomWorkingDirectory = "NO"
-      debugDocumentVersioning = "YES">
-   </ProfileAction>
-   <AnalyzeAction
-      buildConfiguration = "Debug">
-   </AnalyzeAction>
-   <ArchiveAction
-      buildConfiguration = "Release"
-      revealArchiveInOrganizer = "YES">
-   </ArchiveAction>
-</Scheme>

+ 0 - 5
创维盒子/Pods/Pods.xcodeproj/xcuserdata/xdh.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -64,11 +64,6 @@
 			<key>isShown</key>
 			<false/>
 		</dict>
-		<key>RayProxy.xcscheme</key>
-		<dict>
-			<key>isShown</key>
-			<false/>
-		</dict>
 		<key>SDCycleScrollView.xcscheme</key>
 		<dict>
 			<key>isShown</key>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 5 - 5
创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器.debug.xcconfig


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 5 - 5
创维盒子/Pods/Target Support Files/Pods-计算器/Pods-计算器.release.xcconfig


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 5 - 5
创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护.debug.xcconfig


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 5 - 5
创维盒子/Pods/Target Support Files/Pods-隐私保护/Pods-隐私保护.release.xcconfig


+ 0 - 5
创维盒子/Pods/Target Support Files/RayProxy/RayProxy-dummy.m

@@ -1,5 +0,0 @@
-#import <Foundation/Foundation.h>
-@interface PodsDummy_RayProxy : NSObject
-@end
-@implementation PodsDummy_RayProxy
-@end

+ 0 - 12
创维盒子/Pods/Target Support Files/RayProxy/RayProxy-prefix.pch

@@ -1,12 +0,0 @@
-#ifdef __OBJC__
-#import <UIKit/UIKit.h>
-#else
-#ifndef FOUNDATION_EXPORT
-#if defined(__cplusplus)
-#define FOUNDATION_EXPORT extern "C"
-#else
-#define FOUNDATION_EXPORT extern
-#endif
-#endif
-#endif
-

+ 0 - 17
创维盒子/Pods/Target Support Files/RayProxy/RayProxy-umbrella.h

@@ -1,17 +0,0 @@
-#ifdef __OBJC__
-#import <UIKit/UIKit.h>
-#else
-#ifndef FOUNDATION_EXPORT
-#if defined(__cplusplus)
-#define FOUNDATION_EXPORT extern "C"
-#else
-#define FOUNDATION_EXPORT extern
-#endif
-#endif
-#endif
-
-#import "RaylinkProxy.h"
-
-FOUNDATION_EXPORT double RayProxyVersionNumber;
-FOUNDATION_EXPORT const unsigned char RayProxyVersionString[];
-

+ 0 - 14
创维盒子/Pods/Target Support Files/RayProxy/RayProxy.debug.xcconfig

@@ -1,14 +0,0 @@
-CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
-CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/RayProxy
-DEFINES_MODULE = YES
-EXCLUDED_ARCHS[sdk=iphonesimulator*] = i386
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/RayProxy" "${PODS_ROOT}/Headers/Public" ${PODS_ROOT}/../RayProxy/include/
-PODS_BUILD_DIR = ${BUILD_DIR}
-PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
-PODS_ROOT = ${SRCROOT}
-PODS_TARGET_SRCROOT = ${PODS_ROOT}/../RayProxy
-PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
-PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
-SKIP_INSTALL = YES
-USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

+ 0 - 6
创维盒子/Pods/Target Support Files/RayProxy/RayProxy.modulemap

@@ -1,6 +0,0 @@
-module RayProxy {
-  umbrella header "RayProxy-umbrella.h"
-
-  export *
-  module * { export * }
-}

+ 0 - 14
创维盒子/Pods/Target Support Files/RayProxy/RayProxy.release.xcconfig

@@ -1,14 +0,0 @@
-CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
-CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/RayProxy
-DEFINES_MODULE = YES
-EXCLUDED_ARCHS[sdk=iphonesimulator*] = i386
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/RayProxy" "${PODS_ROOT}/Headers/Public" ${PODS_ROOT}/../RayProxy/include/
-PODS_BUILD_DIR = ${BUILD_DIR}
-PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
-PODS_ROOT = ${SRCROOT}
-PODS_TARGET_SRCROOT = ${PODS_ROOT}/../RayProxy
-PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
-PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
-SKIP_INSTALL = YES
-USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

+ 0 - 50
创维盒子/RayProxy/Classes/RaylinkProxy.h

@@ -1,50 +0,0 @@
-//
-//  RaylinkProxy.h
-//  raylink_sdk_flutter
-//
-//  Created by Sim Tsai on 2022/12/14.
-//
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@protocol RaylinkProxyDelegate <NSObject>
-
-
-@optional
-- (void)sdnRouteChange:(NSString *)sdnId type:(int)type;
-
-- (void)onProxyConnected:(NSString *)sdnId status:(int)status;
-
-- (void)OnProxyDisconnected_cb:(NSString *)sdnId;
-
-@end
-
-typedef void(^RaylinkProxyConnectBlock)(int port);
-
-@interface RaylinkProxy : NSObject
-
-+ (instancetype)sharedManager;
-
-@property (nonatomic, weak) id<RaylinkProxyDelegate> delegate;
-
-- (void)initProxy:(NSString *)logPath rootSdnInfo:(NSData *)rootSdnInfo;
-
-- (BOOL)createNewConnection:(NSString *)sdnId;
-
-- (NSUInteger)createHttpService:(NSString *)sdnId;
-
-- (void)closeConnection:(NSString *)sdnId;
-
-- (void)closeHttpService:(NSString *)sdnId;
-
-- (BOOL)addSdnId:(NSString *)sdnId ip:(NSString *)ip allowPort:(NSUInteger)port;
-
-- (NSString *)getSdnId;
-
-- (BOOL)isSdnConnected;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 323
创维盒子/RayProxy/Classes/RaylinkProxy.mm

@@ -1,323 +0,0 @@
-//
-//  RaylinkProxy.m
-//  raylink_sdk_flutter
-//
-//  Created by Sim Tsai on 2022/12/14.
-//
-
-#import "RaylinkProxy.h"
-#import "TyphoonMultiSocks.h"
-#import "TyphoonServer.h"
-#include "net_detection.h"
-#include "string.h"
-
-
-@interface RayLinkConnectionInfo : NSObject
-
-@property (nonatomic, strong) NSValue *pHandle;
-
-@property (nonatomic, copy) NSString *sdnId;
-
-@end
-
-@implementation RayLinkConnectionInfo
-
-
-
-@end
-
-
-@implementation RaylinkProxy {
-    NSMutableDictionary<NSString*, RayLinkConnectionInfo *> *_connectInfos;
-    std::string _last_root_info;
-}
-
-+ (instancetype)sharedManager {
-    static RaylinkProxy *_sharedManager = nil;
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        _sharedManager = [RaylinkProxy new];
-    });
-
-    return _sharedManager;
-}
-
-
-- (void)initServer:(NSString * _Nonnull)logPath rootSdnInfo:(NSData * _Nonnull)rootSdnInfo {
-    struct InitServerPrama param = { 0 };
-    param.listenAddr = "127.0.0.1";
-    param.listenPort = 32004;
-    param.minSpeed = 5*1024/8;
-    param.maxSpeed = 200*1024/8;
-    param.logPath = (char *)[logPath cStringUsingEncoding:NSUTF8StringEncoding];
-    param.licensePath = (char *)[logPath cStringUsingEncoding:NSUTF8StringEncoding];
-    param.caPath = ".";
-    param.licenseType = TYPHOON_APP_ID_PROXYS;
-    param.license = "";
-    param.MaxSegmentSize = 1200;
-    param.bSdnOn = true;
-    param.rootsData = (void *)rootSdnInfo.bytes;
-    param.rootsDataLen = rootSdnInfo.length;
-    param.FecPercent = 1000;
-    param.bCompress = true;
-    stTyphoonServerProxyConnectionStatusCb cb1 = {OnTcpConnected, OnTcpDisConnected};
-    TyphoonServerProxy_SetConnectionStatusCb(cb1);
-    if (TyphoonProxy_InitServer(&param) == 0)
-    {
-        // 初始化成功后记录信息,下次使用相同信息初始化时(如websocket断线重连)不再重新初始化
-        NSLog(@"TyphoonProxy_InitServer ok");
-        _last_root_info = std::string((char *)rootSdnInfo.bytes, rootSdnInfo.length);
-    }
-}
-
-- (void)initProxy:(NSString *)logPath rootSdnInfo:(NSData *)rootSdnInfo {
-    
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        
-        _connectInfos = @{}.mutableCopy;
-        [self initServer:logPath rootSdnInfo:rootSdnInfo];;
-        
-        NSLog(@"TyphoonMultiProxy_InitClient rootSdnInfoSize %ld", rootSdnInfo.length);
-
-        int result = TyphoonMultiProxy_InitClient(0, 0, (char *)[logPath cStringUsingEncoding:NSUTF8StringEncoding], "", (void *)rootSdnInfo.bytes, rootSdnInfo.length);
-        
-        if (result == 0) {
-            NSLog(@"TyphoonMultiProxy_InitClient ok");
-        }
-        struct TyphoonMultiProxyConnectionStatusCb cb2;
-        cb2.pfnOnConnected = OnProxyConnected_cb;
-        cb2.pfnOnDisConnected = OnProxyDisconnected_cb;
-        cb2.pfnOnSDNRouteChange = OnSDNRouteChange;
-        TyphoonMultiProxy_SetConnectionStatusCb(cb2);
-        
-    });
-    
-    TyphoonMultiProxy_SetUserData((uint64_t)(__bridge void *)(self));
-    
-    if (!_last_root_info.empty()) {
-        if (_last_root_info.compare(std::string((char *)rootSdnInfo.bytes, rootSdnInfo.length)) != 0) {
-            if (TyphoonProxy_RestartSdnRoot((void *)rootSdnInfo.bytes, rootSdnInfo.length) == 0)
-            {
-                _last_root_info = std::string((char *)rootSdnInfo.bytes, rootSdnInfo.length);
-            }
-        }
-    }
-    
-}
-
-- (BOOL)isSdnConnected {
-    return TyphoonProxy_CheckSdnIsOnline() == 0;
-}
-
-
-- (BOOL)createNewConnection:(NSString *)sdnId {
-    
-    char ipBuff[64];
-    short sdnPort = 0;
-    TyphoonMultiProxy_SDNId2IpPort((char *)[sdnId cStringUsingEncoding:NSUTF8StringEncoding], ipBuff, &sdnPort);
-    HTyphoonHandle pHandle = TyphoonMultiProxy_CreateNewTyphoonConn(ipBuff, sdnPort, 1200, 0, 0, 1/*fec*/, true);
-    
-    if (!pHandle) {
-        return NO;
-    }
-    
-    RayLinkConnectionInfo *connectInfo = [[RayLinkConnectionInfo alloc] init];
-    
-    connectInfo.pHandle = [NSValue valueWithPointer:pHandle];
-    connectInfo.sdnId = sdnId;
-    
-    @synchronized (self) {
-        _connectInfos[sdnId] = connectInfo;
-    }
-  
-    
-    NSLog(@"TyphoonMultiProxy_CreateNewTyphoonConn ok");
-    
-    return YES;
-    
-}
-
-- (BOOL)addSdnId:(NSString *)sdnId ip:(NSString *)ip allowPort:(NSUInteger)port {
-    
-    RayLinkConnectionInfo *connectInfo = _connectInfos[sdnId];
-    
-    if (connectInfo) {
-        NSLog(@"TyphoonMultiProxy_AddHttpFirewallAllowAddress: %d", (int)port);
-        TyphoonMultiProxy_AddHttpFirewallAllowAddress(connectInfo.pHandle.pointerValue, (char *)[ip cStringUsingEncoding:NSUTF8StringEncoding], (int)port);
-        return YES;
-    }
-    
-    return NO;
-}
-
-- (NSString *)getSdnId {
-    
-    uint64_t nodeId = TyphoonProxy_GetNodeId();
-    char sdnBuf[64] = {0};
-    std::snprintf(sdnBuf, 64, "%llx", nodeId);
-    
-    return [NSString stringWithCString:sdnBuf encoding:NSUTF8StringEncoding];
-    
-}
-
-- (RayLinkConnectionInfo *)getConnectInfoByHandle:(HTyphoonHandle) pyHandle {
-    
-    @synchronized (self) {
-        for (RayLinkConnectionInfo *value in _connectInfos.allValues) {
-            RayLinkConnectionInfo *connectInfo = value;
-            
-            if (connectInfo.pHandle.pointerValue == pyHandle) {
-                return connectInfo;
-            }
-        }
-        
-    }
-
-    return NULL;
-}
-
-- (void)onProxyConnected:(NSString *)sdnId status:(int)status {
-    [self.delegate onProxyConnected:sdnId status:status];
-}
-
-
-void OnProxyConnected_cb(HTyphoonHandle pyHandle, int status) {
-    
-    RaylinkProxy* proxy = (__bridge RaylinkProxy *)(void *)TyphoonMultiProxy_GetUserData();
-    
-    RayLinkConnectionInfo *connectInfo = [proxy getConnectInfoByHandle:pyHandle];
-    
-    if (connectInfo != NULL) {
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            [proxy onProxyConnected:connectInfo.sdnId status:status];
-        });
-        
-    }
-    
-    if (status == 0) {
-        NSLog(@"pyHandle = 0x%x OnProxyConnected ok", pyHandle);
-        OnSDNRouteChange(pyHandle, 0);
-    } else {
-        NSLog(@"pyHandle = 0x%x OnProxyConnected %d", pyHandle, status);
-    }
-    
-}
-
-- (NSUInteger)createHttpService:(NSString *)sdnId {
-    RayLinkConnectionInfo *info = _connectInfos[sdnId];
-    if (info) {
-        
-        if (TyphoonMultiProxy_CheckHttpPartUsable((HTyphoonHandle)info.pHandle.pointerValue) == 1) {
-            return TyphoonMultiProxy_GetHttpPort((HTyphoonHandle)info.pHandle.pointerValue);
-        }
-        
-        int port = TyphoonMultiProxy_GetHttpPort((HTyphoonHandle)info.pHandle.pointerValue);
-        
-        if (port > 0) {
-            TyphoonMultiProxy_CloseHttpService((HTyphoonHandle)info.pHandle.pointerValue);
-        } else {
-            port = 0;
-        }
-        
-        port = TyphoonMultiProxy_CreateHttpService(info.pHandle.pointerValue, "127.0.0.1", 0, 0, 1, 1);
-        TyphoonMultiProxy_SetHttpServiceFecPercent(info.pHandle.pointerValue, 1000);
-        TyphoonMultiProxy_SetConnRecvSpeed(info.pHandle.pointerValue, 20*1024/8);
-        TyphoonMultiProxy_SetMaxSendSpeed(info.pHandle.pointerValue, 20*1024/8);
-        TyphoonMultiProxy_SetMinSendSpeed(info.pHandle.pointerValue, 5*1024/8);
-        
-        return port;
-    }
-    
-    return 0;
-}
-
-- (void)closeHttpService:(NSString *)sdnId {
-    
-    RayLinkConnectionInfo *info = _connectInfos[sdnId];
-    if (info) {
-        NSLog(@"closeHttpService");
-        TyphoonMultiProxy_CloseHttpService(info.pHandle.pointerValue);
-    }
-}
-
-- (void)closeConnection:(NSString *)sdnId {
-    RayLinkConnectionInfo *info = _connectInfos[sdnId];
-    if (info) {
-        NSLog(@"closeHttpService");
-        TyphoonMultiProxy_CloseConnect(info.pHandle.pointerValue);
-    }
-}
-
-
-
-void OnProxyDisconnected_cb(HTyphoonHandle pyHandle) {
-    
-    NSLog(@"pyHandle = 0x%x OnProxyDisconnected_cb", pyHandle);
-    
-    RaylinkProxy* proxy = (__bridge RaylinkProxy *)(void *)TyphoonMultiProxy_GetUserData();
-    
-    RayLinkConnectionInfo *info = [proxy getConnectInfoByHandle:pyHandle];
-    if (info) {
-        
-        if ([proxy.delegate respondsToSelector:@selector(OnProxyDisconnected_cb:)]) {
-            [proxy.delegate OnProxyDisconnected_cb:info.sdnId];
-        }
-    }
-}
-
-
-void OnSDNRouteChange(HTyphoonHandle pyHandle, int type) {
-    
-    RaylinkProxy* proxy = (__bridge RaylinkProxy *)(void *)TyphoonMultiProxy_GetUserData();
-    
-    RayLinkConnectionInfo *info = [proxy getConnectInfoByHandle:pyHandle];
-    if (info) {
-        
-        if ([proxy.delegate respondsToSelector:@selector(sdnRouteChange:type:)]) {
-            [proxy.delegate sdnRouteChange:info.sdnId type:type];
-        }
-    }
-    
-    NSLog(@"pyHandle = 0x%x OnSDNRouteChange = %d", pyHandle, type);
-    
-}
-
-void OnTcpConnected(void *pHandle, const char *userData, int userDataLen) {
-    NSLog(@"OnTcpConnected");
-}
-
-void OnTcpDisConnected(void *pHandle) {
-    
-    
-    NSLog(@"OnTcpDisConnected");
-}
-
-- (NSArray *)get_nat_type:(NSString *)stun_server port:(int)port {
-    
-    std::string natIpPort;
-    
-    NatBehavior natBehavior = ServiceNatDetection::get_nat_behavior(natIpPort, [stun_server cStringUsingEncoding:NSUTF8StringEncoding], port);
-    NatFiltering filterKind = ServiceNatDetection::get_nat_filtering(natIpPort, [stun_server cStringUsingEncoding:NSUTF8StringEncoding], port);
-    
-    NSString *natIp = [NSString stringWithCString:natIpPort.c_str() encoding:NSUTF8StringEncoding];
-    
-    int type = ServiceNatDetection::get_nat_type(natBehavior, filterKind);
-    
-    return @[@(type), natIp];
-    
-}
-
-- (int)get_nat_behavior:(NSString *)stun_server port:(int)port {
-    std::string natIpPort;
-    
-    NatBehavior natBehavior = ServiceNatDetection::get_nat_behavior(natIpPort, [stun_server cStringUsingEncoding:NSUTF8StringEncoding], port);
-    
-    return natBehavior;
-}
-
-
-
-@end

+ 0 - 43
创维盒子/RayProxy/RayProxy.podspec

@@ -1,43 +0,0 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint raylink_sdk_flutter.podspec` to validate before publishing.
-#
-Pod::Spec.new do |s|
-  s.name             = 'RayProxy'
-  s.version          = '0.0.1'
-  s.summary          = 'A new flutter plugin project.'
-  s.description      = <<-DESC
-A new flutter plugin project.
-                       DESC
-  s.homepage         = 'http://example.com'
-  s.license          = { :file => '../LICENSE' }
-  s.author           = { 'Your Company' => 'email@example.com' }
-  s.source           = { :path => '.' }
-  s.source_files = 'Classes/**/*'
-  s.platform = :ios, '11.0'
-  
-
-  s.vendored_libraries = [
-    '*.a' 
-  ]
-  
-  # $dir = File.dirname(__FILE__)
-  # s.xcconfig  = {
-  #   "HEADER_SEARCH_PATHS" => [
-  #   "#$dir/include/"
-  #   ]
-  # }
-
-  
-  s.xcconfig  = {
-    "HEADER_SEARCH_PATHS" => [
-    "${PODS_ROOT}/../RayProxy/include/"
-    ]
-  }
-  
-  s.libraries = 'c++', 'z'
-  s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
-  s.swift_version = '5.0'
-  s.static_framework = true
-    
-end

+ 0 - 696
创维盒子/RayProxy/include/Typhoon.h

@@ -1,696 +0,0 @@
-#ifndef __TYPHOON_H__
-#define __TYPHOON_H__
-
-#include <vector>
-#include "uv.h"
-#include "YyAuthenticationManageFile.h"
-#include "TyphoonDefine.h"
-
-#ifdef WIN32
-#ifdef _DLL_SAMPLE
-#define TYPHOON_API __declspec(dllexport)
-#else
-#define TYPHOON_API __declspec(dllimport)
-#endif
-#else
-#define TYPHOON_API
-#endif
-
-#ifndef SOCKADDR
-typedef struct sockaddr SOCKADDR;
-#endif
-
-
-typedef struct ControlPackets
-{
-    /* 控制指令, 包括notify/handshake/Ack */
-    int64_t m_NotifyCount;                          //Notify消息数量
-    int64_t m_NotifySize;                           //Notify消息大小
-    int64_t m_HandShakeCount;                       //心跳报文的数量
-    int64_t m_HandShakeSize;                        //心跳报文的大小
-    int64_t m_AckCount;                             //Ack报文的数量
-    int64_t m_AckSize;                              //Ack报文的大小
-    int64_t m_SackCount;                            //Sack报文的数量
-    int64_t m_SackSize;                             //Sack报文的大小
-    int64_t m_NatKeepAliveCount;                    //NAT保活报文数量
-    int64_t m_NatKeepAliveSize;                     //NAT保活报文大小
-    int64_t m_ForceSyncCount;						//Partial Reliable功能中的强制同步窗口命令数量
-    int64_t m_ForceSyncSize;						//Partial Reliable功能中的强制同步窗口命令大小
-}stControlPackets;
-
-
-
-
-struct ITyphoonInfo:public TyphoonConnStats         //1条连接的统计信息
-{    
-    int64_t m_CurrentSendSpeed;                      //当前的发送速度 字节/秒
-
-    std::vector<uint32_t>  m_resendStatistic;             //重发统计, [0]为重发1次的报文记录, [1]位重发2次的
-
-    stControlPackets m_RxStats;                     //控制报文接收统计
-    stControlPackets m_TxStats;                      //控制报文发送统计
-
-    /* 连接建立时间 */
-    time_t m_ConSetupTime;                           //连接建立时间
-
-	//连接上IsWritable返回false的次数
-	uint32_t m_UnWritableCount;
-
-	//连接上因为对端缓冲区满的次数
-	uint32_t m_PeerNoBufferCount;
-
-	//连接上因为Unack的报文太多的次数
-	uint32_t m_TooManyUackPackCount;
-
-	//连接上因为TickDataSize不够的次数
-	uint32_t m_NoTickDataSize;
-
-	//连接上因为TooFast属性被暂停发送的报文
-	uint32_t m_TooFastCount;
-};
-
-typedef TyphoonCfg ITyphoonCfg;
-
-//Single Typhoon Connection configuration
-class TYPHOON_API ITyphoonConnCfg
-{
-public:
-    uint32_t MaxQueueSize;                 //Max Size of Typhoon connection send and recv queue size    
-    uint32_t FixedSendSpeed;               //连接的固定发送速度, 默认为0表示不设置, 由typhoon自动探测发送速度; 
-                                           //如该值设置后, typhoon内部发送速度探测算法不再生效, 连接每秒发送速度的按照用户设置值进行
-    uint32_t MaxSendSpeed;                 //连接的最大发送速度, 默认为0表示不设置;
-                                           //如该选项进行了设置, 实时发送速度依然由typhoon内部算法决定, 但是连接最大的速度不能超过本设置值
-    uint32_t MinSendSpeed;                 //如该选项进行了设置, Typhoon的发送速度不低于该值
-    uint16_t MaxChannelSize;               //每条连接可以建立的channel数量
-    uint16_t MaxSegmentSize;               //Typhonn协议每个报文的最大值
-    uint32_t SendBuffSize;                 //连接发送缓存大小, 这个配置仅影响初始发送缓冲值, typhoon算法会自动计算发送缓存大小最优值, 以保证发送效率
-    uint32_t RecvBuffSize;                 //连接接收缓存大小
-    uint8_t  UseThreadForAppDataCb;        //配置当前连接是否使用额外的线程执行用户数据通知回调, 默认为0, 即回调函数不使用额外的线程处理
-                                           //取值范围[0, 1]
-    uint8_t  CompressMethod;               //连接支持的压缩方法, 可以设置为支持1种或多种方法, 通过enTyphoonCompressMethod的值 | 得到结果
-    uint8_t  TransferMode;                 //连接传输模式, 分为文件传输模式0, 实时传输模式1, 默认为0
-    uint8_t  UseDataPush;				   //当数据达到时, PushData的方式是调用OnRead回调, 非PushData(PullData)的方式是调用OnDataArrived回调
-    										//两种方式没有本质区别, 区别在于OnRead回调让用户必须立刻马上处理这个数据, 而OnDataArrived只是通知用户数据达到了, 用户可以选择马上处理或者不马上处理
-public:
-    ITyphoonConnCfg();
-};
-
-
-//typhoon utils
-
-//事件类, 用于线程间信息同步
-class TYPHOON_API IWaitEvent                
-{
-public:
-    /* 在当前事件上等待指定时间, 单位ms
-       如果在指定时间内被唤醒, 在唤醒时刻立刻返回; 
-       如果在指定时间内没有收到事件, 则在超时后返回 */
-    virtual int Wait(uint64_t ms) = 0;
-
-    /* 一直等待, 直到被Signal唤醒 */
-    virtual void Wait() = 0;
-
-    /* 触发事件 */
-    virtual void Signal() = 0;
-};
-
-
-
-
-
-
-class TYPHOON_API ITyphoonBuff
-{
-public:
-    //获取缓存报文头指针
-    virtual uint8_t* GetBuff(void) = 0;  
-
-    //获取缓存报文长度
-    virtual int32_t GetLen(void) = 0;     
-
-    //释放缓存实例
-    virtual void Destroy() = 0;             
-    virtual ~ITyphoonBuff(){}
-};
-
-class TYPHOON_API ITyPhoonChannel;
-class TYPHOON_API ITyPhoonConnCallBack;
-class TYPHOON_API ITyPhoonConn;
-class TYPHOON_API ITyphoon;
-
-//遍历同一条连接下的所有channel回调原型
-typedef void (*TyphonnConn_TraverseChannels_Cb)(ITyPhoonConn *pConn, ITyPhoonChannel *pChan, void* arg);
-
-//连接遍历回调
-typedef void (*Typhoon_TraverseConnections_Cb)(ITyphoon *pTyphoon, ITyPhoonConn *pConn, void* arg);
-
-
-//同步执行回调
-typedef int (*Typhoon_SynchronizedExecute_Cb)(void* arg);
-
-
-class TYPHOON_API ITyPhoonChannel 
-{
-public:
-    /* channel 是否可写 */
-    virtual bool IsWritable() = 0;
-
-    /* 发送数据接口
-        pData: 数据首地址指针
-        len: 数据长度
-        compresLevel: 压缩级别, 有效范围[0, 19], 0表示不压缩;
-                      [1, 19]是有效压缩级别, 越小压缩速度越快, 但是压缩效果较普通, 越大压缩效果越好, 但是耗时越长
-                      当使用压缩时, 建议pData的数据, len长度为128KB, 这个值仅仅是建议, 不是强制要求
-        lifeTime: 报文的生命周期, 单位为毫秒; 
-                  当lifeTime为0时, 表示不设置生命周期, 该报文确保会被发送到对端;
-                  当lifeTime不为0时, 在lifeTime时间内, Typhoon协议会尝试重发将报文发送到对端, 当超过lifeTime时间后,
-                  该报文被放弃发送   
-        maxSendCount: 报文最大发送次数
-                      当maxSendCount为0时, 表示不设置发送次数限制, 该报文会确保被发送到对端
-                      当maxSendCount不为0时, Typhoon协议最大尝试maxSendCount次重发, 每个RTT重发一次, 即尝试RTT*maxSendCount时间
-        fecPercent: FEC保护报文的比例, 该值在0-10000之间, 采用的是万分之fecPercent
-                    fecPercent为500代表万分之500, 即5%的冗余率. 
-        			fec报文的数量 = (len/mss + 1) * fecPercent/10000
-        			fec报文的大小 = mss
-        备注: 1) 本接口的内置智能压缩功能, 如果发送时通过compresLevel指定了压缩, 但是内部进行实际压缩计算时发现数据压缩后比压缩前还大
-              将自动放弃压缩的结果, 使用原始数据进行传输;
-              2) 压缩是针对每次Send的数据单独进行的, 同一个channel, 用户可以选择第一次Send进行压缩, 第二次Send不进行压缩;
-    */
-    virtual bool Send(uint8_t* pData,int32_t len, 
-    				uint8_t compresLevel=0, uint32_t lifeTime=0, uint8_t maxSendCount=0, uint16_t fecPercent=0) = 0; 
-
- 
-    virtual ITyphoonBuff *Recv() = 0; 
-
-
-    /* 关闭一个Channel */
-    virtual int32_t Close() = 0; 
-
-    /* 关闭本端channel的写 */
-    virtual int32_t Shutdown() = 0;   
-
-    //channel用户自定义数据, 可以是指针, 数据内容由用户层自行定义和解释, Typhoon内部只保存, 不理解处理该字段
-    virtual void SetUserData(uint64_t Data) = 0; 
-    virtual uint64_t GetUserData() = 0;    
-
-    //打开/关闭channel的可写检测回调开关, 当开关打开时, Typhoon会调用应用注册的OnSentDataAcknowledged
-    virtual void EnableWritableWatch() = 0;
-    virtual void DisableWritableWatch() = 0;
-    virtual uint8_t GetWritableWatch() = 0;
-
-    //获取channel下未确认的数据长度
-    //返回值
-    virtual int64_t GetUnackedDataLength() = 0;       
-
-
-    //获取channelID
-    //返回值:channelID
-    virtual uint16_t ChannelId() = 0;
-
-    //显示Channel当前信息, 调试使用
-    virtual void ShowChannel() = 0;
-
-    //channel是客户端打开的还是服务端打开的
-    virtual bool OpenByClient() = 0;
-
-    virtual bool OpenByServer() = 0;
-
-    virtual bool OpenByMyself() = 0;
-};
-
-
-
-class TYPHOON_API ITyPhoonFecTunnel 
-{
-public:
-
-
-    virtual bool Send(uint8_t* pData,int32_t len, uint8_t maxSendCount=0) = 0; 
-
- 
-    virtual ITyphoonBuff *Recv() = 0; 
-
-
-    /* 关闭一个FecTunnel */
-    virtual int32_t Close() = 0; 
-
-    //FecTunnel用户自定义数据, 可以是指针, 数据内容由用户层自行定义和解释, Typhoon内部只保存, 不理解处理该字段
-    virtual void SetUserData(uint64_t Data) = 0; 
-    virtual uint64_t GetUserData() = 0;    
-
-   
-    virtual uint16_t TunnelId() = 0;
-};
-
-
-
-
-class TYPHOON_API ITyPhoonConn 
-{
-public:
-    /* 客户端主动连接服务器
-       ip: 服务器ip地址
-       port: 服务器端口
-       sync: 函数是同步阻塞操作还是异步非阻塞操作
-             sync = false  异步非阻塞操作, ConnectTo马上返回, 实际的连接结果在OnConnected回调函数中获取
-             sync = true   同步阻塞操作 ConnectTo 一直阻塞等到连接完成返回;
-       data
-       data_len  Typhoon支持在建立连接过程中客户端向服务端发送数据, data为数据的首地址, data_len为数据长度
-    */
-    virtual int32_t ConnectTo(char *ip, uint16_t port, bool sync=false, 
-                        uint8_t *data=NULL, uint16_t data_len=0) = 0; 
-    virtual int32_t  ConnectToEx(char *ip, uint16_t port, char *bind_ip, uint16_t bind_port, 
-                                bool sync=false, uint8_t *data=NULL, uint16_t data_len=0) = 0; 
-
-    /* 关闭连接 */                        
-    virtual void Destroy() = 0;
-    
-    /* 连接是否建立 */
-    virtual bool IsConnected() = 0;                        
-
-    /* 打开一个新的Channel, 返回ITyPhoonChannel对象, 如果返回值为NULL, 则打开channel失败 */
-    virtual ITyPhoonChannel *OpenChannel() = 0;
-
-    /* 获取连接的对端地址 */
-    virtual SOCKADDR *GetRemoteAddr() = 0;                
-
-    /* Typhoon连接定时器设置 */
-    virtual void SetTimeout(stTyphoonTimerConfig *pCfg) = 0;
-    virtual stTyphoonTimerConfig GetTimeout() = 0;
-
-    /* 查询当前连接的实际打开的channel数量, 包括默认0 channel, 因此即使用户没有调用OpenChannel接口, 也存在1个channel */
-    virtual uint16_t QueryChannelCount() = 0;   
-
-    /* 获得当前连接的RTT信息, 单位: 毫秒 */
-    virtual uint32_t QueryRTT() = 0;
-
-    /* 获得当前连接的丢包率信息, 单位: 万分之X */
-    virtual uint32_t QueryDropRate(bool bLast10Sec=true) = 0;
-
-    virtual int32_t GetMaxAuthSendSpeed() = 0;
-
-    /* MaxSegmentSize, 单个Typhoon报文的最大长度, 与用户的网络MTU相关 
-       SetMaxSegmentSize 设置本端的Mss
-       GetMaxSegmentSize 获取设置的Mss大小
-       QueryMaxSegmentSize 获取实际的Mss大小, 实际的Mss值是客户端与服务端之间在建立连接过程中协商出来的
-                           可能小于设置值
-    */
-    virtual void SetMaxSegmentSize(uint16_t Mss) = 0;
-    virtual uint16_t GetMaxSegmentSize() = 0;
-    virtual uint16_t QueryMaxSegmentSize() = 0;       
-
-    //连接用户自定义数据, 可以是指针, 数据内容由用户层自行定义和解释, Typhoon内部只保存, 不理解处理该字段
-    virtual void SetUserData(uint64_t Data) = 0; 
-    virtual uint64_t GetUserData() = 0;
-   
-    //连接发送缓存大小, 所有的Channel共用发送缓存
-    virtual void SetSendBuffSize(uint32_t Size) = 0;      
-    virtual uint32_t GetSendBuffSize() = 0;                    
-
-    //接收缓存大小, 所有的Channel共用发送缓存
-    virtual void SetRecvBuffSize(uint32_t Size) = 0;
-    virtual uint32_t GetRecvBuffSize() = 0;                        
-
-    //连接回调, 每条连接可以设置不同的回调函数
-    virtual void SetConnCallback(ITyPhoonConnCallBack *) = 0; 
-    virtual ITyPhoonConnCallBack *GetConnCallback() = 0; 
-
-    /* 设置连接固定发送速度, 固定发送速度被设置为大于0后, Typhoon将按照设置的速度进行数据发送 
-       Size: 发送速度, 单位为bytes/sec
-    */
-    virtual void SetFixedSendSpeed(uint32_t Size) = 0;
-
-    /* 获取固定发送速度的设置值 */
-    virtual uint32_t GetFixedSendSpeed() = 0;  
-
-    /* 设置最大发送速度 , 设置连接的发送速度上限
-       Size: 最大发送速度, 单位为bytes/sec
-    */
-    virtual void SetMaxSendSpeed(uint32_t Size) = 0;
-
-    /* 获取最大发送速度 */
-    virtual uint32_t GetMaxSendSpeed() = 0;     
-
-
-    //设置最小发送速度
-    virtual void SetMinSendSpeed(uint32_t Size) = 0;
-    virtual uint32_t GetMinSendSpeed() = 0;  
-	virtual int64_t GetCurSendSpeed() = 0;  
-
-	virtual void SetCompress(uint8_t     CompressMethod) = 0;
-    virtual uint32_t GetCompress() = 0;
-
-	virtual void AuthChange() = 0;
-	virtual void setAuth(sTyphoonProxyLicense  *license) = 0;
-	
-    virtual void GetWanAddr(struct sockaddr *addr) = 0;
-    virtual void GetRemoteAddr(struct sockaddr *addr) = 0;
-
-    //遍历连接下所有存在的channel
-    virtual void TraverseChannels(TyphonnConn_TraverseChannels_Cb traverse_cb, void* arg) = 0;
-
-    //获取连接的默认通道, 即通道0
-    virtual ITyPhoonChannel *GetDefaultChannel() = 0;
-
-    //关闭当前连接下所有的channel
-    virtual void ShutdownAllChannels() = 0;
-
-    //根据ChannelId 获取Channel实例, 如果Cid找不到, 返回NULL
-    virtual ITyPhoonChannel *GetChannel(uint16_t Cid) = 0;
-
-    /* 获取对端RTT */
-    virtual uint32_t QueryPeerRtt() = 0;
-
-    /* 获取对端丢包率 */    
-    virtual uint32_t QueryPeerDropRate(bool bLast10Sec=true) = 0;
-
-    virtual ITyphoonInfo *GetStats() = 0;
-
-    /* 设置连接的传输模式 TransferMode 0代表文件传输模式, 1代表实时传输模式 */
-    virtual uint8_t SetTransferMode(uint8_t TransferMode) = 0;
-
-    /* 获取当前连接的传输模式 TransferMode 0代表文件传输模式, 1代表实时传输模式 */
-    virtual uint8_t GetTransferMode() = 0;  
-    /* 连接角色是客户端还是服务端 */
-    virtual bool IsClient() = 0;
-    virtual bool IsServer() = 0;
-
-	/* Typhoon协议内置丢包模拟器, 用于日常测试
-	   SetPacketLoss  设置丢包率, 为万分之Percent, 如果要设置5%的丢包, Percent需要设置为500
-	   GetPacketLoss  获得目前设置的丢包率, 丢包率为0代表未设置丢包
-	   IsPacketLossSet 是否设置了丢包率, 如果返回真, 则GetPacketLoss() > 0
-
-	   丢包模拟器使用伪随机算法进行处理, 
-	   对每个报文做随机丢包处理会消耗较多的CPU, 尤其在传输速度很高时, 如每秒需发送数万个报文
-	   因此本功能仅作为方便内部测试使用, 不要在真实传输场景中打开
-	*/
-	virtual uint16_t GetPacketLoss() = 0;
-	virtual void SetPacketLoss(uint16_t Percent) = 0;
-	virtual bool IsPacketLossSet() = 0;
-	
-	virtual ITyPhoonFecTunnel * OpenFecTunnel(uint16_t channelCount) = 0;
-    virtual void CloseFecTunnel(uint16_t tunnelId) = 0;
-
-    
-    virtual ~ITyPhoonConn(){}
-};
-
-
-
-
-
-
-
-
-
-class TYPHOON_API ITyPhoonConnCallBack
-{
-public:
-    /* 连接结果通知回调 
-       pConn: 连接指针
-       erro:  通知结果
-       data: (仅对连接的服务端有效)如果连接成功并且data不为空, 收到客户端在发起连接时发送的数据
-       data_len: data指针表示的数据长度
-    */
-    virtual void OnConnected(ITyPhoonConn* pConn, enTyphoonErr erro, uint8_t* data, uint16_t data_len) = 0;
-
-    /*
-        连接中断通知回调
-        pConn: 连接指针
-        cause: 中断原因
-    */    
-    virtual void OnDisconnected(ITyPhoonConn* pConn, enTyphoonDisconnectCause cause) = 0;
-
-    /*
-        PUSH模式下, Typhoon收到收据后主动通知应用回调
-        在非线程回调模式下, 应用层不能在OnRead回调中做阻塞操作
-        在线程回调模式下, 应用层可以在OnRead回调中做阻塞操作
-        pConn: 连接指针
-        pChan: 数据所属的channel指针
-        pData: 数据指针
-        len: 数据长度
-    */        
-    virtual void OnRead(ITyPhoonConn * pConn,ITyPhoonChannel *pChan,uint8_t* pData,int32_t len){} 
-
-
-    /*
-        Channel可写回调
-        在非线程回调模式下, 应用层不能在OnWritable回调中做阻塞操作
-        在线程回调模式下, 应用层可以在OnWritable回调中做阻塞操作        
-        pConn: 连接指针
-        pChan: 数据所属的channel指针
-    */        
-    virtual void OnWritable(ITyPhoonConn * pConn, ITyPhoonChannel *pChan){} 
-
-
-    /*
-        发送的数据被对方确认回调
-        备注: 应用层在本回调函数中不能执行阻塞操作
-        pConn: 连接指针
-        pChan: 数据所属的channel指针
-        ackLen: 被确认的数据长度
-    */      
-    virtual void OnSentDataAcknowledged(ITyPhoonConn * pConn, ITyPhoonChannel *pChan, int32_t ackLen){}
-    
-    /*
-        PULL模式下, Typhoon收到收据后主动通知应用回调, 应用层可以根据处理情况调用Recv接口
-        pConn: 连接指针
-        pChan: 数据所属的channel指针
-    */    
-    virtual void OnDataArriveNotify(ITyPhoonConn *pConn, ITyPhoonChannel *pChan){}
-
-    
-    /*
-      新的Channel打开回调, 本接口仅用于Channel的被动打开方, 对于主动打开方, 只需要调用OpenChannel
-      pConn: 连接指针
-      pChan: 数据所属的channel指针
-    */    
-    virtual void OnChannelOpen(ITyPhoonConn *pConn, ITyPhoonChannel *pChan){}
-
-    /*
-      Channel 关闭回调
-      触发时机: 当对端调用CloseChannel接口直接关闭Channel时, 会触发本端的OnChannelClose
-                上层应用需要在OnChannelClose完成该Channel相关的资源清理工作
-      注意: 1) 当收到OnChannelClose回调时, 该channel已经无法用于通信, 用户不要在该Channel上进行Channel相关的任何操作;
-            2) 本地Channel已经自动关闭, 不需要应用调用CloseChannel去关闭本地Channel
-      pConn: 连接指针
-      pChan: 数据所属的channel指针   
-      closeType: 引发关闭的原因
-    */
-    virtual void OnChannelClose(ITyPhoonConn *pConn, ITyPhoonChannel *pChan, enChannelCloseType closeType){}
-
-    virtual void OnAuthChange(ITyPhoonConn *pConn, sTyphoonProxyLicense *license){}
-
- 
-	/* 定时器回调, 在连接建立成功后会调用该函数.
-	   调用者可以通过返回值来指示希望下一次触发该回调的时间
-	   相当于一个定时器. 比如返回5表示5毫秒后触发该定时器
-	   返回值为0: 表示继续使用当前的触发超时时间
-	   OnTimer默认10毫秒调用一次
-	   	
-	   应用场景: 调用者经常需要定时发送一些数据, 可以在本回调中进行
-	   调用者可以借用ITyPhoonConn的UserData信息去保存处理任务相关的信息
-	   注意事项: OnTimer运行在Typhoon协议线程上, 回调函数中不能有阻塞或需要处理很长时间(比如大于1毫秒)的工作
-	   否则会将Typhoon协议处理线程阻塞住, 导致协议的发送和接受数据受影响
-	*/
-    virtual uint32_t OnTimer(ITyPhoonConn* pConn) { return 0; }
-
-
-	/* SDN 节点与连接对端Peer的路由方式
-	   pConn: 连接指针
-	   type: 路由方式
-	   TYPHOON_SDN_RELAY : 与对端节点通过中转节点通信
-	   TYPHOON_SDN_DIRECT: 与对端节点建立了直连通信 
-
-	   本回调函数仅在SDN模式下有效, 非SDN模式该函数不会被调用
-	*/	
-    virtual void OnSDNRouteChange(ITyPhoonConn* pConn, enTyphoonSDNPathType type) {}
-	
-};
-
-
-
-class TYPHOON_API ITyphoon
-{
-public:
-    /* 初始化Typhoon的底层UDP socket
-       ip: socket监听的本地ip地址, NULL表示侦听所有的地址
-       port: socket监听的本地端口, 0表示由系统分配侦听端口, 常用于客户端
-    */   
-    virtual bool InitUDPSocket(char* ip = NULL,uint16_t port = 0) = 0;
-
-    /*
-        设置App的初始化函数
-    */
-    virtual void SetAppInitCB(Typhoon_AppInit_Callback Init) = 0;
-
-    /*
-        设置App的退出析构函数
-    */
-    virtual void SetAppUninitCB(Typhoon_AppUninit_Callback Uninit) = 0;
-
-    /* 获取Typhoon实例的Libuv Loop实例, 仅仅在应用希望与Typhoon运行在同一个线程时调用, 
-       使用该接口后, 应用必须适用libuv相关接口 */
-    virtual uv_loop_t *GetMainLoop() = 0;
-
-    /* 设置连接的全局默认回调函数
-       pSink: 回调函数实例指针
-    */      
-    virtual void SetConnCallback(ITyPhoonConnCallBack *pSink) = 0; 
-
-    /* 获取连接的全局默认回调函数
-    */
-    virtual ITyPhoonConnCallBack *GetConnCallback() = 0;    
-
-    /* 获取本地UDP socket的绑定地址 */    
-    virtual SOCKADDR GetLocalAddr() = 0;                                    
-
-    /* 获取当前的连接数量 */
-    virtual int32_t GetConnectionCount() = 0;                               
-
-    /* 创建一个连接实例 */
-    virtual ITyPhoonConn* CreateConnection() = 0;        
-
-    /* 获取全局配置信息 */
-    virtual ITyphoonCfg  GetTyphoonConfig() = 0;          
-
-    /* 设置全局配置信息 */
-    virtual void  SetTyphoonConfig(ITyphoonCfg cfg) = 0; 
-
-    /* 获取连接的全局默认配置 */
-    virtual ITyphoonConnCfg GetConnDefaultCfg() = 0;
-
-    /* 设置连接的全局默认配置 */
-    virtual void SetConnDefaultCfg(ITyphoonConnCfg *) = 0;
-
-
-    /* 激活Typhoon License 
-       licenseCode: License编号
-       ProductType: 产品类型
-       返回值: > 0 激活成功, 返回值表示该License的网络带宽值(单位Mbps)
-               = 0 激活失败
-       备注: 该函数为阻塞操作, 一直会等到网络激活结果后才会返回
-    */
-    virtual int ActivateLicense(char *licenseCode, int ProductType) = 0;
-
-	/* 设置 ca 路径
-       caPath: ca 路径
-       返回值: == 0 设置成功
-              != 0 设置失败
-    */
-    virtual int SetCaPath(char *caPath) = 0;
-    /*
-      获取License信息
-      返回值: 0 当前存在有效License, pLicenseInfo携带License的详细信息
-      范围值: 非0 当前没有有效License
-    */
-    virtual int GetLicenseInfo(stLocalConfig *pLicenseInfo) = 0;
-
-
-    /*
-        遍历Typhoon实例下所有的连接
-        cb: 遍历回调函数
-        userdata:用户自定义数据, 作为cb的第3个参数
-    */
-    virtual void TraverseConnections(Typhoon_TraverseConnections_Cb cb, void *userdata) = 0;
-
-    /*
-        需要放到Typhoon线程同步执行指定的回调函数, 并返回执行结果
-        cb: 同步执行的回调函数
-        userdata:用户自定义数据, 作为cb的输入参数
-    */
-    virtual int SynchronizedExecute(Typhoon_SynchronizedExecute_Cb cb, void *userdata) = 0;
-
-    /*
-        禁用UDP socket的checksum功能, 仅Linux系统有效
-        禁用checksum的作用: 用于部分场景(比如负载均衡器无法正常更新UDP报文的校验和, 导致系统丢弃UDP报文)
-    */
-
-    virtual void DisableUdpCheckSum() = 0;
-
-
-    /*
-        设置socks5代理
-        参数:
-        stTyphoonSocks5Config *pCfg: 当输入空指针时, 清除socks5设置
-        当输入有效指针时, 设置socks5设置
-        Typhoon传输库不校验输入内容是否正确, 由调用方保证
-
-        返回值:
-        设置成功时, 返回值为0;
-        设置失败时, 返回值小于0;
-    */
-
-    virtual int SetSocks5ProxyConfig(stTyphoonSocks5Config *pCfg) = 0;
-
-    /*
-        读取socks5代理配置
-        当未设置socks5配置时, 返回NULL
-        当设置了socks5配置时, 返回配置指针
-    */
-    virtual stTyphoonSocks5Config * GetSocks5ProxyConfig() = 0;
-	/*
-		获取版本号
-	*/
-    static char *Typhoon_GetVersion();
-
-	virtual void SetRemainingFlow(const int64_t remainingFlow) = 0;
-
-	virtual int StartWebServer(const char *pServerAddr, int serverPort) = 0;
-
-	virtual uint64_t GetNanoSecond() = 0;
-    virtual ~ITyphoon(){}
-};
-
-
-
-/* 创建Typhoon实例 */
-TYPHOON_API ITyphoon* CreateTyphoon(const char *pLicensePath, const char *pLicenseAddr, int licensePort, int logId);
-
-/* 释放Typhoon实例 */
-TYPHOON_API void DestroyTyphoon(ITyphoon *pInstance);
-
-/* 获得Typhoon全局配置信息 */
-TYPHOON_API ITyphoonCfg* GetTyphoonCfg();
-
-/* 将Typhoon全局配置信息输出到日志中 */
-void ShowTyphoonCfg();
-
-
-/* 将Typhoon的通信设置为使用SDN网络模式,       必须在CreateTyphoon前调用    */
-TYPHOON_API void TyphoonUseSDN();
-
-/* 设置SDN网络的配置文件存放路径,必须在CreateTyphoon前调用  */
-TYPHOON_API int TyphoonSetSDNDataDirestory(char *path);
-
-/* 设置SDN节点与外部通信的端口, 默认值为32002, 如果需要调用设置, 必须在CreateTyphoon前调用 */
-TYPHOON_API void TyphoonSetSDNPort(uint32_t port);
-
-/* 获取Typhoon是否是使用SDN网络 */
-TYPHOON_API bool TyphoonIsUseSDN();
-
-/* 功能辅助函数: 将IPV4 sockaddr_in 转换为SDNId */
-TYPHOON_API uint64_t TyphoonAddr2ZtsId(const struct sockaddr_in *addr);
-
-/* 功能辅助函数: 将SDNId转换为IPV4 sockaddr_in */
-TYPHOON_API void TyphoonZtsId2Addr(uint64_t id, struct sockaddr_in *addr);
-
-/* 功能辅助函数: 将SDNId转换为ip, port */
-TYPHOON_API void TyphoonSDNId2IpPort(char * ztsid, char *ipv4, int ipv4_len, short *port);
-
-/* 使用SDN网络时, 在CreateTyphoon后, 获取本节点的SDN NodeId */
-TYPHOON_API uint64_t TyphoonGetNodeId();
-
-
-TYPHOON_API void TyphoonGlobalInit(int clockInterval, int ackInterval=10, int ackCount=800);
-
-
-
-
-
-
-
-
-#undef TYPHOON_API
-
-#endif

+ 0 - 275
创维盒子/RayProxy/include/TyphoonDefine.h

@@ -1,275 +0,0 @@
-#ifndef __TYPHOON_DEFINE_C__H__
-#define __TYPHOON_DEFINE_C__H__
-
-
-#include "uv.h"
-#include "YyAuthenticationManageFile.h"
-
-#ifdef __cplusplus
-extern "C" 
-{
-#endif
-
-
-#ifndef SOCKADDR
-typedef struct sockaddr SOCKADDR;
-#endif
-
-//ChannelID 宏定义
-#define TYPHOON_INVALID_CHANNEL_ID      0xffff                  //无效的channelID
-#define TYPHOON_DEFAULT_CHANNEL_ID      0                       //连接创建成功后的默认channelID
-#define TYPHOON_INVALID_HANDLE   0
-
-#define CCMODE_DROPRATE                 0                       //只使用丢包率作为拥塞控制输入
-#define CCMODE_RTT                      1                       //只使用RTT作为拥塞控制输入
-#define CCMODE_DROPRATE_AND_RTT         2                       //使用丢包率和RTT作为拥塞控制输入
-#define CCMODE_LOW_PRIORITY             3                       //低优先级流量算法
-
-#define TYPHOON_INVALID_CCMODE          255                     //无效的CCMODE
-#define MAX_HASH_KEY_LEN                32                      //hash秘钥最大长度
-
-#define MAX_TYPHOON_HOST_LEN            128                     //host字符串最大长度
-#define MAX_TYPHOON_USERNAME_LEN        128                     //用户名最大长度
-#define MAX_TYPHOON_PASSWORD_LEN        128                     //用户名最大长度
-
-
-
-
-typedef void * HTyphoonChannel;
-typedef void * HTyphoonConn;
-typedef void * HTyphoon;
-typedef void * HTyPhoonConnCallBack;
-typedef void * HTyphoonBuff;
-typedef void * HTyphoonFecTun;
-typedef void (*Typhoon_Logger)(char* str);
-typedef void (*Typhoon_LevelLogger)(int level, char* str);
-
-typedef void (*TyphonnConn_TraverseChannels_Cb_C)(HTyphoonConn Conn, HTyphoonChannel Channel, void* arg);
-
-
-typedef int (*Typhoon_SynchronizedExecute_Cb)(void* arg);
-
-typedef void (*Typhoon_Logger_Flush)();
-
-typedef enum TYPHOON_ERROCODE
-{
-    //errocode : 0,成功,1失败超时
-    TYPHOON_CON_SUCCEED = 0,
-    TYPHOON_CON_TIMEOUT,
-    TYPHOON_CON_BUTT,
-    TYPHOON_CON_NETWORK_ERROR       // 网络异常
-}enTyphoonErr;
-
-typedef enum TYPHOON_DISCONNECT_CAUSE
-{
-    TYPHOON_REMOTE_DISCONNECT  = 0,
-    TYPHOON_TIMEOUT_DISCONNECT = 1,
-    TYPHOON_MTU_RESET          = 2,
-    TYPHOON_INVALID_AK         = 3,         //不合法的客户端, 用于授权
-    TYPHOON_IN_BLACKLIST       = 4,         //客户端IP在黑名单中或不在白名单中
-    
-    TYPHOON_DISCONNECT_BUTT
-}enTyphoonDisconnectCause;
-
-
-//channel断开状态码
-typedef enum TYPHOON_CHANNEL_CLOSE_TYPE
-{
-    TYPHOON_CHANNEL_CLOSE_NORMAL = 0,           //对端主动CloseChannel导致的channel断开
-    TYPHOON_CHANNEL_CLOSE_RESET,                //对端channel已经异常关闭导致的channel断开
-    TYPHOON_CHANNEL_CLOSE_INFO,                 //正常shutdown后, channel进入close状态前的通知
-    TYPHOON_CHANNEL_CLOSE_BUTT
-}enChannelCloseType;
-
-
-typedef enum TYPHOON_COMPRESS_METHOD
-{
-    TYPHOON_COMPRESS_NONE = 0,              //不支持压缩
-    TYPHOON_COMPRESS_ZSTD = 0x01,           //支持ZSTD
-    TYPHOON_COMPRESS_ZLIB = 0x02,           //支持ZLIB
-    TYPHOON_COMPRESS_RESERVE2 = 0x04,       //保留值, 用于后续扩充
-    TYPHOON_COMPRESS_RESERVE3 = 0x08,
-    TYPHOON_COMPRESS_RESERVE4 = 0x10,
-    TYPHOON_COMPRESS_RESERVE5 = 0x20,
-    TYPHOON_COMPRESS_RESERVE6 = 0x40,
-    TYPHOON_COMPRESS_RESERVE7 = 0x80   
-}enTyphoonCompressMethod;
-
-
-enum tagTYPHOON_LOGLEVEL
-{
-    TYPHOON_INFO = 20,
-    TYPHOON_NOTICE = 40,
-    TYPHOON_DEBUG = 60,     
-    TYPHOON_WARN = 80,
-    TYPHOON_ERROR = 100,
-    TYPHOON_FATAL = 120,
-    TYPHOON_BUTT
-};
-
-
-typedef enum TYPHOON_SDNPATH_TYPE
-{
-    TYPHOON_SDN_RELAY = 0,
-    TYPHOON_SDN_DIRECT = 1,
-    TYPHOON_SDN_TCP_TUNNLE = 2,
-    TYPHOON_SDNTYPE_BUTT
-}enTyphoonSDNPathType;
-
-
-
-typedef struct TyphoonTimerConfig
-{
-    int32_t TryConnectTime;
-    int32_t HandShakeTime;
-    int32_t ConnBrokenTime;
-}stTyphoonTimerConfig;
-
-
-struct TyphoonConnStats                             //1条连接的统计信息
-{
-    /* Rx */
-    int64_t m_dwRead;                               //当前接收到的数据长度,已经确认的
-    int64_t m_ReadCount;                            //当前接收到的包数,已经确认的
-    int64_t m_dwDumpCount;                          //收到的重包数
-    int64_t m_dwDumpSize;							//收到的重包大小
-    int64_t m_dwOutRange;                           //收到的不在接收窗口中的包数
-    int64_t m_dwOutRangeSize;						//收到的不在接收窗口中的包大小
-    int64_t m_AppRxTraffic;							//实际接收到的应用层报文流量大小, 当数据被压缩时, 网络流量小于应用层报文原始大小
-    int64_t m_RecvResendCount;						//收到的重发报文数量
-    int64_t m_RecvResendSize;						//收到的重发报文数量
-    int64_t m_RxFecDataSize;						//收到的Fec数据大小
-	int64_t m_RxFecDataCount;						//收到的Fec报文数量
-    int64_t m_RxFecRecoverDataSize;					//通过FEC恢复出的数据数量
-	int64_t m_RxFecRecoverDataCount;				//通过FEC恢复出的数据个数
-	int64_t m_RxErrorFecCount;						//Fec解码错误次数统计
-	int64_t m_RxFecOutRangeCount;					//Fec解码成功后, 恢复的数据不在接收窗口内次数统计
-	int64_t m_RxFecDumpCount;						//Fec解码成功后, 恢复的数据已经收到重复次数统计
-	int64_t m_RxFecNoDecoderpCount;					//Fec原始数据, 无法找到Decoder的统计(原因为FecRecover报文丢失了)
-	int64_t	m_RxDelayedDataCount;					//数据的部分报文由于丢失重传, 比未丢失报文的数据达到时间要晚的数量
-	int64_t	m_RxFecMismatchDecoderCount;
-	int64_t	m_RxFecErrorSegindex;
-	int64_t	m_RxFecDataLateCount;
-    
-    /* Tx */
-    int64_t m_dwWrite;                            	//当前接发送的数据长度,已经确认的
-    int64_t m_Checked;                            	//已经确认的包数, ACK+SACK  
-    int64_t m_SendTotalCount;                     	//总共发送的总包数,包括重传部分
-    int64_t m_ReSendCount;                        	//快速重传的包数
-    int32_t m_rtt;                                	//连接的RTT
-    int32_t m_minrtt;                             	//连接的最小RTT
-    int64_t m_AppTxTraffic;						  	//记录应用层Send接口的数据流量大小
-    int64_t m_TxFecDataSize;					  	//发出的Fec数据大小
-	int64_t m_TxFecDataCount;						//发出的Fec报文数量 
-	int32_t m_TxDropCount;							//模拟丢包功能丢失的报文数量
-    
-};
-
-
-
-typedef struct  TyphoonCfg
-{
-    Typhoon_Logger Log;                     //Typhoon内部日志输出接口, 如果不设置则无日志输出
-    Typhoon_LevelLogger pfnLevelLogger;     //Typhoon内部日志输出接口, 如果不设置则无日志输出
-    uint32_t UdpSocketSendBuffSize;         //Typhoon实例的UDP socket发送缓存大小, 1个Typhoon实例绑定1个UDP socket, 由该实例所有连接共用;
-                                            //默认值为1MB, 发送缓冲区大小建议不小于1MB
-    uint32_t UdpSocketRecvBuffSize;         //Typhoon实例的UDP socket接收缓存大小, 1个Typhoon实例绑定1个UDP socket, 由该实例所有连接共用;
-                                            //默认值为1MB, 接收缓冲区大小建议不小于1MB
-    uint16_t PackCountTriggerAck;           //收到多少个数据报文触发一次ACK, 默认为250个
-    uint8_t  LoopInterval;                  //Typhoon内部调度间隔, 默认为10毫秒
-    uint8_t  AckInterval;                   //客户端最大ACK响应间隔时间, 默认为50毫秒
-    uint8_t  NoLockMode;                    //如果Typhoon应用与Typhoon协议栈运行在同一个线程中, 此处设置为1, 双方的数据传递可以不使用锁
-                                            //默认为0, 即双方的数据传递会使用锁
-	uint8_t	HightSpeedMode;                 //是否为HightSpeedMode, 默认为0
-    uint8_t CCMode;                         //拥塞控制模式. 0使用丢包率, 1使用RTT, 2使用丢包率+时延
-    uint16_t ResistDropRate;                //可抵抗的丢包率. 这里使用万分制比列表示, 默认为250, 即万分之250 --> 2.5%
-    uint8_t IOThreadNum;                    //Typhoon Socket I/O线程数量, 默认为1, 最大可以设置为2
-    uint8_t ResendCheckTime;                //在进行报文重发时, 需要确认报文上次发送时间到重发时是否大于RTT+1个缓冲时间, 默认值为10毫秒
-    uint8_t UdpGSO;                         //是否启用UDP GSO, UDP GSO在Linux内核4.18后才支持CentOS 8.0支持
-    uint8_t BindCpu;                        //是否启用CPU绑定, 默认为0不启用
-	uint32_t LogLevel;                       //日志输出级别, 只有大于指定级别才输出日志, 默认为DEBUG(60)
-	Typhoon_Logger_Flush Flush;
-}stTyphoonCfg;                              
-
-
-
-typedef struct TyphoonConnCfg                
-{
-    uint32_t MaxQueueSize;                 //Max Size of Typhoon connection send and recv queue size    
-    uint32_t FixedSendSpeed;               //连接的固定发送速度, 默认为0表示不设置, 由typhoon自动探测发送速度; 
-                                           //如该值设置后, typhoon内部发送速度探测算法不再生效, 连接每秒发送速度的按照用户设置值进行
-    uint32_t MaxSendSpeed;                 //连接的最大发送速度, 默认为0表示不设置;
-                                           //如该选项进行了设置, 发送实时速度依然由typhoon内部算法决定, 但是连接最大的速度不能超过本设置值
-    uint32_t MinSendSpeed;                 //如该选项进行了设置, Typhoon的发送速度不低于该值                                           
-    uint16_t MaxChannelSize;               //每条连接可以建立的channel数量
-    uint16_t MaxSegmentSize;               //Typhonn协议每个报文的最大值
-    uint32_t SendBuffSize;                //连接发送缓存大小, 这个配置仅影响初始发送缓冲值, typhoon算法会自动计算发送缓存大小最优值, 以保证发送效率
-    uint32_t RecvBuffSize;                //连接接收缓存大小
-    uint8_t  UseThreadForAppDataCb;        //配置当前连接是否使用额外的线程执行用户数据通知回调, 默认为1, 即使用
-                                           //取值范围[0, 1]
-    uint8_t  CompressMethod;               //连接支持的压缩方法, 可以设置为支持1种或多种方法, 通过enTyphoonCompressMethod的值 | 得到结果                                           
-    uint8_t  TransferMode;                 //连接传输模式, 分为文件传输模式0, 实时传输模式1, 默认为0
-    uint8_t  UseDataPush;				    //取值范围[0, 1]: 1 PushData, 0 PullData. 当数据达到时, PushData的方式是调用OnRead回调, 非PushData(PullData)的方式是调用OnDataArrived回调
-    										//两种方式没有本质区别, 区别在于OnRead回调让用户必须立刻马上处理这个数据, 而OnDataArrived只是通知用户数据达到了, 用户可以选择马上处理或者不马上处理
-	uint8_t	m_checkFlag;					//0:不开启校验;1:开启 xxHash 校验
-}stTyphoonConnCfg;
-
-
-typedef struct TyphoonProxyLicense{
-	uint8_t  version;
-	uint16_t clientNum;			  //允许接入的客户端数量,0表示无限制
-	uint16_t clientLicenseLevel;  //允许接入的客户端的带宽,单位Mbps,0表示无限制
-	uint32_t flow;				  //流量,包括上行和下行流量,单位G,0表示无限制
-}sTyphoonProxyLicense;
-
-
-typedef int32_t (*Typhoon_AppInit_Callback)();
-typedef void (*Typhoon_AppUninit_Callback)();
-
-typedef void (*TyphoonConn_OnConnected)(HTyphoonConn pConn, enTyphoonErr erro, uint8_t *data, uint16_t data_len);
-typedef void (*TyphoonConn_OnDisconnected)(HTyphoonConn pConn, enTyphoonDisconnectCause cause);
-typedef void (*TyphoonConn_OnRead)(HTyphoonConn pConn, HTyphoonChannel pChan,uint8_t* pData,int32_t len);
-typedef void (*TyphoonConn_OnWritable)(HTyphoonConn pConn, HTyphoonChannel pChan);
-typedef void (*TyphoonConn_OnSentDataAcknowledged)(HTyphoonConn pConn, HTyphoonChannel pChan, int32_t ackLen);
-typedef void (*TyphoonConn_OnDataArriveNotify)(HTyphoonConn pConn, HTyphoonChannel pChan);
-typedef void (*TyphoonConn_OnChannelOpen)(HTyphoonConn pConn, HTyphoonChannel pChan);
-typedef void (*TyphoonConn_OnChannelClose)(HTyphoonConn pConn, HTyphoonChannel pChan, enChannelCloseType closeType);
-typedef void (*TyphoonConn_OnAuthChange)(HTyphoonConn pConn, sTyphoonProxyLicense *license);
-typedef void (*TyphoonConn_OnFecTunOpen)(HTyphoonConn pConn, HTyphoonFecTun pTun);
-typedef void (*TyphoonConn_OnFecTunClose)(HTyphoonConn pConn, HTyphoonFecTun pTun);
-typedef uint32_t (*TyphoonConn_OnTimer)(HTyphoonConn pConn);
-typedef void (*TyphoonConn_OnSDNRouteChange)(HTyphoonConn pConn, enTyphoonSDNPathType type);
-
-
-
-
-typedef struct __TyPhoonConnCallBack
-{
-    TyphoonConn_OnConnected pfnOnConnected;
-    TyphoonConn_OnDisconnected pfnOnDisconnected;
-    TyphoonConn_OnRead  pfnOnRead;
-    TyphoonConn_OnWritable pfnWritable;
-    TyphoonConn_OnSentDataAcknowledged pfnOnSentDataAcknowledged;
-    TyphoonConn_OnDataArriveNotify pfnOnDataArriveNotify; 
-    TyphoonConn_OnChannelOpen  pfnOnChannelOpen;
-    TyphoonConn_OnChannelClose pfnOnChannelClose;
-    TyphoonConn_OnAuthChange pfnOnAuthChange;
-	TyphoonConn_OnTimer		  pfnOnTimer;
-	TyphoonConn_OnSDNRouteChange pfnOnSDNRouteChange;
-}stTyPhoonConnCallBack;
-
-
-typedef struct __Socks5Config
-{
-    char server[MAX_TYPHOON_HOST_LEN];          //代理服务器ip或域名
-    uint16_t port;                              //代理服务器端口
-    char username[MAX_TYPHOON_USERNAME_LEN];    //代理服务器用户名
-    char password[MAX_TYPHOON_PASSWORD_LEN];    //代理服务器密码
-}stTyphoonSocks5Config;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-

+ 0 - 681
创维盒子/RayProxy/include/TyphoonMultiSocks.h

@@ -1,681 +0,0 @@
-#ifndef __TYPHOON_SOCKS_H__
-#define __TYPHOON_SOCKS_H__
-
-#ifdef __cplusplus
-extern "C" 
-{
-#endif
-
-#include "stdint.h"
-
-#ifdef _WIN32
-#ifdef TYPHOON_SOCKS_DLL_IMPLEMENT
-#define TYPHOON_SOCKS_EXTERN __declspec(dllexport)
-#else 
-#ifdef _STATIC_LIB_
-#define TYPHOON_SOCKS_EXTERN 
-#else
-#define TYPHOON_SOCKS_EXTERN __declspec(dllimport) 
-#endif
-#endif
-#define TYPHOON_STDCALL __stdcall
-#else
-#define TYPHOON_SOCKS_EXTERN /* nothing */
-#define TYPHOON_STDCALL
-#endif
-typedef void * HTyphoonHandle;
-
-enum TyphoonMultiProxyServiceType
-{
-	SOCKS5_SERVICE = 0,
-	HTTP_SERVICE,
-};
-
-/*
- * 连接回调
- * status 为0:连接成功
- * status 非0:连接失败,失败后客户端会继续尝试重连
- */
-typedef void (TYPHOON_STDCALL *TyphoonMultiProxy_OnConnected)(HTyphoonHandle pyHandle, int status);
-
-/*
- * 连接断开回调
- */
-typedef void (TYPHOON_STDCALL *TyphoonMultiProxy_OnDisconnected)(HTyphoonHandle pyHandle);
-
-/*
- * 授权改变回调
- */
-typedef void (TYPHOON_STDCALL *TyphoonMultiProxy_OnAuthChange)(HTyphoonHandle pyHandle);
-
-/*
- * sdn连接路径改变回调
- */
-typedef void (TYPHOON_STDCALL *TyphoonMultiProxy_OnSDNRouteChange)(HTyphoonHandle pyHandle, int type);
-
-/*
- * 服务空闲回调回调
- */
-typedef void (TYPHOON_STDCALL *TyphoonMultiProxy_OnServiceIdleTimeout)(HTyphoonHandle pyHandle, TyphoonMultiProxyServiceType serviceType);
-
-/*
- * TyphoonProxy local与Server连接状态通知回调
- * 应用如果关心连接状态信息, 需注册对应回调函数;
- */
-typedef struct TyphoonMultiProxyConnectionStatusCb
-{
-    TyphoonMultiProxy_OnConnected     pfnOnConnected;
-    TyphoonMultiProxy_OnDisconnected  pfnOnDisConnected;
-    TyphoonMultiProxy_OnAuthChange  pfnOnAuthChange;
-	TyphoonMultiProxy_OnSDNRouteChange pfnOnSDNRouteChange;
-	TyphoonMultiProxy_OnServiceIdleTimeout pfnOnServiceIdleTimeout;
-}stTyphoonMultiProxyConnectionStatusCb;
-
-typedef struct ConnectExParam_s{
-	char *socks5Ip;
-	int socks5Port;
-	char *serverIp;
-	int serverPort;
-	unsigned int mss;
-	int bCompress;
-	unsigned int timeOut;
-	uint8_t transferMode;
-	bool bUseSdn;
-}ConnectExParam_t;
-
-/*
- * 设置Typhoon 回调
- */
-TYPHOON_SOCKS_EXTERN void TyphoonMultiProxy_SetConnectionStatusCb(stTyphoonMultiProxyConnectionStatusCb Cb);
-
-/*
- * 获取Typhoon 回调
- */
-TYPHOON_SOCKS_EXTERN stTyphoonMultiProxyConnectionStatusCb TyphoonMultiProxy_GetConnectionStatusCb();
-
-/*
- * 初始化Typhoon
- * 参数:
- * maxSpeed:最大速度,单位KB,只能在权限范围内设置,设为0,使用最大权限速度
- * minSpeed:最小速度,单位KB,设为0,默认128KB
- * pLogPath:日志路径
- * pLicensePath:license文件产生路径
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_InitClient(unsigned int maxSpeed, unsigned int minSpeed, const char *pLogPath, const char *pLicensePath, void *rootsData = nullptr, int rootsDataLen = 0);
-
-/*
- * 初始化Typhoon
- * 参数:
- * maxSpeed:最大速度,单位KB,只能在权限范围内设置,设为0,使用最大权限速度
- * minSpeed:最小速度,单位KB,设为0,默认128KB
- * pLogPath:日志路径
- * pLicensePath:license文件产生路径
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_InitClientEx(unsigned int maxSpeed, unsigned int minSpeed, const char *pLogPath, const char *pLicensePath, uint8_t transferMode);
-
-/*
- * 新建一条连接
- * 参数:
- * socks5Ip:socket5 监听ip
- * socks5Port:socket5 监听端口,设置为0由系统随机分配端口
- * serverIp:Typhoon server ip
- * serverPort:Typhoon server 端口
- * mss:最大报文长度,范围 600-1442
- * 该值的实际大小由 server与client协商决定,谁小用谁
- * 
- * bCompress:是否开启压缩,1开启,0关闭;
- * 是否开启压缩实际效果由 server与client协商决定,只有都打开压缩才会有效
- * 
- * timeOut:连接超时时间,单位 ms,设置为0不使用超时
- * 返回值:
- * 返回连接的句柄,该句柄需要由调用者自行维护,其他与连接相关的api都需要此句柄
- */
-TYPHOON_SOCKS_EXTERN HTyphoonHandle TyphoonMultiProxy_CreateNewConnect(const char *socks5Ip, int socks5Port, 
-		const char *serverIp, int serverPort, unsigned int mss, int bCompress, unsigned int timeOut);
-
-TYPHOON_SOCKS_EXTERN HTyphoonHandle TyphoonMultiProxy_CreateNewConnectEx(ConnectExParam_t *connP);
-
-TYPHOON_SOCKS_EXTERN HTyphoonHandle TyphoonMultiProxy_CreateNewTyphoonConn(const char *serverIp, int serverPort, 
-		unsigned int mss, int bCompress, unsigned int timeOut, uint8_t transferMode = 0, uint8_t useSdn = 0);
-
-TYPHOON_SOCKS_EXTERN HTyphoonHandle TyphoonMultiProxy_CreateNewTyphoonConnVia(const char *serverIp, int serverPort, 
-		unsigned int mss, int bCompress, unsigned int timeOut, uint8_t transferMode, uint64_t via);
-
-/*
- * 关闭连接
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_CloseConnect(HTyphoonHandle pyHandle);
-
-/*
- * 重置连接
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 0成功,非0失败
- * 说明:
- * 该方法主要用来在mss或者压缩状态改变时候使用
- * 设置后所有的 socket5连接都会断开
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_RestartConnect(HTyphoonHandle pyHandle);
-
-/*
- * 使能压缩
- * 参数:
- * pyHandle:连接句柄
- * 说明:
- * 该方法设置后需要重置连接才会生效
- */
-TYPHOON_SOCKS_EXTERN void TyphoonMultiProxy_EnableCompress(HTyphoonHandle pyHandle);
-
-/*
- * 关闭压缩
- * 参数:
- * pyHandle:连接句柄
- * 说明:
- * 该方法设置后需要重置连接才会生效
- */
-TYPHOON_SOCKS_EXTERN void TyphoonMultiProxy_DisableCompress(HTyphoonHandle pyHandle);
-
-/*
- * 获取连接的压缩状态
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 1开启压缩,0未开启
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_IsCompressEnabled(HTyphoonHandle pyHandle);
-
-/*
- * 获取连接状态
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 1已连接,0未连接
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetConnectionStatus(HTyphoonHandle pyHandle);
-
-/*
- * 获取Socks5端口
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于等于0失败,大于0为监听的端口
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetSocks5Port(HTyphoonHandle pyHandle);
-
-/*
- * 获取Http端口
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于等于0失败,大于0为监听的端口
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetHttpPort(HTyphoonHandle pyHandle);
-
-/*
- * 设置连接接收速度
- * 参数:
- * pyHandle:连接句柄
- * RecvSpeed:接收速度,单位KB,设为0使用最大权限带宽
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_SetConnRecvSpeed(HTyphoonHandle pyHandle, unsigned int RecvSpeed);
-
-/*
- * 设置最大发送速度
- * 参数:
- * pyHandle:连接句柄
- * Speed:发送速度,单位KB,设为0使用最大权限带宽
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_SetMaxSendSpeed(HTyphoonHandle pyHandle, unsigned int Speed);
-
-/*
- * 设置最小发送速度
- * 参数:
- * pyHandle:连接句柄
- * Speed:发送速度,单位KB,设为0默认128KB
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_SetMinSendSpeed(HTyphoonHandle pyHandle, unsigned int Speed);
-
-/*
- * 设置最小接收速度
- * 参数:
- * pyHandle:连接句柄
- * Speed:接收速度,单位KB,设为0默认128KB
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_SetMinRecvSpeed(HTyphoonHandle pyHandle, unsigned int Speed);
-
-/*
- * 设置连接的超时时间
- * 参数:
- * pyHandle:连接句柄
- * timeout:超时时间,单位 ms
- * 返回值:
- * 小于0失败,大于等于0为设置的超时时间
- */
-TYPHOON_SOCKS_EXTERN unsigned int TyphoonMultiProxy_SetTcpIdleTimout(HTyphoonHandle pyHandle, unsigned int timeout);
-
-/*
- * 设置服务的超时时间
- * 参数:
- * pyHandle:连接句柄
- * serviceType:服务类型
- * timeout:超时时间,单位 ms,必须大于等于 10*1000
- * 返回值:
- * 小于0失败,等于0成功
- */
-TYPHOON_SOCKS_EXTERN unsigned int TyphoonMultiProxy_SetServiceIdleTimout(HTyphoonHandle pyHandle, TyphoonMultiProxyServiceType serviceType, unsigned int timeout);
-
-/*
- * 获取连接的 rtt
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于0失败,大于等于0为rtt
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetConnectionRTT(HTyphoonHandle pyHandle);
-
-/*
- * 获取连接的丢包率
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于0失败,大于等于0为丢包率
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetConnectionDropRate(HTyphoonHandle pyHandle);
-
-/*
- * 获取Typhoon client版本
- * 参数:
- * verbuff:版本缓存,需要大于256字节
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetClientVersion(char *verbuff);
-
-/*
- * 获取最大权限带宽
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于0失败,大于0权限带宽,单位Mbps
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetMaxAuthSendSpeed(HTyphoonHandle pyHandle);
-
-/*
- * 设置 mss
- * 参数:
- * pyHandle:连接句柄
- * mss:范围600-1442
- * 返回值:
- * 0成功,非0失败
- * 说明:
- * 该方法设置后需要重置连接才会生效
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_SetMss(HTyphoonHandle pyHandle, unsigned int mss);
-
-/*
- * 获取 mss
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于等于0失败,大于0为mss
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetMss(HTyphoonHandle pyHandle);
-
-/*
- * 设置用户的私有数据,用来保存用户数据指针
- * 参数:
- * 无
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_SetUserData(uint64_t Data);
-
-/*
- * 获取用户的私有数据
- * 参数:
- * 无
- * 返回值:
- * 返回用户指针
- */
-TYPHOON_SOCKS_EXTERN uint64_t TyphoonMultiProxy_GetUserData();
-
-/*
- * 获取连接的出口ip地址
- * 参数:
- * pyHandle:连接句柄
- * addr:保存地址结构体指针
- * 返回值:
- * 无
- */
-TYPHOON_SOCKS_EXTERN void TyphoonMultiProxy_GetWanAddr(HTyphoonHandle pyHandle, struct sockaddr *addr);
-
-/*
- * 获取对端ip地址
- * 参数:
- * pyHandle:连接句柄
- * addr:保存地址结构体指针
- * 返回值:
- * 无
- */
-TYPHOON_SOCKS_EXTERN void TyphoonMultiProxy_GetRemoteAddr(HTyphoonHandle pyHandle, struct sockaddr *addr);
-
-/*
- * 获取对端 rtt
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于等于0失败,大于0为rtt
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetQueryPeerRTT(HTyphoonHandle pyHandle);
-
-/*
- * 获取对端丢包率
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于等于0失败,大于0为丢包率,单位万分之一
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetQueryPeerDropRate(HTyphoonHandle pyHandle);
-
-/*
- * 获取最大发送速度
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于等于0失败,大于0为最大发送速度,单位B
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetMaxSendSpeed(HTyphoonHandle pyHandle);
-
-/*
- * 获取最小发送速度
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于等于0失败,大于0为最小发送速度,单位B
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetMinSendSpeed(HTyphoonHandle pyHandle);
-
-/*
- * 获取对端 mss
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于等于0失败,大于0为 mss
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetQueryMss(HTyphoonHandle pyHandle);
-
-/*
- * 获取当前发送的实时速度
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 小于等于0失败,大于0为实时发送速度
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_GetCurSendSpeed(HTyphoonHandle pyHandle);
-
-/*
- * 设置HSM模式
- * 参数:
- * mode:1开始HSM,0关闭HSM
- * 返回值:
- * 0成功,非0失败
- * 说明:
- * 该方法需要在TyphoonMultiProxy_InitClient之后,CreateNewConnect之前设置
- */
-TYPHOON_SOCKS_EXTERN unsigned int TyphoonMultiProxy_SetHighSpeedMode(unsigned int mode);
-
-/*
- * 设置连接的私有数据,用来保存用户数据指针
- * 参数:
- * pyHandle:连接句柄
- * Data:数据指针
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_SetConnectUserData(HTyphoonHandle pyHandle, uint64_t Data);
-
-/*
- * 获取连接的私有数据
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 返回用户指针
- */
-TYPHOON_SOCKS_EXTERN uint64_t TyphoonMultiProxy_GetConnectUserData(HTyphoonHandle pyHandle);
-
-/*
- * 设置socks5 代理的配置
- * 参数:
- * server:socks5域名或ip
- * port:端口
- * username:用户名
- * password:密码
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_SetSocks5ProxyConfig(char *server, uint16_t port, char *username, char *password);
-
-/*
- * 使能GSO
- * 参数:无
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_EnableGSO();
-
-/*
- * 关闭GSO
- * 参数:无
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_DisableGSO();
-
-/*
- * 创建 http 服务
- * 参数:
- * pyHandle:连接句柄
- * httpIp:ip地址
- * httpPort: 端口
- * timeOut:超时时间
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_CreateHttpService(HTyphoonHandle pyHandle, const char *httpIp, int httpPort, uint32_t timeOut, uint16_t ifUseFirewall = 0, uint16_t fecPercent = 0);
-
-/*
- * 创建端口前转服务
- * 参数:
- * pyHandle:连接句柄
- * localIp:本地地址
- * localPort: 本地端口
- * remoteIp:远端地址
- * remotePort: 远端端口
- * timeOut:超时时间
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_CreateLocalPortForwardService(HTyphoonHandle pyHandle, const char *localIp, int localPort, const char *remoteIp, int remotePort, uint32_t timeOut);
-
-/*
- * 设置传输模式
- * 参数:
- * pyHandle:连接句柄
- * TransferMode:设置连接的传输模式,0代表文件传输模式, 1代表实时传输模式
- * 返回值:
- * 设置的模式数值
- * 说明:
- * 该方法设置后需要重置连接才会生效
- */
-TYPHOON_SOCKS_EXTERN uint8_t TyphoonMultiProxy_SetTransferMode(HTyphoonHandle pyHandle, uint8_t TransferMode);
-
-/*
- * 创建远端socks5 代理
- * 参数:
- * pyHandle:连接句柄
- * pServerIp:远端监听的ip地址
- * serverPort:远端监听的端口
- * 返回值:
- * 小于等于0失败
- * 大于0成功
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_CreateRemoteSocketService(HTyphoonHandle pyHandle, const char *pServerIp, uint16_t serverPort);
-
-/*
- * 创建远端http 代理
- * 参数:
- * pyHandle:连接句柄
- * pServerIp:远端监听的ip地址
- * serverPort:远端监听的端口
- * 返回值:
- * 小于等于0失败
- * 大于0成功
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_CreateRemoteHttpService(HTyphoonHandle pyHandle, const char *pServerIp, uint16_t serverPort);
-
-/*
- * 创建远端端口前转
- * 参数:
- * pyHandle:连接句柄
- * pLocalIp:本地连接的ip地址
- * localPort:本地连接的端口
- * pServerIp:远端监听的ip地址
- * serverPort:远端监听的端口
- * 返回值:
- * 小于等于0失败
- * 大于0成功
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_CreateRemotePortForwardService(HTyphoonHandle pyHandle, 
-	const char *pLocalIp, uint16_t localPort, const char *pServerIp, uint16_t serverPort);
-
-/*
- * 获取SDN ID
- * 参数:
- * 无
- * 返回值:
- * nodeId
- */
-TYPHOON_SOCKS_EXTERN uint64_t TyphoonMultiProxy_GetSdnNodeId();
-
-/*
- * sdnId 转换为 ip 和 端口
- * 参数:
- * ztsid:sdnId
- * ipv4:转换的ip地址
- * port:端口
- * 返回值:
- * 无
- */
-TYPHOON_SOCKS_EXTERN void TyphoonMultiProxy_SDNId2IpPort(char * ztsid, char *ipv4, short *port);
-
-/*
- * 设置 http 服务的 fec 百分比
- * 参数:
- * pyHandle:连接句柄
- * fecPercent:fec百分比,单位万分之一
- * 返回值:
- * 不等于0失败
- * 等于0成功
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_SetHttpServiceFecPercent(HTyphoonHandle pyHandle, uint16_t fecPercent);
-
-/*
- * 设置http服务允许的地址
- * 参数:
- * pyHandle:连接句柄
- * ip:允许的ip地址
- * port:允许的端口
- * 返回值:
- * 非0失败
- * 等于0成功
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_AddHttpFirewallAllowAddress(HTyphoonHandle pyHandle, char* ip, int port);
-
-/*
- * 删除http服务允许的地址
- * 参数:
- * pyHandle:连接句柄
- * ip:允许的ip地址
- * port:允许的端口
- * 返回值:
- * 非0失败
- * 等于0成功
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_DelHttpFirewallAllowAddress(HTyphoonHandle pyHandle, char* ip, int port);
-
-/*
- * 设置多线程发送
- * 参数:
- * enable:1使能,0关闭
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN unsigned int TyphoonMultiProxy_SetMultiSender(unsigned int enable);
-
-/*
- * 退出Typhoon
- * 参数:
- * 无
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_ExitClient();
-
-/*
- * 关闭 Http 服务
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_CloseHttpService(HTyphoonHandle pyHandle);
-
-/*
- * 关闭 Http 服务
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_CloseHttpService(HTyphoonHandle pyHandle);
-
-/*
- * 检测是否是 p2p 连接
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 0 p2p 连接,1 普通连接,-1 连接句柄无效
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_CheckIsP2p(HTyphoonHandle pyHandle);
-
-/*
- * 检测Http端口是否可用,只在移动端可用
- * 参数:
- * pyHandle:连接句柄
- * 返回值:
- * 0 不可用,1 可用, -1 句柄无效
- */
-TYPHOON_SOCKS_EXTERN int TyphoonMultiProxy_CheckHttpPartUsable(HTyphoonHandle pyHandle);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 37
创维盒子/RayProxy/include/TyphoonProduct.h

@@ -1,37 +0,0 @@
-#ifndef __TYPHOON_PRODUCT_H__
-#define __TYPHOON_PRODUCT_H__
-
-typedef enum TyphoonAppId_E
-{
-    TYPHOON_APP_ID_NONE = 0x0,
-    TYPHOON_APP_ID_FTP = 0x1,
-    TYPHOON_APP_ID_WEB = 0x2,
-    TYPHOON_APP_ID_SYNC = 0x4,
-    TYPHOON_APP_ID_OTHER = 0x8,
-    TYPHOON_APP_ID_FTPC = 0x10,
-    TYPHOON_APP_ID_FTPS = 0x20,
-    TYPHOON_APP_ID_PROXYC = 0x40,
-    TYPHOON_APP_ID_PROXYS = 0x80,
-    TYPHOON_APP_ID_OFFLINE = 0x100,
-    TYPHOON_APP_ID_ENCAUTH = 0x200,
-}TyphoonAppId_E;
-
-#if 0
-#define LOCAL_CONFIG_BUF        128
-typedef struct tm_local_config
-{
-    char code[LOCAL_CONFIG_BUF];
-    char duration[LOCAL_CONFIG_BUF];
-    char max_bandwidth[LOCAL_CONFIG_BUF];
-    char expire_date[LOCAL_CONFIG_BUF];
-    char activate_date[LOCAL_CONFIG_BUF];
-    char server_date[LOCAL_CONFIG_BUF];
-    char low_bound_bandwidth[LOCAL_CONFIG_BUF];
-
-    char server_key[LOCAL_CONFIG_BUF];
-    int productId;
-}stLocalConfig;
-#endif
-
-#endif
-

+ 0 - 148
创维盒子/RayProxy/include/TyphoonServer.h

@@ -1,148 +0,0 @@
-#ifndef __TYPHOON_SERVER_H__
-#define __TYPHOON_SERVER_H__
-
-#include "stdint.h"
-#include "TyphoonProduct.h"
-
-#ifdef __cplusplus
-extern "C" 
-{
-#endif
-
-#ifdef _WIN32
-#ifdef TYPHOON_SOCKS_DLL_IMPLEMENT
-#define TYPHOON_SERVER_EXTERN __declspec(dllexport)
-#else 
-#ifdef _STATIC_LIB_
-#define TYPHOON_SERVER_EXTERN 
-#else
-#define TYPHOON_SERVER_EXTERN __declspec(dllimport) 
-#endif
-#endif
-#define TYPHOON_STDCALL __stdcall
-#else
-#define TYPHOON_SERVER_EXTERN /* nothing */
-#define TYPHOON_STDCALL
-#endif
-
-typedef void (TYPHOON_STDCALL *TyphoonServerProxy_OnConnected)(void *pHandle, const char *userData, int userDataLen);
-typedef void (TYPHOON_STDCALL *TyphoonServerProxy_OnDisConnected)(void *pHandle);
-
-typedef struct TyphoonServerProxyConnectionStatusCb
-{
-    TyphoonServerProxy_OnConnected     pfnOnConnected;
-    TyphoonServerProxy_OnDisConnected  pfnOnDisConnected;
-}stTyphoonServerProxyConnectionStatusCb;
-
-
-struct InitServerPrama{
-	char* listenAddr;
-	uint32_t listenPort;
-	uint32_t minSpeed;
-	uint32_t maxSpeed;
-	int logId;
-	char *logPath;
-	char *licensePath;
-	char* caPath;
-	TyphoonAppId_E licenseType;
-	char* license;
-	bool bUdpGSO;
-	int32_t MaxSegmentSize;
-	bool bSdnOn;
-	void *rootsData;
-	int rootsDataLen;
-	int FecPercent;
-	bool bCompress;
-};
-
-
-/*
- * 初始化代理服务器
- * 参数:
- * param:输入参数结构体
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SERVER_EXTERN int TyphoonProxy_InitServer(InitServerPrama *param);
-
-/*
- * 去初始化代理服务器
- * 参数:
- * 无
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SERVER_EXTERN int TyphoonProxy_UninitServer();
-
-TYPHOON_SERVER_EXTERN uint64_t TyphoonProxy_GetNodeId();
-
-TYPHOON_SERVER_EXTERN void * TyphoonProxy_GetServerInstance();
-
-TYPHOON_SERVER_EXTERN void TyphoonProxy_writeLog(const char * fileName,       
-              const char * funcName, 
-              unsigned int line, 
-              unsigned int level, 
-              const char * format, 
-              ...);
-
-TYPHOON_SERVER_EXTERN int TyphoonProxy_RestartSdnRoot(void *rootsData, int rootsDataLen);
-
-TYPHOON_SERVER_EXTERN int TyphoonProxy_CheckSdnIsOnline();
-
-TYPHOON_SERVER_EXTERN void TyphoonServerProxy_SetConnectionStatusCb(stTyphoonServerProxyConnectionStatusCb Cb);
-
-TYPHOON_SERVER_EXTERN stTyphoonServerProxyConnectionStatusCb TyphoonServerProxy_GetConnectionStatusCb();
-
-/*
- * 设置 sdn tcp 转发端口
- * 参数:
- * port:端口号
- * 返回值:
- * 无
- */
-TYPHOON_SERVER_EXTERN void TyphoonProxy_SetSDNLocalTcpProxyPort(uint16_t port);
-
-/*
- * 设置 stun 服务器地址,必须在服务器初始化之前设置才能生效
- * 参数:
- * stun_server:stun 服务器地址
- * stun_port:stun 端口号
- * 返回值:
- * 无
- */
-TYPHOON_SERVER_EXTERN void TyphoonProxy_SetStunServer(const char*stun_server, uint16_t stun_port);
-
-/*
- * 设置 tcp 转发服务器地址,必须在服务器初始化之前设置才能生效
- * 参数:
- * tcp_relay_server:tcp 转发服务器地址
- * tcp_relay_port:tcp 转发服务器端口号
- * 返回值:
- * 无
- */
-TYPHOON_SERVER_EXTERN void TyphoonProxy_SetTcpRelayServer(const char*tcp_relay_server, uint16_t tcp_relay_port);
-
-/*
- * 设置 p2p 使用多服务器ip同时发送
- * 参数:
- * isMultiSend:1 开启,0 关闭
- * 返回值:
- * 无
- */
-TYPHOON_SERVER_EXTERN void TyphoonProxy_SetMultiSendToServer(int isMultiSend);
-
-/*
- * 获取SDN Root 服务器地址
- * 参数:
- * buf: 地址buff
- * 返回值:
- * 0成功,非0失败
- */
-TYPHOON_SERVER_EXTERN int TyphoonProxy_GetSDNRelayRootAddress(char *buf);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-

+ 0 - 169
创维盒子/RayProxy/include/Typhoon_C.h

@@ -1,169 +0,0 @@
-#ifndef __TYPHOON_C__H__
-#define __TYPHOON_C__H__
-
-#include "uv.h"
-#include "YyAuthenticationManageFile.h"
-#include "TyphoonDefine.h"
-
-#ifdef __cplusplus
-extern "C" 
-{
-#endif
-
-
-#ifdef _WIN32
-#ifdef DLL_IMPLEMENT
-#define TYPHOON_EXTERN __declspec(dllexport)
-#else 
-#define TYPHOON_EXTERN __declspec(dllimport) 
-#endif
-#else
-#define TYPHOON_EXTERN /* nothing */
-#endif
-
-/* TyPhoonConnCallBack 函数 */
-TYPHOON_EXTERN HTyPhoonConnCallBack CreateHTyPhoonConnCallBack(stTyPhoonConnCallBack *pCb);
-TYPHOON_EXTERN void DestroyHTyPhoonConnCallBack(HTyPhoonConnCallBack handle);
-TYPHOON_EXTERN void TyPhoonConnCallBack_SetPushData(HTyPhoonConnCallBack handle, int set);
-TYPHOON_EXTERN int TyPhoonConnCallBack_GetPushData();
-
-
-/* TyphoonChannel 相关函数 */
-TYPHOON_EXTERN int32_t TyphoonChannel_IsWritable(HTyphoonChannel handle);
-TYPHOON_EXTERN int32_t TyphoonChannel_Send(HTyphoonChannel handle, uint8_t* pData,int32_t len);
-TYPHOON_EXTERN int32_t TyphoonChannel_CompressSend(HTyphoonChannel handle, uint8_t* pData,int32_t len, uint8_t compressLevel);
-TYPHOON_EXTERN int32_t TyphoonChannel_SendWithExpiredTime(HTyphoonChannel handle, uint8_t* pData,int32_t len, uint32_t lifeTime);
-TYPHOON_EXTERN int32_t TyphoonChannel_SendWithMaxCount(HTyphoonChannel handle, uint8_t* pData,int32_t len, uint8_t maxCount);
-TYPHOON_EXTERN int32_t TyphoonChannel_SendWithAllFunction(HTyphoonChannel handle, 
-														   uint8_t* pData, 
-														   int32_t len, 
-														   uint8_t compresLevel, 
-														   uint32_t lifeTime, 
-														   uint8_t maxSendCount, 
-														   uint16_t fecPercent);
-
-
-TYPHOON_EXTERN HTyphoonBuff TyphoonChannel_Recv(HTyphoonChannel handle);
-TYPHOON_EXTERN int32_t TyphoonChannel_Close(HTyphoonChannel handle);
-TYPHOON_EXTERN int32_t TyphoonChannel_Shutdown(HTyphoonChannel handle);
-TYPHOON_EXTERN void TyphoonChannel_SetUserData(HTyphoonChannel handle, uint64_t Data);
-TYPHOON_EXTERN uint64_t TyphoonChannel_GetUserData(HTyphoonChannel handle);
-TYPHOON_EXTERN void TyphoonChannel_EnableWritableWatch(HTyphoonChannel handle);
-TYPHOON_EXTERN void TyphoonChannel_DisableWritableWatch(HTyphoonChannel handle);
-TYPHOON_EXTERN uint8_t TyphoonChannel_GetWritableWatch(HTyphoonChannel handle);
-TYPHOON_EXTERN uint8_t TyphoonChannel_GetWritableWatch(HTyphoonChannel handle);
-TYPHOON_EXTERN int64_t TyphoonChannel_GetUnackedDataLength(HTyphoonChannel handle);
-TYPHOON_EXTERN uint16_t TyphoonChannel_ChannelId(HTyphoonChannel handle);
-TYPHOON_EXTERN void TyphoonChannel_ShowChannel(HTyphoonChannel handle);
-TYPHOON_EXTERN int TyphoonChannel_OpenByClient(HTyphoonChannel handle);
-TYPHOON_EXTERN int TyphoonChannel_OpenByServer(HTyphoonChannel handle);
-TYPHOON_EXTERN int TyphoonChannel_OpenBySelf(HTyphoonChannel handle);
-
-
-/* TyphoonFecTun 函数 */
-TYPHOON_EXTERN int32_t TyphoonFecTun_Close(HTyphoonFecTun Tun);
-TYPHOON_EXTERN uint16_t TyphoonFecTun_TunnelId(HTyphoonFecTun Tun);
-
-
-
-/* TyphoonConn 函数 */
-TYPHOON_EXTERN HTyphoonConn CreateHTyphoonConn(HTyphoon handle);
-TYPHOON_EXTERN void DestroyHTyphoonConn(HTyphoonConn handle);
-TYPHOON_EXTERN int32_t TyphoonConn_ConnectTo(HTyphoonConn handle, char *ip, uint16_t port, int sync, uint8_t *data, uint16_t data_len);
-TYPHOON_EXTERN int32_t TyphoonConn_ConnectToEx(HTyphoonConn handle, char *ip, uint16_t port, char *bind_ip, uint16_t bind_port,int sync, uint8_t *data, uint16_t data_len);
-TYPHOON_EXTERN int32_t TyphoonConn_IsConnected(HTyphoonConn handle);
-TYPHOON_EXTERN HTyphoonChannel TyphoonConn_OpenChannel(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetTimeout(HTyphoonConn handle, stTyphoonTimerConfig *pCfg);
-TYPHOON_EXTERN stTyphoonTimerConfig TyphoonConn_GetTimeout(HTyphoonConn handle);
-TYPHOON_EXTERN uint16_t TyphoonConn_QueryChannelCount(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetMaxSegmentSize(HTyphoonConn handle, uint16_t Mss);
-TYPHOON_EXTERN uint16_t TyphoonConn_GetMaxSegmentSize(HTyphoonConn handle);
-TYPHOON_EXTERN uint16_t TyphoonConn_QueryMaxSegmentSize(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetUserData(HTyphoonConn handle, uint64_t Data);
-TYPHOON_EXTERN uint64_t TyphoonConn_GetUserData(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetSendBuffSize(HTyphoonConn handle, uint32_t Size);
-TYPHOON_EXTERN uint32_t TyphoonConn_GetSendBuffSize(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetRecvBuffSize(HTyphoonConn handle, uint32_t Size);
-TYPHOON_EXTERN uint32_t TyphoonConn_GetRecvBuffSize(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetConnCallback(HTyphoonConn handle, HTyPhoonConnCallBack cb);
-TYPHOON_EXTERN HTyPhoonConnCallBack TyphoonConn_GetConnCallback(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetFixedSendSpeed(HTyphoonConn handle, uint32_t Size);
-TYPHOON_EXTERN uint32_t TyphoonConn_GetFixedSendSpeed(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetMaxSendSpeed(HTyphoonConn handle, uint32_t Size);
-TYPHOON_EXTERN uint32_t TyphoonConn_GetMaxSendSpeed(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetMinSendSpeed(HTyphoonConn handle, uint32_t Size);
-TYPHOON_EXTERN uint32_t TyphoonConn_GetMinSendSpeed(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_TraverseChannels(HTyphoonConn handle, TyphonnConn_TraverseChannels_Cb_C traverse_cb, void* arg);
-TYPHOON_EXTERN uint32_t TyphoonConn_QueryRTT(HTyphoonConn handle);
-TYPHOON_EXTERN uint32_t TyphoonConn_QueryDropRate(HTyphoonConn handle);
-TYPHOON_EXTERN HTyphoonChannel TyphoonConn_GetDefaultChannel(HTyphoonConn handle);
-TYPHOON_EXTERN int32_t TyphoonConn_GetMaxAuthSendSpeed(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetCompress(HTyphoonConn handle, uint8_t CompressMethod);
-TYPHOON_EXTERN uint32_t TyphoonConn_GetCompress(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetAuth(HTyphoonConn handle, sTyphoonProxyLicense  *license);
-TYPHOON_EXTERN HTyphoonChannel TyphoonConn_GetChannel(HTyphoonConn handle, uint16_t cid);
-TYPHOON_EXTERN uint32_t TyphoonConn_QueryPeerRTT(HTyphoonConn handle);
-TYPHOON_EXTERN uint32_t TyphoonConn_QueryPeerDropRate(HTyphoonConn handle);
-TYPHOON_EXTERN TyphoonConnStats *TyphoonConn_GetStats(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_GetWanAddr(HTyphoonConn handle, struct sockaddr *addr);
-TYPHOON_EXTERN void TyphoonConn_GetRemoteAddr(HTyphoonConn handle, struct sockaddr *addr);
-TYPHOON_EXTERN uint32_t TyphoonConn_GetCurSendSpeed(HTyphoonConn handle);
-TYPHOON_EXTERN int TyphoonConn_IsClient(HTyphoonConn handle);
-TYPHOON_EXTERN int TyphoonConn_IsServer(HTyphoonConn handle);
-TYPHOON_EXTERN uint8_t TyphoonConn_GetTransferMode(HTyphoonConn handle);
-TYPHOON_EXTERN uint8_t TyphoonConn_SetTransferMode(HTyphoonConn handle);
-TYPHOON_EXTERN void TyphoonConn_SetPacketLoss(HTyphoonConn handle, uint16_t percent);
-TYPHOON_EXTERN int TyphoonConn_IsPacketLossSet(HTyphoonConn handle);
-TYPHOON_EXTERN int TyphoonConn_GetPacketLoss(HTyphoonConn handle);
-TYPHOON_EXTERN HTyphoonFecTun TyphoonConn_OpenFecTun(HTyphoonConn handle, uint16_t channelCount);
-TYPHOON_EXTERN void TyphoonConn_CloseFecTun(HTyphoonConn handle, uint16_t tunId);
-
-
-
-/* Typhoon 函数 */
-TYPHOON_EXTERN HTyphoon CreateHTyphoon(const char *pLicensePath, const char *pLicenseAddr, int licensePort, int logId);
-TYPHOON_EXTERN void DestroyHTyphoon(HTyphoon handle);
-TYPHOON_EXTERN int Typhoon_ActiveLicense(HTyphoon handle, char *licenseCode, int productType);
-TYPHOON_EXTERN int Typhoon_StartWebServer(HTyphoon handle,  const char *pServerAddr, int serverPort);
-TYPHOON_EXTERN int Typhoon_GetLicenseInfo(HTyphoon handle, stLocalConfig *pLicenseInfo);
-TYPHOON_EXTERN void Typhoon_SetConnCallback(HTyphoon handle, HTyPhoonConnCallBack hCb);
-TYPHOON_EXTERN int Typhoon_InitUDPSocket(HTyphoon handle, char* ip, uint16_t port);
-TYPHOON_EXTERN SOCKADDR Typhoon_GetLocalAddr(HTyphoon handle);
-TYPHOON_EXTERN int32_t Typhoon_GetConnectionCount(HTyphoon handle);
-TYPHOON_EXTERN stTyphoonCfg Typhoon_GetTyphoonConfig(HTyphoon handle);
-TYPHOON_EXTERN void Typhoon_SetTyphoonConfig(HTyphoon handle, stTyphoonCfg *pCfg);
-TYPHOON_EXTERN stTyphoonConnCfg Typhoon_GetConnDefaultCfg(HTyphoon handle);
-TYPHOON_EXTERN void Typhoon_SetConnDefaultCfg(HTyphoon handle, stTyphoonConnCfg *pCfg);
-TYPHOON_EXTERN uv_loop_t *Typhoon_GetMainLoop(HTyphoon handle);
-TYPHOON_EXTERN void Typhoon_SetAppInitCB(HTyphoon handle, Typhoon_AppInit_Callback Init);
-TYPHOON_EXTERN void Typhoon_SetAppUninitCB(HTyphoon handle, Typhoon_AppUninit_Callback Uninit);
-TYPHOON_EXTERN void Typhoon_SetConnCallback(HTyphoon handle, HTyPhoonConnCallBack hCb);
-TYPHOON_EXTERN int Typhoon_SynchronizedExecute(HTyphoon handle, Typhoon_SynchronizedExecute_Cb cb, void *userdata);
-TYPHOON_EXTERN char *Typhoon_GetVersion();
-TYPHOON_EXTERN void Typhoon_DisableUdpCheckSum(HTyphoon handle);
-TYPHOON_EXTERN int Typhoon_SetCaPath(HTyphoon handle, char *caPath);
-TYPHOON_EXTERN int Typhoon_SetSocks5ProxyConfig(HTyphoon handle, stTyphoonSocks5Config *pCfg);
-TYPHOON_EXTERN stTyphoonSocks5Config *Typhoon_GetSocks5ProxyConfig(HTyphoon handle);
-TYPHOON_EXTERN void Typhoon_SetRemainingFlow(HTyphoon handle, const int64_t remainingFlow);
-TYPHOON_EXTERN int Typhoon_SetSDNDataDirestory(char *path);
-TYPHOON_EXTERN void Typhoon_SetSDNPort(uint32_t port);
-TYPHOON_EXTERN TyphoonCfg* Typhoon_GetGlobalCfg();
-TYPHOON_EXTERN void Typhoon_SDNId2IpPort(char * ztsid, char *ipv4, int ipv4_len, short *port);
-TYPHOON_EXTERN void Typhoon_GlobalInit(int clockInterval);
-TYPHOON_EXTERN void Typhoon_UseSDN();
-TYPHOON_EXTERN int Typhoon_IsUseSDN();
-TYPHOON_EXTERN uint64_t Typhoon_GetNodeId();
-
-
-/* TyphoonBuff 函数 */
-//应用无法直接Create TyphoonBuff实例, 在PULL数据的模式下, 应用可以通过连接的recv函数获取TyphoonBuff
-//此处的操作仅用于获取缓存头指针/缓存数据长度
-TYPHOON_EXTERN void DestroyHTyphoonBuff(HTyphoonBuff buf);
-TYPHOON_EXTERN uint8_t* TyphoonBuff_GetBuff(HTyphoonBuff buf);
-TYPHOON_EXTERN int32_t TyphoonBuff_GetLen(HTyphoonBuff buf);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 84
创维盒子/RayProxy/include/YyAuthenticationManageFile.h

@@ -1,84 +0,0 @@
-#ifndef __YY_AUTHENTICATION_MANAGE_FILE_H__
-#define __YY_AUTHENTICATION_MANAGE_FILE_H__
-
-#ifdef __cplusplus
-extern "C" 
-{
-#endif
-
-#ifdef _WIN32
-#ifdef YY_DLL_IMPLEMENT
-#define YY_AUTHERNTICATION_EXTERN __declspec(dllexport)
-#else 
-#define YY_AUTHERNTICATION_EXTERN __declspec(dllimport) 
-#endif
-#else
-#define YY_AUTHERNTICATION_EXTERN /* nothing */
-#endif
-
-#define LOCAL_CONFIG_BUF        128
-typedef struct tm_local_config
-{
-    char code[LOCAL_CONFIG_BUF];
-    char duration[LOCAL_CONFIG_BUF];
-    char max_bandwidth[LOCAL_CONFIG_BUF];
-    char expire_date[LOCAL_CONFIG_BUF];
-    char activate_date[LOCAL_CONFIG_BUF];
-    char server_date[LOCAL_CONFIG_BUF];
-    char low_bound_bandwidth[LOCAL_CONFIG_BUF];
-
-    char server_key[LOCAL_CONFIG_BUF];
-    char status[LOCAL_CONFIG_BUF];
-    int productId;
-	int category;
-	int bandwidth;
-	int active_state; /* 0:no_active;1:active;2:expire */
-	int client_number;
-}stLocalConfig;
-
-typedef struct offline_cfg_s{
-    char sn[32];
-    int productId;
-    int duration;
-    time_t activateDate;
-    time_t endDate;
-    int clientNum;  /*typhoon client number*/
-    int bandwidth;
-	int category;
-	int traffic; /*GB*/
-	int originTraffic; /*GB*/
-	int appClientNum;  /*application client number*/
-	char expire_date[LOCAL_CONFIG_BUF];
-    char activate_date[LOCAL_CONFIG_BUF];
-}offline_cfg_t;
-
-/*
-tm_read_config      read configuration from local config file
-@file_path : local configuration file absolute path
-@pOutConfig: configuration information
-return :   0           OK
-          non-zeor     failed
-*/
-YY_AUTHERNTICATION_EXTERN int tm_read_file(char *pbuff, int buff_len, int *out_len);
-YY_AUTHERNTICATION_EXTERN int tm_parse_file(stLocalConfig *pOutConfig, char *pfile);
-YY_AUTHERNTICATION_EXTERN int tm_read_config(stLocalConfig *pOutConfig);
-YY_AUTHERNTICATION_EXTERN int tm_set_caPath(char *caPath);
-YY_AUTHERNTICATION_EXTERN int tm_delete_license_file();
-
-int tm_build_json(char *pOut, stLocalConfig *pConfig);
-int tm_write_json_to_file(char *pJson);
-/*
-tm_write_config      write configuration into local config file
-@pOutConfig: configuration information
-@file_path : local configuration file absolute path
-return :   0           OK
-          non-zeor     failed
-*/
-YY_AUTHERNTICATION_EXTERN int tm_write_config(stLocalConfig *pConfig);
-YY_AUTHERNTICATION_EXTERN int write_offline_config(offline_cfg_t *pConfig);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 52
创维盒子/RayProxy/include/net_detection.h

@@ -1,52 +0,0 @@
-#pragma once
-#include <string>
-
-enum NatBehavior
-{
-    UnknownBehavior,
-    DirectMapping,                  // IP address and port are the same between client and server view (NO NAT)
-    EndpointIndependentMapping,     // same mapping regardless of IP:port original packet sent to (the kind of NAT we like)
-    AddressDependentMapping,        // mapping changes for local socket based on remote IP address only, but remote port can change (partially symmetric, not great)
-    AddressAndPortDependentMapping  // different port mapping if the ip address or port change (symmetric NAT, difficult to predict port mappings)
-};
-
-enum NatFiltering
-{
-    UnknownFiltering,
-    DirectConnectionFiltering,
-    EndpointIndependentFiltering,    // shouldn't be common unless connection is already direct (can receive on mapped address from anywhere regardless of where the original send went)
-    AddressDependentFiltering,       // IP-restricted NAT
-    AddressAndPortDependentFiltering // port-restricted NAT
-};
-
-enum NAT_TYPE
-{
-	NAT_UnknownType,
-	NAT_DirectMapping,
-	NAT_FullCone,
-	NAT_IpRestricted,
-	NAT_PortRestricted,
-	NAT_Symmetric
-};
-
-//先检测behavior,再检测filtering,结合2者判断
-/*
-   1、NAT_BEHAVIOR_UnknownBehavior  不用继续测
-   2、AT_BEHAVIOR_DirectMapping   直连,没有nat,不用继续测
-   3、NAT_BEHAVIOR_EndpointIndependentMapping
-	 1)NAT_Filtering_UnknownFiltering  未定义
-	 2)NAT_Filtering_DirectConnectionFiltering, 没有过滤,认为全锥形
-	 3)NAT_Filtering_EndpointIndependentFiltering, 端口无关过滤,对应全锥形
-	 4)NAT_Filtering_AddressDependentFiltering,    地址依赖过滤,认为是地址受限锥形
-	 5)NAT_Filtering_AddressAndPortDependentFiltering 地址和端口依赖过滤,认为是 地址端口受限锥形
-   4、 NAT_BEHAVIOR_AddressDependentMapping
-	  和3一样
-   5、NAT_BEHAVIOR_AddressAndPortDependentMapping  认为是对称型
-*/
-
-namespace ServiceNatDetection
-{
-NatBehavior get_nat_behavior(std::string& nat_ip, const std::string& stun_server, uint16_t stun_port);
-NatFiltering get_nat_filtering(std::string& nat_ip, const std::string& stun_server, uint16_t stun_port);
-NAT_TYPE get_nat_type(NatBehavior natBehavior, NatFiltering natFiltering);
-};

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 1782
创维盒子/RayProxy/include/uv.h


+ 0 - 32
创维盒子/RayProxy/include/uv/aix.h

@@ -1,32 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef UV_AIX_H
-#define UV_AIX_H
-
-#define UV_PLATFORM_LOOP_FIELDS                                               \
-  int fs_fd;                                                                  \
-
-#define UV_PLATFORM_FS_EVENT_FIELDS                                           \
-  uv__io_t event_watcher;                                                     \
-  char *dir_filename;                                                         \
-
-#endif /* UV_AIX_H */

+ 0 - 54
创维盒子/RayProxy/include/uv/android-ifaddrs.h

@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1995, 1999
- *	Berkeley Software Design, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp
- */
-
-#ifndef	_IFADDRS_H_
-#define	_IFADDRS_H_
-
-struct ifaddrs {
-	struct ifaddrs  *ifa_next;
-	char		*ifa_name;
-	unsigned int	 ifa_flags;
-	struct sockaddr	*ifa_addr;
-	struct sockaddr	*ifa_netmask;
-	struct sockaddr	*ifa_dstaddr;
-	void		*ifa_data;
-};
-
-/*
- * This may have been defined in <net/if.h>.  Note that if <net/if.h> is
- * to be included it must be included before this header file.
- */
-#ifndef	ifa_broadaddr
-#define	ifa_broadaddr	ifa_dstaddr	/* broadcast address interface */
-#endif
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-extern int getifaddrs(struct ifaddrs **ifap);
-extern void freeifaddrs(struct ifaddrs *ifa);
-__END_DECLS
-
-#endif

+ 0 - 34
创维盒子/RayProxy/include/uv/bsd.h

@@ -1,34 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef UV_BSD_H
-#define UV_BSD_H
-
-#define UV_PLATFORM_FS_EVENT_FIELDS                                           \
-  uv__io_t event_watcher;                                                     \
-
-#define UV_IO_PRIVATE_PLATFORM_FIELDS                                         \
-  int rcount;                                                                 \
-  int wcount;                                                                 \
-
-#define UV_HAVE_KQUEUE 1
-
-#endif /* UV_BSD_H */

+ 0 - 61
创维盒子/RayProxy/include/uv/darwin.h

@@ -1,61 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef UV_DARWIN_H
-#define UV_DARWIN_H
-
-#if defined(__APPLE__) && defined(__MACH__)
-# include <mach/mach.h>
-# include <mach/task.h>
-# include <mach/semaphore.h>
-# include <TargetConditionals.h>
-# define UV_PLATFORM_SEM_T semaphore_t
-#endif
-
-#define UV_IO_PRIVATE_PLATFORM_FIELDS                                         \
-  int rcount;                                                                 \
-  int wcount;                                                                 \
-
-#define UV_PLATFORM_LOOP_FIELDS                                               \
-  uv_thread_t cf_thread;                                                      \
-  void* _cf_reserved;                                                         \
-  void* cf_state;                                                             \
-  uv_mutex_t cf_mutex;                                                        \
-  uv_sem_t cf_sem;                                                            \
-  void* cf_signals[2];                                                        \
-
-#define UV_PLATFORM_FS_EVENT_FIELDS                                           \
-  uv__io_t event_watcher;                                                     \
-  char* realpath;                                                             \
-  int realpath_len;                                                           \
-  int cf_flags;                                                               \
-  uv_async_t* cf_cb;                                                          \
-  void* cf_events[2];                                                         \
-  void* cf_member[2];                                                         \
-  int cf_error;                                                               \
-  uv_mutex_t cf_mutex;                                                        \
-
-#define UV_STREAM_PRIVATE_PLATFORM_FIELDS                                     \
-  void* select;                                                               \
-
-#define UV_HAVE_KQUEUE 1
-
-#endif /* UV_DARWIN_H */

+ 0 - 448
创维盒子/RayProxy/include/uv/errno.h

@@ -1,448 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef UV_ERRNO_H_
-#define UV_ERRNO_H_
-
-#include <errno.h>
-#if EDOM > 0
-# define UV__ERR(x) (-(x))
-#else
-# define UV__ERR(x) (x)
-#endif
-
-#define UV__EOF     (-4095)
-#define UV__UNKNOWN (-4094)
-
-#define UV__EAI_ADDRFAMILY  (-3000)
-#define UV__EAI_AGAIN       (-3001)
-#define UV__EAI_BADFLAGS    (-3002)
-#define UV__EAI_CANCELED    (-3003)
-#define UV__EAI_FAIL        (-3004)
-#define UV__EAI_FAMILY      (-3005)
-#define UV__EAI_MEMORY      (-3006)
-#define UV__EAI_NODATA      (-3007)
-#define UV__EAI_NONAME      (-3008)
-#define UV__EAI_OVERFLOW    (-3009)
-#define UV__EAI_SERVICE     (-3010)
-#define UV__EAI_SOCKTYPE    (-3011)
-#define UV__EAI_BADHINTS    (-3013)
-#define UV__EAI_PROTOCOL    (-3014)
-
-/* Only map to the system errno on non-Windows platforms. It's apparently
- * a fairly common practice for Windows programmers to redefine errno codes.
- */
-#if defined(E2BIG) && !defined(_WIN32)
-# define UV__E2BIG UV__ERR(E2BIG)
-#else
-# define UV__E2BIG (-4093)
-#endif
-
-#if defined(EACCES) && !defined(_WIN32)
-# define UV__EACCES UV__ERR(EACCES)
-#else
-# define UV__EACCES (-4092)
-#endif
-
-#if defined(EADDRINUSE) && !defined(_WIN32)
-# define UV__EADDRINUSE UV__ERR(EADDRINUSE)
-#else
-# define UV__EADDRINUSE (-4091)
-#endif
-
-#if defined(EADDRNOTAVAIL) && !defined(_WIN32)
-# define UV__EADDRNOTAVAIL UV__ERR(EADDRNOTAVAIL)
-#else
-# define UV__EADDRNOTAVAIL (-4090)
-#endif
-
-#if defined(EAFNOSUPPORT) && !defined(_WIN32)
-# define UV__EAFNOSUPPORT UV__ERR(EAFNOSUPPORT)
-#else
-# define UV__EAFNOSUPPORT (-4089)
-#endif
-
-#if defined(EAGAIN) && !defined(_WIN32)
-# define UV__EAGAIN UV__ERR(EAGAIN)
-#else
-# define UV__EAGAIN (-4088)
-#endif
-
-#if defined(EALREADY) && !defined(_WIN32)
-# define UV__EALREADY UV__ERR(EALREADY)
-#else
-# define UV__EALREADY (-4084)
-#endif
-
-#if defined(EBADF) && !defined(_WIN32)
-# define UV__EBADF UV__ERR(EBADF)
-#else
-# define UV__EBADF (-4083)
-#endif
-
-#if defined(EBUSY) && !defined(_WIN32)
-# define UV__EBUSY UV__ERR(EBUSY)
-#else
-# define UV__EBUSY (-4082)
-#endif
-
-#if defined(ECANCELED) && !defined(_WIN32)
-# define UV__ECANCELED UV__ERR(ECANCELED)
-#else
-# define UV__ECANCELED (-4081)
-#endif
-
-#if defined(ECHARSET) && !defined(_WIN32)
-# define UV__ECHARSET UV__ERR(ECHARSET)
-#else
-# define UV__ECHARSET (-4080)
-#endif
-
-#if defined(ECONNABORTED) && !defined(_WIN32)
-# define UV__ECONNABORTED UV__ERR(ECONNABORTED)
-#else
-# define UV__ECONNABORTED (-4079)
-#endif
-
-#if defined(ECONNREFUSED) && !defined(_WIN32)
-# define UV__ECONNREFUSED UV__ERR(ECONNREFUSED)
-#else
-# define UV__ECONNREFUSED (-4078)
-#endif
-
-#if defined(ECONNRESET) && !defined(_WIN32)
-# define UV__ECONNRESET UV__ERR(ECONNRESET)
-#else
-# define UV__ECONNRESET (-4077)
-#endif
-
-#if defined(EDESTADDRREQ) && !defined(_WIN32)
-# define UV__EDESTADDRREQ UV__ERR(EDESTADDRREQ)
-#else
-# define UV__EDESTADDRREQ (-4076)
-#endif
-
-#if defined(EEXIST) && !defined(_WIN32)
-# define UV__EEXIST UV__ERR(EEXIST)
-#else
-# define UV__EEXIST (-4075)
-#endif
-
-#if defined(EFAULT) && !defined(_WIN32)
-# define UV__EFAULT UV__ERR(EFAULT)
-#else
-# define UV__EFAULT (-4074)
-#endif
-
-#if defined(EHOSTUNREACH) && !defined(_WIN32)
-# define UV__EHOSTUNREACH UV__ERR(EHOSTUNREACH)
-#else
-# define UV__EHOSTUNREACH (-4073)
-#endif
-
-#if defined(EINTR) && !defined(_WIN32)
-# define UV__EINTR UV__ERR(EINTR)
-#else
-# define UV__EINTR (-4072)
-#endif
-
-#if defined(EINVAL) && !defined(_WIN32)
-# define UV__EINVAL UV__ERR(EINVAL)
-#else
-# define UV__EINVAL (-4071)
-#endif
-
-#if defined(EIO) && !defined(_WIN32)
-# define UV__EIO UV__ERR(EIO)
-#else
-# define UV__EIO (-4070)
-#endif
-
-#if defined(EISCONN) && !defined(_WIN32)
-# define UV__EISCONN UV__ERR(EISCONN)
-#else
-# define UV__EISCONN (-4069)
-#endif
-
-#if defined(EISDIR) && !defined(_WIN32)
-# define UV__EISDIR UV__ERR(EISDIR)
-#else
-# define UV__EISDIR (-4068)
-#endif
-
-#if defined(ELOOP) && !defined(_WIN32)
-# define UV__ELOOP UV__ERR(ELOOP)
-#else
-# define UV__ELOOP (-4067)
-#endif
-
-#if defined(EMFILE) && !defined(_WIN32)
-# define UV__EMFILE UV__ERR(EMFILE)
-#else
-# define UV__EMFILE (-4066)
-#endif
-
-#if defined(EMSGSIZE) && !defined(_WIN32)
-# define UV__EMSGSIZE UV__ERR(EMSGSIZE)
-#else
-# define UV__EMSGSIZE (-4065)
-#endif
-
-#if defined(ENAMETOOLONG) && !defined(_WIN32)
-# define UV__ENAMETOOLONG UV__ERR(ENAMETOOLONG)
-#else
-# define UV__ENAMETOOLONG (-4064)
-#endif
-
-#if defined(ENETDOWN) && !defined(_WIN32)
-# define UV__ENETDOWN UV__ERR(ENETDOWN)
-#else
-# define UV__ENETDOWN (-4063)
-#endif
-
-#if defined(ENETUNREACH) && !defined(_WIN32)
-# define UV__ENETUNREACH UV__ERR(ENETUNREACH)
-#else
-# define UV__ENETUNREACH (-4062)
-#endif
-
-#if defined(ENFILE) && !defined(_WIN32)
-# define UV__ENFILE UV__ERR(ENFILE)
-#else
-# define UV__ENFILE (-4061)
-#endif
-
-#if defined(ENOBUFS) && !defined(_WIN32)
-# define UV__ENOBUFS UV__ERR(ENOBUFS)
-#else
-# define UV__ENOBUFS (-4060)
-#endif
-
-#if defined(ENODEV) && !defined(_WIN32)
-# define UV__ENODEV UV__ERR(ENODEV)
-#else
-# define UV__ENODEV (-4059)
-#endif
-
-#if defined(ENOENT) && !defined(_WIN32)
-# define UV__ENOENT UV__ERR(ENOENT)
-#else
-# define UV__ENOENT (-4058)
-#endif
-
-#if defined(ENOMEM) && !defined(_WIN32)
-# define UV__ENOMEM UV__ERR(ENOMEM)
-#else
-# define UV__ENOMEM (-4057)
-#endif
-
-#if defined(ENONET) && !defined(_WIN32)
-# define UV__ENONET UV__ERR(ENONET)
-#else
-# define UV__ENONET (-4056)
-#endif
-
-#if defined(ENOSPC) && !defined(_WIN32)
-# define UV__ENOSPC UV__ERR(ENOSPC)
-#else
-# define UV__ENOSPC (-4055)
-#endif
-
-#if defined(ENOSYS) && !defined(_WIN32)
-# define UV__ENOSYS UV__ERR(ENOSYS)
-#else
-# define UV__ENOSYS (-4054)
-#endif
-
-#if defined(ENOTCONN) && !defined(_WIN32)
-# define UV__ENOTCONN UV__ERR(ENOTCONN)
-#else
-# define UV__ENOTCONN (-4053)
-#endif
-
-#if defined(ENOTDIR) && !defined(_WIN32)
-# define UV__ENOTDIR UV__ERR(ENOTDIR)
-#else
-# define UV__ENOTDIR (-4052)
-#endif
-
-#if defined(ENOTEMPTY) && !defined(_WIN32)
-# define UV__ENOTEMPTY UV__ERR(ENOTEMPTY)
-#else
-# define UV__ENOTEMPTY (-4051)
-#endif
-
-#if defined(ENOTSOCK) && !defined(_WIN32)
-# define UV__ENOTSOCK UV__ERR(ENOTSOCK)
-#else
-# define UV__ENOTSOCK (-4050)
-#endif
-
-#if defined(ENOTSUP) && !defined(_WIN32)
-# define UV__ENOTSUP UV__ERR(ENOTSUP)
-#else
-# define UV__ENOTSUP (-4049)
-#endif
-
-#if defined(EPERM) && !defined(_WIN32)
-# define UV__EPERM UV__ERR(EPERM)
-#else
-# define UV__EPERM (-4048)
-#endif
-
-#if defined(EPIPE) && !defined(_WIN32)
-# define UV__EPIPE UV__ERR(EPIPE)
-#else
-# define UV__EPIPE (-4047)
-#endif
-
-#if defined(EPROTO) && !defined(_WIN32)
-# define UV__EPROTO UV__ERR(EPROTO)
-#else
-# define UV__EPROTO UV__ERR(4046)
-#endif
-
-#if defined(EPROTONOSUPPORT) && !defined(_WIN32)
-# define UV__EPROTONOSUPPORT UV__ERR(EPROTONOSUPPORT)
-#else
-# define UV__EPROTONOSUPPORT (-4045)
-#endif
-
-#if defined(EPROTOTYPE) && !defined(_WIN32)
-# define UV__EPROTOTYPE UV__ERR(EPROTOTYPE)
-#else
-# define UV__EPROTOTYPE (-4044)
-#endif
-
-#if defined(EROFS) && !defined(_WIN32)
-# define UV__EROFS UV__ERR(EROFS)
-#else
-# define UV__EROFS (-4043)
-#endif
-
-#if defined(ESHUTDOWN) && !defined(_WIN32)
-# define UV__ESHUTDOWN UV__ERR(ESHUTDOWN)
-#else
-# define UV__ESHUTDOWN (-4042)
-#endif
-
-#if defined(ESPIPE) && !defined(_WIN32)
-# define UV__ESPIPE UV__ERR(ESPIPE)
-#else
-# define UV__ESPIPE (-4041)
-#endif
-
-#if defined(ESRCH) && !defined(_WIN32)
-# define UV__ESRCH UV__ERR(ESRCH)
-#else
-# define UV__ESRCH (-4040)
-#endif
-
-#if defined(ETIMEDOUT) && !defined(_WIN32)
-# define UV__ETIMEDOUT UV__ERR(ETIMEDOUT)
-#else
-# define UV__ETIMEDOUT (-4039)
-#endif
-
-#if defined(ETXTBSY) && !defined(_WIN32)
-# define UV__ETXTBSY UV__ERR(ETXTBSY)
-#else
-# define UV__ETXTBSY (-4038)
-#endif
-
-#if defined(EXDEV) && !defined(_WIN32)
-# define UV__EXDEV UV__ERR(EXDEV)
-#else
-# define UV__EXDEV (-4037)
-#endif
-
-#if defined(EFBIG) && !defined(_WIN32)
-# define UV__EFBIG UV__ERR(EFBIG)
-#else
-# define UV__EFBIG (-4036)
-#endif
-
-#if defined(ENOPROTOOPT) && !defined(_WIN32)
-# define UV__ENOPROTOOPT UV__ERR(ENOPROTOOPT)
-#else
-# define UV__ENOPROTOOPT (-4035)
-#endif
-
-#if defined(ERANGE) && !defined(_WIN32)
-# define UV__ERANGE UV__ERR(ERANGE)
-#else
-# define UV__ERANGE (-4034)
-#endif
-
-#if defined(ENXIO) && !defined(_WIN32)
-# define UV__ENXIO UV__ERR(ENXIO)
-#else
-# define UV__ENXIO (-4033)
-#endif
-
-#if defined(EMLINK) && !defined(_WIN32)
-# define UV__EMLINK UV__ERR(EMLINK)
-#else
-# define UV__EMLINK (-4032)
-#endif
-
-/* EHOSTDOWN is not visible on BSD-like systems when _POSIX_C_SOURCE is
- * defined. Fortunately, its value is always 64 so it's possible albeit
- * icky to hard-code it.
- */
-#if defined(EHOSTDOWN) && !defined(_WIN32)
-# define UV__EHOSTDOWN UV__ERR(EHOSTDOWN)
-#elif defined(__APPLE__) || \
-      defined(__DragonFly__) || \
-      defined(__FreeBSD__) || \
-      defined(__FreeBSD_kernel__) || \
-      defined(__NetBSD__) || \
-      defined(__OpenBSD__)
-# define UV__EHOSTDOWN (-64)
-#else
-# define UV__EHOSTDOWN (-4031)
-#endif
-
-#if defined(EREMOTEIO) && !defined(_WIN32)
-# define UV__EREMOTEIO UV__ERR(EREMOTEIO)
-#else
-# define UV__EREMOTEIO (-4030)
-#endif
-
-#if defined(ENOTTY) && !defined(_WIN32)
-# define UV__ENOTTY UV__ERR(ENOTTY)
-#else
-# define UV__ENOTTY (-4029)
-#endif
-
-#if defined(EFTYPE) && !defined(_WIN32)
-# define UV__EFTYPE UV__ERR(EFTYPE)
-#else
-# define UV__EFTYPE (-4028)
-#endif
-
-#if defined(EILSEQ) && !defined(_WIN32)
-# define UV__EILSEQ UV__ERR(EILSEQ)
-#else
-# define UV__EILSEQ (-4027)
-#endif
-
-#endif /* UV_ERRNO_H_ */

+ 0 - 34
创维盒子/RayProxy/include/uv/linux.h

@@ -1,34 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef UV_LINUX_H
-#define UV_LINUX_H
-
-#define UV_PLATFORM_LOOP_FIELDS                                               \
-  uv__io_t inotify_read_watcher;                                              \
-  void* inotify_watchers;                                                     \
-  int inotify_fd;                                                             \
-
-#define UV_PLATFORM_FS_EVENT_FIELDS                                           \
-  void* watchers[2];                                                          \
-  int wd;                                                                     \
-
-#endif /* UV_LINUX_H */

+ 0 - 33
创维盒子/RayProxy/include/uv/os390.h

@@ -1,33 +0,0 @@
-/* Copyright libuv project contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef UV_MVS_H
-#define UV_MVS_H
-
-#define UV_PLATFORM_SEM_T long
-
-#define UV_PLATFORM_LOOP_FIELDS                                               \
-  void* ep;                                                                   \
-
-#define UV_PLATFORM_FS_EVENT_FIELDS                                           \
-  char rfis_rftok[8];                                                         \
-
-#endif /* UV_MVS_H */

+ 0 - 31
创维盒子/RayProxy/include/uv/posix.h

@@ -1,31 +0,0 @@
-/* Copyright libuv project contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef UV_POSIX_H
-#define UV_POSIX_H
-
-#define UV_PLATFORM_LOOP_FIELDS                                               \
-  struct pollfd* poll_fds;                                                    \
-  size_t poll_fds_used;                                                       \
-  size_t poll_fds_size;                                                       \
-  unsigned char poll_fds_iterating;                                           \
-
-#endif /* UV_POSIX_H */

+ 0 - 247
创维盒子/RayProxy/include/uv/stdint-msvc2008.h

@@ -1,247 +0,0 @@
-// ISO C9x  compliant stdint.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
-// 
-//  Copyright (c) 2006-2008 Alexander Chemeris
-// 
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// 
-//   1. Redistributions of source code must retain the above copyright notice,
-//      this list of conditions and the following disclaimer.
-// 
-//   2. Redistributions in binary form must reproduce the above copyright
-//      notice, this list of conditions and the following disclaimer in the
-//      documentation and/or other materials provided with the distribution.
-// 
-//   3. The name of the author may be used to endorse or promote products
-//      derived from this software without specific prior written permission.
-// 
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// 
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef _MSC_VER // [
-#error "Use this header only with Microsoft Visual C++ compilers!"
-#endif // _MSC_VER ]
-
-#ifndef _MSC_STDINT_H_ // [
-#define _MSC_STDINT_H_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif
-
-#include <limits.h>
-
-// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
-// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
-// or compiler give many errors like this:
-//   error C2733: second C linkage of overloaded function 'wmemchr' not allowed
-#ifdef __cplusplus
-extern "C" {
-#endif
-#  include <wchar.h>
-#ifdef __cplusplus
-}
-#endif
-
-// Define _W64 macros to mark types changing their size, like intptr_t.
-#ifndef _W64
-#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
-#     define _W64 __w64
-#  else
-#     define _W64
-#  endif
-#endif
-
-
-// 7.18.1 Integer types
-
-// 7.18.1.1 Exact-width integer types
-
-// Visual Studio 6 and Embedded Visual C++ 4 doesn't
-// realize that, e.g. char has the same size as __int8
-// so we give up on __intX for them.
-#if (_MSC_VER < 1300)
-   typedef signed char       int8_t;
-   typedef signed short      int16_t;
-   typedef signed int        int32_t;
-   typedef unsigned char     uint8_t;
-   typedef unsigned short    uint16_t;
-   typedef unsigned int      uint32_t;
-#else
-   typedef signed __int8     int8_t;
-   typedef signed __int16    int16_t;
-   typedef signed __int32    int32_t;
-   typedef unsigned __int8   uint8_t;
-   typedef unsigned __int16  uint16_t;
-   typedef unsigned __int32  uint32_t;
-#endif
-typedef signed __int64       int64_t;
-typedef unsigned __int64     uint64_t;
-
-
-// 7.18.1.2 Minimum-width integer types
-typedef int8_t    int_least8_t;
-typedef int16_t   int_least16_t;
-typedef int32_t   int_least32_t;
-typedef int64_t   int_least64_t;
-typedef uint8_t   uint_least8_t;
-typedef uint16_t  uint_least16_t;
-typedef uint32_t  uint_least32_t;
-typedef uint64_t  uint_least64_t;
-
-// 7.18.1.3 Fastest minimum-width integer types
-typedef int8_t    int_fast8_t;
-typedef int16_t   int_fast16_t;
-typedef int32_t   int_fast32_t;
-typedef int64_t   int_fast64_t;
-typedef uint8_t   uint_fast8_t;
-typedef uint16_t  uint_fast16_t;
-typedef uint32_t  uint_fast32_t;
-typedef uint64_t  uint_fast64_t;
-
-// 7.18.1.4 Integer types capable of holding object pointers
-#ifdef _WIN64 // [
-   typedef signed __int64    intptr_t;
-   typedef unsigned __int64  uintptr_t;
-#else // _WIN64 ][
-   typedef _W64 signed int   intptr_t;
-   typedef _W64 unsigned int uintptr_t;
-#endif // _WIN64 ]
-
-// 7.18.1.5 Greatest-width integer types
-typedef int64_t   intmax_t;
-typedef uint64_t  uintmax_t;
-
-
-// 7.18.2 Limits of specified-width integer types
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259
-
-// 7.18.2.1 Limits of exact-width integer types
-#define INT8_MIN     ((int8_t)_I8_MIN)
-#define INT8_MAX     _I8_MAX
-#define INT16_MIN    ((int16_t)_I16_MIN)
-#define INT16_MAX    _I16_MAX
-#define INT32_MIN    ((int32_t)_I32_MIN)
-#define INT32_MAX    _I32_MAX
-#define INT64_MIN    ((int64_t)_I64_MIN)
-#define INT64_MAX    _I64_MAX
-#define UINT8_MAX    _UI8_MAX
-#define UINT16_MAX   _UI16_MAX
-#define UINT32_MAX   _UI32_MAX
-#define UINT64_MAX   _UI64_MAX
-
-// 7.18.2.2 Limits of minimum-width integer types
-#define INT_LEAST8_MIN    INT8_MIN
-#define INT_LEAST8_MAX    INT8_MAX
-#define INT_LEAST16_MIN   INT16_MIN
-#define INT_LEAST16_MAX   INT16_MAX
-#define INT_LEAST32_MIN   INT32_MIN
-#define INT_LEAST32_MAX   INT32_MAX
-#define INT_LEAST64_MIN   INT64_MIN
-#define INT_LEAST64_MAX   INT64_MAX
-#define UINT_LEAST8_MAX   UINT8_MAX
-#define UINT_LEAST16_MAX  UINT16_MAX
-#define UINT_LEAST32_MAX  UINT32_MAX
-#define UINT_LEAST64_MAX  UINT64_MAX
-
-// 7.18.2.3 Limits of fastest minimum-width integer types
-#define INT_FAST8_MIN    INT8_MIN
-#define INT_FAST8_MAX    INT8_MAX
-#define INT_FAST16_MIN   INT16_MIN
-#define INT_FAST16_MAX   INT16_MAX
-#define INT_FAST32_MIN   INT32_MIN
-#define INT_FAST32_MAX   INT32_MAX
-#define INT_FAST64_MIN   INT64_MIN
-#define INT_FAST64_MAX   INT64_MAX
-#define UINT_FAST8_MAX   UINT8_MAX
-#define UINT_FAST16_MAX  UINT16_MAX
-#define UINT_FAST32_MAX  UINT32_MAX
-#define UINT_FAST64_MAX  UINT64_MAX
-
-// 7.18.2.4 Limits of integer types capable of holding object pointers
-#ifdef _WIN64 // [
-#  define INTPTR_MIN   INT64_MIN
-#  define INTPTR_MAX   INT64_MAX
-#  define UINTPTR_MAX  UINT64_MAX
-#else // _WIN64 ][
-#  define INTPTR_MIN   INT32_MIN
-#  define INTPTR_MAX   INT32_MAX
-#  define UINTPTR_MAX  UINT32_MAX
-#endif // _WIN64 ]
-
-// 7.18.2.5 Limits of greatest-width integer types
-#define INTMAX_MIN   INT64_MIN
-#define INTMAX_MAX   INT64_MAX
-#define UINTMAX_MAX  UINT64_MAX
-
-// 7.18.3 Limits of other integer types
-
-#ifdef _WIN64 // [
-#  define PTRDIFF_MIN  _I64_MIN
-#  define PTRDIFF_MAX  _I64_MAX
-#else  // _WIN64 ][
-#  define PTRDIFF_MIN  _I32_MIN
-#  define PTRDIFF_MAX  _I32_MAX
-#endif  // _WIN64 ]
-
-#define SIG_ATOMIC_MIN  INT_MIN
-#define SIG_ATOMIC_MAX  INT_MAX
-
-#ifndef SIZE_MAX // [
-#  ifdef _WIN64 // [
-#     define SIZE_MAX  _UI64_MAX
-#  else // _WIN64 ][
-#     define SIZE_MAX  _UI32_MAX
-#  endif // _WIN64 ]
-#endif // SIZE_MAX ]
-
-// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
-#ifndef WCHAR_MIN // [
-#  define WCHAR_MIN  0
-#endif  // WCHAR_MIN ]
-#ifndef WCHAR_MAX // [
-#  define WCHAR_MAX  _UI16_MAX
-#endif  // WCHAR_MAX ]
-
-#define WINT_MIN  0
-#define WINT_MAX  _UI16_MAX
-
-#endif // __STDC_LIMIT_MACROS ]
-
-
-// 7.18.4 Limits of other integer types
-
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260
-
-// 7.18.4.1 Macros for minimum-width integer constants
-
-#define INT8_C(val)  val##i8
-#define INT16_C(val) val##i16
-#define INT32_C(val) val##i32
-#define INT64_C(val) val##i64
-
-#define UINT8_C(val)  val##ui8
-#define UINT16_C(val) val##ui16
-#define UINT32_C(val) val##ui32
-#define UINT64_C(val) val##ui64
-
-// 7.18.4.2 Macros for greatest-width integer constants
-#define INTMAX_C   INT64_C
-#define UINTMAX_C  UINT64_C
-
-#endif // __STDC_CONSTANT_MACROS ]
-
-
-#endif // _MSC_STDINT_H_ ]

+ 0 - 44
创维盒子/RayProxy/include/uv/sunos.h

@@ -1,44 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef UV_SUNOS_H
-#define UV_SUNOS_H
-
-#include <sys/port.h>
-#include <port.h>
-
-/* For the sake of convenience and reduced #ifdef-ery in src/unix/sunos.c,
- * add the fs_event fields even when this version of SunOS doesn't support
- * file watching.
- */
-#define UV_PLATFORM_LOOP_FIELDS                                               \
-  uv__io_t fs_event_watcher;                                                  \
-  int fs_fd;                                                                  \
-
-#if defined(PORT_SOURCE_FILE)
-
-# define UV_PLATFORM_FS_EVENT_FIELDS                                          \
-  file_obj_t fo;                                                              \
-  int fd;                                                                     \
-
-#endif /* defined(PORT_SOURCE_FILE) */
-
-#endif /* UV_SUNOS_H */

+ 0 - 37
创维盒子/RayProxy/include/uv/threadpool.h

@@ -1,37 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-/*
- * This file is private to libuv. It provides common functionality to both
- * Windows and Unix backends.
- */
-
-#ifndef UV_THREADPOOL_H_
-#define UV_THREADPOOL_H_
-
-struct uv__work {
-  void (*work)(struct uv__work *w);
-  void (*done)(struct uv__work *w, int status);
-  struct uv_loop_s* loop;
-  void* wq[2];
-};
-
-#endif /* UV_THREADPOOL_H_ */

+ 0 - 768
创维盒子/RayProxy/include/uv/tree.h

@@ -1,768 +0,0 @@
-/*-
- * Copyright 2002 Niels Provos <provos@citi.umich.edu>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef  UV_TREE_H_
-#define  UV_TREE_H_
-
-#ifndef UV__UNUSED
-# if __GNUC__
-#  define UV__UNUSED __attribute__((unused))
-# else
-#  define UV__UNUSED
-# endif
-#endif
-
-/*
- * This file defines data structures for different types of trees:
- * splay trees and red-black trees.
- *
- * A splay tree is a self-organizing data structure.  Every operation
- * on the tree causes a splay to happen.  The splay moves the requested
- * node to the root of the tree and partly rebalances it.
- *
- * This has the benefit that request locality causes faster lookups as
- * the requested nodes move to the top of the tree.  On the other hand,
- * every lookup causes memory writes.
- *
- * The Balance Theorem bounds the total access time for m operations
- * and n inserts on an initially empty tree as O((m + n)lg n).  The
- * amortized cost for a sequence of m accesses to a splay tree is O(lg n);
- *
- * A red-black tree is a binary search tree with the node color as an
- * extra attribute.  It fulfills a set of conditions:
- *  - every search path from the root to a leaf consists of the
- *    same number of black nodes,
- *  - each red node (except for the root) has a black parent,
- *  - each leaf node is black.
- *
- * Every operation on a red-black tree is bounded as O(lg n).
- * The maximum height of a red-black tree is 2lg (n+1).
- */
-
-#define SPLAY_HEAD(name, type)                                                \
-struct name {                                                                 \
-  struct type *sph_root; /* root of the tree */                               \
-}
-
-#define SPLAY_INITIALIZER(root)                                               \
-  { NULL }
-
-#define SPLAY_INIT(root) do {                                                 \
-  (root)->sph_root = NULL;                                                    \
-} while (/*CONSTCOND*/ 0)
-
-#define SPLAY_ENTRY(type)                                                     \
-struct {                                                                      \
-  struct type *spe_left;          /* left element */                          \
-  struct type *spe_right;         /* right element */                         \
-}
-
-#define SPLAY_LEFT(elm, field)    (elm)->field.spe_left
-#define SPLAY_RIGHT(elm, field)   (elm)->field.spe_right
-#define SPLAY_ROOT(head)          (head)->sph_root
-#define SPLAY_EMPTY(head)         (SPLAY_ROOT(head) == NULL)
-
-/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */
-#define SPLAY_ROTATE_RIGHT(head, tmp, field) do {                             \
-  SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field);              \
-  SPLAY_RIGHT(tmp, field) = (head)->sph_root;                                 \
-  (head)->sph_root = tmp;                                                     \
-} while (/*CONSTCOND*/ 0)
-
-#define SPLAY_ROTATE_LEFT(head, tmp, field) do {                              \
-  SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field);              \
-  SPLAY_LEFT(tmp, field) = (head)->sph_root;                                  \
-  (head)->sph_root = tmp;                                                     \
-} while (/*CONSTCOND*/ 0)
-
-#define SPLAY_LINKLEFT(head, tmp, field) do {                                 \
-  SPLAY_LEFT(tmp, field) = (head)->sph_root;                                  \
-  tmp = (head)->sph_root;                                                     \
-  (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);                     \
-} while (/*CONSTCOND*/ 0)
-
-#define SPLAY_LINKRIGHT(head, tmp, field) do {                                \
-  SPLAY_RIGHT(tmp, field) = (head)->sph_root;                                 \
-  tmp = (head)->sph_root;                                                     \
-  (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);                    \
-} while (/*CONSTCOND*/ 0)
-
-#define SPLAY_ASSEMBLE(head, node, left, right, field) do {                   \
-  SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field);             \
-  SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);            \
-  SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field);             \
-  SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field);             \
-} while (/*CONSTCOND*/ 0)
-
-/* Generates prototypes and inline functions */
-
-#define SPLAY_PROTOTYPE(name, type, field, cmp)                               \
-void name##_SPLAY(struct name *, struct type *);                              \
-void name##_SPLAY_MINMAX(struct name *, int);                                 \
-struct type *name##_SPLAY_INSERT(struct name *, struct type *);               \
-struct type *name##_SPLAY_REMOVE(struct name *, struct type *);               \
-                                                                              \
-/* Finds the node with the same key as elm */                                 \
-static __inline struct type *                                                 \
-name##_SPLAY_FIND(struct name *head, struct type *elm)                        \
-{                                                                             \
-  if (SPLAY_EMPTY(head))                                                      \
-    return(NULL);                                                             \
-  name##_SPLAY(head, elm);                                                    \
-  if ((cmp)(elm, (head)->sph_root) == 0)                                      \
-    return (head->sph_root);                                                  \
-  return (NULL);                                                              \
-}                                                                             \
-                                                                              \
-static __inline struct type *                                                 \
-name##_SPLAY_NEXT(struct name *head, struct type *elm)                        \
-{                                                                             \
-  name##_SPLAY(head, elm);                                                    \
-  if (SPLAY_RIGHT(elm, field) != NULL) {                                      \
-    elm = SPLAY_RIGHT(elm, field);                                            \
-    while (SPLAY_LEFT(elm, field) != NULL) {                                  \
-      elm = SPLAY_LEFT(elm, field);                                           \
-    }                                                                         \
-  } else                                                                      \
-    elm = NULL;                                                               \
-  return (elm);                                                               \
-}                                                                             \
-                                                                              \
-static __inline struct type *                                                 \
-name##_SPLAY_MIN_MAX(struct name *head, int val)                              \
-{                                                                             \
-  name##_SPLAY_MINMAX(head, val);                                             \
-  return (SPLAY_ROOT(head));                                                  \
-}
-
-/* Main splay operation.
- * Moves node close to the key of elm to top
- */
-#define SPLAY_GENERATE(name, type, field, cmp)                                \
-struct type *                                                                 \
-name##_SPLAY_INSERT(struct name *head, struct type *elm)                      \
-{                                                                             \
-    if (SPLAY_EMPTY(head)) {                                                  \
-      SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL;                \
-    } else {                                                                  \
-      int __comp;                                                             \
-      name##_SPLAY(head, elm);                                                \
-      __comp = (cmp)(elm, (head)->sph_root);                                  \
-      if(__comp < 0) {                                                        \
-        SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);         \
-        SPLAY_RIGHT(elm, field) = (head)->sph_root;                           \
-        SPLAY_LEFT((head)->sph_root, field) = NULL;                           \
-      } else if (__comp > 0) {                                                \
-        SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);       \
-        SPLAY_LEFT(elm, field) = (head)->sph_root;                            \
-        SPLAY_RIGHT((head)->sph_root, field) = NULL;                          \
-      } else                                                                  \
-        return ((head)->sph_root);                                            \
-    }                                                                         \
-    (head)->sph_root = (elm);                                                 \
-    return (NULL);                                                            \
-}                                                                             \
-                                                                              \
-struct type *                                                                 \
-name##_SPLAY_REMOVE(struct name *head, struct type *elm)                      \
-{                                                                             \
-  struct type *__tmp;                                                         \
-  if (SPLAY_EMPTY(head))                                                      \
-    return (NULL);                                                            \
-  name##_SPLAY(head, elm);                                                    \
-  if ((cmp)(elm, (head)->sph_root) == 0) {                                    \
-    if (SPLAY_LEFT((head)->sph_root, field) == NULL) {                        \
-      (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);                \
-    } else {                                                                  \
-      __tmp = SPLAY_RIGHT((head)->sph_root, field);                           \
-      (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);                 \
-      name##_SPLAY(head, elm);                                                \
-      SPLAY_RIGHT((head)->sph_root, field) = __tmp;                           \
-    }                                                                         \
-    return (elm);                                                             \
-  }                                                                           \
-  return (NULL);                                                              \
-}                                                                             \
-                                                                              \
-void                                                                          \
-name##_SPLAY(struct name *head, struct type *elm)                             \
-{                                                                             \
-  struct type __node, *__left, *__right, *__tmp;                              \
-  int __comp;                                                                 \
-                                                                              \
-  SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;            \
-  __left = __right = &__node;                                                 \
-                                                                              \
-  while ((__comp = (cmp)(elm, (head)->sph_root)) != 0) {                      \
-    if (__comp < 0) {                                                         \
-      __tmp = SPLAY_LEFT((head)->sph_root, field);                            \
-      if (__tmp == NULL)                                                      \
-        break;                                                                \
-      if ((cmp)(elm, __tmp) < 0){                                             \
-        SPLAY_ROTATE_RIGHT(head, __tmp, field);                               \
-        if (SPLAY_LEFT((head)->sph_root, field) == NULL)                      \
-          break;                                                              \
-      }                                                                       \
-      SPLAY_LINKLEFT(head, __right, field);                                   \
-    } else if (__comp > 0) {                                                  \
-      __tmp = SPLAY_RIGHT((head)->sph_root, field);                           \
-      if (__tmp == NULL)                                                      \
-        break;                                                                \
-      if ((cmp)(elm, __tmp) > 0){                                             \
-        SPLAY_ROTATE_LEFT(head, __tmp, field);                                \
-        if (SPLAY_RIGHT((head)->sph_root, field) == NULL)                     \
-          break;                                                              \
-      }                                                                       \
-      SPLAY_LINKRIGHT(head, __left, field);                                   \
-    }                                                                         \
-  }                                                                           \
-  SPLAY_ASSEMBLE(head, &__node, __left, __right, field);                      \
-}                                                                             \
-                                                                              \
-/* Splay with either the minimum or the maximum element                       \
- * Used to find minimum or maximum element in tree.                           \
- */                                                                           \
-void name##_SPLAY_MINMAX(struct name *head, int __comp)                       \
-{                                                                             \
-  struct type __node, *__left, *__right, *__tmp;                              \
-                                                                              \
-  SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;            \
-  __left = __right = &__node;                                                 \
-                                                                              \
-  while (1) {                                                                 \
-    if (__comp < 0) {                                                         \
-      __tmp = SPLAY_LEFT((head)->sph_root, field);                            \
-      if (__tmp == NULL)                                                      \
-        break;                                                                \
-      if (__comp < 0){                                                        \
-        SPLAY_ROTATE_RIGHT(head, __tmp, field);                               \
-        if (SPLAY_LEFT((head)->sph_root, field) == NULL)                      \
-          break;                                                              \
-      }                                                                       \
-      SPLAY_LINKLEFT(head, __right, field);                                   \
-    } else if (__comp > 0) {                                                  \
-      __tmp = SPLAY_RIGHT((head)->sph_root, field);                           \
-      if (__tmp == NULL)                                                      \
-        break;                                                                \
-      if (__comp > 0) {                                                       \
-        SPLAY_ROTATE_LEFT(head, __tmp, field);                                \
-        if (SPLAY_RIGHT((head)->sph_root, field) == NULL)                     \
-          break;                                                              \
-      }                                                                       \
-      SPLAY_LINKRIGHT(head, __left, field);                                   \
-    }                                                                         \
-  }                                                                           \
-  SPLAY_ASSEMBLE(head, &__node, __left, __right, field);                      \
-}
-
-#define SPLAY_NEGINF  -1
-#define SPLAY_INF     1
-
-#define SPLAY_INSERT(name, x, y)  name##_SPLAY_INSERT(x, y)
-#define SPLAY_REMOVE(name, x, y)  name##_SPLAY_REMOVE(x, y)
-#define SPLAY_FIND(name, x, y)    name##_SPLAY_FIND(x, y)
-#define SPLAY_NEXT(name, x, y)    name##_SPLAY_NEXT(x, y)
-#define SPLAY_MIN(name, x)        (SPLAY_EMPTY(x) ? NULL                      \
-                                  : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF))
-#define SPLAY_MAX(name, x)        (SPLAY_EMPTY(x) ? NULL                      \
-                                  : name##_SPLAY_MIN_MAX(x, SPLAY_INF))
-
-#define SPLAY_FOREACH(x, name, head)                                          \
-  for ((x) = SPLAY_MIN(name, head);                                           \
-       (x) != NULL;                                                           \
-       (x) = SPLAY_NEXT(name, head, x))
-
-/* Macros that define a red-black tree */
-#define RB_HEAD(name, type)                                                   \
-struct name {                                                                 \
-  struct type *rbh_root; /* root of the tree */                               \
-}
-
-#define RB_INITIALIZER(root)                                                  \
-  { NULL }
-
-#define RB_INIT(root) do {                                                    \
-  (root)->rbh_root = NULL;                                                    \
-} while (/*CONSTCOND*/ 0)
-
-#define RB_BLACK  0
-#define RB_RED    1
-#define RB_ENTRY(type)                                                        \
-struct {                                                                      \
-  struct type *rbe_left;        /* left element */                            \
-  struct type *rbe_right;       /* right element */                           \
-  struct type *rbe_parent;      /* parent element */                          \
-  int rbe_color;                /* node color */                              \
-}
-
-#define RB_LEFT(elm, field)     (elm)->field.rbe_left
-#define RB_RIGHT(elm, field)    (elm)->field.rbe_right
-#define RB_PARENT(elm, field)   (elm)->field.rbe_parent
-#define RB_COLOR(elm, field)    (elm)->field.rbe_color
-#define RB_ROOT(head)           (head)->rbh_root
-#define RB_EMPTY(head)          (RB_ROOT(head) == NULL)
-
-#define RB_SET(elm, parent, field) do {                                       \
-  RB_PARENT(elm, field) = parent;                                             \
-  RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL;                          \
-  RB_COLOR(elm, field) = RB_RED;                                              \
-} while (/*CONSTCOND*/ 0)
-
-#define RB_SET_BLACKRED(black, red, field) do {                               \
-  RB_COLOR(black, field) = RB_BLACK;                                          \
-  RB_COLOR(red, field) = RB_RED;                                              \
-} while (/*CONSTCOND*/ 0)
-
-#ifndef RB_AUGMENT
-#define RB_AUGMENT(x)  do {} while (0)
-#endif
-
-#define RB_ROTATE_LEFT(head, elm, tmp, field) do {                            \
-  (tmp) = RB_RIGHT(elm, field);                                               \
-  if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) {                 \
-    RB_PARENT(RB_LEFT(tmp, field), field) = (elm);                            \
-  }                                                                           \
-  RB_AUGMENT(elm);                                                            \
-  if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) {              \
-    if ((elm) == RB_LEFT(RB_PARENT(elm, field), field))                       \
-      RB_LEFT(RB_PARENT(elm, field), field) = (tmp);                          \
-    else                                                                      \
-      RB_RIGHT(RB_PARENT(elm, field), field) = (tmp);                         \
-  } else                                                                      \
-    (head)->rbh_root = (tmp);                                                 \
-  RB_LEFT(tmp, field) = (elm);                                                \
-  RB_PARENT(elm, field) = (tmp);                                              \
-  RB_AUGMENT(tmp);                                                            \
-  if ((RB_PARENT(tmp, field)))                                                \
-    RB_AUGMENT(RB_PARENT(tmp, field));                                        \
-} while (/*CONSTCOND*/ 0)
-
-#define RB_ROTATE_RIGHT(head, elm, tmp, field) do {                           \
-  (tmp) = RB_LEFT(elm, field);                                                \
-  if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) {                 \
-    RB_PARENT(RB_RIGHT(tmp, field), field) = (elm);                           \
-  }                                                                           \
-  RB_AUGMENT(elm);                                                            \
-  if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) {              \
-    if ((elm) == RB_LEFT(RB_PARENT(elm, field), field))                       \
-      RB_LEFT(RB_PARENT(elm, field), field) = (tmp);                          \
-    else                                                                      \
-      RB_RIGHT(RB_PARENT(elm, field), field) = (tmp);                         \
-  } else                                                                      \
-    (head)->rbh_root = (tmp);                                                 \
-  RB_RIGHT(tmp, field) = (elm);                                               \
-  RB_PARENT(elm, field) = (tmp);                                              \
-  RB_AUGMENT(tmp);                                                            \
-  if ((RB_PARENT(tmp, field)))                                                \
-    RB_AUGMENT(RB_PARENT(tmp, field));                                        \
-} while (/*CONSTCOND*/ 0)
-
-/* Generates prototypes and inline functions */
-#define  RB_PROTOTYPE(name, type, field, cmp)                                 \
-  RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)
-#define  RB_PROTOTYPE_STATIC(name, type, field, cmp)                          \
-  RB_PROTOTYPE_INTERNAL(name, type, field, cmp, UV__UNUSED static)
-#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr)                   \
-attr void name##_RB_INSERT_COLOR(struct name *, struct type *);               \
-attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
-attr struct type *name##_RB_REMOVE(struct name *, struct type *);             \
-attr struct type *name##_RB_INSERT(struct name *, struct type *);             \
-attr struct type *name##_RB_FIND(struct name *, struct type *);               \
-attr struct type *name##_RB_NFIND(struct name *, struct type *);              \
-attr struct type *name##_RB_NEXT(struct type *);                              \
-attr struct type *name##_RB_PREV(struct type *);                              \
-attr struct type *name##_RB_MINMAX(struct name *, int);                       \
-                                                                              \
-
-/* Main rb operation.
- * Moves node close to the key of elm to top
- */
-#define  RB_GENERATE(name, type, field, cmp)                                  \
-  RB_GENERATE_INTERNAL(name, type, field, cmp,)
-#define  RB_GENERATE_STATIC(name, type, field, cmp)                           \
-  RB_GENERATE_INTERNAL(name, type, field, cmp, UV__UNUSED static)
-#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr)                    \
-attr void                                                                     \
-name##_RB_INSERT_COLOR(struct name *head, struct type *elm)                   \
-{                                                                             \
-  struct type *parent, *gparent, *tmp;                                        \
-  while ((parent = RB_PARENT(elm, field)) != NULL &&                          \
-      RB_COLOR(parent, field) == RB_RED) {                                    \
-    gparent = RB_PARENT(parent, field);                                       \
-    if (parent == RB_LEFT(gparent, field)) {                                  \
-      tmp = RB_RIGHT(gparent, field);                                         \
-      if (tmp && RB_COLOR(tmp, field) == RB_RED) {                            \
-        RB_COLOR(tmp, field) = RB_BLACK;                                      \
-        RB_SET_BLACKRED(parent, gparent, field);                              \
-        elm = gparent;                                                        \
-        continue;                                                             \
-      }                                                                       \
-      if (RB_RIGHT(parent, field) == elm) {                                   \
-        RB_ROTATE_LEFT(head, parent, tmp, field);                             \
-        tmp = parent;                                                         \
-        parent = elm;                                                         \
-        elm = tmp;                                                            \
-      }                                                                       \
-      RB_SET_BLACKRED(parent, gparent, field);                                \
-      RB_ROTATE_RIGHT(head, gparent, tmp, field);                             \
-    } else {                                                                  \
-      tmp = RB_LEFT(gparent, field);                                          \
-      if (tmp && RB_COLOR(tmp, field) == RB_RED) {                            \
-        RB_COLOR(tmp, field) = RB_BLACK;                                      \
-        RB_SET_BLACKRED(parent, gparent, field);                              \
-        elm = gparent;                                                        \
-        continue;                                                             \
-      }                                                                       \
-      if (RB_LEFT(parent, field) == elm) {                                    \
-        RB_ROTATE_RIGHT(head, parent, tmp, field);                            \
-        tmp = parent;                                                         \
-        parent = elm;                                                         \
-        elm = tmp;                                                            \
-      }                                                                       \
-      RB_SET_BLACKRED(parent, gparent, field);                                \
-      RB_ROTATE_LEFT(head, gparent, tmp, field);                              \
-    }                                                                         \
-  }                                                                           \
-  RB_COLOR(head->rbh_root, field) = RB_BLACK;                                 \
-}                                                                             \
-                                                                              \
-attr void                                                                     \
-name##_RB_REMOVE_COLOR(struct name *head, struct type *parent,                \
-    struct type *elm)                                                         \
-{                                                                             \
-  struct type *tmp;                                                           \
-  while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) &&                 \
-      elm != RB_ROOT(head)) {                                                 \
-    if (RB_LEFT(parent, field) == elm) {                                      \
-      tmp = RB_RIGHT(parent, field);                                          \
-      if (RB_COLOR(tmp, field) == RB_RED) {                                   \
-        RB_SET_BLACKRED(tmp, parent, field);                                  \
-        RB_ROTATE_LEFT(head, parent, tmp, field);                             \
-        tmp = RB_RIGHT(parent, field);                                        \
-      }                                                                       \
-      if ((RB_LEFT(tmp, field) == NULL ||                                     \
-          RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&                \
-          (RB_RIGHT(tmp, field) == NULL ||                                    \
-          RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {               \
-        RB_COLOR(tmp, field) = RB_RED;                                        \
-        elm = parent;                                                         \
-        parent = RB_PARENT(elm, field);                                       \
-      } else {                                                                \
-        if (RB_RIGHT(tmp, field) == NULL ||                                   \
-            RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {              \
-          struct type *oleft;                                                 \
-          if ((oleft = RB_LEFT(tmp, field))                                   \
-              != NULL)                                                        \
-            RB_COLOR(oleft, field) = RB_BLACK;                                \
-          RB_COLOR(tmp, field) = RB_RED;                                      \
-          RB_ROTATE_RIGHT(head, tmp, oleft, field);                           \
-          tmp = RB_RIGHT(parent, field);                                      \
-        }                                                                     \
-        RB_COLOR(tmp, field) = RB_COLOR(parent, field);                       \
-        RB_COLOR(parent, field) = RB_BLACK;                                   \
-        if (RB_RIGHT(tmp, field))                                             \
-          RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;                   \
-        RB_ROTATE_LEFT(head, parent, tmp, field);                             \
-        elm = RB_ROOT(head);                                                  \
-        break;                                                                \
-      }                                                                       \
-    } else {                                                                  \
-      tmp = RB_LEFT(parent, field);                                           \
-      if (RB_COLOR(tmp, field) == RB_RED) {                                   \
-        RB_SET_BLACKRED(tmp, parent, field);                                  \
-        RB_ROTATE_RIGHT(head, parent, tmp, field);                            \
-        tmp = RB_LEFT(parent, field);                                         \
-      }                                                                       \
-      if ((RB_LEFT(tmp, field) == NULL ||                                     \
-          RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&                \
-          (RB_RIGHT(tmp, field) == NULL ||                                    \
-          RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {               \
-        RB_COLOR(tmp, field) = RB_RED;                                        \
-        elm = parent;                                                         \
-        parent = RB_PARENT(elm, field);                                       \
-      } else {                                                                \
-        if (RB_LEFT(tmp, field) == NULL ||                                    \
-            RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {               \
-          struct type *oright;                                                \
-          if ((oright = RB_RIGHT(tmp, field))                                 \
-              != NULL)                                                        \
-            RB_COLOR(oright, field) = RB_BLACK;                               \
-          RB_COLOR(tmp, field) = RB_RED;                                      \
-          RB_ROTATE_LEFT(head, tmp, oright, field);                           \
-          tmp = RB_LEFT(parent, field);                                       \
-        }                                                                     \
-        RB_COLOR(tmp, field) = RB_COLOR(parent, field);                       \
-        RB_COLOR(parent, field) = RB_BLACK;                                   \
-        if (RB_LEFT(tmp, field))                                              \
-          RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;                    \
-        RB_ROTATE_RIGHT(head, parent, tmp, field);                            \
-        elm = RB_ROOT(head);                                                  \
-        break;                                                                \
-      }                                                                       \
-    }                                                                         \
-  }                                                                           \
-  if (elm)                                                                    \
-    RB_COLOR(elm, field) = RB_BLACK;                                          \
-}                                                                             \
-                                                                              \
-attr struct type *                                                            \
-name##_RB_REMOVE(struct name *head, struct type *elm)                         \
-{                                                                             \
-  struct type *child, *parent, *old = elm;                                    \
-  int color;                                                                  \
-  if (RB_LEFT(elm, field) == NULL)                                            \
-    child = RB_RIGHT(elm, field);                                             \
-  else if (RB_RIGHT(elm, field) == NULL)                                      \
-    child = RB_LEFT(elm, field);                                              \
-  else {                                                                      \
-    struct type *left;                                                        \
-    elm = RB_RIGHT(elm, field);                                               \
-    while ((left = RB_LEFT(elm, field)) != NULL)                              \
-      elm = left;                                                             \
-    child = RB_RIGHT(elm, field);                                             \
-    parent = RB_PARENT(elm, field);                                           \
-    color = RB_COLOR(elm, field);                                             \
-    if (child)                                                                \
-      RB_PARENT(child, field) = parent;                                       \
-    if (parent) {                                                             \
-      if (RB_LEFT(parent, field) == elm)                                      \
-        RB_LEFT(parent, field) = child;                                       \
-      else                                                                    \
-        RB_RIGHT(parent, field) = child;                                      \
-      RB_AUGMENT(parent);                                                     \
-    } else                                                                    \
-      RB_ROOT(head) = child;                                                  \
-    if (RB_PARENT(elm, field) == old)                                         \
-      parent = elm;                                                           \
-    (elm)->field = (old)->field;                                              \
-    if (RB_PARENT(old, field)) {                                              \
-      if (RB_LEFT(RB_PARENT(old, field), field) == old)                       \
-        RB_LEFT(RB_PARENT(old, field), field) = elm;                          \
-      else                                                                    \
-        RB_RIGHT(RB_PARENT(old, field), field) = elm;                         \
-      RB_AUGMENT(RB_PARENT(old, field));                                      \
-    } else                                                                    \
-      RB_ROOT(head) = elm;                                                    \
-    RB_PARENT(RB_LEFT(old, field), field) = elm;                              \
-    if (RB_RIGHT(old, field))                                                 \
-      RB_PARENT(RB_RIGHT(old, field), field) = elm;                           \
-    if (parent) {                                                             \
-      left = parent;                                                          \
-      do {                                                                    \
-        RB_AUGMENT(left);                                                     \
-      } while ((left = RB_PARENT(left, field)) != NULL);                      \
-    }                                                                         \
-    goto color;                                                               \
-  }                                                                           \
-  parent = RB_PARENT(elm, field);                                             \
-  color = RB_COLOR(elm, field);                                               \
-  if (child)                                                                  \
-    RB_PARENT(child, field) = parent;                                         \
-  if (parent) {                                                               \
-    if (RB_LEFT(parent, field) == elm)                                        \
-      RB_LEFT(parent, field) = child;                                         \
-    else                                                                      \
-      RB_RIGHT(parent, field) = child;                                        \
-    RB_AUGMENT(parent);                                                       \
-  } else                                                                      \
-    RB_ROOT(head) = child;                                                    \
-color:                                                                        \
-  if (color == RB_BLACK)                                                      \
-    name##_RB_REMOVE_COLOR(head, parent, child);                              \
-  return (old);                                                               \
-}                                                                             \
-                                                                              \
-/* Inserts a node into the RB tree */                                         \
-attr struct type *                                                            \
-name##_RB_INSERT(struct name *head, struct type *elm)                         \
-{                                                                             \
-  struct type *tmp;                                                           \
-  struct type *parent = NULL;                                                 \
-  int comp = 0;                                                               \
-  tmp = RB_ROOT(head);                                                        \
-  while (tmp) {                                                               \
-    parent = tmp;                                                             \
-    comp = (cmp)(elm, parent);                                                \
-    if (comp < 0)                                                             \
-      tmp = RB_LEFT(tmp, field);                                              \
-    else if (comp > 0)                                                        \
-      tmp = RB_RIGHT(tmp, field);                                             \
-    else                                                                      \
-      return (tmp);                                                           \
-  }                                                                           \
-  RB_SET(elm, parent, field);                                                 \
-  if (parent != NULL) {                                                       \
-    if (comp < 0)                                                             \
-      RB_LEFT(parent, field) = elm;                                           \
-    else                                                                      \
-      RB_RIGHT(parent, field) = elm;                                          \
-    RB_AUGMENT(parent);                                                       \
-  } else                                                                      \
-    RB_ROOT(head) = elm;                                                      \
-  name##_RB_INSERT_COLOR(head, elm);                                          \
-  return (NULL);                                                              \
-}                                                                             \
-                                                                              \
-/* Finds the node with the same key as elm */                                 \
-attr struct type *                                                            \
-name##_RB_FIND(struct name *head, struct type *elm)                           \
-{                                                                             \
-  struct type *tmp = RB_ROOT(head);                                           \
-  int comp;                                                                   \
-  while (tmp) {                                                               \
-    comp = cmp(elm, tmp);                                                     \
-    if (comp < 0)                                                             \
-      tmp = RB_LEFT(tmp, field);                                              \
-    else if (comp > 0)                                                        \
-      tmp = RB_RIGHT(tmp, field);                                             \
-    else                                                                      \
-      return (tmp);                                                           \
-  }                                                                           \
-  return (NULL);                                                              \
-}                                                                             \
-                                                                              \
-/* Finds the first node greater than or equal to the search key */            \
-attr struct type *                                                            \
-name##_RB_NFIND(struct name *head, struct type *elm)                          \
-{                                                                             \
-  struct type *tmp = RB_ROOT(head);                                           \
-  struct type *res = NULL;                                                    \
-  int comp;                                                                   \
-  while (tmp) {                                                               \
-    comp = cmp(elm, tmp);                                                     \
-    if (comp < 0) {                                                           \
-      res = tmp;                                                              \
-      tmp = RB_LEFT(tmp, field);                                              \
-    }                                                                         \
-    else if (comp > 0)                                                        \
-      tmp = RB_RIGHT(tmp, field);                                             \
-    else                                                                      \
-      return (tmp);                                                           \
-  }                                                                           \
-  return (res);                                                               \
-}                                                                             \
-                                                                              \
-/* ARGSUSED */                                                                \
-attr struct type *                                                            \
-name##_RB_NEXT(struct type *elm)                                              \
-{                                                                             \
-  if (RB_RIGHT(elm, field)) {                                                 \
-    elm = RB_RIGHT(elm, field);                                               \
-    while (RB_LEFT(elm, field))                                               \
-      elm = RB_LEFT(elm, field);                                              \
-  } else {                                                                    \
-    if (RB_PARENT(elm, field) &&                                              \
-        (elm == RB_LEFT(RB_PARENT(elm, field), field)))                       \
-      elm = RB_PARENT(elm, field);                                            \
-    else {                                                                    \
-      while (RB_PARENT(elm, field) &&                                         \
-          (elm == RB_RIGHT(RB_PARENT(elm, field), field)))                    \
-        elm = RB_PARENT(elm, field);                                          \
-      elm = RB_PARENT(elm, field);                                            \
-    }                                                                         \
-  }                                                                           \
-  return (elm);                                                               \
-}                                                                             \
-                                                                              \
-/* ARGSUSED */                                                                \
-attr struct type *                                                            \
-name##_RB_PREV(struct type *elm)                                              \
-{                                                                             \
-  if (RB_LEFT(elm, field)) {                                                  \
-    elm = RB_LEFT(elm, field);                                                \
-    while (RB_RIGHT(elm, field))                                              \
-      elm = RB_RIGHT(elm, field);                                             \
-  } else {                                                                    \
-    if (RB_PARENT(elm, field) &&                                              \
-        (elm == RB_RIGHT(RB_PARENT(elm, field), field)))                      \
-      elm = RB_PARENT(elm, field);                                            \
-    else {                                                                    \
-      while (RB_PARENT(elm, field) &&                                         \
-          (elm == RB_LEFT(RB_PARENT(elm, field), field)))                     \
-        elm = RB_PARENT(elm, field);                                          \
-      elm = RB_PARENT(elm, field);                                            \
-    }                                                                         \
-  }                                                                           \
-  return (elm);                                                               \
-}                                                                             \
-                                                                              \
-attr struct type *                                                            \
-name##_RB_MINMAX(struct name *head, int val)                                  \
-{                                                                             \
-  struct type *tmp = RB_ROOT(head);                                           \
-  struct type *parent = NULL;                                                 \
-  while (tmp) {                                                               \
-    parent = tmp;                                                             \
-    if (val < 0)                                                              \
-      tmp = RB_LEFT(tmp, field);                                              \
-    else                                                                      \
-      tmp = RB_RIGHT(tmp, field);                                             \
-  }                                                                           \
-  return (parent);                                                            \
-}
-
-#define RB_NEGINF   -1
-#define RB_INF      1
-
-#define RB_INSERT(name, x, y)   name##_RB_INSERT(x, y)
-#define RB_REMOVE(name, x, y)   name##_RB_REMOVE(x, y)
-#define RB_FIND(name, x, y)     name##_RB_FIND(x, y)
-#define RB_NFIND(name, x, y)    name##_RB_NFIND(x, y)
-#define RB_NEXT(name, x, y)     name##_RB_NEXT(y)
-#define RB_PREV(name, x, y)     name##_RB_PREV(y)
-#define RB_MIN(name, x)         name##_RB_MINMAX(x, RB_NEGINF)
-#define RB_MAX(name, x)         name##_RB_MINMAX(x, RB_INF)
-
-#define RB_FOREACH(x, name, head)                                             \
-  for ((x) = RB_MIN(name, head);                                              \
-       (x) != NULL;                                                           \
-       (x) = name##_RB_NEXT(x))
-
-#define RB_FOREACH_FROM(x, name, y)                                           \
-  for ((x) = (y);                                                             \
-      ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL);                \
-       (x) = (y))
-
-#define RB_FOREACH_SAFE(x, name, head, y)                                     \
-  for ((x) = RB_MIN(name, head);                                              \
-      ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL);                \
-       (x) = (y))
-
-#define RB_FOREACH_REVERSE(x, name, head)                                     \
-  for ((x) = RB_MAX(name, head);                                              \
-       (x) != NULL;                                                           \
-       (x) = name##_RB_PREV(x))
-
-#define RB_FOREACH_REVERSE_FROM(x, name, y)                                   \
-  for ((x) = (y);                                                             \
-      ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL);                \
-       (x) = (y))
-
-#define RB_FOREACH_REVERSE_SAFE(x, name, head, y)                             \
-  for ((x) = RB_MAX(name, head);                                              \
-      ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL);                \
-       (x) = (y))
-
-#endif  /* UV_TREE_H_ */

+ 0 - 505
创维盒子/RayProxy/include/uv/unix.h

@@ -1,505 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef UV_UNIX_H
-#define UV_UNIX_H
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <dirent.h>
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <netdb.h>  /* MAXHOSTNAMELEN on Solaris */
-
-#include <termios.h>
-#include <pwd.h>
-
-#if !defined(__MVS__)
-#include <semaphore.h>
-#include <sys/param.h> /* MAXHOSTNAMELEN on Linux and the BSDs */
-#endif
-#include <pthread.h>
-#include <signal.h>
-
-#include "uv/threadpool.h"
-
-#if defined(__linux__)
-# include "uv/linux.h"
-#elif defined (__MVS__)
-# include "uv/os390.h"
-#elif defined(__PASE__)  /* __PASE__ and _AIX are both defined on IBM i */
-# include "uv/posix.h"  /* IBM i needs uv/posix.h, not uv/aix.h */
-#elif defined(_AIX)
-# include "uv/aix.h"
-#elif defined(__sun)
-# include "uv/sunos.h"
-#elif defined(__APPLE__)
-# include "uv/darwin.h"
-#elif defined(__DragonFly__)       || \
-      defined(__FreeBSD__)         || \
-      defined(__FreeBSD_kernel__)  || \
-      defined(__OpenBSD__)         || \
-      defined(__NetBSD__)
-# include "uv/bsd.h"
-#elif defined(__CYGWIN__) || \
-      defined(__MSYS__)   || \
-      defined(__GNU__)
-# include "uv/posix.h"
-#elif defined(__HAIKU__)
-# include "uv/posix.h"
-#endif
-
-#ifndef NI_MAXHOST
-# define NI_MAXHOST 1025
-#endif
-
-#ifndef NI_MAXSERV
-# define NI_MAXSERV 32
-#endif
-
-#ifndef UV_IO_PRIVATE_PLATFORM_FIELDS
-# define UV_IO_PRIVATE_PLATFORM_FIELDS /* empty */
-#endif
-
-struct uv__io_s;
-struct uv_loop_s;
-
-typedef void (*uv__io_cb)(struct uv_loop_s* loop,
-                          struct uv__io_s* w,
-                          unsigned int events);
-typedef struct uv__io_s uv__io_t;
-
-struct uv__io_s {
-  uv__io_cb cb;
-  void* pending_queue[2];
-  void* watcher_queue[2];
-  unsigned int pevents; /* Pending event mask i.e. mask at next tick. */
-  unsigned int events;  /* Current event mask. */
-  int fd;
-  UV_IO_PRIVATE_PLATFORM_FIELDS
-};
-
-#ifndef UV_PLATFORM_SEM_T
-# define UV_PLATFORM_SEM_T sem_t
-#endif
-
-#ifndef UV_PLATFORM_LOOP_FIELDS
-# define UV_PLATFORM_LOOP_FIELDS /* empty */
-#endif
-
-#ifndef UV_PLATFORM_FS_EVENT_FIELDS
-# define UV_PLATFORM_FS_EVENT_FIELDS /* empty */
-#endif
-
-#ifndef UV_STREAM_PRIVATE_PLATFORM_FIELDS
-# define UV_STREAM_PRIVATE_PLATFORM_FIELDS /* empty */
-#endif
-
-/* Note: May be cast to struct iovec. See writev(2). */
-typedef struct uv_buf_t {
-  char* base;
-  size_t len;
-} uv_buf_t;
-
-typedef int uv_file;
-typedef int uv_os_sock_t;
-typedef int uv_os_fd_t;
-typedef pid_t uv_pid_t;
-
-#define UV_ONCE_INIT PTHREAD_ONCE_INIT
-
-typedef pthread_once_t uv_once_t;
-typedef pthread_t uv_thread_t;
-typedef pthread_mutex_t uv_mutex_t;
-typedef pthread_rwlock_t uv_rwlock_t;
-typedef UV_PLATFORM_SEM_T uv_sem_t;
-typedef pthread_cond_t uv_cond_t;
-typedef pthread_key_t uv_key_t;
-
-/* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */
-#if defined(_AIX) || \
-    defined(__OpenBSD__) || \
-    !defined(PTHREAD_BARRIER_SERIAL_THREAD)
-/* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */
-struct _uv_barrier {
-  uv_mutex_t mutex;
-  uv_cond_t cond;
-  unsigned threshold;
-  unsigned in;
-  unsigned out;
-};
-
-typedef struct {
-  struct _uv_barrier* b;
-# if defined(PTHREAD_BARRIER_SERIAL_THREAD)
-  /* TODO(bnoordhuis) Remove padding in v2. */
-  char pad[sizeof(pthread_barrier_t) - sizeof(struct _uv_barrier*)];
-# endif
-} uv_barrier_t;
-#else
-typedef pthread_barrier_t uv_barrier_t;
-#endif
-
-/* Platform-specific definitions for uv_spawn support. */
-typedef gid_t uv_gid_t;
-typedef uid_t uv_uid_t;
-
-typedef struct dirent uv__dirent_t;
-
-#define UV_DIR_PRIVATE_FIELDS \
-  DIR* dir;
-
-#if defined(DT_UNKNOWN)
-# define HAVE_DIRENT_TYPES
-# if defined(DT_REG)
-#  define UV__DT_FILE DT_REG
-# else
-#  define UV__DT_FILE -1
-# endif
-# if defined(DT_DIR)
-#  define UV__DT_DIR DT_DIR
-# else
-#  define UV__DT_DIR -2
-# endif
-# if defined(DT_LNK)
-#  define UV__DT_LINK DT_LNK
-# else
-#  define UV__DT_LINK -3
-# endif
-# if defined(DT_FIFO)
-#  define UV__DT_FIFO DT_FIFO
-# else
-#  define UV__DT_FIFO -4
-# endif
-# if defined(DT_SOCK)
-#  define UV__DT_SOCKET DT_SOCK
-# else
-#  define UV__DT_SOCKET -5
-# endif
-# if defined(DT_CHR)
-#  define UV__DT_CHAR DT_CHR
-# else
-#  define UV__DT_CHAR -6
-# endif
-# if defined(DT_BLK)
-#  define UV__DT_BLOCK DT_BLK
-# else
-#  define UV__DT_BLOCK -7
-# endif
-#endif
-
-/* Platform-specific definitions for uv_dlopen support. */
-#define UV_DYNAMIC /* empty */
-
-typedef struct {
-  void* handle;
-  char* errmsg;
-} uv_lib_t;
-
-#define UV_LOOP_PRIVATE_FIELDS                                                \
-  unsigned long flags;                                                        \
-  int backend_fd;                                                             \
-  void* pending_queue[2];                                                     \
-  void* watcher_queue[2];                                                     \
-  uv__io_t** watchers;                                                        \
-  unsigned int nwatchers;                                                     \
-  unsigned int nfds;                                                          \
-  void* wq[2];                                                                \
-  uv_mutex_t wq_mutex;                                                        \
-  uv_async_t wq_async;                                                        \
-  uv_rwlock_t cloexec_lock;                                                   \
-  uv_handle_t* closing_handles;                                               \
-  void* process_handles[2];                                                   \
-  void* prepare_handles[2];                                                   \
-  void* check_handles[2];                                                     \
-  void* idle_handles[2];                                                      \
-  void* async_handles[2];                                                     \
-  void (*async_unused)(void);  /* TODO(bnoordhuis) Remove in libuv v2. */     \
-  uv__io_t async_io_watcher;                                                  \
-  int async_wfd;                                                              \
-  struct {                                                                    \
-    void* min;                                                                \
-    unsigned int nelts;                                                       \
-  } timer_heap;                                                               \
-  uint64_t timer_counter;                                                     \
-  uint64_t time;                                                              \
-  int signal_pipefd[2];                                                       \
-  uv__io_t signal_io_watcher;                                                 \
-  uv_signal_t child_watcher;                                                  \
-  int emfile_fd;                                                              \
-  UV_PLATFORM_LOOP_FIELDS                                                     \
-
-#define UV_REQ_TYPE_PRIVATE /* empty */
-
-#define UV_REQ_PRIVATE_FIELDS  /* empty */
-
-#define UV_PRIVATE_REQ_TYPES /* empty */
-
-#define UV_WRITE_PRIVATE_FIELDS                                               \
-  void* queue[2];                                                             \
-  unsigned int write_index;                                                   \
-  uv_buf_t* bufs;                                                             \
-  unsigned int nbufs;                                                         \
-  int error;                                                                  \
-  uv_buf_t bufsml[4];                                                         \
-
-#define UV_CONNECT_PRIVATE_FIELDS                                             \
-  void* queue[2];                                                             \
-
-#define UV_SHUTDOWN_PRIVATE_FIELDS /* empty */
-
-#define UV_UDP_SEND_PRIVATE_FIELDS                                            \
-  void* queue[2];                                                             \
-  struct sockaddr_storage addr;                                               \
-  unsigned int nbufs;                                                         \
-  uv_buf_t* bufs;                                                             \
-  ssize_t status;                                                             \
-  uv_udp_send_cb send_cb;                                                     \
-  uv_buf_t bufsml[4];                                                         \
-
-#define UV_HANDLE_PRIVATE_FIELDS                                              \
-  uv_handle_t* next_closing;                                                  \
-  unsigned int flags;                                                         \
-
-#define UV_STREAM_PRIVATE_FIELDS                                              \
-  uv_connect_t *connect_req;                                                  \
-  uv_shutdown_t *shutdown_req;                                                \
-  uv__io_t io_watcher;                                                        \
-  void* write_queue[2];                                                       \
-  void* write_completed_queue[2];                                             \
-  uv_connection_cb connection_cb;                                             \
-  int delayed_error;                                                          \
-  int accepted_fd;                                                            \
-  void* queued_fds;                                                           \
-  UV_STREAM_PRIVATE_PLATFORM_FIELDS                                           \
-
-#define UV_TCP_PRIVATE_FIELDS /* empty */
-
-#define UV_UDP_PRIVATE_FIELDS                                                 \
-  uv_alloc_cb alloc_cb;                                                       \
-  uv_udp_recv_cb recv_cb;                                                     \
-  uv__io_t io_watcher;                                                        \
-  void* write_queue[2];                                                       \
-  void* write_completed_queue[2];                                             \
-
-#define UV_PIPE_PRIVATE_FIELDS                                                \
-  const char* pipe_fname; /* strdup'ed */
-
-#define UV_POLL_PRIVATE_FIELDS                                                \
-  uv__io_t io_watcher;
-
-#define UV_PREPARE_PRIVATE_FIELDS                                             \
-  uv_prepare_cb prepare_cb;                                                   \
-  void* queue[2];                                                             \
-
-#define UV_CHECK_PRIVATE_FIELDS                                               \
-  uv_check_cb check_cb;                                                       \
-  void* queue[2];                                                             \
-
-#define UV_IDLE_PRIVATE_FIELDS                                                \
-  uv_idle_cb idle_cb;                                                         \
-  void* queue[2];                                                             \
-
-#define UV_ASYNC_PRIVATE_FIELDS                                               \
-  uv_async_cb async_cb;                                                       \
-  void* queue[2];                                                             \
-  int pending;                                                                \
-
-#define UV_TIMER_PRIVATE_FIELDS                                               \
-  uv_timer_cb timer_cb;                                                       \
-  void* heap_node[3];                                                         \
-  uint64_t timeout;                                                           \
-  uint64_t repeat;                                                            \
-  uint64_t start_id;
-
-#define UV_GETADDRINFO_PRIVATE_FIELDS                                         \
-  struct uv__work work_req;                                                   \
-  uv_getaddrinfo_cb cb;                                                       \
-  struct addrinfo* hints;                                                     \
-  char* hostname;                                                             \
-  char* service;                                                              \
-  struct addrinfo* addrinfo;                                                  \
-  int retcode;
-
-#define UV_GETNAMEINFO_PRIVATE_FIELDS                                         \
-  struct uv__work work_req;                                                   \
-  uv_getnameinfo_cb getnameinfo_cb;                                           \
-  struct sockaddr_storage storage;                                            \
-  int flags;                                                                  \
-  char host[NI_MAXHOST];                                                      \
-  char service[NI_MAXSERV];                                                   \
-  int retcode;
-
-#define UV_PROCESS_PRIVATE_FIELDS                                             \
-  void* queue[2];                                                             \
-  int status;                                                                 \
-
-#define UV_FS_PRIVATE_FIELDS                                                  \
-  const char *new_path;                                                       \
-  uv_file file;                                                               \
-  int flags;                                                                  \
-  mode_t mode;                                                                \
-  unsigned int nbufs;                                                         \
-  uv_buf_t* bufs;                                                             \
-  off_t off;                                                                  \
-  uv_uid_t uid;                                                               \
-  uv_gid_t gid;                                                               \
-  double atime;                                                               \
-  double mtime;                                                               \
-  struct uv__work work_req;                                                   \
-  uv_buf_t bufsml[4];                                                         \
-
-#define UV_WORK_PRIVATE_FIELDS                                                \
-  struct uv__work work_req;
-
-#define UV_TTY_PRIVATE_FIELDS                                                 \
-  struct termios orig_termios;                                                \
-  int mode;
-
-#define UV_SIGNAL_PRIVATE_FIELDS                                              \
-  /* RB_ENTRY(uv_signal_s) tree_entry; */                                     \
-  struct {                                                                    \
-    struct uv_signal_s* rbe_left;                                             \
-    struct uv_signal_s* rbe_right;                                            \
-    struct uv_signal_s* rbe_parent;                                           \
-    int rbe_color;                                                            \
-  } tree_entry;                                                               \
-  /* Use two counters here so we don have to fiddle with atomics. */          \
-  unsigned int caught_signals;                                                \
-  unsigned int dispatched_signals;
-
-#define UV_FS_EVENT_PRIVATE_FIELDS                                            \
-  uv_fs_event_cb cb;                                                          \
-  UV_PLATFORM_FS_EVENT_FIELDS                                                 \
-
-/* fs open() flags supported on this platform: */
-#if defined(O_APPEND)
-# define UV_FS_O_APPEND       O_APPEND
-#else
-# define UV_FS_O_APPEND       0
-#endif
-#if defined(O_CREAT)
-# define UV_FS_O_CREAT        O_CREAT
-#else
-# define UV_FS_O_CREAT        0
-#endif
-
-#if defined(__linux__) && defined(__arm__)
-# define UV_FS_O_DIRECT       0x10000
-#elif defined(__linux__) && defined(__m68k__)
-# define UV_FS_O_DIRECT       0x10000
-#elif defined(__linux__) && defined(__mips__)
-# define UV_FS_O_DIRECT       0x08000
-#elif defined(__linux__) && defined(__powerpc__)
-# define UV_FS_O_DIRECT       0x20000
-#elif defined(__linux__) && defined(__s390x__)
-# define UV_FS_O_DIRECT       0x04000
-#elif defined(__linux__) && defined(__x86_64__)
-# define UV_FS_O_DIRECT       0x04000
-#elif defined(O_DIRECT)
-# define UV_FS_O_DIRECT       O_DIRECT
-#else
-# define UV_FS_O_DIRECT       0
-#endif
-
-#if defined(O_DIRECTORY)
-# define UV_FS_O_DIRECTORY    O_DIRECTORY
-#else
-# define UV_FS_O_DIRECTORY    0
-#endif
-#if defined(O_DSYNC)
-# define UV_FS_O_DSYNC        O_DSYNC
-#else
-# define UV_FS_O_DSYNC        0
-#endif
-#if defined(O_EXCL)
-# define UV_FS_O_EXCL         O_EXCL
-#else
-# define UV_FS_O_EXCL         0
-#endif
-#if defined(O_EXLOCK)
-# define UV_FS_O_EXLOCK       O_EXLOCK
-#else
-# define UV_FS_O_EXLOCK       0
-#endif
-#if defined(O_NOATIME)
-# define UV_FS_O_NOATIME      O_NOATIME
-#else
-# define UV_FS_O_NOATIME      0
-#endif
-#if defined(O_NOCTTY)
-# define UV_FS_O_NOCTTY       O_NOCTTY
-#else
-# define UV_FS_O_NOCTTY       0
-#endif
-#if defined(O_NOFOLLOW)
-# define UV_FS_O_NOFOLLOW     O_NOFOLLOW
-#else
-# define UV_FS_O_NOFOLLOW     0
-#endif
-#if defined(O_NONBLOCK)
-# define UV_FS_O_NONBLOCK     O_NONBLOCK
-#else
-# define UV_FS_O_NONBLOCK     0
-#endif
-#if defined(O_RDONLY)
-# define UV_FS_O_RDONLY       O_RDONLY
-#else
-# define UV_FS_O_RDONLY       0
-#endif
-#if defined(O_RDWR)
-# define UV_FS_O_RDWR         O_RDWR
-#else
-# define UV_FS_O_RDWR         0
-#endif
-#if defined(O_SYMLINK)
-# define UV_FS_O_SYMLINK      O_SYMLINK
-#else
-# define UV_FS_O_SYMLINK      0
-#endif
-#if defined(O_SYNC)
-# define UV_FS_O_SYNC         O_SYNC
-#else
-# define UV_FS_O_SYNC         0
-#endif
-#if defined(O_TRUNC)
-# define UV_FS_O_TRUNC        O_TRUNC
-#else
-# define UV_FS_O_TRUNC        0
-#endif
-#if defined(O_WRONLY)
-# define UV_FS_O_WRONLY       O_WRONLY
-#else
-# define UV_FS_O_WRONLY       0
-#endif
-
-/* fs open() flags supported on other platforms: */
-#define UV_FS_O_FILEMAP       0
-#define UV_FS_O_RANDOM        0
-#define UV_FS_O_SHORT_LIVED   0
-#define UV_FS_O_SEQUENTIAL    0
-#define UV_FS_O_TEMPORARY     0
-
-#endif /* UV_UNIX_H */

+ 0 - 43
创维盒子/RayProxy/include/uv/version.h

@@ -1,43 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef UV_VERSION_H
-#define UV_VERSION_H
-
- /*
- * Versions with the same major number are ABI stable. API is allowed to
- * evolve between minor releases, but only in a backwards compatible way.
- * Make sure you update the -soname directives in configure.ac
- * and uv.gyp whenever you bump UV_VERSION_MAJOR or UV_VERSION_MINOR (but
- * not UV_VERSION_PATCH.)
- */
-
-#define UV_VERSION_MAJOR 1
-#define UV_VERSION_MINOR 34
-#define UV_VERSION_PATCH 0
-#define UV_VERSION_IS_RELEASE 1
-#define UV_VERSION_SUFFIX ""
-
-#define UV_VERSION_HEX  ((UV_VERSION_MAJOR << 16) | \
-                         (UV_VERSION_MINOR <<  8) | \
-                         (UV_VERSION_PATCH))
-
-#endif /* UV_VERSION_H */

+ 0 - 691
创维盒子/RayProxy/include/uv/win.h

@@ -1,691 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef _WIN32_WINNT
-# define _WIN32_WINNT   0x0600
-#endif
-
-#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
-typedef intptr_t ssize_t;
-# define SSIZE_MAX INTPTR_MAX
-# define _SSIZE_T_
-# define _SSIZE_T_DEFINED
-#endif
-
-#include <winsock2.h>
-
-#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
-typedef struct pollfd {
-  SOCKET fd;
-  short  events;
-  short  revents;
-} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
-#endif
-
-#ifndef LOCALE_INVARIANT
-# define LOCALE_INVARIANT 0x007f
-#endif
-
-#include <mswsock.h>
-#include <ws2tcpip.h>
-#include <windows.h>
-
-#include <process.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-#if defined(_MSC_VER) && _MSC_VER < 1600
-# include "uv/stdint-msvc2008.h"
-#else
-# include <stdint.h>
-#endif
-
-#include "uv/tree.h"
-#include "uv/threadpool.h"
-
-#define MAX_PIPENAME_LEN 256
-
-#ifndef S_IFLNK
-# define S_IFLNK 0xA000
-#endif
-
-/* Additional signals supported by uv_signal and or uv_kill. The CRT defines
- * the following signals already:
- *
- *   #define SIGINT           2
- *   #define SIGILL           4
- *   #define SIGABRT_COMPAT   6
- *   #define SIGFPE           8
- *   #define SIGSEGV         11
- *   #define SIGTERM         15
- *   #define SIGBREAK        21
- *   #define SIGABRT         22
- *
- * The additional signals have values that are common on other Unix
- * variants (Linux and Darwin)
- */
-#define SIGHUP                1
-#define SIGKILL               9
-#define SIGWINCH             28
-
-/* Redefine NSIG to take SIGWINCH into consideration */
-#if defined(NSIG) && NSIG <= SIGWINCH
-# undef NSIG
-#endif
-#ifndef NSIG
-# define NSIG SIGWINCH + 1
-#endif
-
-/* The CRT defines SIGABRT_COMPAT as 6, which equals SIGABRT on many unix-like
- * platforms. However MinGW doesn't define it, so we do. */
-#ifndef SIGABRT_COMPAT
-# define SIGABRT_COMPAT       6
-#endif
-
-/*
- * Guids and typedefs for winsock extension functions
- * Mingw32 doesn't have these :-(
- */
-#ifndef WSAID_ACCEPTEX
-# define WSAID_ACCEPTEX                                                       \
-         {0xb5367df1, 0xcbac, 0x11cf,                                         \
-         {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
-
-# define WSAID_CONNECTEX                                                      \
-         {0x25a207b9, 0xddf3, 0x4660,                                         \
-         {0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}}
-
-# define WSAID_GETACCEPTEXSOCKADDRS                                           \
-         {0xb5367df2, 0xcbac, 0x11cf,                                         \
-         {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
-
-# define WSAID_DISCONNECTEX                                                   \
-         {0x7fda2e11, 0x8630, 0x436f,                                         \
-         {0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}}
-
-# define WSAID_TRANSMITFILE                                                   \
-         {0xb5367df0, 0xcbac, 0x11cf,                                         \
-         {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}}
-
-  typedef BOOL (PASCAL *LPFN_ACCEPTEX)
-                      (SOCKET sListenSocket,
-                       SOCKET sAcceptSocket,
-                       PVOID lpOutputBuffer,
-                       DWORD dwReceiveDataLength,
-                       DWORD dwLocalAddressLength,
-                       DWORD dwRemoteAddressLength,
-                       LPDWORD lpdwBytesReceived,
-                       LPOVERLAPPED lpOverlapped);
-
-  typedef BOOL (PASCAL *LPFN_CONNECTEX)
-                      (SOCKET s,
-                       const struct sockaddr* name,
-                       int namelen,
-                       PVOID lpSendBuffer,
-                       DWORD dwSendDataLength,
-                       LPDWORD lpdwBytesSent,
-                       LPOVERLAPPED lpOverlapped);
-
-  typedef void (PASCAL *LPFN_GETACCEPTEXSOCKADDRS)
-                      (PVOID lpOutputBuffer,
-                       DWORD dwReceiveDataLength,
-                       DWORD dwLocalAddressLength,
-                       DWORD dwRemoteAddressLength,
-                       LPSOCKADDR* LocalSockaddr,
-                       LPINT LocalSockaddrLength,
-                       LPSOCKADDR* RemoteSockaddr,
-                       LPINT RemoteSockaddrLength);
-
-  typedef BOOL (PASCAL *LPFN_DISCONNECTEX)
-                      (SOCKET hSocket,
-                       LPOVERLAPPED lpOverlapped,
-                       DWORD dwFlags,
-                       DWORD reserved);
-
-  typedef BOOL (PASCAL *LPFN_TRANSMITFILE)
-                      (SOCKET hSocket,
-                       HANDLE hFile,
-                       DWORD nNumberOfBytesToWrite,
-                       DWORD nNumberOfBytesPerSend,
-                       LPOVERLAPPED lpOverlapped,
-                       LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,
-                       DWORD dwFlags);
-
-  typedef PVOID RTL_SRWLOCK;
-  typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK;
-#endif
-
-typedef int (WSAAPI* LPFN_WSARECV)
-            (SOCKET socket,
-             LPWSABUF buffers,
-             DWORD buffer_count,
-             LPDWORD bytes,
-             LPDWORD flags,
-             LPWSAOVERLAPPED overlapped,
-             LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine);
-
-typedef int (WSAAPI* LPFN_WSARECVFROM)
-            (SOCKET socket,
-             LPWSABUF buffers,
-             DWORD buffer_count,
-             LPDWORD bytes,
-             LPDWORD flags,
-             struct sockaddr* addr,
-             LPINT addr_len,
-             LPWSAOVERLAPPED overlapped,
-             LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine);
-
-#ifndef _NTDEF_
-  typedef LONG NTSTATUS;
-  typedef NTSTATUS *PNTSTATUS;
-#endif
-
-#ifndef RTL_CONDITION_VARIABLE_INIT
-  typedef PVOID CONDITION_VARIABLE, *PCONDITION_VARIABLE;
-#endif
-
-typedef struct _AFD_POLL_HANDLE_INFO {
-  HANDLE Handle;
-  ULONG Events;
-  NTSTATUS Status;
-} AFD_POLL_HANDLE_INFO, *PAFD_POLL_HANDLE_INFO;
-
-typedef struct _AFD_POLL_INFO {
-  LARGE_INTEGER Timeout;
-  ULONG NumberOfHandles;
-  ULONG Exclusive;
-  AFD_POLL_HANDLE_INFO Handles[1];
-} AFD_POLL_INFO, *PAFD_POLL_INFO;
-
-#define UV_MSAFD_PROVIDER_COUNT 3
-
-
-/**
- * It should be possible to cast uv_buf_t[] to WSABUF[]
- * see http://msdn.microsoft.com/en-us/library/ms741542(v=vs.85).aspx
- */
-typedef struct uv_buf_t {
-  ULONG len;
-  char* base;
-} uv_buf_t;
-
-typedef int uv_file;
-typedef SOCKET uv_os_sock_t;
-typedef HANDLE uv_os_fd_t;
-typedef int uv_pid_t;
-
-typedef HANDLE uv_thread_t;
-
-typedef HANDLE uv_sem_t;
-
-typedef CRITICAL_SECTION uv_mutex_t;
-
-/* This condition variable implementation is based on the SetEvent solution
- * (section 3.2) at http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
- * We could not use the SignalObjectAndWait solution (section 3.4) because
- * it want the 2nd argument (type uv_mutex_t) of uv_cond_wait() and
- * uv_cond_timedwait() to be HANDLEs, but we use CRITICAL_SECTIONs.
- */
-
-typedef union {
-  CONDITION_VARIABLE cond_var;
-  struct {
-    unsigned int waiters_count;
-    CRITICAL_SECTION waiters_count_lock;
-    HANDLE signal_event;
-    HANDLE broadcast_event;
-  } unused_; /* TODO: retained for ABI compatibility; remove me in v2.x. */
-} uv_cond_t;
-
-typedef union {
-  struct {
-    unsigned int num_readers_;
-    CRITICAL_SECTION num_readers_lock_;
-    HANDLE write_semaphore_;
-  } state_;
-  /* TODO: remove me in v2.x. */
-  struct {
-    SRWLOCK unused_;
-  } unused1_;
-  /* TODO: remove me in v2.x. */
-  struct {
-    uv_mutex_t unused1_;
-    uv_mutex_t unused2_;
-  } unused2_;
-} uv_rwlock_t;
-
-typedef struct {
-  unsigned int n;
-  unsigned int count;
-  uv_mutex_t mutex;
-  uv_sem_t turnstile1;
-  uv_sem_t turnstile2;
-} uv_barrier_t;
-
-typedef struct {
-  DWORD tls_index;
-} uv_key_t;
-
-#define UV_ONCE_INIT { 0, NULL }
-
-typedef struct uv_once_s {
-  unsigned char ran;
-  HANDLE event;
-} uv_once_t;
-
-/* Platform-specific definitions for uv_spawn support. */
-typedef unsigned char uv_uid_t;
-typedef unsigned char uv_gid_t;
-
-typedef struct uv__dirent_s {
-  int d_type;
-  char d_name[1];
-} uv__dirent_t;
-
-#define UV_DIR_PRIVATE_FIELDS \
-  HANDLE dir_handle;          \
-  WIN32_FIND_DATAW find_data; \
-  BOOL need_find_call;
-
-#define HAVE_DIRENT_TYPES
-#define UV__DT_DIR     UV_DIRENT_DIR
-#define UV__DT_FILE    UV_DIRENT_FILE
-#define UV__DT_LINK    UV_DIRENT_LINK
-#define UV__DT_FIFO    UV_DIRENT_FIFO
-#define UV__DT_SOCKET  UV_DIRENT_SOCKET
-#define UV__DT_CHAR    UV_DIRENT_CHAR
-#define UV__DT_BLOCK   UV_DIRENT_BLOCK
-
-/* Platform-specific definitions for uv_dlopen support. */
-#define UV_DYNAMIC FAR WINAPI
-typedef struct {
-  HMODULE handle;
-  char* errmsg;
-} uv_lib_t;
-
-#define UV_LOOP_PRIVATE_FIELDS                                                \
-    /* The loop's I/O completion port */                                      \
-  HANDLE iocp;                                                                \
-  /* The current time according to the event loop. in msecs. */               \
-  uint64_t time;                                                              \
-  /* Tail of a single-linked circular queue of pending reqs. If the queue */  \
-  /* is empty, tail_ is NULL. If there is only one item, */                   \
-  /* tail_->next_req == tail_ */                                              \
-  uv_req_t* pending_reqs_tail;                                                \
-  /* Head of a single-linked list of closed handles */                        \
-  uv_handle_t* endgame_handles;                                               \
-  /* TODO(bnoordhuis) Stop heap-allocating |timer_heap| in libuv v2.x. */     \
-  void* timer_heap;                                                           \
-    /* Lists of active loop (prepare / check / idle) watchers */              \
-  uv_prepare_t* prepare_handles;                                              \
-  uv_check_t* check_handles;                                                  \
-  uv_idle_t* idle_handles;                                                    \
-  /* This pointer will refer to the prepare/check/idle handle whose */        \
-  /* callback is scheduled to be called next. This is needed to allow */      \
-  /* safe removal from one of the lists above while that list being */        \
-  /* iterated over. */                                                        \
-  uv_prepare_t* next_prepare_handle;                                          \
-  uv_check_t* next_check_handle;                                              \
-  uv_idle_t* next_idle_handle;                                                \
-  /* This handle holds the peer sockets for the fast variant of uv_poll_t */  \
-  SOCKET poll_peer_sockets[UV_MSAFD_PROVIDER_COUNT];                          \
-  /* Counter to keep track of active tcp streams */                           \
-  unsigned int active_tcp_streams;                                            \
-  /* Counter to keep track of active udp streams */                           \
-  unsigned int active_udp_streams;                                            \
-  /* Counter to started timer */                                              \
-  uint64_t timer_counter;                                                     \
-  /* Threadpool */                                                            \
-  void* wq[2];                                                                \
-  uv_mutex_t wq_mutex;                                                        \
-  uv_async_t wq_async;
-
-#define UV_REQ_TYPE_PRIVATE                                                   \
-  /* TODO: remove the req suffix */                                           \
-  UV_ACCEPT,                                                                  \
-  UV_FS_EVENT_REQ,                                                            \
-  UV_POLL_REQ,                                                                \
-  UV_PROCESS_EXIT,                                                            \
-  UV_READ,                                                                    \
-  UV_UDP_RECV,                                                                \
-  UV_WAKEUP,                                                                  \
-  UV_SIGNAL_REQ,
-
-#define UV_REQ_PRIVATE_FIELDS                                                 \
-  union {                                                                     \
-    /* Used by I/O operations */                                              \
-    struct {                                                                  \
-      OVERLAPPED overlapped;                                                  \
-      size_t queued_bytes;                                                    \
-    } io;                                                                     \
-  } u;                                                                        \
-  struct uv_req_s* next_req;
-
-#define UV_WRITE_PRIVATE_FIELDS \
-  int coalesced;                \
-  uv_buf_t write_buffer;        \
-  HANDLE event_handle;          \
-  HANDLE wait_handle;
-
-#define UV_CONNECT_PRIVATE_FIELDS                                             \
-  /* empty */
-
-#define UV_SHUTDOWN_PRIVATE_FIELDS                                            \
-  /* empty */
-
-#define UV_UDP_SEND_PRIVATE_FIELDS                                            \
-  /* empty */
-
-#define UV_PRIVATE_REQ_TYPES                                                  \
-  typedef struct uv_pipe_accept_s {                                           \
-    UV_REQ_FIELDS                                                             \
-    HANDLE pipeHandle;                                                        \
-    struct uv_pipe_accept_s* next_pending;                                    \
-  } uv_pipe_accept_t;                                                         \
-                                                                              \
-  typedef struct uv_tcp_accept_s {                                            \
-    UV_REQ_FIELDS                                                             \
-    SOCKET accept_socket;                                                     \
-    char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32];             \
-    HANDLE event_handle;                                                      \
-    HANDLE wait_handle;                                                       \
-    struct uv_tcp_accept_s* next_pending;                                     \
-  } uv_tcp_accept_t;                                                          \
-                                                                              \
-  typedef struct uv_read_s {                                                  \
-    UV_REQ_FIELDS                                                             \
-    HANDLE event_handle;                                                      \
-    HANDLE wait_handle;                                                       \
-  } uv_read_t;
-
-#define uv_stream_connection_fields                                           \
-  unsigned int write_reqs_pending;                                            \
-  uv_shutdown_t* shutdown_req;
-
-#define uv_stream_server_fields                                               \
-  uv_connection_cb connection_cb;
-
-#define UV_STREAM_PRIVATE_FIELDS                                              \
-  unsigned int reqs_pending;                                                  \
-  int activecnt;                                                              \
-  uv_read_t read_req;                                                         \
-  union {                                                                     \
-    struct { uv_stream_connection_fields } conn;                              \
-    struct { uv_stream_server_fields     } serv;                              \
-  } stream;
-
-#define uv_tcp_server_fields                                                  \
-  uv_tcp_accept_t* accept_reqs;                                               \
-  unsigned int processed_accepts;                                             \
-  uv_tcp_accept_t* pending_accepts;                                           \
-  LPFN_ACCEPTEX func_acceptex;
-
-#define uv_tcp_connection_fields                                              \
-  uv_buf_t read_buffer;                                                       \
-  LPFN_CONNECTEX func_connectex;
-
-#define UV_TCP_PRIVATE_FIELDS                                                 \
-  SOCKET socket;                                                              \
-  int delayed_error;                                                          \
-  union {                                                                     \
-    struct { uv_tcp_server_fields } serv;                                     \
-    struct { uv_tcp_connection_fields } conn;                                 \
-  } tcp;
-
-#define UV_UDP_PRIVATE_FIELDS                                                 \
-  SOCKET socket;                                                              \
-  unsigned int reqs_pending;                                                  \
-  int activecnt;                                                              \
-  uv_req_t recv_req;                                                          \
-  uv_buf_t recv_buffer;                                                       \
-  struct sockaddr_storage recv_from;                                          \
-  int recv_from_len;                                                          \
-  uv_udp_recv_cb recv_cb;                                                     \
-  uv_alloc_cb alloc_cb;                                                       \
-  LPFN_WSARECV func_wsarecv;                                                  \
-  LPFN_WSARECVFROM func_wsarecvfrom;
-
-#define uv_pipe_server_fields                                                 \
-  int pending_instances;                                                      \
-  uv_pipe_accept_t* accept_reqs;                                              \
-  uv_pipe_accept_t* pending_accepts;
-
-#define uv_pipe_connection_fields                                             \
-  uv_timer_t* eof_timer;                                                      \
-  uv_write_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \
-  DWORD ipc_remote_pid;                                                       \
-  union {                                                                     \
-    uint32_t payload_remaining;                                               \
-    uint64_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \
-  } ipc_data_frame;                                                           \
-  void* ipc_xfer_queue[2];                                                    \
-  int ipc_xfer_queue_length;                                                  \
-  uv_write_t* non_overlapped_writes_tail;                                     \
-  CRITICAL_SECTION readfile_thread_lock;                                      \
-  volatile HANDLE readfile_thread_handle;
-
-#define UV_PIPE_PRIVATE_FIELDS                                                \
-  HANDLE handle;                                                              \
-  WCHAR* name;                                                                \
-  union {                                                                     \
-    struct { uv_pipe_server_fields } serv;                                    \
-    struct { uv_pipe_connection_fields } conn;                                \
-  } pipe;
-
-/* TODO: put the parser states in an union - TTY handles are always half-duplex
- * so read-state can safely overlap write-state. */
-#define UV_TTY_PRIVATE_FIELDS                                                 \
-  HANDLE handle;                                                              \
-  union {                                                                     \
-    struct {                                                                  \
-      /* Used for readable TTY handles */                                     \
-      /* TODO: remove me in v2.x. */                                          \
-      HANDLE unused_;                                                         \
-      uv_buf_t read_line_buffer;                                              \
-      HANDLE read_raw_wait;                                                   \
-      /* Fields used for translating win keystrokes into vt100 characters */  \
-      char last_key[8];                                                       \
-      unsigned char last_key_offset;                                          \
-      unsigned char last_key_len;                                             \
-      WCHAR last_utf16_high_surrogate;                                        \
-      INPUT_RECORD last_input_record;                                         \
-    } rd;                                                                     \
-    struct {                                                                  \
-      /* Used for writable TTY handles */                                     \
-      /* utf8-to-utf16 conversion state */                                    \
-      unsigned int utf8_codepoint;                                            \
-      unsigned char utf8_bytes_left;                                          \
-      /* eol conversion state */                                              \
-      unsigned char previous_eol;                                             \
-      /* ansi parser state */                                                 \
-      unsigned char ansi_parser_state;                                        \
-      unsigned char ansi_csi_argc;                                            \
-      unsigned short ansi_csi_argv[4];                                        \
-      COORD saved_position;                                                   \
-      WORD saved_attributes;                                                  \
-    } wr;                                                                     \
-  } tty;
-
-#define UV_POLL_PRIVATE_FIELDS                                                \
-  SOCKET socket;                                                              \
-  /* Used in fast mode */                                                     \
-  SOCKET peer_socket;                                                         \
-  AFD_POLL_INFO afd_poll_info_1;                                              \
-  AFD_POLL_INFO afd_poll_info_2;                                              \
-  /* Used in fast and slow mode. */                                           \
-  uv_req_t poll_req_1;                                                        \
-  uv_req_t poll_req_2;                                                        \
-  unsigned char submitted_events_1;                                           \
-  unsigned char submitted_events_2;                                           \
-  unsigned char mask_events_1;                                                \
-  unsigned char mask_events_2;                                                \
-  unsigned char events;
-
-#define UV_TIMER_PRIVATE_FIELDS                                               \
-  void* heap_node[3];                                                         \
-  int unused;                                                                 \
-  uint64_t timeout;                                                           \
-  uint64_t repeat;                                                            \
-  uint64_t start_id;                                                          \
-  uv_timer_cb timer_cb;
-
-#define UV_ASYNC_PRIVATE_FIELDS                                               \
-  struct uv_req_s async_req;                                                  \
-  uv_async_cb async_cb;                                                       \
-  /* char to avoid alignment issues */                                        \
-  char volatile async_sent;
-
-#define UV_PREPARE_PRIVATE_FIELDS                                             \
-  uv_prepare_t* prepare_prev;                                                 \
-  uv_prepare_t* prepare_next;                                                 \
-  uv_prepare_cb prepare_cb;
-
-#define UV_CHECK_PRIVATE_FIELDS                                               \
-  uv_check_t* check_prev;                                                     \
-  uv_check_t* check_next;                                                     \
-  uv_check_cb check_cb;
-
-#define UV_IDLE_PRIVATE_FIELDS                                                \
-  uv_idle_t* idle_prev;                                                       \
-  uv_idle_t* idle_next;                                                       \
-  uv_idle_cb idle_cb;
-
-#define UV_HANDLE_PRIVATE_FIELDS                                              \
-  uv_handle_t* endgame_next;                                                  \
-  unsigned int flags;
-
-#define UV_GETADDRINFO_PRIVATE_FIELDS                                         \
-  struct uv__work work_req;                                                   \
-  uv_getaddrinfo_cb getaddrinfo_cb;                                           \
-  void* alloc;                                                                \
-  WCHAR* node;                                                                \
-  WCHAR* service;                                                             \
-  /* The addrinfoW field is used to store a pointer to the hints, and    */   \
-  /* later on to store the result of GetAddrInfoW. The final result will */   \
-  /* be converted to struct addrinfo* and stored in the addrinfo field.  */   \
-  struct addrinfoW* addrinfow;                                                \
-  struct addrinfo* addrinfo;                                                  \
-  int retcode;
-
-#define UV_GETNAMEINFO_PRIVATE_FIELDS                                         \
-  struct uv__work work_req;                                                   \
-  uv_getnameinfo_cb getnameinfo_cb;                                           \
-  struct sockaddr_storage storage;                                            \
-  int flags;                                                                  \
-  char host[NI_MAXHOST];                                                      \
-  char service[NI_MAXSERV];                                                   \
-  int retcode;
-
-#define UV_PROCESS_PRIVATE_FIELDS                                             \
-  struct uv_process_exit_s {                                                  \
-    UV_REQ_FIELDS                                                             \
-  } exit_req;                                                                 \
-  BYTE* child_stdio_buffer;                                                   \
-  int exit_signal;                                                            \
-  HANDLE wait_handle;                                                         \
-  HANDLE process_handle;                                                      \
-  volatile char exit_cb_pending;
-
-#define UV_FS_PRIVATE_FIELDS                                                  \
-  struct uv__work work_req;                                                   \
-  int flags;                                                                  \
-  DWORD sys_errno_;                                                           \
-  union {                                                                     \
-    /* TODO: remove me in 0.9. */                                             \
-    WCHAR* pathw;                                                             \
-    int fd;                                                                   \
-  } file;                                                                     \
-  union {                                                                     \
-    struct {                                                                  \
-      int mode;                                                               \
-      WCHAR* new_pathw;                                                       \
-      int file_flags;                                                         \
-      int fd_out;                                                             \
-      unsigned int nbufs;                                                     \
-      uv_buf_t* bufs;                                                         \
-      int64_t offset;                                                         \
-      uv_buf_t bufsml[4];                                                     \
-    } info;                                                                   \
-    struct {                                                                  \
-      double atime;                                                           \
-      double mtime;                                                           \
-    } time;                                                                   \
-  } fs;
-
-#define UV_WORK_PRIVATE_FIELDS                                                \
-  struct uv__work work_req;
-
-#define UV_FS_EVENT_PRIVATE_FIELDS                                            \
-  struct uv_fs_event_req_s {                                                  \
-    UV_REQ_FIELDS                                                             \
-  } req;                                                                      \
-  HANDLE dir_handle;                                                          \
-  int req_pending;                                                            \
-  uv_fs_event_cb cb;                                                          \
-  WCHAR* filew;                                                               \
-  WCHAR* short_filew;                                                         \
-  WCHAR* dirw;                                                                \
-  char* buffer;
-
-#define UV_SIGNAL_PRIVATE_FIELDS                                              \
-  RB_ENTRY(uv_signal_s) tree_entry;                                           \
-  struct uv_req_s signal_req;                                                 \
-  unsigned long pending_signum;
-
-#ifndef F_OK
-#define F_OK 0
-#endif
-#ifndef R_OK
-#define R_OK 4
-#endif
-#ifndef W_OK
-#define W_OK 2
-#endif
-#ifndef X_OK
-#define X_OK 1
-#endif
-
-/* fs open() flags supported on this platform: */
-#define UV_FS_O_APPEND       _O_APPEND
-#define UV_FS_O_CREAT        _O_CREAT
-#define UV_FS_O_EXCL         _O_EXCL
-#define UV_FS_O_FILEMAP      0x20000000
-#define UV_FS_O_RANDOM       _O_RANDOM
-#define UV_FS_O_RDONLY       _O_RDONLY
-#define UV_FS_O_RDWR         _O_RDWR
-#define UV_FS_O_SEQUENTIAL   _O_SEQUENTIAL
-#define UV_FS_O_SHORT_LIVED  _O_SHORT_LIVED
-#define UV_FS_O_TEMPORARY    _O_TEMPORARY
-#define UV_FS_O_TRUNC        _O_TRUNC
-#define UV_FS_O_WRONLY       _O_WRONLY
-
-/* fs open() flags supported on other platforms (or mapped on this platform): */
-#define UV_FS_O_DIRECT       0x02000000 /* FILE_FLAG_NO_BUFFERING */
-#define UV_FS_O_DIRECTORY    0
-#define UV_FS_O_DSYNC        0x04000000 /* FILE_FLAG_WRITE_THROUGH */
-#define UV_FS_O_EXLOCK       0x10000000 /* EXCLUSIVE SHARING MODE */
-#define UV_FS_O_NOATIME      0
-#define UV_FS_O_NOCTTY       0
-#define UV_FS_O_NOFOLLOW     0
-#define UV_FS_O_NONBLOCK     0
-#define UV_FS_O_SYMLINK      0
-#define UV_FS_O_SYNC         0x08000000 /* FILE_FLAG_WRITE_THROUGH */

BIN
创维盒子/RayProxy/libAuthentication.a


BIN
创维盒子/RayProxy/libEncryptAuth.a


BIN
创维盒子/RayProxy/libRaySync-Multi-Proxy-Client-Plus.a


BIN
创维盒子/RayProxy/libRaySync-Multi-Proxy-Client.a


BIN
创维盒子/RayProxy/libRaySync-Proxy-Common-Lib.a


BIN
创维盒子/RayProxy/libRaySync-Proxy-Server-Lib.a


BIN
创维盒子/RayProxy/libRaySync.a


BIN
创维盒子/RayProxy/libRvCommon.a


BIN
创维盒子/RayProxy/libcommon.a


BIN
创维盒子/RayProxy/libcrypto.a


BIN
创维盒子/RayProxy/libcurl.a


BIN
创维盒子/RayProxy/libjsoncpp.a


BIN
创维盒子/RayProxy/libnet_detection.a


BIN
创维盒子/RayProxy/libnet_detection_client.a


BIN
创维盒子/RayProxy/libspdlog.a


BIN
创维盒子/RayProxy/libssl.a


BIN
创维盒子/RayProxy/libuv.a


BIN
创维盒子/RayProxy/libxxhash.a


BIN
创维盒子/RayProxy/libzerotier-one.a


BIN
创维盒子/RayProxy/libzipCompress.a


BIN
创维盒子/RayProxy/libzstd.a


+ 20 - 57
创维盒子/code/connectDeviceManager/connectDeviceManager.m

@@ -8,7 +8,6 @@
 //第三方  瑞云 的链接服务
 #import "connectDeviceManager.h"
 
-#import <RayProxy/RaylinkProxy.h>
 #import <CocoaAsyncSocket/GCDAsyncSocket.h>
 
 #import "WHPingTester.h"
@@ -17,7 +16,7 @@
 
 @interface connectDeviceManager ()<
 GCDAsyncSocketDelegate,
-RaylinkProxyDelegate,
+//RaylinkProxyDelegate,
 WHPingDelegate
 >
 {
@@ -128,7 +127,7 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
             [HWDataManager setObjectWithKey:Const_Have_Add_Device value:dict];
             
             //
-            bool connected = [RaylinkProxy.sharedManager isSdnConnected];
+            bool connected = 1;// [RaylinkProxy.sharedManager isSdnConnected];
             if(!connected || needReconnect){
                 self->didPingType = NO;
                 self->didRuiyunLinkType = NO;
@@ -196,7 +195,7 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
     //self.sdnConnectStateLab.text = @"SDN state: Connectting";
     //self.sdnIDLab.text = @"My SDN ID:";
     
-    RaylinkProxy.sharedManager.delegate = self;
+    //RaylinkProxy.sharedManager.delegate = self;
     
     initProxyQueue = dispatch_queue_create("init_proxy", 0);
     
@@ -211,7 +210,7 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
         NSData *sdnInfo = [NSData dataWithContentsOfURL:[[NSBundle.mainBundle bundleURL] URLByAppendingPathComponent:@"planet.1ali_3ry_peer"]];
         
         /// 1. 初始化代理库
-        [RaylinkProxy.sharedManager initProxy:logUrl.path rootSdnInfo:sdnInfo];
+        //[RaylinkProxy.sharedManager initProxy:logUrl.path rootSdnInfo:sdnInfo];
         
         self->didRuiYunInitOkType = YES;
         
@@ -219,7 +218,7 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
         self.connectCheckTimer = [NSTimer scheduledTimerWithTimeInterval:0.5 repeats:YES block:^(NSTimer * _Nonnull timer) {
             
             /// 2. 监听SDN 连接状态
-            bool connected = [RaylinkProxy.sharedManager isSdnConnected];
+            bool connected = 1;// [RaylinkProxy.sharedManager isSdnConnected];
             if (self.sdnConnected == connected) {
                 return;
             }
@@ -283,7 +282,7 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
     }
     
     /// 3. 根据对端的 SDN ID 创建连接
-    [RaylinkProxy.sharedManager createNewConnection:curSdnId];
+    //[RaylinkProxy.sharedManager createNewConnection:curSdnId];
     
     //self.socket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
     //[self.connectBtn setEnabled:NO];
@@ -308,8 +307,8 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
     }
     
     if(curSdnId){
-        [RaylinkProxy.sharedManager closeConnection:curSdnId];
-        [RaylinkProxy.sharedManager closeHttpService:curSdnId];
+//        [RaylinkProxy.sharedManager closeConnection:curSdnId];
+//        [RaylinkProxy.sharedManager closeHttpService:curSdnId];
         //[self.connectBtn setTitle:@"连接" forState:UIControlStateNormal];
         self.peerConnected = NO;
     }
@@ -344,49 +343,13 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
 //
 //}
 
-- (void)onProxyConnected:(NSString *)sdnId status:(int)status {
-    
-    
-    if (status == 0) {
-        
-        /// 4. 创建 HttpService
-        self.tcpPort = [RaylinkProxy.sharedManager createHttpService:sdnId];
-        self.tcpPortStr = [[NSString alloc] initWithFormat:@"%ld",self.tcpPort];
-        [[netWorkManager shareInstance] setAFHTTPSessionManagerFunBy:self.tcpPort];
-        /// 5. 添加端口防火墙
-        [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9300];
-        [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9100];
-        [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9888];
-        [cachesFileManager writeLogsWithMsg:@"onProxyConnected connectToHost"];
-        
-        /// 6. 等待连接成功回调,创建 TCP socket 连接 HttpService 的端口
-//         NSError *error;
-//
-//        NSString*log1 =  [[NSString alloc] initWithFormat:@"onProxyConnected connectToHost begin %ld", (long)self.tcpPort];
-//        [cachesFileManager writeLogsWithMsg:log1];
-//
-//        [self.socket connectToHost:@"127.0.0.1" onPort:self.tcpPort error:&error];
-//
-//        NSString*log2 =  [[NSString alloc] initWithFormat:@"onProxyConnected connectToHost end %ld, self.socket = %@ error = %@", (long)self.tcpPort, self.socket, error];
-//        [cachesFileManager writeLogsWithMsg:log2];
-        
-        _curConnectDeviceState = DeviceConnectDeciceOk;
-        _Pre_sdnId = self.DeviceThirdIdMod.data.sdnId;
-        
-        disconnected_cb_type = NO;
+- (void)on111ProxyConnected:(NSString *)sdnId status:(int)status
+{
     
-        didRuiyunLinkType = YES;
-        [self beginLinkWebSocketFun];
-    } else {
-        
-        HLog(@"瑞云链接断开");
-    }
 }
 
-- (void)OnProxyDisconnected_cb:(NSString *)sdnId {
-    //[RaylinkProxy.sharedManager closeHttpService:sdnId];
-    [cachesFileManager writeLogsWithMsg:@"OnProxyDisconnected_cb"];
-    disconnected_cb_type = YES;
+- (void)On22ProxyDisconnected_cb:(NSString *)sdnId {
+    
 }
 
 //瑞云sock 断开了 需要重连
@@ -455,14 +418,14 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
 
 //音视频 链接返回-5的时候调用
 - (void)recreateHttpServiceFun{
-    [cachesFileManager writeLogsWithMsg:@"recreateHttpServiceFun"];
-    NSString *sdnId = self.DeviceThirdIdMod.data.sdnId;
-    self.tcpPort = [RaylinkProxy.sharedManager createHttpService:sdnId];
-    self.tcpPortStr = [[NSString alloc] initWithFormat:@"%ld",self.tcpPort];
-    [[netWorkManager shareInstance] setAFHTTPSessionManagerFunBy:self.tcpPort];
-    [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9300];
-    [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9100];
-    [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9888];
+//    [cachesFileManager writeLogsWithMsg:@"recreateHttpServiceFun"];
+//    NSString *sdnId = self.DeviceThirdIdMod.data.sdnId;
+//    self.tcpPort = [RaylinkProxy.sharedManager createHttpService:sdnId];
+//    self.tcpPortStr = [[NSString alloc] initWithFormat:@"%ld",self.tcpPort];
+//    [[netWorkManager shareInstance] setAFHTTPSessionManagerFunBy:self.tcpPort];
+//    [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9300];
+//    [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9100];
+//    [RaylinkProxy.sharedManager addSdnId:sdnId ip:ruiyunlinkIp allowPort:9888];
 }
 
 //- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port {