├── is-graal-build ├── core ├── build.gradle └── src │ └── main │ ├── java │ └── io │ │ └── vproxy │ │ └── msquic │ │ ├── wrap │ │ ├── OnSendComplete.java │ │ ├── SendContext.java │ │ ├── ApiExtraTables.java │ │ ├── ApiTables.java │ │ ├── ApiTable.java │ │ ├── Configuration.java │ │ └── Registration.java │ │ ├── callback │ │ ├── ListenerCallback.java │ │ └── StreamCallback.java │ │ └── MsQuicUpcallImpl.java │ ├── c-generated │ ├── io_vproxy_msquic_QuicAddr.extra.c │ ├── io_vproxy_msquic_QuicCertificate.h │ ├── jni.h │ ├── io_vproxy_msquic_QuicBuffer.h │ ├── io_vproxy_msquic_QuicSettings.h │ ├── io_vproxy_msquic_QuicCertificateFile.h │ ├── io_vproxy_msquic_QuicExecutionConfig.h │ ├── io_vproxy_msquic_CXPLAT_THREAD_CONFIG.h │ ├── io_vproxy_msquic_QuicListenerEventUnion.h │ ├── io_vproxy_msquic_QuicTLSSecret.h │ ├── io_vproxy_msquic_QuicStreamEvent.h │ ├── io_vproxy_msquic_QuicRegistrationConfig.h │ ├── io_vproxy_msquic_QuicListenerEvent.h │ ├── io_vproxy_msquic_MsQuicMod.impl.h │ ├── io_vproxy_msquic_QuicConnectionEvent.h │ ├── io_vproxy_msquic_QuicCredentialConfig.h │ ├── io_vproxy_msquic_QuicNewConnectionInfo.h │ ├── io_vproxy_msquic_MsQuicModUpcall.h │ ├── io_vproxy_msquic_MsQuic.impl.h │ ├── io_vproxy_msquic_QuicExtraApiTable.impl.h │ ├── io_vproxy_msquic_QuicConfiguration.impl.h │ ├── io_vproxy_msquic_MsQuicMod.h │ ├── io_vproxy_msquic_MsQuic.h │ ├── io_vproxy_msquic_QuicAddr.impl.h │ ├── io_vproxy_msquic_MsQuicModUpcall.c │ ├── io_vproxy_msquic_MsQuicValues.impl.h │ ├── io_vproxy_msquic_QuicConnectionEventResumed.h │ ├── io_vproxy_msquic_QuicRegistrationConfigEx.h │ ├── io_vproxy_msquic_QuicStreamEventSendComplete.h │ ├── io_vproxy_msquic_QuicStreamEventPeerSendAborted.h │ ├── io_vproxy_msquic_QuicListenerEventStopComplete.h │ ├── io_vproxy_msquic_QuicStreamEventPeerReceiveAborted.h │ ├── io_vproxy_msquic_QuicListener.impl.h │ ├── io_vproxy_msquic_QuicConnectionEventConnected.h │ ├── io_vproxy_msquic_QuicStreamEventIdealSendBufferSize.h │ ├── io_vproxy_msquic_QuicStreamEventStartComplete.h │ ├── io_vproxy_msquic_QuicStreamEventSendShutdownComplete.h │ ├── io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams.h │ ├── io_vproxy_msquic_QuicStreamEventReceive.h │ ├── io_vproxy_msquic_QuicStreamEventUnion.h │ ├── io_vproxy_msquic_QuicConnectionEventPeerStreamStarted.h │ ├── io_vproxy_msquic_QuicListenerEventNewConnection.h │ ├── io_vproxy_msquic_QuicConnectionEventStreamsAvailable.h │ ├── io_vproxy_msquic_QuicTLSSecretIsSet.h │ ├── io_vproxy_msquic_QuicConnectionEventDatagramReceived.h │ ├── io_vproxy_msquic_QuicConnectionEventPeerAddressChanged.h │ ├── io_vproxy_msquic_MsQuicUpcall.h │ ├── io_vproxy_msquic_QuicConnectionEventLocalAddressChanged.h │ ├── io_vproxy_msquic_QuicConnectionEventDatagramStateChanged.h │ ├── io_vproxy_msquic_MsQuicValues.h │ ├── io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated.h │ ├── io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer.h │ ├── io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged.h │ ├── io_vproxy_msquic_QuicExtraApiTable.h │ ├── io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged.h │ ├── io_vproxy_msquic_QuicConfiguration.h │ ├── io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived.h │ ├── pni.c │ ├── io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport.h │ ├── io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived.h │ ├── io_vproxy_msquic_QuicStreamEventShutdownComplete.h │ ├── io_vproxy_msquic_QuicAddr.h │ ├── io_vproxy_msquic_QuicListener.h │ ├── io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete.h │ ├── io_vproxy_msquic_QuicObjectBase.h │ ├── io_vproxy_msquic_QuicApiTable.h │ ├── io_vproxy_msquic_QuicObjectBase.impl.h │ ├── io_vproxy_msquic_QuicStream.h │ ├── io_vproxy_msquic_QuicApiTable.impl.h │ └── io_vproxy_msquic_QuicConnectionEventUnion.h │ ├── c-generated-graal │ ├── io_vproxy_msquic_QuicAddr.extra.c │ ├── io_vproxy_msquic_QuicCertificate.h │ ├── jni.h │ ├── io_vproxy_msquic_QuicBuffer.h │ ├── io_vproxy_msquic_QuicSettings.h │ ├── io_vproxy_msquic_CXPLAT_THREAD_CONFIG.h │ ├── io_vproxy_msquic_QuicCertificateFile.h │ ├── io_vproxy_msquic_QuicExecutionConfig.h │ ├── io_vproxy_msquic_QuicListenerEventUnion.h │ ├── io_vproxy_msquic_QuicTLSSecret.h │ ├── io_vproxy_msquic_QuicStreamEvent.h │ ├── io_vproxy_msquic_QuicRegistrationConfig.h │ ├── io_vproxy_msquic_MsQuicMod.impl.h │ ├── io_vproxy_msquic_QuicListenerEvent.h │ ├── io_vproxy_msquic_QuicConnectionEvent.h │ ├── io_vproxy_msquic_QuicCredentialConfig.h │ ├── io_vproxy_msquic_QuicNewConnectionInfo.h │ ├── io_vproxy_msquic_MsQuic.impl.h │ ├── io_vproxy_msquic_MsQuicModUpcall.h │ ├── io_vproxy_msquic_QuicExtraApiTable.impl.h │ ├── io_vproxy_msquic_QuicConfiguration.impl.h │ ├── io_vproxy_msquic_MsQuicMod.h │ ├── io_vproxy_msquic_MsQuic.h │ ├── io_vproxy_msquic_QuicAddr.impl.h │ ├── io_vproxy_msquic_MsQuicValues.impl.h │ ├── io_vproxy_msquic_MsQuicModUpcall.c │ ├── io_vproxy_msquic_QuicRegistrationConfigEx.h │ ├── io_vproxy_msquic_QuicStreamEventSendComplete.h │ ├── io_vproxy_msquic_QuicConnectionEventResumed.h │ ├── io_vproxy_msquic_QuicStreamEventPeerSendAborted.h │ ├── io_vproxy_msquic_QuicListenerEventStopComplete.h │ ├── io_vproxy_msquic_QuicStreamEventPeerReceiveAborted.h │ ├── io_vproxy_msquic_QuicListener.impl.h │ ├── io_vproxy_msquic_QuicConnectionEventConnected.h │ ├── io_vproxy_msquic_QuicStreamEventIdealSendBufferSize.h │ ├── io_vproxy_msquic_QuicStreamEventStartComplete.h │ ├── io_vproxy_msquic_QuicStreamEventSendShutdownComplete.h │ ├── io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams.h │ ├── io_vproxy_msquic_QuicStreamEventReceive.h │ ├── io_vproxy_msquic_QuicStreamEventUnion.h │ ├── io_vproxy_msquic_QuicConnectionEventPeerStreamStarted.h │ ├── io_vproxy_msquic_QuicListenerEventNewConnection.h │ ├── io_vproxy_msquic_QuicConnectionEventStreamsAvailable.h │ ├── io_vproxy_msquic_QuicTLSSecretIsSet.h │ ├── io_vproxy_msquic_QuicConnectionEventDatagramReceived.h │ ├── io_vproxy_msquic_QuicConnectionEventPeerAddressChanged.h │ ├── io_vproxy_msquic_MsQuicUpcall.h │ ├── io_vproxy_msquic_QuicConnectionEventDatagramStateChanged.h │ ├── io_vproxy_msquic_QuicConnectionEventLocalAddressChanged.h │ ├── io_vproxy_msquic_MsQuicValues.h │ ├── io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated.h │ ├── io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer.h │ ├── io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged.h │ ├── io_vproxy_msquic_QuicExtraApiTable.h │ ├── io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged.h │ ├── io_vproxy_msquic_QuicConfiguration.h │ ├── io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived.h │ ├── pni.c │ ├── io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport.h │ ├── io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived.h │ ├── io_vproxy_msquic_QuicStreamEventShutdownComplete.h │ ├── io_vproxy_msquic_QuicAddr.h │ ├── io_vproxy_msquic_QuicListener.h │ ├── io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete.h │ ├── io_vproxy_msquic_QuicObjectBase.h │ ├── io_vproxy_msquic_QuicApiTable.h │ ├── io_vproxy_msquic_QuicObjectBase.impl.h │ ├── io_vproxy_msquic_QuicStream.h │ ├── io_vproxy_msquic_QuicApiTable.impl.h │ └── io_vproxy_msquic_QuicConnectionEventUnion.h │ ├── module-info │ └── module-info.java │ ├── c │ ├── gen-strerror.py │ ├── inline.c │ └── make-quic.sh │ └── generated │ └── io │ └── vproxy │ └── msquic │ └── MsQuicMod.java ├── sample ├── build.gradle └── src │ └── main │ └── java │ └── io │ └── vproxy │ └── msquic │ └── sample │ ├── SampleLogConnectionCallback.java │ ├── Main.java │ ├── MsQuicModUpcallImpl.java │ └── SampleConnectionCallback.java ├── template ├── build.gradle └── src │ └── main │ └── java │ └── io │ └── vproxy │ └── msquic │ ├── PNIQuicBuffer.java │ ├── PNIMsQuicUpcall.java │ ├── PNIMsQuic.java │ ├── PNIQuicTLSSecret.java │ ├── PNIQuicAddr.java │ ├── PNIMsQuicValues.java │ ├── PNIQuicConfiguration.java │ └── PNIQuicObjectBase.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── settings.gradle ├── gradle.properties ├── Makefile ├── .gitignore ├── LICENSE └── README.md /is-graal-build: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /core/build.gradle: -------------------------------------------------------------------------------- 1 | compileJava { 2 | } 3 | -------------------------------------------------------------------------------- /sample/build.gradle: -------------------------------------------------------------------------------- 1 | compileJava { 2 | } 3 | -------------------------------------------------------------------------------- /template/build.gradle: -------------------------------------------------------------------------------- 1 | compileJava { 2 | } 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wkgcass/msquic-java/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'msquic-java' 2 | include 'template' 3 | include 'core' 4 | include 'sample' 5 | 6 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=--add-opens java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED -javaagent:../../modify-gradle-compiler-args-agent.jar 2 | -------------------------------------------------------------------------------- /core/src/main/java/io/vproxy/msquic/wrap/OnSendComplete.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.wrap; 2 | 3 | @FunctionalInterface 4 | public interface OnSendComplete { 5 | void onSendComplete(SendContext ctx, boolean succeeded); 6 | } 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 28 03:14:56 CST 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .DEFAULT_GOAL := build 2 | 3 | .PHONY: clean 4 | clean: 5 | cd core/src/main/c && rm -rf *.so 6 | cd core/src/main/c && rm -rf *.dylib 7 | cd core/src/main/c && rm -rf *.dll 8 | 9 | .PHONY: build 10 | build: build-native 11 | 12 | .PHONY: build-native 13 | build-native: 14 | cd core/src/main/c && ./make-quic.sh 15 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicAddr.extra.c: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicAddr.h" 2 | 3 | JNIEXPORT size_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr___getLayoutByteSize() { 4 | return sizeof(QUIC_ADDR); 5 | } 6 | // metadata.generator-version: pni 21.0.0.11 7 | // sha256:21dc2a6ff150d2da37b014a25761b8836133e529f2d02e5ecf614a65d3b5dfc2 8 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicAddr.extra.c: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicAddr.h" 2 | 3 | JNIEXPORT size_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr___getLayoutByteSize() { 4 | return sizeof(QUIC_ADDR); 5 | } 6 | // metadata.generator-version: pni 21.0.0.16 7 | // sha256:21dc2a6ff150d2da37b014a25761b8836133e529f2d02e5ecf614a65d3b5dfc2 8 | -------------------------------------------------------------------------------- /core/src/main/module-info/module-info.java: -------------------------------------------------------------------------------- 1 | module io.vproxy.msquic { 2 | requires io.vproxy.pni; 3 | requires io.vproxy.pni.graal; 4 | requires io.vproxy.base; 5 | requires org.graalvm.word; 6 | requires org.graalvm.nativeimage; 7 | 8 | exports io.vproxy.msquic; 9 | exports io.vproxy.msquic.wrap; 10 | exports io.vproxy.msquic.callback; 11 | } 12 | -------------------------------------------------------------------------------- /template/src/main/java/io/vproxy/msquic/PNIQuicBuffer.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic; 2 | 3 | import io.vproxy.pni.annotation.*; 4 | 5 | import java.lang.foreign.MemorySegment; 6 | 7 | @Struct(skip = true) 8 | @AlwaysAligned 9 | @Include("msquic.h") 10 | @Name("QUIC_BUFFER") 11 | public abstract class PNIQuicBuffer { 12 | @Unsigned int Length; 13 | MemorySegment Buffer; 14 | } 15 | -------------------------------------------------------------------------------- /sample/src/main/java/io/vproxy/msquic/sample/SampleLogConnectionCallback.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.sample; 2 | 3 | import io.vproxy.msquic.callback.LogConnectionCallback; 4 | 5 | import java.nio.file.Path; 6 | 7 | public class SampleLogConnectionCallback extends LogConnectionCallback { 8 | private final CommandLine cli; 9 | 10 | public SampleLogConnectionCallback(CommandLine cli) { 11 | super(true); 12 | this.cli = cli; 13 | } 14 | 15 | @Override 16 | protected Path getSSLKeyLogFilePath() { 17 | return cli.quicTlsSecretLogFilePath; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /template/src/main/java/io/vproxy/msquic/PNIMsQuicUpcall.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic; 2 | 3 | import io.vproxy.pni.annotation.Include; 4 | import io.vproxy.pni.annotation.Upcall; 5 | 6 | import java.lang.foreign.MemorySegment; 7 | 8 | @Upcall 9 | @Include("msquic.h") 10 | public interface PNIMsQuicUpcall { 11 | int listenerCallback(MemorySegment Listener, MemorySegment Context, PNIQuicListenerEvent Event); 12 | 13 | int connectionCallback(MemorySegment Connection, MemorySegment Context, PNIQuicConnectionEvent Event); 14 | 15 | int streamCallback(MemorySegment Stream, MemorySegment Context, PNIQuicStreamEvent Event); 16 | } 17 | -------------------------------------------------------------------------------- /core/src/main/java/io/vproxy/msquic/wrap/SendContext.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.wrap; 2 | 3 | import io.vproxy.pni.Allocator; 4 | 5 | public class SendContext { 6 | public final Allocator allocator; 7 | public final OnSendComplete onSendComplete; 8 | 9 | public SendContext( 10 | Allocator allocator, 11 | OnSendComplete onSendComplete 12 | ) { 13 | this.allocator = allocator; 14 | this.onSendComplete = onSendComplete; 15 | } 16 | 17 | private static final SendContext EMPTY_INSTANCE = new SendContext( 18 | Allocator.ofDummy(), (ctx, ok) -> { 19 | } 20 | ); 21 | 22 | public static SendContext empty() { 23 | return EMPTY_INSTANCE; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicCertificate.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicCertificate */ 3 | #ifndef _Included_io_vproxy_msquic_QuicCertificate 4 | #define _Included_io_vproxy_msquic_QuicCertificate 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicCertificateFile.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | #endif // _Included_io_vproxy_msquic_QuicCertificate 26 | // metadata.generator-version: pni 21.0.0.8 27 | // sha256:05c3d5c754191d27f1b5b3f17aa52264f301e0f12ae06a654b4758a267753fad 28 | -------------------------------------------------------------------------------- /core/src/main/c-generated/jni.h: -------------------------------------------------------------------------------- 1 | #ifndef PNI_JNIMOCK_H 2 | #define PNI_JNIMOCK_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef WIN32 8 | #define JNIEXPORT __declspec(dllexport) 9 | #else 10 | #define JNIEXPORT __attribute__((visibility("default"))) 11 | #endif 12 | 13 | #ifdef WIN32 14 | #define JNICALL __stdcall 15 | #else 16 | #define JNICALL 17 | #endif 18 | 19 | #include 20 | 21 | typedef int8_t jbyte; 22 | typedef uint16_t jchar; 23 | typedef double jdouble; 24 | typedef float jfloat; 25 | typedef int32_t jint; 26 | typedef int64_t jlong; 27 | typedef int16_t jshort; 28 | typedef uint8_t jboolean; 29 | 30 | #define JNI_FALSE (0) 31 | #define JNI_TRUE (1) 32 | 33 | #define JNI_OK (0) 34 | #define JNI_ERR (-1) 35 | 36 | #endif // PNI_JNIMOCK_H 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | !**/src/main/**/build/ 5 | !**/src/test/**/build/ 6 | 7 | ### IntelliJ IDEA ### 8 | .idea/ 9 | *.iws 10 | *.iml 11 | *.ipr 12 | out/ 13 | !**/src/main/**/out/ 14 | !**/src/test/**/out/ 15 | 16 | ### Eclipse ### 17 | .apt_generated 18 | .classpath 19 | .factorypath 20 | .project 21 | .settings 22 | .springBeans 23 | .sts4-cache 24 | bin/ 25 | !**/src/main/**/bin/ 26 | !**/src/test/**/bin/ 27 | 28 | ### NetBeans ### 29 | /nbproject/private/ 30 | /nbbuild/ 31 | /dist/ 32 | /nbdist/ 33 | /.nb-gradle/ 34 | 35 | ### VS Code ### 36 | .vscode/ 37 | 38 | ### Mac OS ### 39 | .DS_Store 40 | 41 | !misc/pni.jar 42 | 43 | *.so 44 | *.dylib 45 | *.dll 46 | 47 | my-server.sh 48 | my-server-mingw.sh 49 | my-client.sh 50 | 51 | sample/sample.run 52 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicCertificate.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicCertificate */ 3 | #ifndef _Included_io_vproxy_msquic_QuicCertificate 4 | #define _Included_io_vproxy_msquic_QuicCertificate 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicCertificateFile.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | #endif // _Included_io_vproxy_msquic_QuicCertificate 26 | // metadata.generator-version: pni 21.0.0.16 27 | // sha256:05c3d5c754191d27f1b5b3f17aa52264f301e0f12ae06a654b4758a267753fad 28 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/jni.h: -------------------------------------------------------------------------------- 1 | #ifndef PNI_JNIMOCK_H 2 | #define PNI_JNIMOCK_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef WIN32 8 | #define JNIEXPORT __declspec(dllexport) 9 | #else 10 | #define JNIEXPORT __attribute__((visibility("default"))) 11 | #endif 12 | 13 | #ifdef WIN32 14 | #define JNICALL __stdcall 15 | #else 16 | #define JNICALL 17 | #endif 18 | 19 | #include 20 | 21 | typedef int8_t jbyte; 22 | typedef uint16_t jchar; 23 | typedef double jdouble; 24 | typedef float jfloat; 25 | typedef int32_t jint; 26 | typedef int64_t jlong; 27 | typedef int16_t jshort; 28 | typedef uint8_t jboolean; 29 | 30 | #define JNI_FALSE (0) 31 | #define JNI_TRUE (1) 32 | 33 | #define JNI_OK (0) 34 | #define JNI_ERR (-1) 35 | 36 | #endif // PNI_JNIMOCK_H 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicBuffer.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicBuffer */ 3 | #ifndef _Included_io_vproxy_msquic_QuicBuffer 4 | #define _Included_io_vproxy_msquic_QuicBuffer 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(QUIC_BUFFER, QUIC_BUFFER *) 22 | PNIBufExpand(QUIC_BUFFER, QUIC_BUFFER, 16) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_QuicBuffer 28 | // metadata.generator-version: pni 21.0.0.12 29 | // sha256:d671b66f1d0b3e09f7c0b9f39d42c9305d1d5db5c25791ee006b775cca4da76e 30 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicBuffer.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicBuffer */ 3 | #ifndef _Included_io_vproxy_msquic_QuicBuffer 4 | #define _Included_io_vproxy_msquic_QuicBuffer 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(QUIC_BUFFER, QUIC_BUFFER *) 22 | PNIBufExpand(QUIC_BUFFER, QUIC_BUFFER, 16) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_QuicBuffer 28 | // metadata.generator-version: pni 21.0.0.16 29 | // sha256:d671b66f1d0b3e09f7c0b9f39d42c9305d1d5db5c25791ee006b775cca4da76e 30 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicSettings.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicSettings */ 3 | #ifndef _Included_io_vproxy_msquic_QuicSettings 4 | #define _Included_io_vproxy_msquic_QuicSettings 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicSettingsIsSet.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_SETTINGS, QUIC_SETTINGS *) 23 | PNIBufExpand(QUIC_SETTINGS, QUIC_SETTINGS, 128) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicSettings 29 | // metadata.generator-version: pni 21.0.0.12 30 | // sha256:0ec0c1f6d1893ff65e5668d3e891872f5dc2b0e59a4276c0c7b4344280275762 31 | -------------------------------------------------------------------------------- /core/src/main/java/io/vproxy/msquic/wrap/ApiExtraTables.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.wrap; 2 | 3 | import io.vproxy.msquic.MsQuicConsts; 4 | import io.vproxy.msquic.MsQuicMod; 5 | import io.vproxy.msquic.QuicExtraApiTable; 6 | import io.vproxy.pni.Allocator; 7 | import io.vproxy.pni.array.IntArray; 8 | 9 | public class ApiExtraTables { 10 | private ApiExtraTables() { 11 | } 12 | 13 | public static final QuicExtraApiTable V2EXTRA; 14 | 15 | static { 16 | try (var tmpAlloc = Allocator.ofConfined()) { 17 | var ret = new IntArray(tmpAlloc, 1); 18 | var v2extra = MsQuicMod.get().openExtra(MsQuicConsts.QUIC_API_VERSION_2, ret); 19 | if (v2extra == null) { 20 | throw new RuntimeException("failed to init V2extra: " + ret.get(0)); 21 | } 22 | V2EXTRA = v2extra; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicSettings.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicSettings */ 3 | #ifndef _Included_io_vproxy_msquic_QuicSettings 4 | #define _Included_io_vproxy_msquic_QuicSettings 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicSettingsIsSet.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_SETTINGS, QUIC_SETTINGS *) 23 | PNIBufExpand(QUIC_SETTINGS, QUIC_SETTINGS, 128) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicSettings 29 | // metadata.generator-version: pni 21.0.0.16 30 | // sha256:0ec0c1f6d1893ff65e5668d3e891872f5dc2b0e59a4276c0c7b4344280275762 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicCertificateFile.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicCertificateFile */ 3 | #ifndef _Included_io_vproxy_msquic_QuicCertificateFile 4 | #define _Included_io_vproxy_msquic_QuicCertificateFile 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(QUIC_CERTIFICATE_FILE, QUIC_CERTIFICATE_FILE *) 22 | PNIBufExpand(QUIC_CERTIFICATE_FILE, QUIC_CERTIFICATE_FILE, 16) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_QuicCertificateFile 28 | // metadata.generator-version: pni 21.0.0.12 29 | // sha256:998d4920d1a9dca147693174416ea167a3ad73b82eafed66b08d78b11254bff8 30 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicExecutionConfig.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicExecutionConfig */ 3 | #ifndef _Included_io_vproxy_msquic_QuicExecutionConfig 4 | #define _Included_io_vproxy_msquic_QuicExecutionConfig 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(QUIC_EXECUTION_CONFIG, QUIC_EXECUTION_CONFIG *) 22 | PNIBufExpand(QUIC_EXECUTION_CONFIG, QUIC_EXECUTION_CONFIG, 16) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_QuicExecutionConfig 28 | // metadata.generator-version: pni 21.0.0.17 29 | // sha256:97ce0946cbb61e4b361dee8da3167abec310bf782c2c82d4d488a9383902af94 30 | -------------------------------------------------------------------------------- /core/src/main/c/gen-strerror.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | 5 | INC = os.environ.get("MSQUIC_INC") 6 | 7 | f = open(os.path.join(INC, 'msquic_posix.h')) 8 | content = f.read() 9 | f.close() 10 | 11 | lines = content.split('\n') 12 | keys = [] 13 | for line in lines: 14 | line = line.strip() 15 | if not line.startswith("#define") or "QUIC_STATUS_" not in line: 16 | continue 17 | sp = line.split(' ') 18 | if len(sp) < 2: 19 | continue 20 | k = sp[1] 21 | if "(" in k: 22 | continue 23 | keys.append(k) 24 | 25 | print ("JNIEXPORT char * JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QuicStatusString(int32_t status) {") 26 | print (" switch (status) {") 27 | for k in keys: 28 | print (" case " + k + ": return \"" + k + "\";") 29 | print (" default: return \"UNKNOWN\";") 30 | print (" }") 31 | print ("}") 32 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_CXPLAT_THREAD_CONFIG.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_CXPLAT_THREAD_CONFIG */ 3 | #ifndef _Included_io_vproxy_msquic_CXPLAT_THREAD_CONFIG 4 | #define _Included_io_vproxy_msquic_CXPLAT_THREAD_CONFIG 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(CXPLAT_THREAD_CONFIG, CXPLAT_THREAD_CONFIG *) 22 | PNIBufExpand(CXPLAT_THREAD_CONFIG, CXPLAT_THREAD_CONFIG, 32) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_CXPLAT_THREAD_CONFIG 28 | // metadata.generator-version: pni 21.0.0.16 29 | // sha256:328978cb80cf1041e3fad8948a256c53d1d99a6232e0b809495c82028d5fbbed 30 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicListenerEventUnion.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicListenerEventUnion */ 3 | #ifndef _Included_io_vproxy_msquic_QuicListenerEventUnion 4 | #define _Included_io_vproxy_msquic_QuicListenerEventUnion 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicListenerEventNewConnection.h" 17 | #include "io_vproxy_msquic_QuicListenerEventStopComplete.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif // _Included_io_vproxy_msquic_QuicListenerEventUnion 27 | // metadata.generator-version: pni 21.0.0.8 28 | // sha256:1fc207526208ba3130ed1f76e2125d982ebda35e249984a97624369c28637a98 29 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicTLSSecret.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicTLSSecret */ 3 | #ifndef _Included_io_vproxy_msquic_QuicTLSSecret 4 | #define _Included_io_vproxy_msquic_QuicTLSSecret 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicTLSSecretIsSet.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_TLS_SECRETS, QUIC_TLS_SECRETS *) 23 | PNIBufExpand(QUIC_TLS_SECRETS, QUIC_TLS_SECRETS, 354) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicTLSSecret 29 | // metadata.generator-version: pni 21.0.0.12 30 | // sha256:1d1a4df7b9f974cea7be1c856bfd37247a72636c38a86759ac0b77e1e94048e7 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_CXPLAT_THREAD_CONFIG.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_CXPLAT_THREAD_CONFIG */ 3 | #ifndef _Included_io_vproxy_msquic_CXPLAT_THREAD_CONFIG 4 | #define _Included_io_vproxy_msquic_CXPLAT_THREAD_CONFIG 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(CXPLAT_THREAD_CONFIG, CXPLAT_THREAD_CONFIG *) 22 | PNIBufExpand(CXPLAT_THREAD_CONFIG, CXPLAT_THREAD_CONFIG, 32) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_CXPLAT_THREAD_CONFIG 28 | // metadata.generator-version: pni 21.0.0.16 29 | // sha256:328978cb80cf1041e3fad8948a256c53d1d99a6232e0b809495c82028d5fbbed 30 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicCertificateFile.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicCertificateFile */ 3 | #ifndef _Included_io_vproxy_msquic_QuicCertificateFile 4 | #define _Included_io_vproxy_msquic_QuicCertificateFile 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(QUIC_CERTIFICATE_FILE, QUIC_CERTIFICATE_FILE *) 22 | PNIBufExpand(QUIC_CERTIFICATE_FILE, QUIC_CERTIFICATE_FILE, 16) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_QuicCertificateFile 28 | // metadata.generator-version: pni 21.0.0.16 29 | // sha256:998d4920d1a9dca147693174416ea167a3ad73b82eafed66b08d78b11254bff8 30 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicExecutionConfig.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicExecutionConfig */ 3 | #ifndef _Included_io_vproxy_msquic_QuicExecutionConfig 4 | #define _Included_io_vproxy_msquic_QuicExecutionConfig 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(QUIC_EXECUTION_CONFIG, QUIC_EXECUTION_CONFIG *) 22 | PNIBufExpand(QUIC_EXECUTION_CONFIG, QUIC_EXECUTION_CONFIG, 16) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_QuicExecutionConfig 28 | // metadata.generator-version: pni 21.0.0.17 29 | // sha256:97ce0946cbb61e4b361dee8da3167abec310bf782c2c82d4d488a9383902af94 30 | -------------------------------------------------------------------------------- /core/src/main/java/io/vproxy/msquic/wrap/ApiTables.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.wrap; 2 | 3 | import io.vproxy.msquic.MsQuic; 4 | import io.vproxy.msquic.MsQuicConsts; 5 | import io.vproxy.pni.Allocator; 6 | import io.vproxy.pni.array.IntArray; 7 | 8 | public class ApiTables { 9 | private static final Allocator allocator = Allocator.ofUnsafe(); 10 | 11 | private ApiTables() { 12 | } 13 | 14 | public static final ApiTable V2; 15 | 16 | static { 17 | try (var tmpAlloc = Allocator.ofConfined()) { 18 | var ret = new IntArray(tmpAlloc, 1); 19 | var v2 = MsQuic.get().open(MsQuicConsts.QUIC_API_VERSION_2, ret, allocator); 20 | if (v2 == null) { 21 | throw new RuntimeException("failed to init V2 api: " + ret.get(0)); 22 | } 23 | V2 = new ApiTable(new ApiTable.Options(v2, null)); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicListenerEventUnion.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicListenerEventUnion */ 3 | #ifndef _Included_io_vproxy_msquic_QuicListenerEventUnion 4 | #define _Included_io_vproxy_msquic_QuicListenerEventUnion 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicListenerEventNewConnection.h" 17 | #include "io_vproxy_msquic_QuicListenerEventStopComplete.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif // _Included_io_vproxy_msquic_QuicListenerEventUnion 27 | // metadata.generator-version: pni 21.0.0.16 28 | // sha256:1fc207526208ba3130ed1f76e2125d982ebda35e249984a97624369c28637a98 29 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicTLSSecret.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicTLSSecret */ 3 | #ifndef _Included_io_vproxy_msquic_QuicTLSSecret 4 | #define _Included_io_vproxy_msquic_QuicTLSSecret 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicTLSSecretIsSet.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_TLS_SECRETS, QUIC_TLS_SECRETS *) 23 | PNIBufExpand(QUIC_TLS_SECRETS, QUIC_TLS_SECRETS, 354) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicTLSSecret 29 | // metadata.generator-version: pni 21.0.0.16 30 | // sha256:1d1a4df7b9f974cea7be1c856bfd37247a72636c38a86759ac0b77e1e94048e7 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicStreamEvent.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEvent */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEvent 4 | #define _Included_io_vproxy_msquic_QuicStreamEvent 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicStreamEventUnion.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_STREAM_EVENT, QUIC_STREAM_EVENT *) 23 | PNIBufExpand(QUIC_STREAM_EVENT, QUIC_STREAM_EVENT, 40) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicStreamEvent 29 | // metadata.generator-version: pni 21.0.0.12 30 | // sha256:078d15ef419e1faaa8ad06c40739e62a54552b696232573c34af2e1da79349ef 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicStreamEvent.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEvent */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEvent 4 | #define _Included_io_vproxy_msquic_QuicStreamEvent 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicStreamEventUnion.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_STREAM_EVENT, QUIC_STREAM_EVENT *) 23 | PNIBufExpand(QUIC_STREAM_EVENT, QUIC_STREAM_EVENT, 40) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicStreamEvent 29 | // metadata.generator-version: pni 21.0.0.16 30 | // sha256:078d15ef419e1faaa8ad06c40739e62a54552b696232573c34af2e1da79349ef 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicRegistrationConfig.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicRegistrationConfig */ 3 | #ifndef _Included_io_vproxy_msquic_QuicRegistrationConfig 4 | #define _Included_io_vproxy_msquic_QuicRegistrationConfig 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(QUIC_REGISTRATION_CONFIG, QUIC_REGISTRATION_CONFIG *) 22 | PNIBufExpand(QUIC_REGISTRATION_CONFIG, QUIC_REGISTRATION_CONFIG, 16) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_QuicRegistrationConfig 28 | // metadata.generator-version: pni 21.0.0.12 29 | // sha256:4e3f5d3aae49a8f3ffdc7599e653e67e16d89f0f9a01aaea07ed638346ee60e3 30 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicRegistrationConfig.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicRegistrationConfig */ 3 | #ifndef _Included_io_vproxy_msquic_QuicRegistrationConfig 4 | #define _Included_io_vproxy_msquic_QuicRegistrationConfig 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(QUIC_REGISTRATION_CONFIG, QUIC_REGISTRATION_CONFIG *) 22 | PNIBufExpand(QUIC_REGISTRATION_CONFIG, QUIC_REGISTRATION_CONFIG, 16) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_QuicRegistrationConfig 28 | // metadata.generator-version: pni 21.0.0.16 29 | // sha256:4e3f5d3aae49a8f3ffdc7599e653e67e16d89f0f9a01aaea07ed638346ee60e3 30 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicListenerEvent.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicListenerEvent */ 3 | #ifndef _Included_io_vproxy_msquic_QuicListenerEvent 4 | #define _Included_io_vproxy_msquic_QuicListenerEvent 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicListenerEventUnion.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_LISTENER_EVENT, QUIC_LISTENER_EVENT *) 23 | PNIBufExpand(QUIC_LISTENER_EVENT, QUIC_LISTENER_EVENT, 24) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicListenerEvent 29 | // metadata.generator-version: pni 21.0.0.12 30 | // sha256:4f60c5c9b1a88368af12610ce938aa5ea477251bf8d0b493b711e6828ca7468c 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_MsQuicMod.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_MsQuicMod.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT QUIC_EXTRA_API_TABLE * JNICALL JavaCritical_io_vproxy_msquic_MsQuicMod_openExtra(uint32_t Version, int32_t * returnStatus) { 8 | QUIC_EXTRA_API_TABLE* api; 9 | QUIC_STATUS res = MsQuicOpenExtra(Version, (const void**) &api); 10 | if (returnStatus != NULL) 11 | *returnStatus = res; 12 | if (QUIC_SUCCEEDED(res)) { 13 | return api; 14 | } 15 | return NULL; 16 | } 17 | 18 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_MsQuicMod_INVOKE_LPTHREAD_START_ROUTINE(void * Callback, void * Context) { 19 | ((LPTHREAD_START_ROUTINE) Callback)(Context); 20 | } 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | // metadata.generator-version: pni 21.0.0.17 26 | // sha256:2c3f4da2fdf4405f3c0972dbc280e69cd99e1e2aa501370c52e22f560e9574f1 27 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_MsQuicMod.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_MsQuicMod.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT QUIC_EXTRA_API_TABLE * JNICALL JavaCritical_io_vproxy_msquic_MsQuicMod_openExtra(uint32_t Version, int32_t * returnStatus) { 8 | QUIC_EXTRA_API_TABLE* api; 9 | QUIC_STATUS res = MsQuicOpenExtra(Version, (const void**) &api); 10 | if (returnStatus != NULL) 11 | *returnStatus = res; 12 | if (QUIC_SUCCEEDED(res)) { 13 | return api; 14 | } 15 | return NULL; 16 | } 17 | 18 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_MsQuicMod_INVOKE_LPTHREAD_START_ROUTINE(void * Callback, void * Context) { 19 | ((LPTHREAD_START_ROUTINE) Callback)(Context); 20 | } 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | // metadata.generator-version: pni 21.0.0.17 26 | // sha256:2c3f4da2fdf4405f3c0972dbc280e69cd99e1e2aa501370c52e22f560e9574f1 27 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicListenerEvent.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicListenerEvent */ 3 | #ifndef _Included_io_vproxy_msquic_QuicListenerEvent 4 | #define _Included_io_vproxy_msquic_QuicListenerEvent 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicListenerEventUnion.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_LISTENER_EVENT, QUIC_LISTENER_EVENT *) 23 | PNIBufExpand(QUIC_LISTENER_EVENT, QUIC_LISTENER_EVENT, 24) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicListenerEvent 29 | // metadata.generator-version: pni 21.0.0.16 30 | // sha256:4f60c5c9b1a88368af12610ce938aa5ea477251bf8d0b493b711e6828ca7468c 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEvent.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEvent */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEvent 4 | #define _Included_io_vproxy_msquic_QuicConnectionEvent 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicConnectionEventUnion.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_CONNECTION_EVENT, QUIC_CONNECTION_EVENT *) 23 | PNIBufExpand(QUIC_CONNECTION_EVENT, QUIC_CONNECTION_EVENT, 32) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicConnectionEvent 29 | // metadata.generator-version: pni 21.0.0.12 30 | // sha256:2de6a82bf6cbd34e5ab395ba7e399cd9c239e9fafab58ce2167592e6fd80f067 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicCredentialConfig.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicCredentialConfig */ 3 | #ifndef _Included_io_vproxy_msquic_QuicCredentialConfig 4 | #define _Included_io_vproxy_msquic_QuicCredentialConfig 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicCertificate.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_CREDENTIAL_CONFIG, QUIC_CREDENTIAL_CONFIG *) 23 | PNIBufExpand(QUIC_CREDENTIAL_CONFIG, QUIC_CREDENTIAL_CONFIG, 56) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicCredentialConfig 29 | // metadata.generator-version: pni 21.0.0.12 30 | // sha256:b4c78ff7e7054fc120645204841be1bb26eb53c93b787564af8d51969e822313 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEvent.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEvent */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEvent 4 | #define _Included_io_vproxy_msquic_QuicConnectionEvent 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicConnectionEventUnion.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_CONNECTION_EVENT, QUIC_CONNECTION_EVENT *) 23 | PNIBufExpand(QUIC_CONNECTION_EVENT, QUIC_CONNECTION_EVENT, 32) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicConnectionEvent 29 | // metadata.generator-version: pni 21.0.0.16 30 | // sha256:2de6a82bf6cbd34e5ab395ba7e399cd9c239e9fafab58ce2167592e6fd80f067 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicCredentialConfig.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicCredentialConfig */ 3 | #ifndef _Included_io_vproxy_msquic_QuicCredentialConfig 4 | #define _Included_io_vproxy_msquic_QuicCredentialConfig 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicCertificate.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_CREDENTIAL_CONFIG, QUIC_CREDENTIAL_CONFIG *) 23 | PNIBufExpand(QUIC_CREDENTIAL_CONFIG, QUIC_CREDENTIAL_CONFIG, 56) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicCredentialConfig 29 | // metadata.generator-version: pni 21.0.0.16 30 | // sha256:b4c78ff7e7054fc120645204841be1bb26eb53c93b787564af8d51969e822313 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicNewConnectionInfo.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicNewConnectionInfo */ 3 | #ifndef _Included_io_vproxy_msquic_QuicNewConnectionInfo 4 | #define _Included_io_vproxy_msquic_QuicNewConnectionInfo 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicAddr.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_NEW_CONNECTION_INFO, QUIC_NEW_CONNECTION_INFO *) 23 | PNIBufExpand(QUIC_NEW_CONNECTION_INFO, QUIC_NEW_CONNECTION_INFO, 72) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicNewConnectionInfo 29 | // metadata.generator-version: pni 21.0.0.12 30 | // sha256:65d753a667cd7d1238701fe92acb2507869b27b422a30ae6b7124bfe3fbb6c82 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicNewConnectionInfo.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicNewConnectionInfo */ 3 | #ifndef _Included_io_vproxy_msquic_QuicNewConnectionInfo 4 | #define _Included_io_vproxy_msquic_QuicNewConnectionInfo 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicAddr.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | PNIEnvExpand(QUIC_NEW_CONNECTION_INFO, QUIC_NEW_CONNECTION_INFO *) 23 | PNIBufExpand(QUIC_NEW_CONNECTION_INFO, QUIC_NEW_CONNECTION_INFO, 72) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_QuicNewConnectionInfo 29 | // metadata.generator-version: pni 21.0.0.16 30 | // sha256:65d753a667cd7d1238701fe92acb2507869b27b422a30ae6b7124bfe3fbb6c82 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_MsQuicModUpcall.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_MsQuicModUpcall */ 3 | #ifndef _Included_io_vproxy_msquic_MsQuicModUpcall 4 | #define _Included_io_vproxy_msquic_MsQuicModUpcall 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_CXPLAT_THREAD_CONFIG.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicModUpcall_dispatch(CXPLAT_THREAD_CONFIG * Config, CXPLAT_EVENTQ * EventQ, void * Thread, void * Context); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_MsQuicModUpcall 28 | // metadata.generator-version: pni 21.0.0.16 29 | // sha256:62b74c2c78fae3d4c61e9b3f602d316e888e7be4253f7d5a7aa8d2f1de9c91f7 30 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_MsQuic.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_MsQuic.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT QuicApiTable * JNICALL JavaCritical_io_vproxy_msquic_MsQuic_open(uint32_t Version, int32_t * returnStatus, QuicApiTable * return_) { 8 | QUIC_API_TABLE* api; 9 | QUIC_STATUS res = MsQuicOpenVersion(Version, (const void**) &api); 10 | if (returnStatus != NULL) 11 | *returnStatus = res; 12 | if (QUIC_SUCCEEDED(res)) { 13 | return_->Api = api; 14 | return return_; 15 | } 16 | return NULL; 17 | } 18 | 19 | JNIEXPORT uint8_t JNICALL JavaCritical_io_vproxy_msquic_MsQuic_buildQuicAddr(char * addr, int32_t port, QUIC_ADDR * result) { 20 | return QuicAddrFromString(addr, port, result); 21 | } 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | // metadata.generator-version: pni 21.0.0.8 27 | // sha256:e77f8998ee63289ed9ef6fc1d71f4609ab2e6a13e458022162f19a877b1dc44f 28 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_MsQuic.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_MsQuic.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT QuicApiTable * JNICALL JavaCritical_io_vproxy_msquic_MsQuic_open(uint32_t Version, int32_t * returnStatus, QuicApiTable * return_) { 8 | QUIC_API_TABLE* api; 9 | QUIC_STATUS res = MsQuicOpenVersion(Version, (const void**) &api); 10 | if (returnStatus != NULL) 11 | *returnStatus = res; 12 | if (QUIC_SUCCEEDED(res)) { 13 | return_->Api = api; 14 | return return_; 15 | } 16 | return NULL; 17 | } 18 | 19 | JNIEXPORT uint8_t JNICALL JavaCritical_io_vproxy_msquic_MsQuic_buildQuicAddr(char * addr, int32_t port, QUIC_ADDR * result) { 20 | return QuicAddrFromString(addr, port, result); 21 | } 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | // metadata.generator-version: pni 21.0.0.16 27 | // sha256:e77f8998ee63289ed9ef6fc1d71f4609ab2e6a13e458022162f19a877b1dc44f 28 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_MsQuicModUpcall.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_MsQuicModUpcall */ 3 | #ifndef _Included_io_vproxy_msquic_MsQuicModUpcall 4 | #define _Included_io_vproxy_msquic_MsQuicModUpcall 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_CXPLAT_THREAD_CONFIG.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicModUpcall_dispatch(CXPLAT_THREAD_CONFIG * Config, CXPLAT_EVENTQ * EventQ, void * Thread, void * Context); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif // _Included_io_vproxy_msquic_MsQuicModUpcall 28 | // metadata.generator-version: pni 21.0.0.16 29 | // sha256:62b74c2c78fae3d4c61e9b3f602d316e888e7be4253f7d5a7aa8d2f1de9c91f7 30 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicExtraApiTable.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicExtraApiTable.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT QUIC_STATUS JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_EventLoopThreadDispatcherSet(QUIC_EXTRA_API_TABLE * self, QUIC_EVENT_LOOP_THREAD_DISPATCH_FN dispatcher) { 8 | return self->EventLoopThreadDispatcherSet(dispatcher); 9 | } 10 | 11 | JNIEXPORT QUIC_STATUS JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_ThreadGetCur(QUIC_EXTRA_API_TABLE * self, CXPLAT_THREAD* Thread) { 12 | return self->ThreadGetCur(Thread); 13 | } 14 | 15 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_ThreadSetIsWorker(QUIC_EXTRA_API_TABLE * self, uint8_t isWorker) { 16 | self->ThreadSetIsWorker(isWorker); 17 | } 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | // metadata.generator-version: pni 21.0.0.17 23 | // sha256:d234e804719dc69f86ee2ebd020430c0a1265deb05b967230c00489a15ad7f56 24 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicExtraApiTable.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicExtraApiTable.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT QUIC_STATUS JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_EventLoopThreadDispatcherSet(QUIC_EXTRA_API_TABLE * self, QUIC_EVENT_LOOP_THREAD_DISPATCH_FN dispatcher) { 8 | return self->EventLoopThreadDispatcherSet(dispatcher); 9 | } 10 | 11 | JNIEXPORT QUIC_STATUS JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_ThreadGetCur(QUIC_EXTRA_API_TABLE * self, CXPLAT_THREAD* Thread) { 12 | return self->ThreadGetCur(Thread); 13 | } 14 | 15 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_ThreadSetIsWorker(QUIC_EXTRA_API_TABLE * self, uint8_t isWorker) { 16 | self->ThreadSetIsWorker(isWorker); 17 | } 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | // metadata.generator-version: pni 21.0.0.17 23 | // sha256:d234e804719dc69f86ee2ebd020430c0a1265deb05b967230c00489a15ad7f56 24 | -------------------------------------------------------------------------------- /sample/src/main/java/io/vproxy/msquic/sample/Main.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.sample; 2 | 3 | import io.vproxy.pni.graal.GraalUtils; 4 | 5 | import java.util.Arrays; 6 | import java.util.Set; 7 | 8 | public class Main { 9 | public static void main(String[] args) { 10 | if (args.length == 0 || !Set.of("client", "server").contains(args[0])) { 11 | throw new RuntimeException("first arg should be \"client\" or \"server\": " + Arrays.toString(args)); 12 | } 13 | var newArgs = new String[args.length - 1]; 14 | System.arraycopy(args, 1, newArgs, 0, newArgs.length); 15 | 16 | System.loadLibrary("msquic"); 17 | System.loadLibrary("msquic-java"); 18 | GraalUtils.init(); 19 | 20 | System.out.println("java.library.path = " + System.getProperty("java.library.path")); 21 | if (args[0].equals("client")) { 22 | Client.main(newArgs); 23 | } else { 24 | Server.main(newArgs); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConfiguration.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicConfiguration.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicConfiguration_close(QuicConfiguration * self) { 8 | QUIC_API_TABLE* api = self->SUPER.Api; 9 | HQUIC conf = self->SUPER.Handle; 10 | api->ConfigurationClose(conf); 11 | } 12 | 13 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicConfiguration_loadCredential(QuicConfiguration * self, QUIC_CREDENTIAL_CONFIG * CredConfig) { 14 | QUIC_API_TABLE* api = self->SUPER.Api; 15 | HQUIC conf = self->SUPER.Handle; 16 | 17 | QUIC_STATUS res = api->ConfigurationLoadCredential(conf, CredConfig); 18 | if (QUIC_SUCCEEDED(res)) { 19 | return 0; 20 | } 21 | return res; 22 | } 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | // metadata.generator-version: pni 21.0.0.17 28 | // sha256:fd7812d7c57fa62015ebff45db86f435e95e6bccf08ac8665c015d182b2055df 29 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConfiguration.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicConfiguration.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicConfiguration_close(QuicConfiguration * self) { 8 | QUIC_API_TABLE* api = self->SUPER.Api; 9 | HQUIC conf = self->SUPER.Handle; 10 | api->ConfigurationClose(conf); 11 | } 12 | 13 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicConfiguration_loadCredential(QuicConfiguration * self, QUIC_CREDENTIAL_CONFIG * CredConfig) { 14 | QUIC_API_TABLE* api = self->SUPER.Api; 15 | HQUIC conf = self->SUPER.Handle; 16 | 17 | QUIC_STATUS res = api->ConfigurationLoadCredential(conf, CredConfig); 18 | if (QUIC_SUCCEEDED(res)) { 19 | return 0; 20 | } 21 | return res; 22 | } 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | // metadata.generator-version: pni 21.0.0.17 28 | // sha256:fd7812d7c57fa62015ebff45db86f435e95e6bccf08ac8665c015d182b2055df 29 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_MsQuicMod.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_MsQuicMod */ 3 | #ifndef _Included_io_vproxy_msquic_MsQuicMod 4 | #define _Included_io_vproxy_msquic_MsQuicMod 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicExtraApiTable.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | JNIEXPORT QUIC_EXTRA_API_TABLE * JNICALL JavaCritical_io_vproxy_msquic_MsQuicMod_openExtra(uint32_t Version, int32_t * returnStatus); 23 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_MsQuicMod_INVOKE_LPTHREAD_START_ROUTINE(void * Callback, void * Context); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_MsQuicMod 29 | // metadata.generator-version: pni 21.0.0.17 30 | // sha256:e116836c8b505ad085baca0e775e3ee3301a9fec4f9e6ee311dbd9c76cca1258 31 | -------------------------------------------------------------------------------- /core/src/main/java/io/vproxy/msquic/callback/ListenerCallback.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.callback; 2 | 3 | import io.vproxy.msquic.QuicListenerEvent; 4 | import io.vproxy.msquic.QuicListenerEventNewConnection; 5 | import io.vproxy.msquic.QuicListenerEventStopComplete; 6 | import io.vproxy.msquic.wrap.Listener; 7 | 8 | import static io.vproxy.msquic.MsQuicConsts.QUIC_STATUS_NOT_SUPPORTED; 9 | 10 | public interface ListenerCallback { 11 | default boolean remove(Listener listener) { 12 | return false; 13 | } 14 | 15 | default int newConnection(Listener listener, QuicListenerEventNewConnection data) { 16 | return QUIC_STATUS_NOT_SUPPORTED; 17 | } 18 | 19 | default int stopComplete(Listener listener, QuicListenerEventStopComplete data) { 20 | return QUIC_STATUS_NOT_SUPPORTED; 21 | } 22 | 23 | default int unknown(Listener listener, QuicListenerEvent event) { 24 | return QUIC_STATUS_NOT_SUPPORTED; 25 | } 26 | 27 | default void closed(Listener listener) { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_MsQuicMod.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_MsQuicMod */ 3 | #ifndef _Included_io_vproxy_msquic_MsQuicMod 4 | #define _Included_io_vproxy_msquic_MsQuicMod 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicExtraApiTable.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | JNIEXPORT QUIC_EXTRA_API_TABLE * JNICALL JavaCritical_io_vproxy_msquic_MsQuicMod_openExtra(uint32_t Version, int32_t * returnStatus); 23 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_MsQuicMod_INVOKE_LPTHREAD_START_ROUTINE(void * Callback, void * Context); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif // _Included_io_vproxy_msquic_MsQuicMod 29 | // metadata.generator-version: pni 21.0.0.17 30 | // sha256:e116836c8b505ad085baca0e775e3ee3301a9fec4f9e6ee311dbd9c76cca1258 31 | -------------------------------------------------------------------------------- /template/src/main/java/io/vproxy/msquic/PNIMsQuic.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic; 2 | 3 | import io.vproxy.pni.annotation.*; 4 | 5 | @Downcall 6 | @Include("msquic.h") 7 | public interface PNIMsQuic { 8 | @Impl( 9 | // language="c" 10 | c = """ 11 | QUIC_API_TABLE* api; 12 | QUIC_STATUS res = MsQuicOpenVersion(Version, (const void**) &api); 13 | if (returnStatus != NULL) 14 | *returnStatus = res; 15 | if (QUIC_SUCCEEDED(res)) { 16 | return_->Api = api; 17 | return return_; 18 | } 19 | return NULL; 20 | """ 21 | ) 22 | @Style(Styles.critical) 23 | PNIQuicApiTable open(@Unsigned int Version, @Raw int[] returnStatus); 24 | 25 | @Impl( 26 | // language="c" 27 | c = """ 28 | return QuicAddrFromString(addr, port, result); 29 | """ 30 | ) 31 | @Style(Styles.critical) 32 | boolean buildQuicAddr(String addr, int port, PNIQuicAddr result); 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_MsQuic.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_MsQuic */ 3 | #ifndef _Included_io_vproxy_msquic_MsQuic 4 | #define _Included_io_vproxy_msquic_MsQuic 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicApiTable.h" 17 | #include "io_vproxy_msquic_QuicAddr.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | JNIEXPORT QuicApiTable * JNICALL JavaCritical_io_vproxy_msquic_MsQuic_open(uint32_t Version, int32_t * returnStatus, QuicApiTable * return_); 24 | JNIEXPORT uint8_t JNICALL JavaCritical_io_vproxy_msquic_MsQuic_buildQuicAddr(char * addr, int32_t port, QUIC_ADDR * result); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | #endif // _Included_io_vproxy_msquic_MsQuic 30 | // metadata.generator-version: pni 21.0.0.8 31 | // sha256:814d69084ae8cfab8a5e36dfedae0d886a9a607513de70e767b7fa13e8a3ba88 32 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_MsQuic.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_MsQuic */ 3 | #ifndef _Included_io_vproxy_msquic_MsQuic 4 | #define _Included_io_vproxy_msquic_MsQuic 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicApiTable.h" 17 | #include "io_vproxy_msquic_QuicAddr.h" 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | JNIEXPORT QuicApiTable * JNICALL JavaCritical_io_vproxy_msquic_MsQuic_open(uint32_t Version, int32_t * returnStatus, QuicApiTable * return_); 24 | JNIEXPORT uint8_t JNICALL JavaCritical_io_vproxy_msquic_MsQuic_buildQuicAddr(char * addr, int32_t port, QUIC_ADDR * result); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | #endif // _Included_io_vproxy_msquic_MsQuic 30 | // metadata.generator-version: pni 21.0.0.16 31 | // sha256:814d69084ae8cfab8a5e36dfedae0d886a9a607513de70e767b7fa13e8a3ba88 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright 2023 wkgcass 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicAddr.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicAddr.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_getFamily(QUIC_ADDR * self) { 8 | return QuicAddrGetFamily(self); 9 | } 10 | 11 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_setFamily(QUIC_ADDR * self, int32_t family) { 12 | QuicAddrSetFamily(self, family); 13 | } 14 | 15 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_getPort(QUIC_ADDR * self) { 16 | return QuicAddrGetPort(self); 17 | } 18 | 19 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_setPort(QUIC_ADDR * self, int32_t port) { 20 | QuicAddrSetPort(self, port); 21 | } 22 | 23 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_toString(QUIC_ADDR * self, char * str) { 24 | QuicAddrToString(self, (QUIC_ADDR_STR*) str); 25 | } 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | // metadata.generator-version: pni 21.0.0.8 31 | // sha256:914650f1bb9fd4b1a0f51dcf23956fe8c4f1fe16511bcfbcf709503d102ee81a 32 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicAddr.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicAddr.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_getFamily(QUIC_ADDR * self) { 8 | return QuicAddrGetFamily(self); 9 | } 10 | 11 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_setFamily(QUIC_ADDR * self, int32_t family) { 12 | QuicAddrSetFamily(self, family); 13 | } 14 | 15 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_getPort(QUIC_ADDR * self) { 16 | return QuicAddrGetPort(self); 17 | } 18 | 19 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_setPort(QUIC_ADDR * self, int32_t port) { 20 | QuicAddrSetPort(self, port); 21 | } 22 | 23 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_toString(QUIC_ADDR * self, char * str) { 24 | QuicAddrToString(self, (QUIC_ADDR_STR*) str); 25 | } 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | // metadata.generator-version: pni 21.0.0.16 31 | // sha256:914650f1bb9fd4b1a0f51dcf23956fe8c4f1fe16511bcfbcf709503d102ee81a 32 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_MsQuicModUpcall.c: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_MsQuicModUpcall.h" 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | static int32_t (*_dispatch)(CXPLAT_THREAD_CONFIG *,CXPLAT_EVENTQ *,void *,void *); 10 | 11 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_MsQuicModUpcall_INIT( 12 | int32_t (*dispatch)(CXPLAT_THREAD_CONFIG *,CXPLAT_EVENTQ *,void *,void *) 13 | ) { 14 | _dispatch = dispatch; 15 | } 16 | 17 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicModUpcall_dispatch(CXPLAT_THREAD_CONFIG * Config, CXPLAT_EVENTQ * EventQ, void * Thread, void * Context) { 18 | if (_dispatch == NULL) { 19 | printf("JavaCritical_io_vproxy_msquic_MsQuicModUpcall_dispatch function pointer is null"); 20 | fflush(stdout); 21 | exit(1); 22 | } 23 | return _dispatch(Config, EventQ, Thread, Context); 24 | } 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | // metadata.generator-version: pni 21.0.0.16 30 | // sha256:b9205bff7493940fc47d62f2ee8ad58022417490b79d4bb57a4ddc5faf559bff 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_MsQuicValues.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_MsQuicValues.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_STATUS_NOT_SUPPORTED(void) { 8 | return QUIC_STATUS_NOT_SUPPORTED; 9 | } 10 | 11 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_STATUS_PENDING(void) { 12 | return QUIC_STATUS_PENDING; 13 | } 14 | 15 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_UNSPEC(void) { 16 | return QUIC_ADDRESS_FAMILY_UNSPEC; 17 | } 18 | 19 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_INET(void) { 20 | return QUIC_ADDRESS_FAMILY_INET; 21 | } 22 | 23 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_INET6(void) { 24 | return QUIC_ADDRESS_FAMILY_INET6; 25 | } 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | // metadata.generator-version: pni 21.0.0.11 31 | // sha256:f09637b8e35510443ca0d5d2db6a5db30164aaf66258a884e3bff227bd264802 32 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_MsQuicValues.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_MsQuicValues.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_STATUS_NOT_SUPPORTED(void) { 8 | return QUIC_STATUS_NOT_SUPPORTED; 9 | } 10 | 11 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_STATUS_PENDING(void) { 12 | return QUIC_STATUS_PENDING; 13 | } 14 | 15 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_UNSPEC(void) { 16 | return QUIC_ADDRESS_FAMILY_UNSPEC; 17 | } 18 | 19 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_INET(void) { 20 | return QUIC_ADDRESS_FAMILY_INET; 21 | } 22 | 23 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_INET6(void) { 24 | return QUIC_ADDRESS_FAMILY_INET6; 25 | } 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | // metadata.generator-version: pni 21.0.0.16 31 | // sha256:f09637b8e35510443ca0d5d2db6a5db30164aaf66258a884e3bff227bd264802 32 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_MsQuicModUpcall.c: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_MsQuicModUpcall.h" 2 | #include 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | static int32_t (*_dispatch)(void *,CXPLAT_THREAD_CONFIG *,CXPLAT_EVENTQ *,void *,void *); 10 | 11 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_MsQuicModUpcall_INIT( 12 | int32_t (*dispatch)(void *,CXPLAT_THREAD_CONFIG *,CXPLAT_EVENTQ *,void *,void *) 13 | ) { 14 | _dispatch = dispatch; 15 | } 16 | 17 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicModUpcall_dispatch(CXPLAT_THREAD_CONFIG * Config, CXPLAT_EVENTQ * EventQ, void * Thread, void * Context) { 18 | if (_dispatch == NULL) { 19 | printf("JavaCritical_io_vproxy_msquic_MsQuicModUpcall_dispatch function pointer is null"); 20 | fflush(stdout); 21 | exit(1); 22 | } 23 | return _dispatch(GetPNIGraalThread(), Config, EventQ, Thread, Context); 24 | } 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | // metadata.generator-version: pni 21.0.0.16 30 | // sha256:ee38d5bb76d1443892dc63cb3390fcfdd300837716b53df5956c11fcd5ac5447 31 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventResumed.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventResumed */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventResumed 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventResumed 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventResumed; 10 | typedef struct QuicConnectionEventResumed QuicConnectionEventResumed; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventResumed, QuicConnectionEventResumed *) 25 | PNIBufExpand(QuicConnectionEventResumed, QuicConnectionEventResumed, 16) 26 | 27 | struct QuicConnectionEventResumed { 28 | uint16_t ResumptionStateLength; 29 | void * ResumptionState; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventResumed 36 | // metadata.generator-version: pni 21.0.0.13 37 | // sha256:46ef71c48d53a0adb715a851e796d8d47f5287220950012c75370cadc3f2867c 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicRegistrationConfigEx.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicRegistrationConfigEx */ 3 | #ifndef _Included_io_vproxy_msquic_QuicRegistrationConfigEx 4 | #define _Included_io_vproxy_msquic_QuicRegistrationConfigEx 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicRegistrationConfigEx; 10 | typedef struct QuicRegistrationConfigEx QuicRegistrationConfigEx; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "io_vproxy_msquic_QuicRegistrationConfig.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicRegistrationConfigEx, QuicRegistrationConfigEx *) 25 | PNIBufExpand(QuicRegistrationConfigEx, QuicRegistrationConfigEx, 24) 26 | 27 | struct QuicRegistrationConfigEx { 28 | QUIC_REGISTRATION_CONFIG SUPER; 29 | void * Context; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicRegistrationConfigEx 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:914fab991cbf92b3f93b14c42a6f75502d2b53eb5530b21eb49a9daa1e6401b2 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicStreamEventSendComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventSendComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventSendComplete 4 | #define _Included_io_vproxy_msquic_QuicStreamEventSendComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventSendComplete; 10 | typedef struct QuicStreamEventSendComplete QuicStreamEventSendComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventSendComplete, QuicStreamEventSendComplete *) 25 | PNIBufExpand(QuicStreamEventSendComplete, QuicStreamEventSendComplete, 16) 26 | 27 | struct QuicStreamEventSendComplete { 28 | uint8_t Canceled; 29 | void * ClientContext; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicStreamEventSendComplete 36 | // metadata.generator-version: pni 21.0.0.13 37 | // sha256:61045224647e55f8be3a84512d8392db65912166fb584b183a9de66a50460e89 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicRegistrationConfigEx.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicRegistrationConfigEx */ 3 | #ifndef _Included_io_vproxy_msquic_QuicRegistrationConfigEx 4 | #define _Included_io_vproxy_msquic_QuicRegistrationConfigEx 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicRegistrationConfigEx; 10 | typedef struct QuicRegistrationConfigEx QuicRegistrationConfigEx; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "io_vproxy_msquic_QuicRegistrationConfig.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicRegistrationConfigEx, QuicRegistrationConfigEx *) 25 | PNIBufExpand(QuicRegistrationConfigEx, QuicRegistrationConfigEx, 24) 26 | 27 | struct QuicRegistrationConfigEx { 28 | QUIC_REGISTRATION_CONFIG SUPER; 29 | void * Context; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicRegistrationConfigEx 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:914fab991cbf92b3f93b14c42a6f75502d2b53eb5530b21eb49a9daa1e6401b2 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicStreamEventSendComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventSendComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventSendComplete 4 | #define _Included_io_vproxy_msquic_QuicStreamEventSendComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventSendComplete; 10 | typedef struct QuicStreamEventSendComplete QuicStreamEventSendComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventSendComplete, QuicStreamEventSendComplete *) 25 | PNIBufExpand(QuicStreamEventSendComplete, QuicStreamEventSendComplete, 16) 26 | 27 | struct QuicStreamEventSendComplete { 28 | uint8_t Canceled; 29 | void * ClientContext; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicStreamEventSendComplete 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:61045224647e55f8be3a84512d8392db65912166fb584b183a9de66a50460e89 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicStreamEventPeerSendAborted.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventPeerSendAborted */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventPeerSendAborted 4 | #define _Included_io_vproxy_msquic_QuicStreamEventPeerSendAborted 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventPeerSendAborted; 10 | typedef struct QuicStreamEventPeerSendAborted QuicStreamEventPeerSendAborted; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventPeerSendAborted, QuicStreamEventPeerSendAborted *) 25 | PNIBufExpand(QuicStreamEventPeerSendAborted, QuicStreamEventPeerSendAborted, 8) 26 | 27 | struct QuicStreamEventPeerSendAborted { 28 | int64_t ErrorCode; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicStreamEventPeerSendAborted 35 | // metadata.generator-version: pni 21.0.0.13 36 | // sha256:491e5b15632a030ab5e7a008fe78a10cf7133f2ec27f7a0c953acefdb4fbd5e4 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventResumed.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventResumed */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventResumed 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventResumed 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventResumed; 10 | typedef struct QuicConnectionEventResumed QuicConnectionEventResumed; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventResumed, QuicConnectionEventResumed *) 25 | PNIBufExpand(QuicConnectionEventResumed, QuicConnectionEventResumed, 16) 26 | 27 | struct QuicConnectionEventResumed { 28 | uint16_t ResumptionStateLength; 29 | void * ResumptionState; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventResumed 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:46ef71c48d53a0adb715a851e796d8d47f5287220950012c75370cadc3f2867c 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicStreamEventPeerSendAborted.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventPeerSendAborted */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventPeerSendAborted 4 | #define _Included_io_vproxy_msquic_QuicStreamEventPeerSendAborted 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventPeerSendAborted; 10 | typedef struct QuicStreamEventPeerSendAborted QuicStreamEventPeerSendAborted; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventPeerSendAborted, QuicStreamEventPeerSendAborted *) 25 | PNIBufExpand(QuicStreamEventPeerSendAborted, QuicStreamEventPeerSendAborted, 8) 26 | 27 | struct QuicStreamEventPeerSendAborted { 28 | int64_t ErrorCode; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicStreamEventPeerSendAborted 35 | // metadata.generator-version: pni 21.0.0.16 36 | // sha256:491e5b15632a030ab5e7a008fe78a10cf7133f2ec27f7a0c953acefdb4fbd5e4 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicListenerEventStopComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicListenerEventStopComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicListenerEventStopComplete 4 | #define _Included_io_vproxy_msquic_QuicListenerEventStopComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicListenerEventStopComplete; 10 | typedef struct QuicListenerEventStopComplete QuicListenerEventStopComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicListenerEventStopComplete, QuicListenerEventStopComplete *) 25 | PNIBufExpand(QuicListenerEventStopComplete, QuicListenerEventStopComplete, 1) 26 | 27 | struct QuicListenerEventStopComplete { 28 | uint8_t AppCloseInProgress : 1; 29 | uint8_t : 7; 30 | 31 | }; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif // _Included_io_vproxy_msquic_QuicListenerEventStopComplete 37 | // metadata.generator-version: pni 21.0.0.13 38 | // sha256:8d5536fe145fbcf4b953575672a3b0523d479b22a59a76c267fd26abd6240aca 39 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicListenerEventStopComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicListenerEventStopComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicListenerEventStopComplete 4 | #define _Included_io_vproxy_msquic_QuicListenerEventStopComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicListenerEventStopComplete; 10 | typedef struct QuicListenerEventStopComplete QuicListenerEventStopComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicListenerEventStopComplete, QuicListenerEventStopComplete *) 25 | PNIBufExpand(QuicListenerEventStopComplete, QuicListenerEventStopComplete, 1) 26 | 27 | struct QuicListenerEventStopComplete { 28 | uint8_t AppCloseInProgress : 1; 29 | uint8_t : 7; 30 | 31 | }; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif // _Included_io_vproxy_msquic_QuicListenerEventStopComplete 37 | // metadata.generator-version: pni 21.0.0.16 38 | // sha256:8d5536fe145fbcf4b953575672a3b0523d479b22a59a76c267fd26abd6240aca 39 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicStreamEventPeerReceiveAborted.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventPeerReceiveAborted */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventPeerReceiveAborted 4 | #define _Included_io_vproxy_msquic_QuicStreamEventPeerReceiveAborted 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventPeerReceiveAborted; 10 | typedef struct QuicStreamEventPeerReceiveAborted QuicStreamEventPeerReceiveAborted; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventPeerReceiveAborted, QuicStreamEventPeerReceiveAborted *) 25 | PNIBufExpand(QuicStreamEventPeerReceiveAborted, QuicStreamEventPeerReceiveAborted, 8) 26 | 27 | struct QuicStreamEventPeerReceiveAborted { 28 | int64_t ErrorCode; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicStreamEventPeerReceiveAborted 35 | // metadata.generator-version: pni 21.0.0.13 36 | // sha256:499eb8fd2056d413733f39acb2e14e629267b860c144245eee988edd2f376944 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicStreamEventPeerReceiveAborted.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventPeerReceiveAborted */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventPeerReceiveAborted 4 | #define _Included_io_vproxy_msquic_QuicStreamEventPeerReceiveAborted 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventPeerReceiveAborted; 10 | typedef struct QuicStreamEventPeerReceiveAborted QuicStreamEventPeerReceiveAborted; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventPeerReceiveAborted, QuicStreamEventPeerReceiveAborted *) 25 | PNIBufExpand(QuicStreamEventPeerReceiveAborted, QuicStreamEventPeerReceiveAborted, 8) 26 | 27 | struct QuicStreamEventPeerReceiveAborted { 28 | int64_t ErrorCode; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicStreamEventPeerReceiveAborted 35 | // metadata.generator-version: pni 21.0.0.16 36 | // sha256:499eb8fd2056d413733f39acb2e14e629267b860c144245eee988edd2f376944 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicListener.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicListener.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicListener_close(QuicListener * self) { 8 | QUIC_API_TABLE* api = self->SUPER.Api; 9 | HQUIC lsn = self->SUPER.Handle; 10 | api->ListenerClose(lsn); 11 | } 12 | 13 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicListener_start(QuicListener * self, QUIC_BUFFER * AlpnBuffers, int32_t AlpnBufferCount, QUIC_ADDR * Addr) { 14 | QUIC_API_TABLE* api = self->SUPER.Api; 15 | HQUIC lsn = self->SUPER.Handle; 16 | 17 | QUIC_STATUS res = api->ListenerStart(lsn, AlpnBuffers, AlpnBufferCount, Addr); 18 | if (QUIC_SUCCEEDED(res)) { 19 | return 0; 20 | } 21 | return res; 22 | } 23 | 24 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicListener_stop(QuicListener * self) { 25 | QUIC_API_TABLE* api = self->SUPER.Api; 26 | HQUIC lsn = self->SUPER.Handle; 27 | api->ListenerStop(lsn); 28 | } 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | // metadata.generator-version: pni 21.0.0.17 34 | // sha256:94d10b724a35e3a3de4c4cdeb92e56e2674771b10e7f4686795e693d58925d29 35 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicListener.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicListener.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicListener_close(QuicListener * self) { 8 | QUIC_API_TABLE* api = self->SUPER.Api; 9 | HQUIC lsn = self->SUPER.Handle; 10 | api->ListenerClose(lsn); 11 | } 12 | 13 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicListener_start(QuicListener * self, QUIC_BUFFER * AlpnBuffers, int32_t AlpnBufferCount, QUIC_ADDR * Addr) { 14 | QUIC_API_TABLE* api = self->SUPER.Api; 15 | HQUIC lsn = self->SUPER.Handle; 16 | 17 | QUIC_STATUS res = api->ListenerStart(lsn, AlpnBuffers, AlpnBufferCount, Addr); 18 | if (QUIC_SUCCEEDED(res)) { 19 | return 0; 20 | } 21 | return res; 22 | } 23 | 24 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicListener_stop(QuicListener * self) { 25 | QUIC_API_TABLE* api = self->SUPER.Api; 26 | HQUIC lsn = self->SUPER.Handle; 27 | api->ListenerStop(lsn); 28 | } 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | // metadata.generator-version: pni 21.0.0.17 34 | // sha256:94d10b724a35e3a3de4c4cdeb92e56e2674771b10e7f4686795e693d58925d29 35 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventConnected.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventConnected */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventConnected 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventConnected 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventConnected; 10 | typedef struct QuicConnectionEventConnected QuicConnectionEventConnected; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventConnected, QuicConnectionEventConnected *) 25 | PNIBufExpand(QuicConnectionEventConnected, QuicConnectionEventConnected, 16) 26 | 27 | struct QuicConnectionEventConnected { 28 | uint8_t SessionResumed; 29 | uint8_t NegotiatedAlpnLength; 30 | void * NegotiatedAlpn; 31 | }; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventConnected 37 | // metadata.generator-version: pni 21.0.0.13 38 | // sha256:3ace30ff4a8a396e6e986f161b83e56b13d31c542ea0194e0113e704b08197e7 39 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicStreamEventIdealSendBufferSize.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventIdealSendBufferSize */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventIdealSendBufferSize 4 | #define _Included_io_vproxy_msquic_QuicStreamEventIdealSendBufferSize 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventIdealSendBufferSize; 10 | typedef struct QuicStreamEventIdealSendBufferSize QuicStreamEventIdealSendBufferSize; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventIdealSendBufferSize, QuicStreamEventIdealSendBufferSize *) 25 | PNIBufExpand(QuicStreamEventIdealSendBufferSize, QuicStreamEventIdealSendBufferSize, 8) 26 | 27 | struct QuicStreamEventIdealSendBufferSize { 28 | uint64_t ByteCount; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicStreamEventIdealSendBufferSize 35 | // metadata.generator-version: pni 21.0.0.13 36 | // sha256:5d0f9600bc3eafca269a9559327286d82378a21d9b23b39c905ed81a26536568 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventConnected.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventConnected */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventConnected 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventConnected 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventConnected; 10 | typedef struct QuicConnectionEventConnected QuicConnectionEventConnected; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventConnected, QuicConnectionEventConnected *) 25 | PNIBufExpand(QuicConnectionEventConnected, QuicConnectionEventConnected, 16) 26 | 27 | struct QuicConnectionEventConnected { 28 | uint8_t SessionResumed; 29 | uint8_t NegotiatedAlpnLength; 30 | void * NegotiatedAlpn; 31 | }; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventConnected 37 | // metadata.generator-version: pni 21.0.0.16 38 | // sha256:3ace30ff4a8a396e6e986f161b83e56b13d31c542ea0194e0113e704b08197e7 39 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicStreamEventIdealSendBufferSize.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventIdealSendBufferSize */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventIdealSendBufferSize 4 | #define _Included_io_vproxy_msquic_QuicStreamEventIdealSendBufferSize 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventIdealSendBufferSize; 10 | typedef struct QuicStreamEventIdealSendBufferSize QuicStreamEventIdealSendBufferSize; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventIdealSendBufferSize, QuicStreamEventIdealSendBufferSize *) 25 | PNIBufExpand(QuicStreamEventIdealSendBufferSize, QuicStreamEventIdealSendBufferSize, 8) 26 | 27 | struct QuicStreamEventIdealSendBufferSize { 28 | uint64_t ByteCount; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicStreamEventIdealSendBufferSize 35 | // metadata.generator-version: pni 21.0.0.16 36 | // sha256:5d0f9600bc3eafca269a9559327286d82378a21d9b23b39c905ed81a26536568 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicStreamEventStartComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventStartComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventStartComplete 4 | #define _Included_io_vproxy_msquic_QuicStreamEventStartComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventStartComplete; 10 | typedef struct QuicStreamEventStartComplete QuicStreamEventStartComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventStartComplete, QuicStreamEventStartComplete *) 25 | PNIBufExpand(QuicStreamEventStartComplete, QuicStreamEventStartComplete, 24) 26 | 27 | struct QuicStreamEventStartComplete { 28 | int32_t Status; 29 | int64_t ID; 30 | uint8_t PeerAccepted : 1; 31 | uint8_t : 7; 32 | 33 | }; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | #endif // _Included_io_vproxy_msquic_QuicStreamEventStartComplete 39 | // metadata.generator-version: pni 21.0.0.13 40 | // sha256:5a919550da4428f5c6558010e63912e2812066985017445c966cf0687fc774ae 41 | -------------------------------------------------------------------------------- /core/src/main/java/io/vproxy/msquic/MsQuicUpcallImpl.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic; 2 | 3 | import io.vproxy.pni.PNIRef; 4 | 5 | import java.lang.foreign.MemorySegment; 6 | 7 | public class MsQuicUpcallImpl implements MsQuicUpcall.Interface { 8 | private MsQuicUpcallImpl() { 9 | } 10 | 11 | private static final MsQuicUpcallImpl IMPL = new MsQuicUpcallImpl(); 12 | 13 | public static MsQuicUpcallImpl get() { 14 | return IMPL; 15 | } 16 | 17 | @Override 18 | public int listenerCallback(MemorySegment Listener, MemorySegment Context, QuicListenerEvent Event) { 19 | var lsn = PNIRef.getRef(Context); 20 | return lsn.callback(Event); 21 | } 22 | 23 | @Override 24 | public int connectionCallback(MemorySegment Connection, MemorySegment Context, QuicConnectionEvent Event) { 25 | var conn = PNIRef.getRef(Context); 26 | return conn.callback(Event); 27 | } 28 | 29 | @Override 30 | public int streamCallback(MemorySegment Stream, MemorySegment Context, QuicStreamEvent Event) { 31 | var stream = PNIRef.getRef(Context); 32 | return stream.callback(Event); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicStreamEventStartComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventStartComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventStartComplete 4 | #define _Included_io_vproxy_msquic_QuicStreamEventStartComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventStartComplete; 10 | typedef struct QuicStreamEventStartComplete QuicStreamEventStartComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventStartComplete, QuicStreamEventStartComplete *) 25 | PNIBufExpand(QuicStreamEventStartComplete, QuicStreamEventStartComplete, 24) 26 | 27 | struct QuicStreamEventStartComplete { 28 | int32_t Status; 29 | int64_t ID; 30 | uint8_t PeerAccepted : 1; 31 | uint8_t : 7; 32 | 33 | }; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | #endif // _Included_io_vproxy_msquic_QuicStreamEventStartComplete 39 | // metadata.generator-version: pni 21.0.0.16 40 | // sha256:5a919550da4428f5c6558010e63912e2812066985017445c966cf0687fc774ae 41 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicStreamEventSendShutdownComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventSendShutdownComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventSendShutdownComplete 4 | #define _Included_io_vproxy_msquic_QuicStreamEventSendShutdownComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventSendShutdownComplete; 10 | typedef struct QuicStreamEventSendShutdownComplete QuicStreamEventSendShutdownComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventSendShutdownComplete, QuicStreamEventSendShutdownComplete *) 25 | PNIBufExpand(QuicStreamEventSendShutdownComplete, QuicStreamEventSendShutdownComplete, 1) 26 | 27 | struct QuicStreamEventSendShutdownComplete { 28 | uint8_t Graceful; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicStreamEventSendShutdownComplete 35 | // metadata.generator-version: pni 21.0.0.13 36 | // sha256:98c7e012d783050d4a714e7d0d86f7fc49d2fdfff57fe44d89d65c9d4c0de637 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicStreamEventSendShutdownComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventSendShutdownComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventSendShutdownComplete 4 | #define _Included_io_vproxy_msquic_QuicStreamEventSendShutdownComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventSendShutdownComplete; 10 | typedef struct QuicStreamEventSendShutdownComplete QuicStreamEventSendShutdownComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventSendShutdownComplete, QuicStreamEventSendShutdownComplete *) 25 | PNIBufExpand(QuicStreamEventSendShutdownComplete, QuicStreamEventSendShutdownComplete, 1) 26 | 27 | struct QuicStreamEventSendShutdownComplete { 28 | uint8_t Graceful; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicStreamEventSendShutdownComplete 35 | // metadata.generator-version: pni 21.0.0.16 36 | // sha256:98c7e012d783050d4a714e7d0d86f7fc49d2fdfff57fe44d89d65c9d4c0de637 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventPeerNeedsStreams; 10 | typedef struct QuicConnectionEventPeerNeedsStreams QuicConnectionEventPeerNeedsStreams; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventPeerNeedsStreams, QuicConnectionEventPeerNeedsStreams *) 25 | PNIBufExpand(QuicConnectionEventPeerNeedsStreams, QuicConnectionEventPeerNeedsStreams, 1) 26 | 27 | struct QuicConnectionEventPeerNeedsStreams { 28 | uint8_t Bidirectional; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams 35 | // metadata.generator-version: pni 21.0.0.13 36 | // sha256:35b1ac0fce307eccbcf24192042d083f66d54e3aae157a51d6fa2de1a1d2e0cd 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventPeerNeedsStreams; 10 | typedef struct QuicConnectionEventPeerNeedsStreams QuicConnectionEventPeerNeedsStreams; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventPeerNeedsStreams, QuicConnectionEventPeerNeedsStreams *) 25 | PNIBufExpand(QuicConnectionEventPeerNeedsStreams, QuicConnectionEventPeerNeedsStreams, 1) 26 | 27 | struct QuicConnectionEventPeerNeedsStreams { 28 | uint8_t Bidirectional; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams 35 | // metadata.generator-version: pni 21.0.0.16 36 | // sha256:35b1ac0fce307eccbcf24192042d083f66d54e3aae157a51d6fa2de1a1d2e0cd 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicStreamEventReceive.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventReceive */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventReceive 4 | #define _Included_io_vproxy_msquic_QuicStreamEventReceive 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventReceive; 10 | typedef struct QuicStreamEventReceive QuicStreamEventReceive; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicBuffer.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | PNIEnvExpand(QuicStreamEventReceive, QuicStreamEventReceive *) 26 | PNIBufExpand(QuicStreamEventReceive, QuicStreamEventReceive, 32) 27 | 28 | struct QuicStreamEventReceive { 29 | uint64_t AbsoluteOffset; 30 | uint64_t TotalBufferLength; 31 | QUIC_BUFFER * Buffers; 32 | uint32_t BufferCount; 33 | int32_t Flags; 34 | }; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | #endif // _Included_io_vproxy_msquic_QuicStreamEventReceive 40 | // metadata.generator-version: pni 21.0.0.13 41 | // sha256:37193b18fb33936bc66bb1211e76dd5e01e0946503e0e9bb8d767ea71ff6847d 42 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicStreamEventReceive.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventReceive */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventReceive 4 | #define _Included_io_vproxy_msquic_QuicStreamEventReceive 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventReceive; 10 | typedef struct QuicStreamEventReceive QuicStreamEventReceive; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicBuffer.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | PNIEnvExpand(QuicStreamEventReceive, QuicStreamEventReceive *) 26 | PNIBufExpand(QuicStreamEventReceive, QuicStreamEventReceive, 32) 27 | 28 | struct QuicStreamEventReceive { 29 | uint64_t AbsoluteOffset; 30 | uint64_t TotalBufferLength; 31 | QUIC_BUFFER * Buffers; 32 | uint32_t BufferCount; 33 | int32_t Flags; 34 | }; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | #endif // _Included_io_vproxy_msquic_QuicStreamEventReceive 40 | // metadata.generator-version: pni 21.0.0.16 41 | // sha256:37193b18fb33936bc66bb1211e76dd5e01e0946503e0e9bb8d767ea71ff6847d 42 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicStreamEventUnion.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventUnion */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventUnion 4 | #define _Included_io_vproxy_msquic_QuicStreamEventUnion 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicStreamEventStartComplete.h" 17 | #include "io_vproxy_msquic_QuicStreamEventReceive.h" 18 | #include "io_vproxy_msquic_QuicStreamEventSendComplete.h" 19 | #include "io_vproxy_msquic_QuicStreamEventPeerSendAborted.h" 20 | #include "io_vproxy_msquic_QuicStreamEventPeerReceiveAborted.h" 21 | #include "io_vproxy_msquic_QuicStreamEventSendShutdownComplete.h" 22 | #include "io_vproxy_msquic_QuicStreamEventShutdownComplete.h" 23 | #include "io_vproxy_msquic_QuicStreamEventIdealSendBufferSize.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | #endif // _Included_io_vproxy_msquic_QuicStreamEventUnion 33 | // metadata.generator-version: pni 21.0.0.8 34 | // sha256:d45d86ad3ae3b5ecff1a94703efbf23885df722346a859e70e6df6f5c2b835a4 35 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicStreamEventUnion.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventUnion */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventUnion 4 | #define _Included_io_vproxy_msquic_QuicStreamEventUnion 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicStreamEventStartComplete.h" 17 | #include "io_vproxy_msquic_QuicStreamEventReceive.h" 18 | #include "io_vproxy_msquic_QuicStreamEventSendComplete.h" 19 | #include "io_vproxy_msquic_QuicStreamEventPeerSendAborted.h" 20 | #include "io_vproxy_msquic_QuicStreamEventPeerReceiveAborted.h" 21 | #include "io_vproxy_msquic_QuicStreamEventSendShutdownComplete.h" 22 | #include "io_vproxy_msquic_QuicStreamEventShutdownComplete.h" 23 | #include "io_vproxy_msquic_QuicStreamEventIdealSendBufferSize.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | #endif // _Included_io_vproxy_msquic_QuicStreamEventUnion 33 | // metadata.generator-version: pni 21.0.0.16 34 | // sha256:d45d86ad3ae3b5ecff1a94703efbf23885df722346a859e70e6df6f5c2b835a4 35 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventPeerStreamStarted.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventPeerStreamStarted */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventPeerStreamStarted 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventPeerStreamStarted 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventPeerStreamStarted; 10 | typedef struct QuicConnectionEventPeerStreamStarted QuicConnectionEventPeerStreamStarted; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventPeerStreamStarted, QuicConnectionEventPeerStreamStarted *) 25 | PNIBufExpand(QuicConnectionEventPeerStreamStarted, QuicConnectionEventPeerStreamStarted, 16) 26 | 27 | struct QuicConnectionEventPeerStreamStarted { 28 | void * Stream; 29 | int32_t Flags; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventPeerStreamStarted 36 | // metadata.generator-version: pni 21.0.0.13 37 | // sha256:45ab03b5c832784b08f12a19699bd600a5cf1737320ecf7eecf9559e8347cd54 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicListenerEventNewConnection.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicListenerEventNewConnection */ 3 | #ifndef _Included_io_vproxy_msquic_QuicListenerEventNewConnection 4 | #define _Included_io_vproxy_msquic_QuicListenerEventNewConnection 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicListenerEventNewConnection; 10 | typedef struct QuicListenerEventNewConnection QuicListenerEventNewConnection; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicNewConnectionInfo.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | PNIEnvExpand(QuicListenerEventNewConnection, QuicListenerEventNewConnection *) 26 | PNIBufExpand(QuicListenerEventNewConnection, QuicListenerEventNewConnection, 16) 27 | 28 | struct QuicListenerEventNewConnection { 29 | QUIC_NEW_CONNECTION_INFO * Info; 30 | void * Connection; 31 | }; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif // _Included_io_vproxy_msquic_QuicListenerEventNewConnection 37 | // metadata.generator-version: pni 21.0.0.13 38 | // sha256:913f6e9659008b700985a0f929862ecbf187ded9e2285d67b4c9a5be8c1a78cd 39 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventPeerStreamStarted.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventPeerStreamStarted */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventPeerStreamStarted 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventPeerStreamStarted 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventPeerStreamStarted; 10 | typedef struct QuicConnectionEventPeerStreamStarted QuicConnectionEventPeerStreamStarted; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventPeerStreamStarted, QuicConnectionEventPeerStreamStarted *) 25 | PNIBufExpand(QuicConnectionEventPeerStreamStarted, QuicConnectionEventPeerStreamStarted, 16) 26 | 27 | struct QuicConnectionEventPeerStreamStarted { 28 | void * Stream; 29 | int32_t Flags; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventPeerStreamStarted 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:45ab03b5c832784b08f12a19699bd600a5cf1737320ecf7eecf9559e8347cd54 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicListenerEventNewConnection.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicListenerEventNewConnection */ 3 | #ifndef _Included_io_vproxy_msquic_QuicListenerEventNewConnection 4 | #define _Included_io_vproxy_msquic_QuicListenerEventNewConnection 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicListenerEventNewConnection; 10 | typedef struct QuicListenerEventNewConnection QuicListenerEventNewConnection; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicNewConnectionInfo.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | PNIEnvExpand(QuicListenerEventNewConnection, QuicListenerEventNewConnection *) 26 | PNIBufExpand(QuicListenerEventNewConnection, QuicListenerEventNewConnection, 16) 27 | 28 | struct QuicListenerEventNewConnection { 29 | QUIC_NEW_CONNECTION_INFO * Info; 30 | void * Connection; 31 | }; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif // _Included_io_vproxy_msquic_QuicListenerEventNewConnection 37 | // metadata.generator-version: pni 21.0.0.16 38 | // sha256:913f6e9659008b700985a0f929862ecbf187ded9e2285d67b4c9a5be8c1a78cd 39 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventStreamsAvailable.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventStreamsAvailable */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventStreamsAvailable 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventStreamsAvailable 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventStreamsAvailable; 10 | typedef struct QuicConnectionEventStreamsAvailable QuicConnectionEventStreamsAvailable; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventStreamsAvailable, QuicConnectionEventStreamsAvailable *) 25 | PNIBufExpand(QuicConnectionEventStreamsAvailable, QuicConnectionEventStreamsAvailable, 4) 26 | 27 | struct QuicConnectionEventStreamsAvailable { 28 | uint16_t BidirectionalCount; 29 | uint16_t UnidirectionalCount; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventStreamsAvailable 36 | // metadata.generator-version: pni 21.0.0.13 37 | // sha256:20d15081b843a61f247e6c4bad7580e07ca468bdc6cc2e9e3ac0a5c4404f0073 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicTLSSecretIsSet.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicTLSSecretIsSet */ 3 | #ifndef _Included_io_vproxy_msquic_QuicTLSSecretIsSet 4 | #define _Included_io_vproxy_msquic_QuicTLSSecretIsSet 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicTLSSecretIsSet; 10 | typedef struct QuicTLSSecretIsSet QuicTLSSecretIsSet; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicTLSSecretIsSet, QuicTLSSecretIsSet *) 25 | PNIBufExpand(QuicTLSSecretIsSet, QuicTLSSecretIsSet, 1) 26 | 27 | struct QuicTLSSecretIsSet { 28 | uint8_t ClientRandom : 1; 29 | uint8_t ClientEarlyTrafficSecret : 1; 30 | uint8_t ClientHandshakeTrafficSecret : 1; 31 | uint8_t ServerHandshakeTrafficSecret : 1; 32 | uint8_t ClientTrafficSecret0 : 1; 33 | uint8_t ServerTrafficSecret0 : 1; 34 | uint8_t : 2; 35 | 36 | }; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif // _Included_io_vproxy_msquic_QuicTLSSecretIsSet 42 | // metadata.generator-version: pni 21.0.0.13 43 | // sha256:f3a594e1f75523e2d93b8a53a72a4878d9bec4cbb8a1757aad53029a52c20176 44 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventStreamsAvailable.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventStreamsAvailable */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventStreamsAvailable 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventStreamsAvailable 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventStreamsAvailable; 10 | typedef struct QuicConnectionEventStreamsAvailable QuicConnectionEventStreamsAvailable; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventStreamsAvailable, QuicConnectionEventStreamsAvailable *) 25 | PNIBufExpand(QuicConnectionEventStreamsAvailable, QuicConnectionEventStreamsAvailable, 4) 26 | 27 | struct QuicConnectionEventStreamsAvailable { 28 | uint16_t BidirectionalCount; 29 | uint16_t UnidirectionalCount; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventStreamsAvailable 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:20d15081b843a61f247e6c4bad7580e07ca468bdc6cc2e9e3ac0a5c4404f0073 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicTLSSecretIsSet.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicTLSSecretIsSet */ 3 | #ifndef _Included_io_vproxy_msquic_QuicTLSSecretIsSet 4 | #define _Included_io_vproxy_msquic_QuicTLSSecretIsSet 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicTLSSecretIsSet; 10 | typedef struct QuicTLSSecretIsSet QuicTLSSecretIsSet; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicTLSSecretIsSet, QuicTLSSecretIsSet *) 25 | PNIBufExpand(QuicTLSSecretIsSet, QuicTLSSecretIsSet, 1) 26 | 27 | struct QuicTLSSecretIsSet { 28 | uint8_t ClientRandom : 1; 29 | uint8_t ClientEarlyTrafficSecret : 1; 30 | uint8_t ClientHandshakeTrafficSecret : 1; 31 | uint8_t ServerHandshakeTrafficSecret : 1; 32 | uint8_t ClientTrafficSecret0 : 1; 33 | uint8_t ServerTrafficSecret0 : 1; 34 | uint8_t : 2; 35 | 36 | }; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif // _Included_io_vproxy_msquic_QuicTLSSecretIsSet 42 | // metadata.generator-version: pni 21.0.0.16 43 | // sha256:f3a594e1f75523e2d93b8a53a72a4878d9bec4cbb8a1757aad53029a52c20176 44 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventDatagramReceived.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventDatagramReceived */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventDatagramReceived 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventDatagramReceived 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventDatagramReceived; 10 | typedef struct QuicConnectionEventDatagramReceived QuicConnectionEventDatagramReceived; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicBuffer.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | PNIEnvExpand(QuicConnectionEventDatagramReceived, QuicConnectionEventDatagramReceived *) 26 | PNIBufExpand(QuicConnectionEventDatagramReceived, QuicConnectionEventDatagramReceived, 24) 27 | 28 | struct QuicConnectionEventDatagramReceived { 29 | QUIC_BUFFER Buffer; 30 | int32_t Flags; 31 | }; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventDatagramReceived 37 | // metadata.generator-version: pni 21.0.0.13 38 | // sha256:ecd836e9a9ccd48557219390ea6b515b20d5bed0f064c19f392e9009ef33f102 39 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventPeerAddressChanged.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventPeerAddressChanged */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventPeerAddressChanged 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventPeerAddressChanged 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventPeerAddressChanged; 10 | typedef struct QuicConnectionEventPeerAddressChanged QuicConnectionEventPeerAddressChanged; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicAddr.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | PNIEnvExpand(QuicConnectionEventPeerAddressChanged, QuicConnectionEventPeerAddressChanged *) 26 | PNIBufExpand(QuicConnectionEventPeerAddressChanged, QuicConnectionEventPeerAddressChanged, 8) 27 | 28 | struct QuicConnectionEventPeerAddressChanged { 29 | QUIC_ADDR * Address; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventPeerAddressChanged 36 | // metadata.generator-version: pni 21.0.0.13 37 | // sha256:fda8d8f455228477d146ce7c69a284f9b27840b3028c7748da29f15e1cd12f0b 38 | -------------------------------------------------------------------------------- /template/src/main/java/io/vproxy/msquic/PNIQuicTLSSecret.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic; 2 | 3 | import io.vproxy.pni.annotation.*; 4 | 5 | @Struct(skip = true) 6 | @AlwaysAligned 7 | @Include("msquic.h") 8 | @Name("QUIC_TLS_SECRETS") 9 | public class PNIQuicTLSSecret { 10 | @Unsigned byte SecretLength; 11 | PNIQuicTLSSecretIsSet IsSet; 12 | @Unsigned @Len(32) byte[] ClientRandom; 13 | @Unsigned @Len(64) byte[] ClientEarlyTrafficSecret; 14 | @Unsigned @Len(64) byte[] ClientHandshakeTrafficSecret; 15 | @Unsigned @Len(64) byte[] ServerHandshakeTrafficSecret; 16 | @Unsigned @Len(64) byte[] ClientTrafficSecret0; 17 | @Unsigned @Len(64) byte[] ServerTrafficSecret0; 18 | } 19 | 20 | @Struct 21 | @AlwaysAligned 22 | @Include("msquic.h") 23 | class PNIQuicTLSSecretIsSet { 24 | @Bit({ 25 | @Bit.Field(name = "ClientRandom", bits = 1, bool = true), 26 | @Bit.Field(name = "ClientEarlyTrafficSecret", bits = 1, bool = true), 27 | @Bit.Field(name = "ClientHandshakeTrafficSecret", bits = 1, bool = true), 28 | @Bit.Field(name = "ServerHandshakeTrafficSecret", bits = 1, bool = true), 29 | @Bit.Field(name = "ClientTrafficSecret0", bits = 1, bool = true), 30 | @Bit.Field(name = "ServerTrafficSecret0", bits = 1, bool = true), 31 | }) 32 | @Unsigned byte IsSet; 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventDatagramReceived.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventDatagramReceived */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventDatagramReceived 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventDatagramReceived 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventDatagramReceived; 10 | typedef struct QuicConnectionEventDatagramReceived QuicConnectionEventDatagramReceived; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicBuffer.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | PNIEnvExpand(QuicConnectionEventDatagramReceived, QuicConnectionEventDatagramReceived *) 26 | PNIBufExpand(QuicConnectionEventDatagramReceived, QuicConnectionEventDatagramReceived, 24) 27 | 28 | struct QuicConnectionEventDatagramReceived { 29 | QUIC_BUFFER Buffer; 30 | int32_t Flags; 31 | }; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventDatagramReceived 37 | // metadata.generator-version: pni 21.0.0.16 38 | // sha256:ecd836e9a9ccd48557219390ea6b515b20d5bed0f064c19f392e9009ef33f102 39 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventPeerAddressChanged.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventPeerAddressChanged */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventPeerAddressChanged 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventPeerAddressChanged 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventPeerAddressChanged; 10 | typedef struct QuicConnectionEventPeerAddressChanged QuicConnectionEventPeerAddressChanged; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicAddr.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | PNIEnvExpand(QuicConnectionEventPeerAddressChanged, QuicConnectionEventPeerAddressChanged *) 26 | PNIBufExpand(QuicConnectionEventPeerAddressChanged, QuicConnectionEventPeerAddressChanged, 8) 27 | 28 | struct QuicConnectionEventPeerAddressChanged { 29 | QUIC_ADDR * Address; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventPeerAddressChanged 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:fda8d8f455228477d146ce7c69a284f9b27840b3028c7748da29f15e1cd12f0b 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_MsQuicUpcall.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_MsQuicUpcall */ 3 | #ifndef _Included_io_vproxy_msquic_MsQuicUpcall 4 | #define _Included_io_vproxy_msquic_MsQuicUpcall 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicListenerEvent.h" 17 | #include "io_vproxy_msquic_QuicConnectionEvent.h" 18 | #include "io_vproxy_msquic_QuicStreamEvent.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicUpcall_listenerCallback(void * Listener, void * Context, QUIC_LISTENER_EVENT * Event); 25 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicUpcall_connectionCallback(void * Connection, void * Context, QUIC_CONNECTION_EVENT * Event); 26 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicUpcall_streamCallback(void * Stream, void * Context, QUIC_STREAM_EVENT * Event); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif // _Included_io_vproxy_msquic_MsQuicUpcall 32 | // metadata.generator-version: pni 21.0.0.8 33 | // sha256:38d59aaa0652ea4be2fe6b1c4d114b4f534fded668b03d52e9ed8b99c54e8a9d 34 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_MsQuicUpcall.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_MsQuicUpcall */ 3 | #ifndef _Included_io_vproxy_msquic_MsQuicUpcall 4 | #define _Included_io_vproxy_msquic_MsQuicUpcall 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicListenerEvent.h" 17 | #include "io_vproxy_msquic_QuicConnectionEvent.h" 18 | #include "io_vproxy_msquic_QuicStreamEvent.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicUpcall_listenerCallback(void * Listener, void * Context, QUIC_LISTENER_EVENT * Event); 25 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicUpcall_connectionCallback(void * Connection, void * Context, QUIC_CONNECTION_EVENT * Event); 26 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicUpcall_streamCallback(void * Stream, void * Context, QUIC_STREAM_EVENT * Event); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif // _Included_io_vproxy_msquic_MsQuicUpcall 32 | // metadata.generator-version: pni 21.0.0.16 33 | // sha256:38d59aaa0652ea4be2fe6b1c4d114b4f534fded668b03d52e9ed8b99c54e8a9d 34 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventLocalAddressChanged.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventLocalAddressChanged */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventLocalAddressChanged 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventLocalAddressChanged 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventLocalAddressChanged; 10 | typedef struct QuicConnectionEventLocalAddressChanged QuicConnectionEventLocalAddressChanged; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicAddr.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | PNIEnvExpand(QuicConnectionEventLocalAddressChanged, QuicConnectionEventLocalAddressChanged *) 26 | PNIBufExpand(QuicConnectionEventLocalAddressChanged, QuicConnectionEventLocalAddressChanged, 8) 27 | 28 | struct QuicConnectionEventLocalAddressChanged { 29 | QUIC_ADDR * Address; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventLocalAddressChanged 36 | // metadata.generator-version: pni 21.0.0.13 37 | // sha256:009ec1ee2d4892ce21eed0b41b4d3f236ee3202a3a34850718678aff380068a6 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventDatagramStateChanged.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventDatagramStateChanged */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventDatagramStateChanged 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventDatagramStateChanged 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventDatagramStateChanged; 10 | typedef struct QuicConnectionEventDatagramStateChanged QuicConnectionEventDatagramStateChanged; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventDatagramStateChanged, QuicConnectionEventDatagramStateChanged *) 25 | PNIBufExpand(QuicConnectionEventDatagramStateChanged, QuicConnectionEventDatagramStateChanged, 4) 26 | 27 | struct QuicConnectionEventDatagramStateChanged { 28 | uint8_t SendEnabled; 29 | uint16_t MaxSendLength; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventDatagramStateChanged 36 | // metadata.generator-version: pni 21.0.0.13 37 | // sha256:1d05fb066f27f2b7a898dd7cd1b92c622319569208b8059a8b926c72ff4ddbbd 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventDatagramStateChanged.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventDatagramStateChanged */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventDatagramStateChanged 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventDatagramStateChanged 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventDatagramStateChanged; 10 | typedef struct QuicConnectionEventDatagramStateChanged QuicConnectionEventDatagramStateChanged; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventDatagramStateChanged, QuicConnectionEventDatagramStateChanged *) 25 | PNIBufExpand(QuicConnectionEventDatagramStateChanged, QuicConnectionEventDatagramStateChanged, 4) 26 | 27 | struct QuicConnectionEventDatagramStateChanged { 28 | uint8_t SendEnabled; 29 | uint16_t MaxSendLength; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventDatagramStateChanged 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:1d05fb066f27f2b7a898dd7cd1b92c622319569208b8059a8b926c72ff4ddbbd 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventLocalAddressChanged.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventLocalAddressChanged */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventLocalAddressChanged 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventLocalAddressChanged 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventLocalAddressChanged; 10 | typedef struct QuicConnectionEventLocalAddressChanged QuicConnectionEventLocalAddressChanged; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicAddr.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | PNIEnvExpand(QuicConnectionEventLocalAddressChanged, QuicConnectionEventLocalAddressChanged *) 26 | PNIBufExpand(QuicConnectionEventLocalAddressChanged, QuicConnectionEventLocalAddressChanged, 8) 27 | 28 | struct QuicConnectionEventLocalAddressChanged { 29 | QUIC_ADDR * Address; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventLocalAddressChanged 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:009ec1ee2d4892ce21eed0b41b4d3f236ee3202a3a34850718678aff380068a6 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_MsQuicValues.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_MsQuicValues */ 3 | #ifndef _Included_io_vproxy_msquic_MsQuicValues 4 | #define _Included_io_vproxy_msquic_MsQuicValues 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | JNIEXPORT char * JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QuicStatusString(int32_t status); 22 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_STATUS_NOT_SUPPORTED(void); 23 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_STATUS_PENDING(void); 24 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_UNSPEC(void); 25 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_INET(void); 26 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_INET6(void); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif // _Included_io_vproxy_msquic_MsQuicValues 32 | // metadata.generator-version: pni 21.0.0.11 33 | // sha256:e7b6272391eac42a904cd2545ce7ca841929635524a385265b9059fce05b4992 34 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventReliableResetNegotiated; 10 | typedef struct QuicConnectionEventReliableResetNegotiated QuicConnectionEventReliableResetNegotiated; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventReliableResetNegotiated, QuicConnectionEventReliableResetNegotiated *) 25 | PNIBufExpand(QuicConnectionEventReliableResetNegotiated, QuicConnectionEventReliableResetNegotiated, 1) 26 | 27 | struct QuicConnectionEventReliableResetNegotiated { 28 | uint8_t IsNegotiated; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated 35 | // metadata.generator-version: pni 21.0.0.13 36 | // sha256:14d7500f94caec3006198d83c8321d2ec6d465c45e64dd772893f2ddc5516b09 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventShutdownInitiatedByPeer; 10 | typedef struct QuicConnectionEventShutdownInitiatedByPeer QuicConnectionEventShutdownInitiatedByPeer; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventShutdownInitiatedByPeer, QuicConnectionEventShutdownInitiatedByPeer *) 25 | PNIBufExpand(QuicConnectionEventShutdownInitiatedByPeer, QuicConnectionEventShutdownInitiatedByPeer, 8) 26 | 27 | struct QuicConnectionEventShutdownInitiatedByPeer { 28 | int64_t ErrorCode; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer 35 | // metadata.generator-version: pni 21.0.0.13 36 | // sha256:f1ba149f445caa3d10d8137a9bb674a9af3b45b2cf233bb06aba03876cd1ba57 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_MsQuicValues.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_MsQuicValues */ 3 | #ifndef _Included_io_vproxy_msquic_MsQuicValues 4 | #define _Included_io_vproxy_msquic_MsQuicValues 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | JNIEXPORT char * JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QuicStatusString(int32_t status); 22 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_STATUS_NOT_SUPPORTED(void); 23 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_STATUS_PENDING(void); 24 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_UNSPEC(void); 25 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_INET(void); 26 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_MsQuicValues_QUIC_ADDRESS_FAMILY_INET6(void); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif // _Included_io_vproxy_msquic_MsQuicValues 32 | // metadata.generator-version: pni 21.0.0.16 33 | // sha256:e7b6272391eac42a904cd2545ce7ca841929635524a385265b9059fce05b4992 34 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventReliableResetNegotiated; 10 | typedef struct QuicConnectionEventReliableResetNegotiated QuicConnectionEventReliableResetNegotiated; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventReliableResetNegotiated, QuicConnectionEventReliableResetNegotiated *) 25 | PNIBufExpand(QuicConnectionEventReliableResetNegotiated, QuicConnectionEventReliableResetNegotiated, 1) 26 | 27 | struct QuicConnectionEventReliableResetNegotiated { 28 | uint8_t IsNegotiated; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated 35 | // metadata.generator-version: pni 21.0.0.16 36 | // sha256:14d7500f94caec3006198d83c8321d2ec6d465c45e64dd772893f2ddc5516b09 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventShutdownInitiatedByPeer; 10 | typedef struct QuicConnectionEventShutdownInitiatedByPeer QuicConnectionEventShutdownInitiatedByPeer; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventShutdownInitiatedByPeer, QuicConnectionEventShutdownInitiatedByPeer *) 25 | PNIBufExpand(QuicConnectionEventShutdownInitiatedByPeer, QuicConnectionEventShutdownInitiatedByPeer, 8) 26 | 27 | struct QuicConnectionEventShutdownInitiatedByPeer { 28 | int64_t ErrorCode; 29 | }; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer 35 | // metadata.generator-version: pni 21.0.0.16 36 | // sha256:f1ba149f445caa3d10d8137a9bb674a9af3b45b2cf233bb06aba03876cd1ba57 37 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventIdealProcessorChanged; 10 | typedef struct QuicConnectionEventIdealProcessorChanged QuicConnectionEventIdealProcessorChanged; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventIdealProcessorChanged, QuicConnectionEventIdealProcessorChanged *) 25 | PNIBufExpand(QuicConnectionEventIdealProcessorChanged, QuicConnectionEventIdealProcessorChanged, 4) 26 | 27 | struct QuicConnectionEventIdealProcessorChanged { 28 | uint16_t IdealProcessor; 29 | uint16_t PartitionIndex; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged 36 | // metadata.generator-version: pni 21.0.0.13 37 | // sha256:074ba5d8b8f9c3fcaace868bc6e7108ec03b46ff6e4a9cb67849bb3dce104435 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventIdealProcessorChanged; 10 | typedef struct QuicConnectionEventIdealProcessorChanged QuicConnectionEventIdealProcessorChanged; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventIdealProcessorChanged, QuicConnectionEventIdealProcessorChanged *) 25 | PNIBufExpand(QuicConnectionEventIdealProcessorChanged, QuicConnectionEventIdealProcessorChanged, 4) 26 | 27 | struct QuicConnectionEventIdealProcessorChanged { 28 | uint16_t IdealProcessor; 29 | uint16_t PartitionIndex; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:074ba5d8b8f9c3fcaace868bc6e7108ec03b46ff6e4a9cb67849bb3dce104435 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicExtraApiTable.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicExtraApiTable */ 3 | #ifndef _Included_io_vproxy_msquic_QuicExtraApiTable 4 | #define _Included_io_vproxy_msquic_QuicExtraApiTable 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(QUIC_EXTRA_API_TABLE, QUIC_EXTRA_API_TABLE *) 22 | PNIBufExpand(QUIC_EXTRA_API_TABLE, QUIC_EXTRA_API_TABLE, (0 /* !!invalid!! */)) 23 | 24 | JNIEXPORT QUIC_STATUS JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_EventLoopThreadDispatcherSet(QUIC_EXTRA_API_TABLE * self, QUIC_EVENT_LOOP_THREAD_DISPATCH_FN dispatcher); 25 | JNIEXPORT QUIC_STATUS JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_ThreadGetCur(QUIC_EXTRA_API_TABLE * self, CXPLAT_THREAD* Thread); 26 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_ThreadSetIsWorker(QUIC_EXTRA_API_TABLE * self, uint8_t isWorker); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif // _Included_io_vproxy_msquic_QuicExtraApiTable 32 | // metadata.generator-version: pni 21.0.0.17 33 | // sha256:88b552741e9d60f48c1477bd5a61d35a59d99354636c31436166531d94cddeb6 34 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicExtraApiTable.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicExtraApiTable */ 3 | #ifndef _Included_io_vproxy_msquic_QuicExtraApiTable 4 | #define _Included_io_vproxy_msquic_QuicExtraApiTable 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | PNIEnvExpand(QUIC_EXTRA_API_TABLE, QUIC_EXTRA_API_TABLE *) 22 | PNIBufExpand(QUIC_EXTRA_API_TABLE, QUIC_EXTRA_API_TABLE, (0 /* !!invalid!! */)) 23 | 24 | JNIEXPORT QUIC_STATUS JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_EventLoopThreadDispatcherSet(QUIC_EXTRA_API_TABLE * self, QUIC_EVENT_LOOP_THREAD_DISPATCH_FN dispatcher); 25 | JNIEXPORT QUIC_STATUS JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_ThreadGetCur(QUIC_EXTRA_API_TABLE * self, CXPLAT_THREAD* Thread); 26 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicExtraApiTable_ThreadSetIsWorker(QUIC_EXTRA_API_TABLE * self, uint8_t isWorker); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif // _Included_io_vproxy_msquic_QuicExtraApiTable 32 | // metadata.generator-version: pni 21.0.0.17 33 | // sha256:88b552741e9d60f48c1477bd5a61d35a59d99354636c31436166531d94cddeb6 34 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventDatagramSendStateChanged; 10 | typedef struct QuicConnectionEventDatagramSendStateChanged QuicConnectionEventDatagramSendStateChanged; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventDatagramSendStateChanged, QuicConnectionEventDatagramSendStateChanged *) 25 | PNIBufExpand(QuicConnectionEventDatagramSendStateChanged, QuicConnectionEventDatagramSendStateChanged, 16) 26 | 27 | struct QuicConnectionEventDatagramSendStateChanged { 28 | void * ClientContext; 29 | int32_t State; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged 36 | // metadata.generator-version: pni 21.0.0.13 37 | // sha256:df95a2329e6acdeeaaee205e54cd018f33ec488219fed60cc5bccefb0d70e947 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventDatagramSendStateChanged; 10 | typedef struct QuicConnectionEventDatagramSendStateChanged QuicConnectionEventDatagramSendStateChanged; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventDatagramSendStateChanged, QuicConnectionEventDatagramSendStateChanged *) 25 | PNIBufExpand(QuicConnectionEventDatagramSendStateChanged, QuicConnectionEventDatagramSendStateChanged, 16) 26 | 27 | struct QuicConnectionEventDatagramSendStateChanged { 28 | void * ClientContext; 29 | int32_t State; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:df95a2329e6acdeeaaee205e54cd018f33ec488219fed60cc5bccefb0d70e947 38 | -------------------------------------------------------------------------------- /template/src/main/java/io/vproxy/msquic/PNIQuicAddr.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic; 2 | 3 | import io.vproxy.pni.annotation.*; 4 | 5 | @Struct(skip = true) 6 | @Include("msquic.h") 7 | @Name("QUIC_ADDR") 8 | @PointerOnly 9 | @Sizeof("QUIC_ADDR") 10 | public abstract class PNIQuicAddr { 11 | @Impl( 12 | // language="c" 13 | c = """ 14 | return QuicAddrGetFamily(self); 15 | """ 16 | ) 17 | @Style(Styles.critical) 18 | abstract int getFamily(); 19 | 20 | @Impl( 21 | // language="c" 22 | c = """ 23 | QuicAddrSetFamily(self, family); 24 | """ 25 | ) 26 | @Style(Styles.critical) 27 | abstract void setFamily(int family); 28 | 29 | @Impl( 30 | // language="c" 31 | c = """ 32 | return QuicAddrGetPort(self); 33 | """ 34 | ) 35 | @Style(Styles.critical) 36 | abstract int getPort(); 37 | 38 | @Impl( 39 | // language="c" 40 | c = """ 41 | QuicAddrSetPort(self, port); 42 | """ 43 | ) 44 | @Style(Styles.critical) 45 | abstract void setPort(int port); 46 | 47 | @Impl( 48 | // language="c" 49 | c = """ 50 | QuicAddrToString(self, (QUIC_ADDR_STR*) str); 51 | """ 52 | ) 53 | @Style(Styles.critical) 54 | abstract void toString(String str); 55 | } 56 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConfiguration.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConfiguration */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConfiguration 4 | #define _Included_io_vproxy_msquic_QuicConfiguration 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConfiguration; 10 | typedef struct QuicConfiguration QuicConfiguration; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicObjectBase.h" 20 | #include "io_vproxy_msquic_QuicCredentialConfig.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | PNIEnvExpand(QuicConfiguration, QuicConfiguration *) 27 | PNIBufExpand(QuicConfiguration, QuicConfiguration, 16) 28 | 29 | struct QuicConfiguration { 30 | QuicObjectBase SUPER; 31 | }; 32 | 33 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicConfiguration_close(QuicConfiguration * self); 34 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicConfiguration_loadCredential(QuicConfiguration * self, QUIC_CREDENTIAL_CONFIG * CredConfig); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | #endif // _Included_io_vproxy_msquic_QuicConfiguration 40 | // metadata.generator-version: pni 21.0.0.17 41 | // sha256:5eba8cf201afbeb2e49bd40e44a7a0618fd711cdecfdbf5c85246d820815660b 42 | -------------------------------------------------------------------------------- /core/src/main/c/inline.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. 4 | Licensed under the MIT License. 5 | 6 | Abstract: 7 | 8 | External definition of C99 inline functions. 9 | See "Clang" / "Language Compatibility" / "C99 inline functions" 10 | ( https://clang.llvm.org/compatibility.html#inline .) 11 | It seems that C99 standard requires that every inline function defined 12 | in a header have a corresponding non-inline definition in a C source file. 13 | Observed behavior is that Clang is enforcing this, but not MSVC. 14 | Until an alternative solution is found, this file is required for Clang. 15 | 16 | --*/ 17 | 18 | #include "msquic.h" 19 | 20 | QUIC_ADDRESS_FAMILY 21 | QuicAddrGetFamily( 22 | _In_ const QUIC_ADDR* const Addr 23 | ); 24 | 25 | void 26 | QuicAddrSetFamily( 27 | _In_ QUIC_ADDR* Addr, 28 | _In_ QUIC_ADDRESS_FAMILY Family 29 | ); 30 | 31 | uint16_t 32 | QuicAddrGetPort( 33 | _In_ const QUIC_ADDR* const Addr 34 | ); 35 | 36 | void 37 | QuicAddrSetPort( 38 | _Out_ QUIC_ADDR* Addr, 39 | _In_ uint16_t Port 40 | ); 41 | 42 | BOOLEAN 43 | QuicAddrFromString( 44 | _In_z_ const char* AddrStr, 45 | _In_ uint16_t Port, // Host byte order 46 | _Out_ QUIC_ADDR* Addr 47 | ); 48 | 49 | BOOLEAN 50 | QuicAddrToString( 51 | _In_ const QUIC_ADDR* Addr, 52 | _Out_ QUIC_ADDR_STR* AddrStr 53 | ); 54 | -------------------------------------------------------------------------------- /template/src/main/java/io/vproxy/msquic/PNIMsQuicValues.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic; 2 | 3 | import io.vproxy.pni.annotation.*; 4 | 5 | @Downcall 6 | @Include("msquic.h") 7 | public interface PNIMsQuicValues { 8 | @Style(Styles.critical) 9 | String QuicStatusString(int status); 10 | 11 | @Impl( 12 | // language="c" 13 | c = """ 14 | return QUIC_STATUS_NOT_SUPPORTED; 15 | """ 16 | ) 17 | @Style(Styles.critical) 18 | int QUIC_STATUS_NOT_SUPPORTED(); 19 | 20 | @Impl( 21 | // language="c" 22 | c = """ 23 | return QUIC_STATUS_PENDING; 24 | """ 25 | ) 26 | @Style(Styles.critical) 27 | int QUIC_STATUS_PENDING(); 28 | 29 | @Impl( 30 | // language="c" 31 | c = """ 32 | return QUIC_ADDRESS_FAMILY_UNSPEC; 33 | """ 34 | ) 35 | @Style(Styles.critical) 36 | int QUIC_ADDRESS_FAMILY_UNSPEC(); 37 | 38 | @Impl( 39 | // language="c" 40 | c = """ 41 | return QUIC_ADDRESS_FAMILY_INET; 42 | """ 43 | ) 44 | @Style(Styles.critical) 45 | int QUIC_ADDRESS_FAMILY_INET(); 46 | 47 | @Impl( 48 | // language="c" 49 | c = """ 50 | return QUIC_ADDRESS_FAMILY_INET6; 51 | """ 52 | ) 53 | @Style(Styles.critical) 54 | int QUIC_ADDRESS_FAMILY_INET6(); 55 | } 56 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConfiguration.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConfiguration */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConfiguration 4 | #define _Included_io_vproxy_msquic_QuicConfiguration 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConfiguration; 10 | typedef struct QuicConfiguration QuicConfiguration; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicObjectBase.h" 20 | #include "io_vproxy_msquic_QuicCredentialConfig.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | PNIEnvExpand(QuicConfiguration, QuicConfiguration *) 27 | PNIBufExpand(QuicConfiguration, QuicConfiguration, 16) 28 | 29 | struct QuicConfiguration { 30 | QuicObjectBase SUPER; 31 | }; 32 | 33 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicConfiguration_close(QuicConfiguration * self); 34 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicConfiguration_loadCredential(QuicConfiguration * self, QUIC_CREDENTIAL_CONFIG * CredConfig); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | #endif // _Included_io_vproxy_msquic_QuicConfiguration 40 | // metadata.generator-version: pni 21.0.0.17 41 | // sha256:5eba8cf201afbeb2e49bd40e44a7a0618fd711cdecfdbf5c85246d820815660b 42 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventResumptionTicketReceived; 10 | typedef struct QuicConnectionEventResumptionTicketReceived QuicConnectionEventResumptionTicketReceived; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventResumptionTicketReceived, QuicConnectionEventResumptionTicketReceived *) 25 | PNIBufExpand(QuicConnectionEventResumptionTicketReceived, QuicConnectionEventResumptionTicketReceived, 16) 26 | 27 | struct QuicConnectionEventResumptionTicketReceived { 28 | uint32_t ResumptionTicketLength; 29 | void * ResumptionTicket; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived 36 | // metadata.generator-version: pni 21.0.0.13 37 | // sha256:07c1c6eff3b9b163d144cc28be435f0ce75ebda8c0548a67d52e11bb9dc74561 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventResumptionTicketReceived; 10 | typedef struct QuicConnectionEventResumptionTicketReceived QuicConnectionEventResumptionTicketReceived; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventResumptionTicketReceived, QuicConnectionEventResumptionTicketReceived *) 25 | PNIBufExpand(QuicConnectionEventResumptionTicketReceived, QuicConnectionEventResumptionTicketReceived, 16) 26 | 27 | struct QuicConnectionEventResumptionTicketReceived { 28 | uint32_t ResumptionTicketLength; 29 | void * ResumptionTicket; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:07c1c6eff3b9b163d144cc28be435f0ce75ebda8c0548a67d52e11bb9dc74561 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/pni.c: -------------------------------------------------------------------------------- 1 | #include "pni.h" 2 | 3 | #if PNI_GRAAL 4 | 5 | static __thread void* _graalThread; 6 | static void* _graalIsolate; 7 | 8 | JNIEXPORT void JNICALL SetPNIGraalThread(void* thread) { 9 | _graalThread = thread; 10 | } 11 | 12 | JNIEXPORT void* JNICALL GetPNIGraalThread(void) { 13 | return _graalThread; 14 | } 15 | 16 | JNIEXPORT void JNICALL SetPNIGraalIsolate(void* isolate) { 17 | _graalIsolate = isolate; 18 | } 19 | 20 | JNIEXPORT void* JNICALL GetPNIGraalIsolate(void) { 21 | return _graalIsolate; 22 | } 23 | 24 | #endif // PNI_GRAAL 25 | 26 | static PNIFuncInvokeFunc _PNIFuncInvokeFunc; 27 | 28 | JNIEXPORT PNIFuncInvokeFunc JNICALL GetPNIFuncInvokeFunc(void) { 29 | return _PNIFuncInvokeFunc; 30 | } 31 | JNIEXPORT void JNICALL SetPNIFuncInvokeFunc(PNIFuncInvokeFunc f) { 32 | _PNIFuncInvokeFunc = f; 33 | } 34 | 35 | static PNIFuncReleaseFunc _PNIFuncReleaseFunc; 36 | 37 | JNIEXPORT PNIFuncReleaseFunc JNICALL GetPNIFuncReleaseFunc(void) { 38 | return _PNIFuncReleaseFunc; 39 | } 40 | JNIEXPORT void JNICALL SetPNIFuncReleaseFunc(PNIFuncReleaseFunc f) { 41 | _PNIFuncReleaseFunc = f; 42 | } 43 | 44 | static PNIRefReleaseFunc _PNIRefReleaseFunc; 45 | 46 | JNIEXPORT PNIRefReleaseFunc JNICALL GetPNIRefReleaseFunc(void) { 47 | return _PNIRefReleaseFunc; 48 | } 49 | JNIEXPORT void JNICALL SetPNIRefReleaseFunc(PNIRefReleaseFunc f) { 50 | _PNIRefReleaseFunc = f; 51 | } 52 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/pni.c: -------------------------------------------------------------------------------- 1 | #include "pni.h" 2 | 3 | #if PNI_GRAAL 4 | 5 | static __thread void* _graalThread; 6 | static void* _graalIsolate; 7 | 8 | JNIEXPORT void JNICALL SetPNIGraalThread(void* thread) { 9 | _graalThread = thread; 10 | } 11 | 12 | JNIEXPORT void* JNICALL GetPNIGraalThread(void) { 13 | return _graalThread; 14 | } 15 | 16 | JNIEXPORT void JNICALL SetPNIGraalIsolate(void* isolate) { 17 | _graalIsolate = isolate; 18 | } 19 | 20 | JNIEXPORT void* JNICALL GetPNIGraalIsolate(void) { 21 | return _graalIsolate; 22 | } 23 | 24 | #endif // PNI_GRAAL 25 | 26 | static PNIFuncInvokeFunc _PNIFuncInvokeFunc; 27 | 28 | JNIEXPORT PNIFuncInvokeFunc JNICALL GetPNIFuncInvokeFunc(void) { 29 | return _PNIFuncInvokeFunc; 30 | } 31 | JNIEXPORT void JNICALL SetPNIFuncInvokeFunc(PNIFuncInvokeFunc f) { 32 | _PNIFuncInvokeFunc = f; 33 | } 34 | 35 | static PNIFuncReleaseFunc _PNIFuncReleaseFunc; 36 | 37 | JNIEXPORT PNIFuncReleaseFunc JNICALL GetPNIFuncReleaseFunc(void) { 38 | return _PNIFuncReleaseFunc; 39 | } 40 | JNIEXPORT void JNICALL SetPNIFuncReleaseFunc(PNIFuncReleaseFunc f) { 41 | _PNIFuncReleaseFunc = f; 42 | } 43 | 44 | static PNIRefReleaseFunc _PNIRefReleaseFunc; 45 | 46 | JNIEXPORT PNIRefReleaseFunc JNICALL GetPNIRefReleaseFunc(void) { 47 | return _PNIRefReleaseFunc; 48 | } 49 | JNIEXPORT void JNICALL SetPNIRefReleaseFunc(PNIRefReleaseFunc f) { 50 | _PNIRefReleaseFunc = f; 51 | } 52 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventShutdownInitiatedByTransport; 10 | typedef struct QuicConnectionEventShutdownInitiatedByTransport QuicConnectionEventShutdownInitiatedByTransport; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventShutdownInitiatedByTransport, QuicConnectionEventShutdownInitiatedByTransport *) 25 | PNIBufExpand(QuicConnectionEventShutdownInitiatedByTransport, QuicConnectionEventShutdownInitiatedByTransport, 16) 26 | 27 | struct QuicConnectionEventShutdownInitiatedByTransport { 28 | int32_t Status; 29 | int64_t ErrorCode; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport 36 | // metadata.generator-version: pni 21.0.0.13 37 | // sha256:4d75e95100db5b28d42e6e5908effb6442f9ae8e617b016210aaaaf317b3fa3d 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventShutdownInitiatedByTransport; 10 | typedef struct QuicConnectionEventShutdownInitiatedByTransport QuicConnectionEventShutdownInitiatedByTransport; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventShutdownInitiatedByTransport, QuicConnectionEventShutdownInitiatedByTransport *) 25 | PNIBufExpand(QuicConnectionEventShutdownInitiatedByTransport, QuicConnectionEventShutdownInitiatedByTransport, 16) 26 | 27 | struct QuicConnectionEventShutdownInitiatedByTransport { 28 | int32_t Status; 29 | int64_t ErrorCode; 30 | }; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:4d75e95100db5b28d42e6e5908effb6442f9ae8e617b016210aaaaf317b3fa3d 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventPeerCertificateReceived; 10 | typedef struct QuicConnectionEventPeerCertificateReceived QuicConnectionEventPeerCertificateReceived; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventPeerCertificateReceived, QuicConnectionEventPeerCertificateReceived *) 25 | PNIBufExpand(QuicConnectionEventPeerCertificateReceived, QuicConnectionEventPeerCertificateReceived, 24) 26 | 27 | struct QuicConnectionEventPeerCertificateReceived { 28 | void * Certificate; 29 | uint32_t DeferredErrorFlags; 30 | int32_t DeferredStatus; 31 | void * Chain; 32 | }; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived 38 | // metadata.generator-version: pni 21.0.0.13 39 | // sha256:de4be49e89e23fd57db6d02f3be66a4a8bdfe36b80f6cfc718501b1f7a8f5cde 40 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventPeerCertificateReceived; 10 | typedef struct QuicConnectionEventPeerCertificateReceived QuicConnectionEventPeerCertificateReceived; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventPeerCertificateReceived, QuicConnectionEventPeerCertificateReceived *) 25 | PNIBufExpand(QuicConnectionEventPeerCertificateReceived, QuicConnectionEventPeerCertificateReceived, 24) 26 | 27 | struct QuicConnectionEventPeerCertificateReceived { 28 | void * Certificate; 29 | uint32_t DeferredErrorFlags; 30 | int32_t DeferredStatus; 31 | void * Chain; 32 | }; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived 38 | // metadata.generator-version: pni 21.0.0.16 39 | // sha256:de4be49e89e23fd57db6d02f3be66a4a8bdfe36b80f6cfc718501b1f7a8f5cde 40 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicStreamEventShutdownComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventShutdownComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventShutdownComplete 4 | #define _Included_io_vproxy_msquic_QuicStreamEventShutdownComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventShutdownComplete; 10 | typedef struct QuicStreamEventShutdownComplete QuicStreamEventShutdownComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventShutdownComplete, QuicStreamEventShutdownComplete *) 25 | PNIBufExpand(QuicStreamEventShutdownComplete, QuicStreamEventShutdownComplete, 24) 26 | 27 | struct QuicStreamEventShutdownComplete { 28 | uint8_t ConnectionShutdown; 29 | uint8_t AppCloseInProgress : 1; 30 | uint8_t ConnectionShutdownByApp : 1; 31 | uint8_t ConnectionClosedRemotely : 1; 32 | uint8_t : 5; 33 | 34 | int64_t ConnectionErrorCode; 35 | int32_t ConnectionCloseStatus; 36 | }; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif // _Included_io_vproxy_msquic_QuicStreamEventShutdownComplete 42 | // metadata.generator-version: pni 21.0.0.13 43 | // sha256:2b5e9b6e869c3af51c69d86b926203e6bb932e3bd52de7885106933f05f16b84 44 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicStreamEventShutdownComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStreamEventShutdownComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStreamEventShutdownComplete 4 | #define _Included_io_vproxy_msquic_QuicStreamEventShutdownComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStreamEventShutdownComplete; 10 | typedef struct QuicStreamEventShutdownComplete QuicStreamEventShutdownComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicStreamEventShutdownComplete, QuicStreamEventShutdownComplete *) 25 | PNIBufExpand(QuicStreamEventShutdownComplete, QuicStreamEventShutdownComplete, 24) 26 | 27 | struct QuicStreamEventShutdownComplete { 28 | uint8_t ConnectionShutdown; 29 | uint8_t AppCloseInProgress : 1; 30 | uint8_t ConnectionShutdownByApp : 1; 31 | uint8_t ConnectionClosedRemotely : 1; 32 | uint8_t : 5; 33 | 34 | int64_t ConnectionErrorCode; 35 | int32_t ConnectionCloseStatus; 36 | }; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif // _Included_io_vproxy_msquic_QuicStreamEventShutdownComplete 42 | // metadata.generator-version: pni 21.0.0.16 43 | // sha256:2b5e9b6e869c3af51c69d86b926203e6bb932e3bd52de7885106933f05f16b84 44 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicAddr.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicAddr */ 3 | #ifndef _Included_io_vproxy_msquic_QuicAddr 4 | #define _Included_io_vproxy_msquic_QuicAddr 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | JNIEXPORT size_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr___getLayoutByteSize(); 22 | 23 | PNIEnvExpand(QUIC_ADDR, QUIC_ADDR *) 24 | PNIBufExpand(QUIC_ADDR, QUIC_ADDR, JavaCritical_io_vproxy_msquic_QuicAddr___getLayoutByteSize()) 25 | 26 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_getFamily(QUIC_ADDR * self); 27 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_setFamily(QUIC_ADDR * self, int32_t family); 28 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_getPort(QUIC_ADDR * self); 29 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_setPort(QUIC_ADDR * self, int32_t port); 30 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_toString(QUIC_ADDR * self, char * str); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicAddr 36 | // metadata.generator-version: pni 21.0.0.12 37 | // sha256:783b22f6cd7c46485cf8e8b49ffa44ef72ab60c31a3a3342b35f0045e0c85f36 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicAddr.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicAddr */ 3 | #ifndef _Included_io_vproxy_msquic_QuicAddr 4 | #define _Included_io_vproxy_msquic_QuicAddr 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | JNIEXPORT size_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr___getLayoutByteSize(); 22 | 23 | PNIEnvExpand(QUIC_ADDR, QUIC_ADDR *) 24 | PNIBufExpand(QUIC_ADDR, QUIC_ADDR, JavaCritical_io_vproxy_msquic_QuicAddr___getLayoutByteSize()) 25 | 26 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_getFamily(QUIC_ADDR * self); 27 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_setFamily(QUIC_ADDR * self, int32_t family); 28 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_getPort(QUIC_ADDR * self); 29 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_setPort(QUIC_ADDR * self, int32_t port); 30 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicAddr_toString(QUIC_ADDR * self, char * str); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif // _Included_io_vproxy_msquic_QuicAddr 36 | // metadata.generator-version: pni 21.0.0.16 37 | // sha256:783b22f6cd7c46485cf8e8b49ffa44ef72ab60c31a3a3342b35f0045e0c85f36 38 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicListener.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicListener */ 3 | #ifndef _Included_io_vproxy_msquic_QuicListener 4 | #define _Included_io_vproxy_msquic_QuicListener 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicListener; 10 | typedef struct QuicListener QuicListener; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicObjectBase.h" 20 | #include "io_vproxy_msquic_QuicBuffer.h" 21 | #include "io_vproxy_msquic_QuicAddr.h" 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | PNIEnvExpand(QuicListener, QuicListener *) 28 | PNIBufExpand(QuicListener, QuicListener, 16) 29 | 30 | struct QuicListener { 31 | QuicObjectBase SUPER; 32 | }; 33 | 34 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicListener_close(QuicListener * self); 35 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicListener_start(QuicListener * self, QUIC_BUFFER * AlpnBuffers, int32_t AlpnBufferCount, QUIC_ADDR * Addr); 36 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicListener_stop(QuicListener * self); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif // _Included_io_vproxy_msquic_QuicListener 42 | // metadata.generator-version: pni 21.0.0.17 43 | // sha256:bb27eaac2026863e730e8c013663340cc0891d641144ee05427af26655c381f8 44 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicListener.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicListener */ 3 | #ifndef _Included_io_vproxy_msquic_QuicListener 4 | #define _Included_io_vproxy_msquic_QuicListener 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicListener; 10 | typedef struct QuicListener QuicListener; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicObjectBase.h" 20 | #include "io_vproxy_msquic_QuicBuffer.h" 21 | #include "io_vproxy_msquic_QuicAddr.h" 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | PNIEnvExpand(QuicListener, QuicListener *) 28 | PNIBufExpand(QuicListener, QuicListener, 16) 29 | 30 | struct QuicListener { 31 | QuicObjectBase SUPER; 32 | }; 33 | 34 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicListener_close(QuicListener * self); 35 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicListener_start(QuicListener * self, QUIC_BUFFER * AlpnBuffers, int32_t AlpnBufferCount, QUIC_ADDR * Addr); 36 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicListener_stop(QuicListener * self); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif // _Included_io_vproxy_msquic_QuicListener 42 | // metadata.generator-version: pni 21.0.0.17 43 | // sha256:bb27eaac2026863e730e8c013663340cc0891d641144ee05427af26655c381f8 44 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventConnectionShutdownComplete; 10 | typedef struct QuicConnectionEventConnectionShutdownComplete QuicConnectionEventConnectionShutdownComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventConnectionShutdownComplete, QuicConnectionEventConnectionShutdownComplete *) 25 | PNIBufExpand(QuicConnectionEventConnectionShutdownComplete, QuicConnectionEventConnectionShutdownComplete, 1) 26 | 27 | struct QuicConnectionEventConnectionShutdownComplete { 28 | uint8_t HandshakeCompleted : 1; 29 | uint8_t PeerAcknowledgedShutdown : 1; 30 | uint8_t AppCloseInProgress : 1; 31 | uint8_t : 5; 32 | 33 | }; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete 39 | // metadata.generator-version: pni 21.0.0.13 40 | // sha256:9d6ee096840f897117207516aedbd52141fc0494e6c16bd7b3cf89279aef3d85 41 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicConnectionEventConnectionShutdownComplete; 10 | typedef struct QuicConnectionEventConnectionShutdownComplete QuicConnectionEventConnectionShutdownComplete; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | PNIEnvExpand(QuicConnectionEventConnectionShutdownComplete, QuicConnectionEventConnectionShutdownComplete *) 25 | PNIBufExpand(QuicConnectionEventConnectionShutdownComplete, QuicConnectionEventConnectionShutdownComplete, 1) 26 | 27 | struct QuicConnectionEventConnectionShutdownComplete { 28 | uint8_t HandshakeCompleted : 1; 29 | uint8_t PeerAcknowledgedShutdown : 1; 30 | uint8_t AppCloseInProgress : 1; 31 | uint8_t : 5; 32 | 33 | }; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete 39 | // metadata.generator-version: pni 21.0.0.16 40 | // sha256:9d6ee096840f897117207516aedbd52141fc0494e6c16bd7b3cf89279aef3d85 41 | -------------------------------------------------------------------------------- /core/src/main/java/io/vproxy/msquic/wrap/ApiTable.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.wrap; 2 | 3 | import io.vproxy.msquic.QuicApiTable; 4 | import io.vproxy.pni.Allocator; 5 | 6 | import java.util.concurrent.atomic.AtomicBoolean; 7 | 8 | public class ApiTable { 9 | public final Options opts; 10 | 11 | public ApiTable(Options opts) { 12 | this.opts = opts; 13 | } 14 | 15 | public static class OptionsBase { 16 | public final QuicApiTable apiTableQ; 17 | 18 | public OptionsBase(QuicApiTable apiTableQ) { 19 | this.apiTableQ = apiTableQ; 20 | } 21 | 22 | public OptionsBase(OptionsBase opts) { 23 | this.apiTableQ = opts.apiTableQ; 24 | } 25 | } 26 | 27 | public static class Options extends OptionsBase { 28 | private final Allocator allocator; 29 | 30 | public Options(QuicApiTable apiTableQ, Allocator allocator) { 31 | super(apiTableQ); 32 | this.allocator = allocator; 33 | } 34 | } 35 | 36 | private final AtomicBoolean closed = new AtomicBoolean(false); 37 | 38 | public boolean isClosed() { 39 | return closed.get(); 40 | } 41 | 42 | public void close() { 43 | if (opts.allocator == null) { 44 | return; // silently swallow because it's not allowed to be closed 45 | } 46 | 47 | if (closed.get()) { 48 | return; 49 | } 50 | if (!closed.compareAndSet(false, true)) { 51 | return; 52 | } 53 | 54 | opts.apiTableQ.close(); 55 | opts.allocator.close(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sample/src/main/java/io/vproxy/msquic/sample/MsQuicModUpcallImpl.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.sample; 2 | 3 | import io.vproxy.base.util.Logger; 4 | import io.vproxy.msquic.CXPLAT_THREAD_CONFIG; 5 | import io.vproxy.msquic.MsQuicMod; 6 | import io.vproxy.msquic.MsQuicModUpcall; 7 | import io.vproxy.msquic.wrap.ApiExtraTables; 8 | import io.vproxy.pni.graal.GraalUtils; 9 | 10 | import java.lang.foreign.MemorySegment; 11 | import java.util.concurrent.CountDownLatch; 12 | 13 | public class MsQuicModUpcallImpl implements MsQuicModUpcall.Interface { 14 | private static final MsQuicModUpcallImpl INST = new MsQuicModUpcallImpl(); 15 | 16 | private MsQuicModUpcallImpl() { 17 | } 18 | 19 | public static MsQuicModUpcallImpl get() { 20 | return INST; 21 | } 22 | 23 | @Override 24 | public int dispatch(CXPLAT_THREAD_CONFIG Config, MemorySegment EventQ, MemorySegment Thread, MemorySegment Context) { 25 | var cb = Config.getCallback(); 26 | var ctx = Config.getContext(); 27 | 28 | var latch = new CountDownLatch(1); 29 | 30 | new Thread(() -> { 31 | GraalUtils.setThread(); 32 | Logger.alert("new msquic thread spawn: " + java.lang.Thread.currentThread()); 33 | 34 | ApiExtraTables.V2EXTRA.ThreadGetCur(Thread); 35 | latch.countDown(); 36 | 37 | ApiExtraTables.V2EXTRA.ThreadSetIsWorker(true); 38 | MsQuicMod.get().INVOKE_LPTHREAD_START_ROUTINE(cb, ctx); 39 | }).start(); 40 | 41 | try { 42 | latch.await(); 43 | } catch (InterruptedException _) { 44 | } 45 | 46 | return 0; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /core/src/main/java/io/vproxy/msquic/wrap/Configuration.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.wrap; 2 | 3 | import io.vproxy.msquic.QuicConfiguration; 4 | import io.vproxy.pni.Allocator; 5 | 6 | import java.util.concurrent.atomic.AtomicBoolean; 7 | 8 | public class Configuration { 9 | public final Options opts; 10 | 11 | public Configuration(Options opts) { 12 | this.opts = opts; 13 | } 14 | 15 | public static class OptionsBase extends Registration.OptionsBase { 16 | public final Registration registration; 17 | public final QuicConfiguration configurationQ; 18 | 19 | public OptionsBase(Registration registration, QuicConfiguration configurationQ) { 20 | super(registration.opts); 21 | this.registration = registration; 22 | this.configurationQ = configurationQ; 23 | } 24 | } 25 | 26 | public static class Options extends OptionsBase { 27 | private final Allocator allocator; 28 | 29 | public Options(Registration registration, QuicConfiguration configurationQ, Allocator allocator) { 30 | super(registration, configurationQ); 31 | this.allocator = allocator; 32 | } 33 | } 34 | 35 | private final AtomicBoolean closed = new AtomicBoolean(false); 36 | 37 | public boolean isClosed() { 38 | return closed.get(); 39 | } 40 | 41 | public void close() { 42 | if (closed.get()) { 43 | return; 44 | } 45 | if (!closed.compareAndSet(false, true)) { 46 | return; 47 | } 48 | 49 | opts.configurationQ.close(); 50 | opts.allocator.close(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicObjectBase.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicObjectBase */ 3 | #ifndef _Included_io_vproxy_msquic_QuicObjectBase 4 | #define _Included_io_vproxy_msquic_QuicObjectBase 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicObjectBase; 10 | typedef struct QuicObjectBase QuicObjectBase; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | PNIEnvExpand(QuicObjectBase, QuicObjectBase *) 24 | PNIBufExpand(QuicObjectBase, QuicObjectBase, 16) 25 | 26 | struct QuicObjectBase { 27 | void * Api; 28 | void * Handle; 29 | }; 30 | 31 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setContext(QuicObjectBase * self, void * Context); 32 | JNIEXPORT void * JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_getContext(QuicObjectBase * self); 33 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setCallbackHandler(QuicObjectBase * self, void * Handler, void * Context); 34 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setParam(QuicObjectBase * self, int32_t Param, int32_t BufferLength, void * Buffer); 35 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_getParam(QuicObjectBase * self, int32_t Param, uint32_t * BufferLength, void * Buffer); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif // _Included_io_vproxy_msquic_QuicObjectBase 41 | // metadata.generator-version: pni 21.0.0.17 42 | // sha256:4788952c2e303cb0a481b5b30d8960f106fdb4117e713c25de974e12dc3e8a40 43 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicObjectBase.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicObjectBase */ 3 | #ifndef _Included_io_vproxy_msquic_QuicObjectBase 4 | #define _Included_io_vproxy_msquic_QuicObjectBase 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicObjectBase; 10 | typedef struct QuicObjectBase QuicObjectBase; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | PNIEnvExpand(QuicObjectBase, QuicObjectBase *) 24 | PNIBufExpand(QuicObjectBase, QuicObjectBase, 16) 25 | 26 | struct QuicObjectBase { 27 | void * Api; 28 | void * Handle; 29 | }; 30 | 31 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setContext(QuicObjectBase * self, void * Context); 32 | JNIEXPORT void * JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_getContext(QuicObjectBase * self); 33 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setCallbackHandler(QuicObjectBase * self, void * Handler, void * Context); 34 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setParam(QuicObjectBase * self, int32_t Param, int32_t BufferLength, void * Buffer); 35 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_getParam(QuicObjectBase * self, int32_t Param, uint32_t * BufferLength, void * Buffer); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif // _Included_io_vproxy_msquic_QuicObjectBase 41 | // metadata.generator-version: pni 21.0.0.17 42 | // sha256:4788952c2e303cb0a481b5b30d8960f106fdb4117e713c25de974e12dc3e8a40 43 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicApiTable.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicApiTable */ 3 | #ifndef _Included_io_vproxy_msquic_QuicApiTable 4 | #define _Included_io_vproxy_msquic_QuicApiTable 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicApiTable; 10 | typedef struct QuicApiTable QuicApiTable; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicRegistration.h" 20 | #include "io_vproxy_msquic_QuicRegistrationConfig.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | PNIEnvExpand(QuicApiTable, QuicApiTable *) 27 | PNIBufExpand(QuicApiTable, QuicApiTable, 8) 28 | 29 | struct QuicApiTable { 30 | void * Api; 31 | }; 32 | 33 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_close(QuicApiTable * self); 34 | JNIEXPORT QuicRegistration * JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_openRegistration(QuicApiTable * self, QUIC_REGISTRATION_CONFIG * Config, int32_t * returnStatus, QuicRegistration * return_); 35 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_setParam(QuicApiTable * self, int32_t Param, int32_t BufferLength, void * Buffer); 36 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_getParam(QuicApiTable * self, int32_t Param, uint32_t * BufferLength, void * Buffer); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif // _Included_io_vproxy_msquic_QuicApiTable 42 | // metadata.generator-version: pni 21.0.0.17 43 | // sha256:2dc95111bb531f4162b40472e77298a9eec4918f39f0eea989fc83852f611ccc 44 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicApiTable.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicApiTable */ 3 | #ifndef _Included_io_vproxy_msquic_QuicApiTable 4 | #define _Included_io_vproxy_msquic_QuicApiTable 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicApiTable; 10 | typedef struct QuicApiTable QuicApiTable; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicRegistration.h" 20 | #include "io_vproxy_msquic_QuicRegistrationConfig.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | PNIEnvExpand(QuicApiTable, QuicApiTable *) 27 | PNIBufExpand(QuicApiTable, QuicApiTable, 8) 28 | 29 | struct QuicApiTable { 30 | void * Api; 31 | }; 32 | 33 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_close(QuicApiTable * self); 34 | JNIEXPORT QuicRegistration * JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_openRegistration(QuicApiTable * self, QUIC_REGISTRATION_CONFIG * Config, int32_t * returnStatus, QuicRegistration * return_); 35 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_setParam(QuicApiTable * self, int32_t Param, int32_t BufferLength, void * Buffer); 36 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_getParam(QuicApiTable * self, int32_t Param, uint32_t * BufferLength, void * Buffer); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif // _Included_io_vproxy_msquic_QuicApiTable 42 | // metadata.generator-version: pni 21.0.0.17 43 | // sha256:2dc95111bb531f4162b40472e77298a9eec4918f39f0eea989fc83852f611ccc 44 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicObjectBase.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicObjectBase.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setContext(QuicObjectBase * self, void * Context) { 8 | QUIC_API_TABLE* api = self->Api; 9 | api->SetContext(self->Handle, Context); 10 | } 11 | 12 | JNIEXPORT void * JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_getContext(QuicObjectBase * self) { 13 | QUIC_API_TABLE* api = self->Api; 14 | return api->GetContext(self->Handle); 15 | } 16 | 17 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setCallbackHandler(QuicObjectBase * self, void * Handler, void * Context) { 18 | QUIC_API_TABLE* api = self->Api; 19 | api->SetCallbackHandler(self->Handle, Handler, Context); 20 | } 21 | 22 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setParam(QuicObjectBase * self, int32_t Param, int32_t BufferLength, void * Buffer) { 23 | QUIC_API_TABLE* api = self->Api; 24 | QUIC_STATUS res = api->SetParam(self->Handle, Param, BufferLength, Buffer); 25 | if (QUIC_SUCCEEDED(res)) { 26 | return 0; 27 | } 28 | return res; 29 | } 30 | 31 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_getParam(QuicObjectBase * self, int32_t Param, uint32_t * BufferLength, void * Buffer) { 32 | QUIC_API_TABLE* api = self->Api; 33 | QUIC_STATUS res = api->GetParam(self->Handle, Param, BufferLength, Buffer); 34 | if (QUIC_SUCCEEDED(res)) { 35 | return 0; 36 | } 37 | return res; 38 | } 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | // metadata.generator-version: pni 21.0.0.17 44 | // sha256:f992bdb5ecc1d314ab511242caaed1e36f9c43bb0efa82f8cc34493e22b9815b 45 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicObjectBase.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicObjectBase.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setContext(QuicObjectBase * self, void * Context) { 8 | QUIC_API_TABLE* api = self->Api; 9 | api->SetContext(self->Handle, Context); 10 | } 11 | 12 | JNIEXPORT void * JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_getContext(QuicObjectBase * self) { 13 | QUIC_API_TABLE* api = self->Api; 14 | return api->GetContext(self->Handle); 15 | } 16 | 17 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setCallbackHandler(QuicObjectBase * self, void * Handler, void * Context) { 18 | QUIC_API_TABLE* api = self->Api; 19 | api->SetCallbackHandler(self->Handle, Handler, Context); 20 | } 21 | 22 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_setParam(QuicObjectBase * self, int32_t Param, int32_t BufferLength, void * Buffer) { 23 | QUIC_API_TABLE* api = self->Api; 24 | QUIC_STATUS res = api->SetParam(self->Handle, Param, BufferLength, Buffer); 25 | if (QUIC_SUCCEEDED(res)) { 26 | return 0; 27 | } 28 | return res; 29 | } 30 | 31 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicObjectBase_getParam(QuicObjectBase * self, int32_t Param, uint32_t * BufferLength, void * Buffer) { 32 | QUIC_API_TABLE* api = self->Api; 33 | QUIC_STATUS res = api->GetParam(self->Handle, Param, BufferLength, Buffer); 34 | if (QUIC_SUCCEEDED(res)) { 35 | return 0; 36 | } 37 | return res; 38 | } 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | // metadata.generator-version: pni 21.0.0.17 44 | // sha256:f992bdb5ecc1d314ab511242caaed1e36f9c43bb0efa82f8cc34493e22b9815b 45 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicStream.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStream */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStream 4 | #define _Included_io_vproxy_msquic_QuicStream 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStream; 10 | typedef struct QuicStream QuicStream; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicObjectBase.h" 20 | #include "io_vproxy_msquic_QuicBuffer.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | PNIEnvExpand(QuicStream, QuicStream *) 27 | PNIBufExpand(QuicStream, QuicStream, 16) 28 | 29 | struct QuicStream { 30 | QuicObjectBase SUPER; 31 | }; 32 | 33 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicStream_close(QuicStream * self); 34 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicStream_start(QuicStream * self, int32_t Flags); 35 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicStream_shutdown(QuicStream * self, int32_t Flags, int64_t ErrorCode); 36 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicStream_send(QuicStream * self, QUIC_BUFFER * Buffers, int32_t BufferCount, int32_t Flags, void * ClientSendContext); 37 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicStream_receiveComplete(QuicStream * self, int64_t BufferLength); 38 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicStream_receiveSetEnabled(QuicStream * self, uint8_t IsEnabled); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | #endif // _Included_io_vproxy_msquic_QuicStream 44 | // metadata.generator-version: pni 21.0.0.17 45 | // sha256:f98d393cf9de31f6ce4230f96d24b53af00101c28551b7dbf7b3129cc7ffd1c8 46 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicStream.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicStream */ 3 | #ifndef _Included_io_vproxy_msquic_QuicStream 4 | #define _Included_io_vproxy_msquic_QuicStream 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | struct QuicStream; 10 | typedef struct QuicStream QuicStream; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #include 17 | #include 18 | #include "msquic.h" 19 | #include "io_vproxy_msquic_QuicObjectBase.h" 20 | #include "io_vproxy_msquic_QuicBuffer.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | PNIEnvExpand(QuicStream, QuicStream *) 27 | PNIBufExpand(QuicStream, QuicStream, 16) 28 | 29 | struct QuicStream { 30 | QuicObjectBase SUPER; 31 | }; 32 | 33 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicStream_close(QuicStream * self); 34 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicStream_start(QuicStream * self, int32_t Flags); 35 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicStream_shutdown(QuicStream * self, int32_t Flags, int64_t ErrorCode); 36 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicStream_send(QuicStream * self, QUIC_BUFFER * Buffers, int32_t BufferCount, int32_t Flags, void * ClientSendContext); 37 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicStream_receiveComplete(QuicStream * self, int64_t BufferLength); 38 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicStream_receiveSetEnabled(QuicStream * self, uint8_t IsEnabled); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | #endif // _Included_io_vproxy_msquic_QuicStream 44 | // metadata.generator-version: pni 21.0.0.17 45 | // sha256:f98d393cf9de31f6ce4230f96d24b53af00101c28551b7dbf7b3129cc7ffd1c8 46 | -------------------------------------------------------------------------------- /core/src/main/java/io/vproxy/msquic/wrap/Registration.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.wrap; 2 | 3 | import io.vproxy.msquic.QuicRegistration; 4 | import io.vproxy.pni.Allocator; 5 | 6 | import java.util.concurrent.atomic.AtomicBoolean; 7 | 8 | public class Registration { 9 | public final Options opts; 10 | 11 | public Registration(Options opts) { 12 | this.opts = opts; 13 | } 14 | 15 | public static class OptionsBase extends ApiTable.OptionsBase { 16 | public final ApiTable apiTable; 17 | public final QuicRegistration registrationQ; 18 | 19 | public OptionsBase(ApiTable apiTable, QuicRegistration registrationQ) { 20 | super(apiTable.opts); 21 | this.apiTable = apiTable; 22 | this.registrationQ = registrationQ; 23 | } 24 | 25 | public OptionsBase(OptionsBase opts) { 26 | super(opts); 27 | this.apiTable = opts.apiTable; 28 | this.registrationQ = opts.registrationQ; 29 | } 30 | } 31 | 32 | public static class Options extends OptionsBase { 33 | private final Allocator allocator; 34 | 35 | public Options(ApiTable apiTable, QuicRegistration registrationQ, Allocator allocator) { 36 | super(apiTable, registrationQ); 37 | this.allocator = allocator; 38 | } 39 | } 40 | 41 | private final AtomicBoolean closed = new AtomicBoolean(false); 42 | 43 | public boolean isClosed() { 44 | return closed.get(); 45 | } 46 | 47 | public void close() { 48 | if (closed.get()) { 49 | return; 50 | } 51 | if (!closed.compareAndSet(false, true)) { 52 | return; 53 | } 54 | 55 | opts.registrationQ.close(); 56 | opts.allocator.close(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicApiTable.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicApiTable.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_close(QuicApiTable * self) { 8 | QUIC_API_TABLE* api = self->Api; 9 | MsQuicClose(api); 10 | } 11 | 12 | JNIEXPORT QuicRegistration * JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_openRegistration(QuicApiTable * self, QUIC_REGISTRATION_CONFIG * Config, int32_t * returnStatus, QuicRegistration * return_) { 13 | QUIC_API_TABLE* api = self->Api; 14 | HQUIC h; 15 | QUIC_STATUS res = api->RegistrationOpen(Config, &h); 16 | if (returnStatus != NULL) 17 | *returnStatus = res; 18 | if (QUIC_SUCCEEDED(res)) { 19 | return_->SUPER.Api = api; 20 | return_->SUPER.Handle = h; 21 | return return_; 22 | } 23 | return NULL; 24 | } 25 | 26 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_setParam(QuicApiTable * self, int32_t Param, int32_t BufferLength, void * Buffer) { 27 | QUIC_API_TABLE* api = self->Api; 28 | QUIC_STATUS res = api->SetParam(NULL, Param, BufferLength, Buffer); 29 | if (QUIC_SUCCEEDED(res)) { 30 | return 0; 31 | } 32 | return res; 33 | } 34 | 35 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_getParam(QuicApiTable * self, int32_t Param, uint32_t * BufferLength, void * Buffer) { 36 | QUIC_API_TABLE* api = self->Api; 37 | QUIC_STATUS res = api->GetParam(NULL, Param, BufferLength, Buffer); 38 | if (QUIC_SUCCEEDED(res)) { 39 | return 0; 40 | } 41 | return res; 42 | } 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | // metadata.generator-version: pni 21.0.0.17 48 | // sha256:4b5289240e0eac2bdd05843044257f09fc1709a09c79f541e851dc9ef5b8a0d6 49 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicApiTable.impl.h: -------------------------------------------------------------------------------- 1 | #include "io_vproxy_msquic_QuicApiTable.h" 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | JNIEXPORT void JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_close(QuicApiTable * self) { 8 | QUIC_API_TABLE* api = self->Api; 9 | MsQuicClose(api); 10 | } 11 | 12 | JNIEXPORT QuicRegistration * JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_openRegistration(QuicApiTable * self, QUIC_REGISTRATION_CONFIG * Config, int32_t * returnStatus, QuicRegistration * return_) { 13 | QUIC_API_TABLE* api = self->Api; 14 | HQUIC h; 15 | QUIC_STATUS res = api->RegistrationOpen(Config, &h); 16 | if (returnStatus != NULL) 17 | *returnStatus = res; 18 | if (QUIC_SUCCEEDED(res)) { 19 | return_->SUPER.Api = api; 20 | return_->SUPER.Handle = h; 21 | return return_; 22 | } 23 | return NULL; 24 | } 25 | 26 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_setParam(QuicApiTable * self, int32_t Param, int32_t BufferLength, void * Buffer) { 27 | QUIC_API_TABLE* api = self->Api; 28 | QUIC_STATUS res = api->SetParam(NULL, Param, BufferLength, Buffer); 29 | if (QUIC_SUCCEEDED(res)) { 30 | return 0; 31 | } 32 | return res; 33 | } 34 | 35 | JNIEXPORT int32_t JNICALL JavaCritical_io_vproxy_msquic_QuicApiTable_getParam(QuicApiTable * self, int32_t Param, uint32_t * BufferLength, void * Buffer) { 36 | QUIC_API_TABLE* api = self->Api; 37 | QUIC_STATUS res = api->GetParam(NULL, Param, BufferLength, Buffer); 38 | if (QUIC_SUCCEEDED(res)) { 39 | return 0; 40 | } 41 | return res; 42 | } 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | // metadata.generator-version: pni 21.0.0.17 48 | // sha256:4b5289240e0eac2bdd05843044257f09fc1709a09c79f541e851dc9ef5b8a0d6 49 | -------------------------------------------------------------------------------- /core/src/main/c-generated/io_vproxy_msquic_QuicConnectionEventUnion.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventUnion */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventUnion 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventUnion 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicConnectionEventConnected.h" 17 | #include "io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport.h" 18 | #include "io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer.h" 19 | #include "io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete.h" 20 | #include "io_vproxy_msquic_QuicConnectionEventLocalAddressChanged.h" 21 | #include "io_vproxy_msquic_QuicConnectionEventPeerAddressChanged.h" 22 | #include "io_vproxy_msquic_QuicConnectionEventPeerStreamStarted.h" 23 | #include "io_vproxy_msquic_QuicConnectionEventStreamsAvailable.h" 24 | #include "io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams.h" 25 | #include "io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged.h" 26 | #include "io_vproxy_msquic_QuicConnectionEventDatagramStateChanged.h" 27 | #include "io_vproxy_msquic_QuicConnectionEventDatagramReceived.h" 28 | #include "io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged.h" 29 | #include "io_vproxy_msquic_QuicConnectionEventResumed.h" 30 | #include "io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived.h" 31 | #include "io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived.h" 32 | #include "io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventUnion 42 | // metadata.generator-version: pni 21.0.0.8 43 | // sha256:8fa9d70ab067d56b89affc3ed5c8c0e9f16b4056130a57ff1d6298c1258fa687 44 | -------------------------------------------------------------------------------- /core/src/main/java/io/vproxy/msquic/callback/StreamCallback.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.callback; 2 | 3 | import io.vproxy.msquic.*; 4 | import io.vproxy.msquic.wrap.Stream; 5 | 6 | import static io.vproxy.msquic.MsQuicConsts.QUIC_STATUS_NOT_SUPPORTED; 7 | 8 | public interface StreamCallback { 9 | default boolean remove(Stream stream) { 10 | return false; 11 | } 12 | 13 | default int startComplete(Stream stream, QuicStreamEventStartComplete data) { 14 | return QUIC_STATUS_NOT_SUPPORTED; 15 | } 16 | 17 | default int receive(Stream stream, QuicStreamEventReceive data) { 18 | return QUIC_STATUS_NOT_SUPPORTED; 19 | } 20 | 21 | default int sendComplete(Stream stream, QuicStreamEventSendComplete data) { 22 | return QUIC_STATUS_NOT_SUPPORTED; 23 | } 24 | 25 | default int peerSendShutdown(Stream stream) { 26 | return QUIC_STATUS_NOT_SUPPORTED; 27 | } 28 | 29 | default int peerSendAborted(Stream stream, QuicStreamEventPeerSendAborted data) { 30 | return QUIC_STATUS_NOT_SUPPORTED; 31 | } 32 | 33 | default int peerReceiveAborted(Stream stream, QuicStreamEventPeerReceiveAborted data) { 34 | return QUIC_STATUS_NOT_SUPPORTED; 35 | } 36 | 37 | default int sendShutdownComplete(Stream stream, QuicStreamEventSendShutdownComplete data) { 38 | return QUIC_STATUS_NOT_SUPPORTED; 39 | } 40 | 41 | default int shutdownComplete(Stream stream, QuicStreamEventShutdownComplete data) { 42 | return QUIC_STATUS_NOT_SUPPORTED; 43 | } 44 | 45 | default int idealSendBufferSize(Stream stream, QuicStreamEventIdealSendBufferSize data) { 46 | return QUIC_STATUS_NOT_SUPPORTED; 47 | } 48 | 49 | default int peerAccepted(Stream stream) { 50 | return QUIC_STATUS_NOT_SUPPORTED; 51 | } 52 | 53 | default int unknown(Stream stream, QuicStreamEvent event) { 54 | return QUIC_STATUS_NOT_SUPPORTED; 55 | } 56 | 57 | default void closed(Stream stream) { 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /core/src/main/c-generated-graal/io_vproxy_msquic_QuicConnectionEventUnion.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | /* Header for class io_vproxy_msquic_QuicConnectionEventUnion */ 3 | #ifndef _Included_io_vproxy_msquic_QuicConnectionEventUnion 4 | #define _Included_io_vproxy_msquic_QuicConnectionEventUnion 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | 13 | #include 14 | #include 15 | #include "msquic.h" 16 | #include "io_vproxy_msquic_QuicConnectionEventConnected.h" 17 | #include "io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByTransport.h" 18 | #include "io_vproxy_msquic_QuicConnectionEventShutdownInitiatedByPeer.h" 19 | #include "io_vproxy_msquic_QuicConnectionEventConnectionShutdownComplete.h" 20 | #include "io_vproxy_msquic_QuicConnectionEventLocalAddressChanged.h" 21 | #include "io_vproxy_msquic_QuicConnectionEventPeerAddressChanged.h" 22 | #include "io_vproxy_msquic_QuicConnectionEventPeerStreamStarted.h" 23 | #include "io_vproxy_msquic_QuicConnectionEventStreamsAvailable.h" 24 | #include "io_vproxy_msquic_QuicConnectionEventPeerNeedsStreams.h" 25 | #include "io_vproxy_msquic_QuicConnectionEventIdealProcessorChanged.h" 26 | #include "io_vproxy_msquic_QuicConnectionEventDatagramStateChanged.h" 27 | #include "io_vproxy_msquic_QuicConnectionEventDatagramReceived.h" 28 | #include "io_vproxy_msquic_QuicConnectionEventDatagramSendStateChanged.h" 29 | #include "io_vproxy_msquic_QuicConnectionEventResumed.h" 30 | #include "io_vproxy_msquic_QuicConnectionEventResumptionTicketReceived.h" 31 | #include "io_vproxy_msquic_QuicConnectionEventPeerCertificateReceived.h" 32 | #include "io_vproxy_msquic_QuicConnectionEventReliableResetNegotiated.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif // _Included_io_vproxy_msquic_QuicConnectionEventUnion 42 | // metadata.generator-version: pni 21.0.0.16 43 | // sha256:8fa9d70ab067d56b89affc3ed5c8c0e9f16b4056130a57ff1d6298c1258fa687 44 | -------------------------------------------------------------------------------- /template/src/main/java/io/vproxy/msquic/PNIQuicConfiguration.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic; 2 | 3 | import io.vproxy.pni.annotation.*; 4 | 5 | import java.lang.foreign.MemorySegment; 6 | 7 | @Struct 8 | @AlwaysAligned 9 | @Include("msquic.h") 10 | public abstract class PNIQuicConfiguration extends PNIQuicObjectBase { 11 | @Impl( 12 | // language="c" 13 | c = """ 14 | QUIC_API_TABLE* api = self->SUPER.Api; 15 | HQUIC conf = self->SUPER.Handle; 16 | api->ConfigurationClose(conf); 17 | """ 18 | ) 19 | @Style(Styles.critical) 20 | abstract void close(); 21 | 22 | @Impl( 23 | // language="c" 24 | c = """ 25 | QUIC_API_TABLE* api = self->SUPER.Api; 26 | HQUIC conf = self->SUPER.Handle; 27 | 28 | QUIC_STATUS res = api->ConfigurationLoadCredential(conf, CredConfig); 29 | if (QUIC_SUCCEEDED(res)) { 30 | return 0; 31 | } 32 | return res; 33 | """ 34 | ) 35 | @Style(Styles.critical) 36 | abstract int loadCredential(PNIQuicCredentialConfig CredConfig); 37 | } 38 | 39 | @Struct(skip = true) 40 | @AlwaysAligned 41 | @Include("msquic.h") 42 | @Name("QUIC_CREDENTIAL_CONFIG") 43 | abstract class PNIQuicCredentialConfig { 44 | int Type; // QUIC_CREDENTIAL_TYPE 45 | int Flags; // QUIC_CREDENTIAL_FLAGS 46 | PNIQuicCertificate Certificate; 47 | String Principle; 48 | MemorySegment Reserved; 49 | MemorySegment AsyncHandler; 50 | int AllowedCipherSuites; // QUIC_ALLOWED_CIPHER_SUITE_FLAGS 51 | String CaCertificateFile; 52 | } 53 | 54 | @Union(embedded = true) 55 | @AlwaysAligned 56 | @Include("msquic.h") 57 | abstract class PNIQuicCertificate { 58 | @Pointer PNIQuicCertificateFile CertificateFile; 59 | } 60 | 61 | @Struct(skip = true) 62 | @AlwaysAligned 63 | @Include("msquic.h") 64 | @Name("QUIC_CERTIFICATE_FILE") 65 | abstract class PNIQuicCertificateFile { 66 | String PrivateKeyFile; 67 | String CertificateFile; 68 | } 69 | -------------------------------------------------------------------------------- /core/src/main/c/make-quic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | error=0 4 | 5 | if [[ -z "$MSQUIC_INC" ]]; then 6 | echo "You must set MSQUIC_INC properly, where the msquic include files are located" 7 | error=1 8 | fi 9 | 10 | if [[ -z "$MSQUIC_LD" ]]; then 11 | echo "You must set MSQUIC_LD properly, where the msquic shared library is located" 12 | error=1 13 | fi 14 | 15 | if [[ "$error" == "1" ]]; then 16 | exit 1 17 | fi 18 | 19 | C_GENERATED="c-generated" 20 | if [[ "$GRAAL" == "true" ]] 21 | then 22 | C_GENERATED="c-generated-graal" 23 | GCC_OPTS="$GCC_OPTS -DPNI_GRAAL=1" 24 | fi 25 | 26 | ls ../$C_GENERATED | grep '\.h$' | grep -v 'QuicRegistrationConfigEx' | \ 27 | awk '{print "#include \""$1"\""}' > io_vproxy_msquic_MsQuic.c 28 | 29 | echo "" >> io_vproxy_msquic_MsQuic.c 30 | ./gen-strerror.py >> io_vproxy_msquic_MsQuic.c 31 | 32 | os=`uname` 33 | 34 | target="msquic-java" 35 | include_platform_dir="" 36 | cflags="" 37 | 38 | if [[ "Linux" == "$os" ]] 39 | then 40 | target="lib$target.so" 41 | include_platform_dir="linux" 42 | cflags="-DCX_PLATFORM_LINUX=1" 43 | elif [[ "Darwin" == "$os" ]] 44 | then 45 | target="lib$target.dylib" 46 | include_platform_dir="darwin" 47 | cflags="-DCX_PLATFORM_DARWIN=1" 48 | else 49 | os="_WIN32" 50 | target="$target.dll" 51 | include_platform_dir="win32" 52 | fi 53 | 54 | rm -f "$target" 55 | 56 | link="-lc -lpthread" 57 | if [ "_WIN32" == "$os" ] 58 | then 59 | link="-L $WINDIR/System32 -lucrt -lntdll" 60 | fi 61 | 62 | if [ "Linux" == "$os" ] 63 | then 64 | link="$link -Wl,--no-as-needed" 65 | fi 66 | if [ "_WIN32" == "$os" ] 67 | then 68 | link="$link -l:msquic.dll" 69 | else 70 | link="$link -lmsquic" 71 | fi 72 | if [ "Linux" == "$os" ] 73 | then 74 | link="$link -Wl,--as-needed" 75 | fi 76 | 77 | gcc -std=gnu11 -O2 \ 78 | $GCC_OPTS \ 79 | -I "$MSQUIC_INC" \ 80 | -I "../$C_GENERATED" \ 81 | -L "$MSQUIC_LD" \ 82 | -DQUIC_ENABLE_CUSTOM_EVENT_LOOP=1 \ 83 | $cflags \ 84 | -shared -Werror $link -fPIC \ 85 | io_vproxy_msquic_MsQuic.c \ 86 | inline.c \ 87 | ../$C_GENERATED/*.c \ 88 | -o "$target" 89 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # msquic-java 2 | 3 | ## prerequists 4 | 5 | 1. At least JDK 21 6 | 2. Follow the instructions [modify-gradle-compiler-args](https://github.com/vproxy-tools/modify-gradle-compiler-args) to install the java-agent for Gradle 7 | 3. Clone and compile the [modified msquic](https://github.com/wkgcass/msquic/blob/modified/README_MODIFIED.md) 8 | 4. If you are using Windows, you will need MinGW UCRT64 9 | 10 | ## tasks 11 | 12 | * `pniGenerate`: generate files 13 | * `pniCompile`: compile the c shim lib. On Windows, this is task does nothing, and you will have to 14 | run `make build-native` manually instead 15 | * `buildSampleNativeImage`: build native image 16 | 17 | ## scripts 18 | 19 | You may add two scripts at the root of this project, for running the sample server and client. 20 | 21 | **my-server.sh** 22 | 23 | ```shell 24 | mode="" 25 | task="runSampleServer" 26 | GRAAL=`cat is-graal-build` 27 | if [[ "$GRAAL" == "true" ]] 28 | then 29 | mode="server" 30 | task="runSampleNativeImage" 31 | fi 32 | 33 | args="$mode cert=${PATH_TO_YOUR_TLS_CERT} key=${PATH_TO_YOUR_TLS_KEY}" 34 | 35 | if [[ "$GRAAL" == "true" ]] 36 | then 37 | ./gradlew $task --console=plain -DARGS="$args" 38 | else 39 | ./gradlew $task --console=plain --args="$args" 40 | fi 41 | ``` 42 | 43 | **my-client.sh** 44 | 45 | ```shell 46 | mode="" 47 | task="runSampleClient" 48 | GRAAL=`cat is-graal-build` 49 | if [[ "$GRAAL" == "true" ]] 50 | then 51 | mode="client" 52 | task="runSampleNativeImage" 53 | fi 54 | 55 | args="$mode host=127.0.0.1 port=443" 56 | SSLKEYLOGFILE="${PATH_TO_STORE_SSL_KEY_LOG_FILE}" 57 | 58 | if [[ "$GRAAL" == "true" ]] 59 | then 60 | SSLKEYLOGFILE="$SSLKEYLOGFILE" ./gradlew $task --console=plain -DARGS="$args" 61 | else 62 | SSLKEYLOGFILE="$SSLKEYLOGFILE" ./gradlew $task --console=plain --args="$args" 63 | fi 64 | ``` 65 | 66 | ## graal 67 | 68 | To compile the graal native-image version code, change content of file `./is-graal-build` to `true`. 69 | 70 | ## windows 71 | 72 | If you are using Windows, you will need `MinGW UCRT64` to build and run, and you will have to call 73 | `make build-native` manually before running. 74 | -------------------------------------------------------------------------------- /sample/src/main/java/io/vproxy/msquic/sample/SampleConnectionCallback.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic.sample; 2 | 3 | import io.vproxy.msquic.*; 4 | import io.vproxy.msquic.callback.ConnectionCallback; 5 | import io.vproxy.msquic.callback.LogStreamCallback; 6 | import io.vproxy.msquic.callback.StreamCallbackList; 7 | import io.vproxy.msquic.wrap.Connection; 8 | import io.vproxy.msquic.wrap.Stream; 9 | import io.vproxy.pni.Allocator; 10 | 11 | class SampleConnectionCallback implements ConnectionCallback { 12 | private final CommandLine cli; 13 | 14 | public SampleConnectionCallback(CommandLine cli) { 15 | this.cli = cli; 16 | } 17 | 18 | @Override 19 | public int connected(Connection conn, QuicConnectionEventConnected data) { 20 | cli.registerConnection(conn); 21 | return 0; 22 | } 23 | 24 | @Override 25 | public int shutdownComplete(Connection conn, QuicConnectionEventConnectionShutdownComplete data) { 26 | cli.removeConnection(conn); 27 | return 0; 28 | } 29 | 30 | @Override 31 | public int peerStreamStarted(Connection conn, QuicConnectionEventPeerStreamStarted data) { 32 | var streamHQUIC = data.getStream(); 33 | var allocator = Allocator.ofUnsafe(); 34 | var stream_ = new QuicStream(allocator); 35 | { 36 | stream_.setApi(conn.opts.apiTableQ.getApi()); 37 | stream_.setHandle(streamHQUIC); 38 | } 39 | var stream = new Stream(new Stream.Options(conn, allocator, 40 | new StreamCallbackList() 41 | .add(new LogStreamCallback(true)) 42 | .add(new SampleStreamCallback(cli)), 43 | stream_)); 44 | stream_.setCallbackHandler(MsQuicUpcall.streamCallback, stream.ref.MEMORY); 45 | cli.registerStream(stream); 46 | return 0; 47 | } 48 | 49 | @Override 50 | public int resumptionTicketReceived(Connection conn, QuicConnectionEventResumptionTicketReceived data) { 51 | var seg = data.getResumptionTicket().reinterpret(data.getResumptionTicketLength() & 0xffff); 52 | cli.registerResumptionTicket(conn.getRemoteAddress().formatToIPPortString(), seg); 53 | return 0; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /template/src/main/java/io/vproxy/msquic/PNIQuicObjectBase.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic; 2 | 3 | import io.vproxy.pni.annotation.*; 4 | 5 | import java.lang.foreign.MemorySegment; 6 | 7 | @Struct 8 | @AlwaysAligned 9 | public abstract class PNIQuicObjectBase { 10 | MemorySegment Api; // QUIC_API_TABLE 11 | MemorySegment Handle; // HQUIC 12 | 13 | @Impl( 14 | // language="c" 15 | c = """ 16 | QUIC_API_TABLE* api = self->Api; 17 | api->SetContext(self->Handle, Context); 18 | """ 19 | ) 20 | @Style(Styles.critical) 21 | abstract void setContext(MemorySegment Context); 22 | 23 | @Impl( 24 | // language="c" 25 | c = """ 26 | QUIC_API_TABLE* api = self->Api; 27 | return api->GetContext(self->Handle); 28 | """ 29 | ) 30 | @Style(Styles.critical) 31 | abstract MemorySegment getContext(); 32 | 33 | @Impl( 34 | // language="c" 35 | c = """ 36 | QUIC_API_TABLE* api = self->Api; 37 | api->SetCallbackHandler(self->Handle, Handler, Context); 38 | """ 39 | ) 40 | @Style(Styles.critical) 41 | abstract void setCallbackHandler(MemorySegment Handler, MemorySegment Context); 42 | 43 | @Impl( 44 | // language="c" 45 | c = """ 46 | QUIC_API_TABLE* api = self->Api; 47 | QUIC_STATUS res = api->SetParam(self->Handle, Param, BufferLength, Buffer); 48 | if (QUIC_SUCCEEDED(res)) { 49 | return 0; 50 | } 51 | return res; 52 | """ 53 | ) 54 | @Style(Styles.critical) 55 | abstract int setParam(int Param, int BufferLength, MemorySegment Buffer); 56 | 57 | @Impl( 58 | // language="c" 59 | c = """ 60 | QUIC_API_TABLE* api = self->Api; 61 | QUIC_STATUS res = api->GetParam(self->Handle, Param, BufferLength, Buffer); 62 | if (QUIC_SUCCEEDED(res)) { 63 | return 0; 64 | } 65 | return res; 66 | """ 67 | ) 68 | @Style(Styles.critical) 69 | abstract int getParam(int Param, @Unsigned @Raw int[] BufferLength, MemorySegment Buffer); 70 | } 71 | -------------------------------------------------------------------------------- /core/src/main/generated/io/vproxy/msquic/MsQuicMod.java: -------------------------------------------------------------------------------- 1 | package io.vproxy.msquic; 2 | 3 | import io.vproxy.pni.*; 4 | import io.vproxy.pni.hack.*; 5 | import io.vproxy.pni.array.*; 6 | import java.lang.foreign.*; 7 | import java.lang.invoke.*; 8 | import java.nio.ByteBuffer; 9 | 10 | public class MsQuicMod { 11 | private MsQuicMod() { 12 | } 13 | 14 | private static final MsQuicMod INSTANCE = new MsQuicMod(); 15 | 16 | public static MsQuicMod get() { 17 | return INSTANCE; 18 | } 19 | 20 | private static final MethodHandle openExtraMH = PanamaUtils.lookupPNICriticalFunction(new PNILinkOptions(), io.vproxy.msquic.QuicExtraApiTable.LAYOUT.getClass(), "JavaCritical_io_vproxy_msquic_MsQuicMod_openExtra", int.class /* Version */, MemorySegment.class /* returnStatus */); 21 | 22 | public io.vproxy.msquic.QuicExtraApiTable openExtra(int Version, IntArray returnStatus) { 23 | MemorySegment RESULT; 24 | try { 25 | RESULT = (MemorySegment) openExtraMH.invokeExact(Version, (MemorySegment) (returnStatus == null ? MemorySegment.NULL : returnStatus.MEMORY)); 26 | } catch (Throwable THROWABLE) { 27 | throw PanamaUtils.convertInvokeExactException(THROWABLE); 28 | } 29 | if (RESULT.address() == 0) return null; 30 | return RESULT == null ? null : new io.vproxy.msquic.QuicExtraApiTable(RESULT); 31 | } 32 | 33 | private static final MethodHandle INVOKE_LPTHREAD_START_ROUTINEMH = PanamaUtils.lookupPNICriticalFunction(new PNILinkOptions(), void.class, "JavaCritical_io_vproxy_msquic_MsQuicMod_INVOKE_LPTHREAD_START_ROUTINE", MemorySegment.class /* Callback */, MemorySegment.class /* Context */); 34 | 35 | public void INVOKE_LPTHREAD_START_ROUTINE(MemorySegment Callback, MemorySegment Context) { 36 | try { 37 | INVOKE_LPTHREAD_START_ROUTINEMH.invokeExact((MemorySegment) (Callback == null ? MemorySegment.NULL : Callback), (MemorySegment) (Context == null ? MemorySegment.NULL : Context)); 38 | } catch (Throwable THROWABLE) { 39 | throw PanamaUtils.convertInvokeExactException(THROWABLE); 40 | } 41 | } 42 | } 43 | // metadata.generator-version: pni 21.0.0.20 44 | // sha256:7ca5b307f9a0606f6910ca278f3dc1fd9a4da18a5657f2e9e38854fe8ca8590e 45 | --------------------------------------------------------------------------------