Skip to content

Commit 1efc636

Browse files
get rid of modifications to the public header
1 parent 11d3dbb commit 1efc636

6 files changed

Lines changed: 41 additions & 5 deletions

File tree

src/inc/msquic_posix.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include "quic_sal_stub.h"
4040

4141
#define QUIC_INLINE static inline
42-
#define QUIC_INVALID_FILE_HANDLE -1
4342

4443
#ifdef __cplusplus
4544
extern "C++" {

src/inc/msquic_winkernel.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <ntintsafe.h>
2929

3030
#define QUIC_INLINE inline
31-
#define QUIC_INVALID_FILE_HANDLE -1
3231

3332
typedef INT8 int8_t;
3433
typedef INT16 int16_t;

src/inc/msquic_winuser.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include <stdint.h>
4040

4141
#define QUIC_INLINE inline
42-
#define QUIC_INVALID_FILE_HANDLE -1
4342

4443
#define SUCCESS_HRESULT_FROM_WIN32(x) \
4544
((HRESULT)(((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16)))

src/platform/unittest/DataPathTest.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include "DataPathTest.cpp.clog.h"
2020
#endif
2121

22+
#define QUIC_INVALID_FILE_HANDLE (-1)
23+
2224
extern bool UseDuoNic;
2325

2426
//
@@ -1493,6 +1495,45 @@ TEST_F(DataPathTest, XdpMapMode_InitFailsWithoutRawDatapath)
14931495
CxPlatWorkerPoolDelete(WorkerPool, CXPLAT_WORKER_POOL_REF_TOOL);
14941496
}
14951497

1498+
TEST_F(DataPathTest, XdpMapMode_InitSucceedsWithRawDatapath)
1499+
{
1500+
//
1501+
// 1-map config succeeds when DuoNic/XDP (raw datapath) is
1502+
// available.
1503+
//
1504+
if (!UseDuoNic) {
1505+
GTEST_SKIP_NO_RETURN_("Requires DuoNic/XDP for raw datapath init");
1506+
return;
1507+
}
1508+
1509+
const uint32_t FakeIfIndex = 0xDEAD;
1510+
const QUIC_XDP_MAP_HANDLE FakeHandle = (QUIC_XDP_MAP_HANDLE)QUIC_INVALID_FILE_HANDLE;
1511+
CXPLAT_XDP_MAP_CONFIG MapConfig = { FakeIfIndex, FakeHandle };
1512+
1513+
CXPLAT_WORKER_POOL* WorkerPool =
1514+
CxPlatWorkerPoolCreate(nullptr, CXPLAT_WORKER_POOL_REF_TOOL);
1515+
ASSERT_NE(nullptr, WorkerPool);
1516+
1517+
CXPLAT_DATAPATH_INIT_CONFIG InitConfig = {0};
1518+
InitConfig.XdpMapConfigs = &MapConfig;
1519+
InitConfig.XdpMapConfigCount = 1;
1520+
1521+
CXPLAT_DATAPATH* Datapath = nullptr;
1522+
QUIC_STATUS Status =
1523+
CxPlatDataPathInitialize(
1524+
0,
1525+
&EmptyUdpCallbacks,
1526+
nullptr,
1527+
WorkerPool,
1528+
&InitConfig,
1529+
&Datapath);
1530+
VERIFY_QUIC_SUCCESS(Status);
1531+
ASSERT_NE(nullptr, Datapath);
1532+
1533+
CxPlatDataPathUninitialize(Datapath);
1534+
CxPlatWorkerPoolDelete(WorkerPool, CXPLAT_WORKER_POOL_REF_TOOL);
1535+
}
1536+
14961537
TEST_F(DataPathTest, XdpMapMode_SingleUnknownIfIndex)
14971538
{
14981539
//

src/rs/ffi/linux_bindings.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ where
136136
}
137137
}
138138
}
139-
pub const QUIC_INVALID_FILE_HANDLE: i32 = -1;
140139
pub const QUIC_ADDRESS_FAMILY_UNSPEC: u32 = 0;
141140
pub const QUIC_ADDRESS_FAMILY_INET: u32 = 2;
142141
pub const QUIC_ADDRESS_FAMILY_INET6: u32 = 10;

src/rs/ffi/win_bindings.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ where
136136
}
137137
}
138138
}
139-
pub const QUIC_INVALID_FILE_HANDLE: i32 = -1;
140139
pub const QUIC_ADDRESS_FAMILY_UNSPEC: u32 = 0;
141140
pub const QUIC_ADDRESS_FAMILY_INET: u32 = 2;
142141
pub const QUIC_ADDRESS_FAMILY_INET6: u32 = 23;

0 commit comments

Comments
 (0)