From 28efa76d5296f45390b483df55d52d48b0daaa38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=98=95?= Date: Thu, 15 Jun 2023 09:35:37 +0800 Subject: [PATCH] =?UTF-8?q?OCT=201.=20=E5=88=9D=E5=A7=8B=E5=8C=96=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .clang-format | 220 +++++ .gitignore | 5 + NetTunnelApp/App.xaml | 9 + NetTunnelApp/App.xaml.cs | 15 + NetTunnelApp/AssemblyInfo.cs | 10 + NetTunnelApp/MainWindow.xaml | 13 + NetTunnelApp/MainWindow.xaml.cs | 37 + NetTunnelApp/NetTunnelApp.csproj | 11 + NetTunnelApp/NetTunnelApp.csproj.user | 14 + NetTunnelApp/NetTunnelLib.cs | 42 + ...CoreApp,Version=v6.0.AssemblyAttributes.cs | 4 + .../obj/Debug/net6.0-windows/App.g.cs | 71 ++ .../obj/Debug/net6.0-windows/App.g.i.cs | 71 ++ .../obj/Debug/net6.0-windows/MainWindow.g.cs | 87 ++ .../Debug/net6.0-windows/MainWindow.g.i.cs | 87 ++ .../NetTunnelApp.AssemblyInfo.cs | 25 + .../NetTunnelApp.AssemblyInfoInputs.cache | 1 + ....GeneratedMSBuildEditorConfig.editorconfig | 11 + ...etTunnelApp.csproj.AssemblyReference.cache | Bin 0 -> 111581 bytes .../NetTunnelApp_MarkupCompile.cache | 20 + .../NetTunnelApp_MarkupCompile.i.cache | 20 + .../NetTunnelApp_MarkupCompile.i.lref | 4 + .../NetTunnelApp_MarkupCompile.lref | 4 + NetTunnelDemo/NetTunnelDemo.cpp | 22 + NetTunnelDemo/NetTunnelDemo.vcxproj | 140 +++ NetTunnelDemo/NetTunnelDemo.vcxproj.filters | 22 + NetTunnelDemo/NetTunnelDemo.vcxproj.user | 4 + NetTunnelSDK/NetTunnelSDK.vcxproj | 186 ++++ NetTunnelSDK/NetTunnelSDK.vcxproj.filters | 72 ++ NetTunnelSDK/NetTunnelSDK.vcxproj.user | 4 + NetTunnelSDK/dllmain.cpp | 16 + NetTunnelSDK/framework.h | 5 + NetTunnelSDK/logs/fmtlog-inl.h | 636 ++++++++++++++ NetTunnelSDK/logs/fmtlog.cc | 1 + NetTunnelSDK/logs/fmtlog.h | 826 ++++++++++++++++++ NetTunnelSDK/misc.h | 10 + NetTunnelSDK/packages.config | 4 + NetTunnelSDK/pch.cpp | 5 + NetTunnelSDK/pch.h | 13 + NetTunnelSDK/tunnel.cpp | 80 ++ NetTunnelSDK/tunnel.h | 44 + NetTunnelSDK/usrerr.cpp | 28 + NetTunnelSDK/usrerr.h | 27 + NetworkTunnel.sln | 100 +++ UTNetTunnelSDK/UTNetTunnelSDK.cpp | 18 + UTNetTunnelSDK/UTNetTunnelSDK.vcxproj | 178 ++++ UTNetTunnelSDK/UTNetTunnelSDK.vcxproj.filters | 30 + UTNetTunnelSDK/UTNetTunnelSDK.vcxproj.user | 4 + UTNetTunnelSDK/pch.cpp | 5 + UTNetTunnelSDK/pch.h | 12 + ...g.C.llvmmingw20230517ucrtx8664.vcpkg.props | 6 + ...C.llvmmingw20230517ucrtx8664.vcpkg.targets | 7 + ...vmmingw20230517ucrtx8664.vcpkg.1.0.0.nupkg | Bin 0 -> 2877 bytes 53 files changed, 3286 insertions(+) create mode 100644 .clang-format create mode 100644 .gitignore create mode 100644 NetTunnelApp/App.xaml create mode 100644 NetTunnelApp/App.xaml.cs create mode 100644 NetTunnelApp/AssemblyInfo.cs create mode 100644 NetTunnelApp/MainWindow.xaml create mode 100644 NetTunnelApp/MainWindow.xaml.cs create mode 100644 NetTunnelApp/NetTunnelApp.csproj create mode 100644 NetTunnelApp/NetTunnelApp.csproj.user create mode 100644 NetTunnelApp/NetTunnelLib.cs create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/App.g.cs create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/App.g.i.cs create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/MainWindow.g.cs create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/MainWindow.g.i.cs create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/NetTunnelApp.AssemblyInfo.cs create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/NetTunnelApp.AssemblyInfoInputs.cache create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/NetTunnelApp.GeneratedMSBuildEditorConfig.editorconfig create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/NetTunnelApp.csproj.AssemblyReference.cache create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/NetTunnelApp_MarkupCompile.cache create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/NetTunnelApp_MarkupCompile.i.cache create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/NetTunnelApp_MarkupCompile.i.lref create mode 100644 NetTunnelApp/obj/Debug/net6.0-windows/NetTunnelApp_MarkupCompile.lref create mode 100644 NetTunnelDemo/NetTunnelDemo.cpp create mode 100644 NetTunnelDemo/NetTunnelDemo.vcxproj create mode 100644 NetTunnelDemo/NetTunnelDemo.vcxproj.filters create mode 100644 NetTunnelDemo/NetTunnelDemo.vcxproj.user create mode 100644 NetTunnelSDK/NetTunnelSDK.vcxproj create mode 100644 NetTunnelSDK/NetTunnelSDK.vcxproj.filters create mode 100644 NetTunnelSDK/NetTunnelSDK.vcxproj.user create mode 100644 NetTunnelSDK/dllmain.cpp create mode 100644 NetTunnelSDK/framework.h create mode 100644 NetTunnelSDK/logs/fmtlog-inl.h create mode 100644 NetTunnelSDK/logs/fmtlog.cc create mode 100644 NetTunnelSDK/logs/fmtlog.h create mode 100644 NetTunnelSDK/misc.h create mode 100644 NetTunnelSDK/packages.config create mode 100644 NetTunnelSDK/pch.cpp create mode 100644 NetTunnelSDK/pch.h create mode 100644 NetTunnelSDK/tunnel.cpp create mode 100644 NetTunnelSDK/tunnel.h create mode 100644 NetTunnelSDK/usrerr.cpp create mode 100644 NetTunnelSDK/usrerr.h create mode 100644 NetworkTunnel.sln create mode 100644 UTNetTunnelSDK/UTNetTunnelSDK.cpp create mode 100644 UTNetTunnelSDK/UTNetTunnelSDK.vcxproj create mode 100644 UTNetTunnelSDK/UTNetTunnelSDK.vcxproj.filters create mode 100644 UTNetTunnelSDK/UTNetTunnelSDK.vcxproj.user create mode 100644 UTNetTunnelSDK/pch.cpp create mode 100644 UTNetTunnelSDK/pch.h create mode 100644 packages/vcpkg.C.llvmmingw20230517ucrtx8664.vcpkg.1.0.0/build/native/vcpkg.C.llvmmingw20230517ucrtx8664.vcpkg.props create mode 100644 packages/vcpkg.C.llvmmingw20230517ucrtx8664.vcpkg.1.0.0/build/native/vcpkg.C.llvmmingw20230517ucrtx8664.vcpkg.targets create mode 100644 packages/vcpkg.C.llvmmingw20230517ucrtx8664.vcpkg.1.0.0/vcpkg.C.llvmmingw20230517ucrtx8664.vcpkg.1.0.0.nupkg diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..dcc8922 --- /dev/null +++ b/.clang-format @@ -0,0 +1,220 @@ +# ClangFormatConfigureSource: 'clang-format-file://D:/development/c/daemon_agent/.clang-format' +Language: Cpp +AccessModifierOffset: -4 +InsertBraces: true +AlignArrayOfStructures: Left +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: + Enabled: true + AcrossEmptyLines: true + AcrossComments: true +AlignConsecutiveAssignments: + Enabled: true + AcrossEmptyLines: false + AcrossComments: true + PadOperators: true + AlignCompound: true +AlignConsecutiveBitFields: None +AlignConsecutiveDeclarations: + Enabled: true + AcrossEmptyLines: false + AcrossComments: true + PadOperators: true + AlignCompound: true +AlignEscapedNewlines: Left +AlignOperands: DontAlign +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: false +AllowAllConstructorInitializersOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortEnumsOnASingleLine: false +AllowShortBlocksOnASingleLine: Always +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: MultiLine +AttributeMacros: + - __capability + - __unused +BinPackArguments: true +BinPackParameters: false +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: true + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeConceptDeclarations: true +BreakBeforeBraces: Custom +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 120 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: true +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DeriveLineEnding: true +DerivePointerAlignment: false +DisableFormat: false +EmptyLineBeforeAccessModifier: LogicalBlock +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +StatementAttributeLikeMacros: + - Q_EMIT +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^' + Priority: 2 + SortPriority: 0 + CaseSensitive: false + - Regex: '^<.*\.h>' + Priority: 1 + SortPriority: 0 + CaseSensitive: false + - Regex: '^<.*' + Priority: 2 + SortPriority: 0 + CaseSensitive: false + - Regex: '.*' + Priority: 3 + SortPriority: 0 + CaseSensitive: false +IncludeIsMainRegex: '([-_](test|unittest))?$' +IncludeIsMainSourceRegex: '' +IndentCaseLabels: true +IndentCaseBlocks: false +IndentGotoLabels: true +IndentPPDirectives: None +IndentExternBlock: AfterExternBlock +IndentRequiresClause: false +IndentWidth: 4 +IndentWrappedFunctionNames: false +InsertTrailingCommas: None +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBinPackProtocolList: Never +ObjCBlockIndentWidth: 4 +ObjCBreakBeforeNestedBlockParam: true +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 1000 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 140 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PenaltyIndentedWhitespace: 0 +PointerAlignment: Right +RawStringFormats: + - Language: Cpp + Delimiters: + - cc + - CC + - cpp + - Cpp + - CPP + - 'c++' + - 'C++' + CanonicalDelimiter: '' + BasedOnStyle: google + - Language: TextProto + Delimiters: + - pb + - PB + - proto + - PROTO + EnclosingFunctions: + - EqualsProto + - EquivToProto + - PARSE_PARTIAL_TEXT_PROTO + - PARSE_TEST_PROTO + - PARSE_TEXT_PROTO + - ParseTextOrDie + - ParseTextProtoOrDie + - ParseTestProto + - ParsePartialTestProto + CanonicalDelimiter: '' + BasedOnStyle: google +ReflowComments: false +SortIncludes: Never +SortJavaStaticImport: Before +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: true +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceAroundPointerQualifiers: Default +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 4 +SpacesInAngles: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: false +SpacesInCStyleCastParentheses: false +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpaceBeforeSquareBrackets: false +BitFieldColonSpacing: Both +Standard: Auto +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 4 +UseCRLF: false +UseTab: Never +SeparateDefinitionBlocks: Always +WhitespaceSensitiveMacros: + - STRINGIZE + - PP_STRINGIZE + - BOOST_PP_STRINGIZE + - NS_SWIFT_NAME + - CF_SWIFT_NAME +TypenameMacros: + - CONFIG_ITEM + - PCONFIG_ITEM diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f14b74d --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +################################################################################ +# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。 +################################################################################ + +/.vs diff --git a/NetTunnelApp/App.xaml b/NetTunnelApp/App.xaml new file mode 100644 index 0000000..65800f4 --- /dev/null +++ b/NetTunnelApp/App.xaml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/NetTunnelApp/App.xaml.cs b/NetTunnelApp/App.xaml.cs new file mode 100644 index 0000000..1859602 --- /dev/null +++ b/NetTunnelApp/App.xaml.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Threading.Tasks; +using System.Windows; + +namespace NetTunnelApp +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} \ No newline at end of file diff --git a/NetTunnelApp/AssemblyInfo.cs b/NetTunnelApp/AssemblyInfo.cs new file mode 100644 index 0000000..4a05c7d --- /dev/null +++ b/NetTunnelApp/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] \ No newline at end of file diff --git a/NetTunnelApp/MainWindow.xaml b/NetTunnelApp/MainWindow.xaml new file mode 100644 index 0000000..0461ad9 --- /dev/null +++ b/NetTunnelApp/MainWindow.xaml @@ -0,0 +1,13 @@ + + +