Skip to content

Commit

Permalink
Merge branch 'master' into branch-removal
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Mar 18, 2024
2 parents 66eb370 + 72c338d commit 0ab2373
Show file tree
Hide file tree
Showing 200 changed files with 1,025 additions and 1,942 deletions.
54 changes: 24 additions & 30 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright 2020-2021 Chris Morgan <[email protected]>
# SPDX-License-Identifier: MIT

environment:
# This key is encrypted using secdev's appveyor private key,
Expand All @@ -9,40 +11,32 @@ environment:
# Disable automatic AppVeyor build logic
build: off
skip_branch_with_pr: true
branches:
only:
- master

image:
- Visual Studio 2022
- Ubuntu1804
- macos

for:
-
matrix:
only:
- image: Visual Studio 2022
install:
- ps: .\scripts\install-windows.ps1
- ps: .\scripts\Install-npcap.ps1
- ps: .\scripts\install-winpkfilter.ps1
build_script:
- dotnet build -c Release
test_script:
- bash scripts/test.sh --filter "TestCategory!=RemotePcap&TestCategory!=WinDivert"
- matrix:
only:
- image: Visual Studio 2022
install:
- ps: .\scripts\install-windows.ps1
- ps: .\scripts\Install-npcap.ps1
- ps: .\scripts\install-winpkfilter.ps1
build_script:
- dotnet build -c Release
test_script:
- bash scripts/test.sh --filter "TestCategory!=RemotePcap&TestCategory!=WinDivert"

-
matrix:
only:
- image: Ubuntu1804
install:
- sudo -E bash scripts/install-libpcap.sh
test_script:
- sudo -E bash scripts/test.sh --filter "TestCategory!=Tunneling"

-
matrix:
only:
- image: macos
install:
- sudo -E bash scripts/install-libpcap.sh
test_script:
- sudo -E bash scripts/test.sh
- matrix:
only:
- image: macos
install:
- brew install --cask dotnet-sdk
- sudo -E bash scripts/install-libpcap.sh
test_script:
- sudo -E bash scripts/test.sh
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2020-2021 Chris Morgan <[email protected]>
# SPDX-License-Identifier: MIT

version: 2.1

orbs:
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2018 Jan Pluskal
# SPDX-License-Identifier: MIT

# Auto detect text files and perform LF normalization
* text=auto

Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2020 Chris Morgan <[email protected]>
# SPDX-License-Identifier: MIT

name: .NET Core

on:
Expand All @@ -12,9 +15,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Install .net dependencies
Expand All @@ -31,19 +34,19 @@ jobs:
- run: sudo chmod -R +r Test/TestResults
if: always()
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: Test/TestResults/TestResults.xml
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: artifacts
path: Test/TestResults/

- name: publish on version change
id: publish_nuget
uses: alirezanet/publish-nuget@v3.0.4
uses: alirezanet/publish-nuget@v3.1.0
with:
# Filepath of the project to be packaged, relative to root of repository
PROJECT_FILE_PATH: SharpPcap/SharpPcap.csproj
Expand All @@ -53,3 +56,15 @@ jobs:

# Flag to toggle pushing symbols along with nuget package to the server, disabled by default
INCLUDE_SYMBOLS: true

license-check:
# We use https://github.com/fsfe/reuse-tool to ensure EVERY file has correct license and copyright info
# Either in the file itself, or in .reuse\dep5 for binary files and files that don't support comments
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: pip install -r requirements.txt
- run: reuse lint
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2018 Jan Pluskal
# SPDX-License-Identifier: MIT

# Created by https://www.gitignore.io/api/visualstudio

### VisualStudio ###
Expand Down Expand Up @@ -299,5 +302,5 @@ __pycache__/

# End of https://www.gitignore.io/api/visualstudio

Scripts/htmldocs
Scripts/monodoc_output
Scripts/htmldocs
Scripts/monodoc_output
31 changes: 31 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: sharppcap
Upstream-Contact: Chris Morgan <[email protected]>
Source: https://github.com/dotpcap/sharppcap

Files: Examples/*
SharpPcap.sln
Test/capture_files/10k_packets.pcap
Test/capture_files/arp_request_response.pcap
Test/capture_files/ipv6_http.pcap
Test/capture_files/ipv6_icmpv6_packet.pcap
Test/capture_files/ip_packet_bogus_length.pcap
Test/capture_files/README
Test/capture_files/tcp.pcap
Test/capture_files/tcp_with_extra_bytes.pcap
Test/capture_files/test_stream.pcap
Test/capture_files/udp_dns_request_response.pcap
Copyright: Tamir Gal <[email protected]>
Chris Morgan <[email protected]>
License: MIT

Files: Tutorial/*
History.md
README.md
renovate.json
Copyright: Chris Morgan <[email protected]>
License: MIT

Files: Test/capture_files/arp_with_vlan.pcap
Copyright: Houcem Benali <[email protected]>
License: MIT
3 changes: 3 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2021-2022 Ayoub Kaanich <[email protected]>
# SPDX-License-Identifier: MIT

version: v1.0
name: Pipeline
agent:
Expand Down
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
Copyright 2020-2021 Ayoub Kaanich <[email protected]>
SPDX-License-Identifier: MIT
-->
<Project>
<PropertyGroup>
<Deterministic>true</Deterministic>
Expand Down
2 changes: 1 addition & 1 deletion Examples/CreatingCaptureFile/CreatingCaptureFile.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharpPcap\SharpPcap.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Examples/CreatingCaptureFile/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

using System;
using SharpPcap;
using SharpPcap.LibPcap;
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example1.IfList/Example01.IfList.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharpPcap\SharpPcap.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Examples/Example1.IfList/Example1.IfList.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

using System;
using SharpPcap;

Expand Down
2 changes: 1 addition & 1 deletion Examples/Example10.SendQueue/Example10.SendQueue.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharpPcap\SharpPcap.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Examples/Example10.SendQueue/Example10.SendQueues.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

using System;
using SharpPcap;
using SharpPcap.LibPcap;
Expand Down
2 changes: 2 additions & 0 deletions Examples/Example11.Statistics/Example11.Statistics.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

using System;
using SharpPcap;
using SharpPcap.LibPcap;
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example11.Statistics/Example11.Statistics.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharpPcap\SharpPcap.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharpPcap\SharpPcap.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Examples/Example12.PacketManipulation/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

using System;
using System.Net.NetworkInformation;
using SharpPcap;
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example2.ArpResolve/Example02.ArpResolve.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharpPcap\SharpPcap.csproj" />
Expand Down
30 changes: 3 additions & 27 deletions Examples/Example2.ArpResolve/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,9 @@
using SharpPcap;
using SharpPcap.LibPcap;

/*
Copyright (c) 2006 Tamir Gal, http://www.tamirgal.com, All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// Copyright (c) 2006 Tamir Gal, http://www.tamirgal.com, All rights reserved.
//
// SPDX-License-Identifier: MIT

namespace Example2
{
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example3.BasicCap/Example03.BasicCap.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharpPcap\SharpPcap.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Examples/Example3.BasicCap/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

using System;
using SharpPcap;
using SharpPcap.LibPcap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharpPcap\SharpPcap.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

using System;
using SharpPcap;

Expand Down
2 changes: 1 addition & 1 deletion Examples/Example5.PcapFilter/Example05.PcapFilter.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharpPcap\SharpPcap.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Examples/Example5.PcapFilter/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

using System;
using SharpPcap;

Expand Down
2 changes: 1 addition & 1 deletion Examples/Example6.DumpTCP/Example06.DumpTCP.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharpPcap\SharpPcap.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Examples/Example6.DumpTCP/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

using System;
using SharpPcap;

Expand Down
2 changes: 1 addition & 1 deletion Examples/Example9.SendPacket/Example09.SendPacket.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharpPcap\SharpPcap.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Examples/Example9.SendPacket/Example9.SendPacket.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: MIT

using System;
using SharpPcap;

Expand Down
Loading

0 comments on commit 0ab2373

Please sign in to comment.