Skip to content

Commit 26f4951

Browse files
yaqian256PhyxionNL
andauthored
Add .NET 10 support (#237)
* Add .NET 10 support * Upgrade .NET SDK setup action and version * Update .NET SDK setup action to version 5 * Upgrade .NET SDK setup action to v5 * Modify .NET SDK version to support 8.0.x, 9.0.x, and 10.0.x Updated the .NET SDK version specification to support multiple versions. * Modify .NET SDK version to include 8.0.x and 9.0.x Updated the .NET SDK version to support multiple versions. * Update .NET SDK version in workflows * Update .NET SDK version to 10.0.x in workflow --------- Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
1 parent ead6b22 commit 26f4951

10 files changed

Lines changed: 38 additions & 46 deletions

File tree

.github/workflows/master.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ jobs:
1212
- uses: actions/checkout@v4
1313

1414
- name: Setup .NET SDK
15-
uses: actions/setup-dotnet@v4
15+
uses: actions/setup-dotnet@v5
1616
with:
17-
dotnet-version: |
18-
8.0.x
19-
9.0.x
17+
dotnet-version: '10.0.x'
2018

2119
- name: Install .NET dependencies
2220
run: dotnet restore
@@ -28,7 +26,7 @@ jobs:
2826
run: dotnet build PacketDotNet/PacketDotNet.csproj -c Release -f "net9.0"
2927

3028
- name: Test
31-
run: dotnet test -c Release -f "net9.0"
29+
run: dotnet test -c Release -f "net10.0"
3230

3331
windows:
3432
runs-on: windows-latest
@@ -37,11 +35,9 @@ jobs:
3735
- uses: actions/checkout@v4
3836

3937
- name: Setup .NET SDK
40-
uses: actions/setup-dotnet@v4
38+
uses: actions/setup-dotnet@v5
4139
with:
42-
dotnet-version: |
43-
8.0.x
44-
9.0.x
40+
dotnet-version: '10.0.x'
4541

4642
- uses: dorny/paths-filter@v3
4743
id: changes

.github/workflows/pull requests.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ jobs:
1212
- uses: actions/checkout@v4
1313

1414
- name: Setup .NET SDK
15-
uses: actions/setup-dotnet@v4
15+
uses: actions/setup-dotnet@v5
1616
with:
17-
dotnet-version: |
18-
8.0.x
19-
9.0.x
17+
dotnet-version: '10.0.x'
2018

2119
- name: Install .NET dependencies
2220
run: dotnet restore
@@ -28,7 +26,7 @@ jobs:
2826
run: dotnet build PacketDotNet/PacketDotNet.csproj -c Release -f "net9.0"
2927

3028
- name: Test
31-
run: dotnet test -c Release -f "net9.0"
29+
run: dotnet test -c Release -f "net10.0"
3230

3331
windows:
3432
runs-on: windows-latest
@@ -37,11 +35,9 @@ jobs:
3735
- uses: actions/checkout@v4
3836

3937
- name: Setup .NET SDK
40-
uses: actions/setup-dotnet@v4
38+
uses: actions/setup-dotnet@v5
4139
with:
42-
dotnet-version: |
43-
8.0.x
44-
9.0.x
40+
dotnet-version: '10.0.x'
4541

4642
- uses: dorny/paths-filter@v3
4743
id: changes

Examples/CapturingAndParsingPackets/CapturingAndParsingPackets.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

Examples/ConstructingPackets/ConstructingPackets.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

PacketDotNet/IPv6ExtensionHeader.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ public int FragmentOffset
3131
set
3232
{
3333
// read the original value
34-
var field = (ushort) FragmentOffsetReservedMore;
34+
var @field = (ushort) FragmentOffsetReservedMore;
3535

3636
// mask in the new field
37-
field = (ushort) ((field & 0x7) | ((ushort) value << 3) & 0xFFF8);
37+
@field = (ushort) ((@field & 0x7) | ((ushort) value << 3) & 0xFFF8);
3838

3939
// write the updated value back
40-
FragmentOffsetReservedMore = (short) field;
40+
FragmentOffsetReservedMore = (short) @field;
4141
}
4242
}
4343

@@ -50,13 +50,13 @@ public bool More
5050
set
5151
{
5252
// read the original value
53-
var field = (ushort) FragmentOffsetReservedMore;
53+
var @field = (ushort) FragmentOffsetReservedMore;
5454

5555
// mask in the new field
56-
field = (ushort) ((field & 0xFFFE) | (value ? 1 : 0) & 0x1);
56+
@field = (ushort) ((@field & 0xFFFE) | (value ? 1 : 0) & 0x1);
5757

5858
// write the updated value back
59-
FragmentOffsetReservedMore = (short) field;
59+
FragmentOffsetReservedMore = (short) @field;
6060
}
6161
}
6262

PacketDotNet/IPv6Packet.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ public int FlowLabel
199199
set
200200
{
201201
// read the original value
202-
var field = (uint) VersionTrafficClassFlowLabel;
202+
var @field = (uint) VersionTrafficClassFlowLabel;
203203

204204
// make the value in
205-
field = (field & 0xFFF00000) | ((uint) value & 0x000FFFFF);
205+
@field = (@field & 0xFFF00000) | ((uint) value & 0x000FFFFF);
206206

207207
// write the updated value back
208-
VersionTrafficClassFlowLabel = (int) field;
208+
VersionTrafficClassFlowLabel = (int) @field;
209209
}
210210
}
211211

@@ -305,13 +305,13 @@ public int TrafficClass
305305
set
306306
{
307307
// read the original value
308-
var field = (uint) VersionTrafficClassFlowLabel;
308+
var @field = (uint) VersionTrafficClassFlowLabel;
309309

310310
// mask in the new field
311-
field = (field & 0xF00FFFFF) | ((uint) value << 20) & 0x0FF00000;
311+
@field = (@field & 0xF00FFFFF) | ((uint) value << 20) & 0x0FF00000;
312312

313313
// write the updated value back
314-
VersionTrafficClassFlowLabel = (int) field;
314+
VersionTrafficClassFlowLabel = (int) @field;
315315
}
316316
}
317317

@@ -326,13 +326,13 @@ public override IPVersion Version
326326
var v = (int) value;
327327

328328
// read the existing value
329-
var field = (uint) VersionTrafficClassFlowLabel;
329+
var @field = (uint) VersionTrafficClassFlowLabel;
330330

331331
// mask the new field into place
332-
field = (uint) ((field & 0x0FFFFFFF) | ((v << 28) & 0xF0000000));
332+
@field = (uint) ((@field & 0x0FFFFFFF) | ((v << 28) & 0xF0000000));
333333

334334
// write the updated value back
335-
VersionTrafficClassFlowLabel = (int) field;
335+
VersionTrafficClassFlowLabel = (int) @field;
336336
}
337337
}
338338

PacketDotNet/Ieee80211/PpiPacket.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ public ushort Length
104104
{
105105
var length = PpiHeaderFields.PpiPacketHeaderLength;
106106

107-
foreach (var field in PpiFields)
107+
foreach (var @field in PpiFields)
108108
{
109-
length += PpiHeaderFields.FieldHeaderLength + field.Length;
109+
length += PpiHeaderFields.FieldHeaderLength + @field.Length;
110110
if ((Flags & HeaderFlags.Alignment32Bit) == HeaderFlags.Alignment32Bit)
111111
{
112-
length += GetDistanceTo32BitAlignment(field.Length);
112+
length += GetDistanceTo32BitAlignment(@field.Length);
113113
}
114114
}
115115

PacketDotNet/IgmpV3MembershipQueryPacket.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ public byte QueriersRobustnessVariable
107107
set
108108
{
109109
// read the original value
110-
byte field = ReservedSFlagAndQRV;
110+
byte @field = ReservedSFlagAndQRV;
111111

112112
// mask in the new field
113-
field = (byte) ((field & 0xF8) | value & 0x07);
113+
@field = (byte) ((@field & 0xF8) | value & 0x07);
114114

115115
// write the updated value back
116-
ReservedSFlagAndQRV = field;
116+
ReservedSFlagAndQRV = @field;
117117
}
118118
}
119119

@@ -169,13 +169,13 @@ public bool SuppressRouterSideProcessingFlag
169169
set
170170
{
171171
// read the original value
172-
byte field = ReservedSFlagAndQRV;
172+
byte @field = ReservedSFlagAndQRV;
173173

174174
// mask in the new field
175-
field = (byte) ((field & 0xF7) | (value ? 1 : 0) & 0x08);
175+
@field = (byte) ((@field & 0xF7) | (value ? 1 : 0) & 0x08);
176176

177177
// write the updated value back
178-
ReservedSFlagAndQRV = field;
178+
ReservedSFlagAndQRV = @field;
179179
}
180180
}
181181

PacketDotNet/PacketDotNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net9.0;net472</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net9.0;net10.0;net472</TargetFrameworks>
55
<Authors>Chris Morgan (chmorgan@gmail.com)</Authors>
66
<LangVersion>latest</LangVersion>
77
<SignAssembly>true</SignAssembly>

Test/Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
</PropertyGroup>
77

0 commit comments

Comments
 (0)