flatten 20260225
This commit is contained in:
154
resources/packages/msquic/Makefile.project
Executable file
154
resources/packages/msquic/Makefile.project
Executable file
@@ -0,0 +1,154 @@
|
||||
_FLAGS := $(_FLAGS) -Wno-deprecated
|
||||
|
||||
include $(MAKEDIR)/Makefile.base
|
||||
|
||||
COPYTO := ../../sdk/lib
|
||||
|
||||
PROJECTS := \
|
||||
src/core \
|
||||
|
||||
# src/platform/cert_capi_openssl.c \
|
||||
|
||||
# src/platform/crypt_openssl.c \
|
||||
|
||||
COMMON_SRC := \
|
||||
src/platform/crypt.c \
|
||||
src/platform/crypt_openssl.c \
|
||||
src/platform/hashtable.c \
|
||||
src/platform/inline.c \
|
||||
src/platform/pcp.c \
|
||||
src/platform/storage_posix.c \
|
||||
src/platform/tls_openssl.c \
|
||||
src/platform/toeplitz.c \
|
||||
src/platform/platform_worker.c \
|
||||
src/platform/cgroup.c \
|
||||
|
||||
NO_SRC := \
|
||||
src/platform/selfsign_openssl.c \
|
||||
|
||||
LINUX_SRC := \
|
||||
src/platform/datapath_epoll.c \
|
||||
src/platform/certificates_posix.c \
|
||||
src/platform/platform_posix.c \
|
||||
# src/platform/datapath_linux.c \
|
||||
|
||||
ANDROID_SRC := \
|
||||
src/platform/datapath_epoll.c \
|
||||
src/platform/certificates_posix.c \
|
||||
src/platform/platform_posix.c \
|
||||
# src/platform/datapath_linux.c \
|
||||
|
||||
POSIX_SRC := \
|
||||
src/platform/datapath_kqueue.c \
|
||||
src/platform/certificates_darwin.c \
|
||||
src/platform/platform_posix.c \
|
||||
|
||||
WIN_SRC := \
|
||||
src/platform/cert_capi.c \
|
||||
src/platform/crypt_bcrypt.c \
|
||||
src/platform/datapath_winkernel.c \
|
||||
src/platform/datapath_winuser.c \
|
||||
src/platform/platform_winkernel.c \
|
||||
src/platform/platform_winuser.c \
|
||||
src/platform/selfsign_capi.c \
|
||||
src/platform/storage_winkernel.c \
|
||||
src/platform/storage_winuser.c \
|
||||
src/platform/tls_schannel.c \
|
||||
|
||||
ifeq ($(SYS_NAME),Linux)
|
||||
SRC_C := $(LINUX_SRC) $(COMMON_SRC)
|
||||
|
||||
_FLAGS := $(_FLAGS) \
|
||||
-fms-extensions \
|
||||
-Wmissing-field-initializers \
|
||||
-Wno-multichar \
|
||||
-DCX_PLATFORM_LINUX \
|
||||
-DQUIC_DISABLE_CLIENT_CERT_TESTS \
|
||||
-DQUIC_DISABLE_DEFERRED_CERT_TESTS \
|
||||
-DVER_BUILD_ID=0 \
|
||||
-DVER_SUFFIX=-private \
|
||||
-D_GNU_SOURCE \
|
||||
-DQUIC_EVENTS_STUB \
|
||||
-DQUIC_LOGS_STUB \
|
||||
|
||||
# -DQUIC_LOGS_STDOUT \
|
||||
# -DQUIC_EVENTS_STDOUT \
|
||||
|
||||
# -DQUIC_EVENTS_STUB \
|
||||
# -DQUIC_LOGS_STUB \
|
||||
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(SYS_NAME),Android)
|
||||
SRC_C := $(ANDROID_SRC) $(COMMON_SRC)
|
||||
|
||||
_FLAGS := $(_FLAGS) \
|
||||
-fms-extensions \
|
||||
-Wmissing-field-initializers \
|
||||
-Wno-multichar \
|
||||
-DQUIC_ANDROID_NO_ECN \
|
||||
-DQUIC_ANDROID_FIX_MISSING_LOCALADDRESS_ON_CLIENT \
|
||||
-DCX_PLATFORM_LINUX \
|
||||
-DQUIC_DISABLE_CLIENT_CERT_TESTS \
|
||||
-DQUIC_DISABLE_DEFERRED_CERT_TESTS \
|
||||
-DVER_BUILD_ID=0 \
|
||||
-DVER_SUFFIX=-private \
|
||||
-D_GNU_SOURCE \
|
||||
\
|
||||
-DQUIC_EVENTS_STUB \
|
||||
-DQUIC_LOGS_STUB \
|
||||
|
||||
# -DQUIC_LOGS_STDOUT \
|
||||
# -DQUIC_EVENTS_STDOUT \
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(SYS_NAME),Darwin)
|
||||
SRC_C := $(POSIX_SRC) $(COMMON_SRC)
|
||||
|
||||
_FLAGS := $(_FLAGS) \
|
||||
-fms-extensions \
|
||||
-Wno-microsoft-anon-tag -Wno-tautological-constant-out-of-range-compare -Wmissing-field-initializers \
|
||||
-DCX_PLATFORM_DARWIN \
|
||||
-DQUIC_DISABLE_CLIENT_CERT_TESTS \
|
||||
-DQUIC_DISABLE_DEFERRED_CERT_TESTS \
|
||||
-DQUIC_EVENTS_STUB \
|
||||
-DQUIC_LOGS_STUB \
|
||||
-DVER_BUILD_ID=0 \
|
||||
-DVER_SUFFIX=-private \
|
||||
-D_GNU_SOURCE \
|
||||
|
||||
endif
|
||||
ifeq ($(SYS_NAME),iOS)
|
||||
SRC_C := $(POSIX_SRC) $(COMMON_SRC)
|
||||
|
||||
_FLAGS := $(_FLAGS) \
|
||||
-fms-extensions \
|
||||
-Wno-microsoft-anon-tag -Wno-tautological-constant-out-of-range-compare -Wmissing-field-initializers \
|
||||
-DCX_PLATFORM_DARWIN \
|
||||
-DQUIC_DISABLE_CLIENT_CERT_TESTS \
|
||||
-DQUIC_DISABLE_DEFERRED_CERT_TESTS \
|
||||
-DQUIC_EVENTS_STUB \
|
||||
-DQUIC_LOGS_STUB \
|
||||
-DVER_BUILD_ID=0 \
|
||||
-DVER_SUFFIX=-private \
|
||||
-D_GNU_SOURCE \
|
||||
|
||||
endif
|
||||
|
||||
|
||||
|
||||
INCPATH := \
|
||||
-I src/inc \
|
||||
-I ../../openssl/openssl/include \
|
||||
|
||||
LIBFILE := libMSQuic.a
|
||||
COPYTO := $(LIBRARIES)/project
|
||||
|
||||
|
||||
# -DQUIC_SHARED_EPHEMERAL_WORKAROUND \
|
||||
# -DQUIC_CLOG \
|
||||
|
||||
include $(MAKEDIR)/Makefile.lib
|
||||
|
||||
68
resources/packages/msquic/android-datapath_epoll.c.diff
Normal file
68
resources/packages/msquic/android-datapath_epoll.c.diff
Normal file
@@ -0,0 +1,68 @@
|
||||
diff --git a/src/platform/datapath_epoll.c b/src/platform/datapath_epoll.c
|
||||
index 422509a..0eab584 100644
|
||||
--- a/src/platform/datapath_epoll.c
|
||||
+++ b/src/platform/datapath_epoll.c
|
||||
@@ -1819,6 +1819,21 @@ CxPlatSocketContextRecvComplete(
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef QUIC_ANDROID_FIX_MISSING_LOCALADDRESS_ON_CLIENT
|
||||
+ if (!FoundLocalAddr) {
|
||||
+ LocalAddr->Ip.sa_family = SocketContext->Binding->LocalAddress.Ip.sa_family;
|
||||
+
|
||||
+ // TJP - not sure if these copies are correct, should they be a memcpy?
|
||||
+ if (LocalAddr->Ip.sa_family == QUIC_ADDRESS_FAMILY_INET6) {
|
||||
+ LocalAddr->Ipv6 = SocketContext->Binding->LocalAddress.Ipv6;
|
||||
+ } else {
|
||||
+ LocalAddr->Ipv4 = SocketContext->Binding->LocalAddress.Ipv4;
|
||||
+ }
|
||||
+
|
||||
+ FoundLocalAddr = TRUE;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
CXPLAT_FRE_ASSERT(FoundLocalAddr);
|
||||
CXPLAT_FRE_ASSERT(FoundTOS);
|
||||
|
||||
@@ -2305,17 +2320,22 @@ CxPlatSendDataPopulateAncillaryData(
|
||||
_Inout_ struct msghdr* Mhdr
|
||||
)
|
||||
{
|
||||
+#ifdef QUIC_ANDROID_NO_ECN
|
||||
+ Mhdr->msg_controllen = 0;
|
||||
+ struct cmsghdr *CMsg = NULL;
|
||||
+#else
|
||||
Mhdr->msg_controllen = CMSG_SPACE(sizeof(int));
|
||||
struct cmsghdr *CMsg = CMSG_FIRSTHDR(Mhdr);
|
||||
CMsg->cmsg_level = SendData->LocalAddress.Ip.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
|
||||
CMsg->cmsg_type = SendData->LocalAddress.Ip.sa_family == AF_INET ? IP_TOS : IPV6_TCLASS;
|
||||
CMsg->cmsg_len = CMSG_LEN(sizeof(int));
|
||||
*(int*)CMSG_DATA(CMsg) = SendData->ECN;
|
||||
+#endif
|
||||
|
||||
if (!SendData->OnConnectedSocket) {
|
||||
if (SendData->LocalAddress.Ip.sa_family == AF_INET) {
|
||||
Mhdr->msg_controllen += CMSG_SPACE(sizeof(struct in_pktinfo));
|
||||
- CMsg = CXPLAT_CMSG_NXTHDR(CMsg);
|
||||
+ CMsg = CMsg ? CXPLAT_CMSG_NXTHDR(CMsg) : CMSG_FIRSTHDR(Mhdr);
|
||||
CMsg->cmsg_level = IPPROTO_IP;
|
||||
CMsg->cmsg_type = IP_PKTINFO;
|
||||
CMsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo));
|
||||
@@ -2325,7 +2345,7 @@ CxPlatSendDataPopulateAncillaryData(
|
||||
PktInfo->ipi_addr = SendData->LocalAddress.Ipv4.sin_addr;
|
||||
} else {
|
||||
Mhdr->msg_controllen += CMSG_SPACE(sizeof(struct in6_pktinfo));
|
||||
- CMsg = CXPLAT_CMSG_NXTHDR(CMsg);
|
||||
+ CMsg = CMsg ? CXPLAT_CMSG_NXTHDR(CMsg) : CMSG_FIRSTHDR(Mhdr);
|
||||
CMsg->cmsg_level = IPPROTO_IPV6;
|
||||
CMsg->cmsg_type = IPV6_PKTINFO;
|
||||
CMsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
|
||||
@@ -2338,7 +2358,7 @@ CxPlatSendDataPopulateAncillaryData(
|
||||
#ifdef UDP_SEGMENT
|
||||
if (SendData->SegmentationSupported && SendData->SegmentSize > 0) {
|
||||
Mhdr->msg_controllen += CMSG_SPACE(sizeof(uint16_t));
|
||||
- CMsg = CXPLAT_CMSG_NXTHDR(CMsg);
|
||||
+ CMsg = CMsg ? CXPLAT_CMSG_NXTHDR(CMsg) : CMSG_FIRSTHDR(Mhdr);
|
||||
CMsg->cmsg_level = SOL_UDP;
|
||||
CMsg->cmsg_type = UDP_SEGMENT;
|
||||
CMsg->cmsg_len = CMSG_LEN(sizeof(uint16_t));
|
||||
45
resources/packages/msquic/prepare
Executable file
45
resources/packages/msquic/prepare
Executable file
@@ -0,0 +1,45 @@
|
||||
set -x
|
||||
|
||||
mkdir -p sdk/include
|
||||
|
||||
LIB=msquic
|
||||
SRC=msquic
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
mkdir $LIB
|
||||
pushd $LIB
|
||||
|
||||
git clone --depth 1 --branch v2.2.4 https://github.com/microsoft/msquic.git
|
||||
#git clone --depth 1 --branch v2.2.2 https://github.com/microsoft/msquic.git
|
||||
#git clone --depth 1 https://github.com/microsoft/msquic.git
|
||||
#git clone --depth 1 --branch v2.1.7 https://github.com/microsoft/msquic.git
|
||||
|
||||
# pushd msquic
|
||||
# git submodule update --init --recursive
|
||||
# mkdir build
|
||||
# pushd build
|
||||
# cmake ..
|
||||
# make
|
||||
# popd
|
||||
# popd
|
||||
|
||||
ln -s $DIR/Makefile.project $SRC/Makefile.project
|
||||
#cp -av $DIR/Makefile.* $SRC
|
||||
|
||||
$DIR/../../prepare-template-just-makefile $SRC $DIR
|
||||
|
||||
pushd $SRC
|
||||
|
||||
if [[ $SYS_NAME == 'Android' ]]; then
|
||||
git apply $DIR/android-datapath_epoll.c.diff
|
||||
fi
|
||||
|
||||
make
|
||||
popd
|
||||
|
||||
popd
|
||||
|
||||
pushd sdk/include
|
||||
ln -s ../../$LIB/$SRC/src/inc msquic
|
||||
popd
|
||||
Reference in New Issue
Block a user