From 7c8ddf7f4a67c3feaba13a7b495c91bfc34ffdea Mon Sep 17 00:00:00 2001 From: "ChenYing Kuo (CY)" Date: Wed, 18 Dec 2024 17:10:04 +0800 Subject: [PATCH] Add CI for checking markdown format. (#40) Signed-off-by: ChenYing Kuo --- .github/workflows/ci.yml | 19 +++++++++++++++++++ .markdownlint.yaml | 6 ++++++ README.md | 21 ++++++++++++++++++--- epan-sys/README.md | 2 +- 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .markdownlint.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..234f242 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI + +on: + push: + branches: ["**"] + pull_request: + branches: ["**"] + schedule: + - cron: "0 6 * * 1-5" + +jobs: + markdown_lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: DavidAnson/markdownlint-cli2-action@v18 + with: + config: '.markdownlint.yaml' + globs: '**/README.md' diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..12f7379 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,6 @@ +{ + "MD013": false, # Line length limitation + "MD033": false, # Enable Inline HTML + "MD041": false, # Allow first line heading + "MD045": false, # Allow Images have no alternate text +} \ No newline at end of file diff --git a/README.md b/README.md index 8400929..22fd1b9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ ![zenoh dissector banner](./assets/zenoh-dissector.svg) -# Zenoh Dissector in Rust! -[Zenoh](http://zenoh.io/) protocol dissector for Wireshark. +# Zenoh Dissector in Rust +[Zenoh](http://zenoh.io/) protocol dissector for Wireshark. > [!WARNING] > For Zenoh protocol of version older than 0.10.0, please check the lua plugin [here](https://github.com/eclipse-zenoh/zenoh-dissector/tree/v0.7.2-rc). @@ -14,7 +14,6 @@ You must have Wireshark 4.4 installed on your platform. Please refer to the [download page](https://www.wireshark.org/download.html) or follow the installation commands below. - ## Installation We highly recommend following the instructions in the [releases](https://github.com/eclipse-zenoh/zenoh-dissector/releases). @@ -28,6 +27,7 @@ Zenoh dissector is based on Wireshark EPAN (Enhanced Packet ANalyzer) library. We need to install Wireshark with its library. Please follow the steps below according to your operating system. - Linux (Ubuntu) + ```bash sudo apt install -y software-properties-common sudo add-apt-repository -y ppa:wireshark-dev/stable @@ -38,10 +38,13 @@ We need to install Wireshark with its library. Please follow the steps below acc - macOS Install Wireshark with [Homebrew](https://brew.sh/). + ```bash brew install --cask wireshark ``` + Create a symbolic link for linking the wireshark dynamic library later. + ```bash ln -snf $(find /Applications/Wireshark.app/Contents/Frameworks -name "libwireshark.*.dylib" | tail -n 1) libwireshark.dylib export WIRESHARK_LIB_DIR=$(pwd) @@ -50,6 +53,7 @@ We need to install Wireshark with its library. Please follow the steps below acc - Windows Install Wireshark with [Chocolatey](https://docs.chocolatey.org/en-us/choco/setup#install-with-powershell.exe). + ```bash choco install -y --force --no-progress xsltproc docbook-bundle nsis winflexbison3 cmake wireshark ``` @@ -70,36 +74,44 @@ cargo build --release > > - Windows (Powershell and Windows version >= 10) > For example, assuming that you have Wireshark installed at 'C:\MyWireshark'. You can tell cargo build to find the Wireshark library you want to link. +> > ```powershell > $Env:WIRESHARK_LIB_DIR='C:\MyWireshark' > cargo build --release > ``` +> > Add the folder into the `PATH` so that it can find the dynamic library in runtime. +> > ```powershell > [System.Environment]::SetEnvironmentVariable('PATH', [System.Environment]::GetEnvironmentVariable('PATH', 'user')+';C:\MyWireshark', 'user') > ``` > > - Linux (Ubuntu) and macOS +> > ```bash > WIRESHARK_LIB_DIR=MyWireshark cargo build --release > ``` +> > Add the library into `LD_LIBRARY_PATH` for linux or `DYLD_LIBRARY_PATH` for macOS. ### Move the plugin to Wireshark's plugin folder - Linux (Ubuntu) + ```bash mkdir -p ~/.local/lib/wireshark/plugins/4.4/epan cp ./target/release/libzenoh_dissector.so ~/.local/lib/wireshark/plugins/4.4/epan/libzenoh_dissector.so ``` - macOS + ```bash mkdir -p ~/.local/lib/wireshark/plugins/4-4/epan cp ./target/release/libzenoh_dissector.dylib ~/.local/lib/wireshark/plugins/4-4/epan/libzenoh_dissector.so ``` - Windows + ```powershell $epan_dir = "$Env:APPDATA\Wireshark\plugins\4.4\epan" if (-Not (Test-Path $epan_dir)) { @@ -115,16 +127,19 @@ cargo build --release Running Wireshark in TUI version Linux(Ubuntu) and macOS + ```bash tshark -r ./assets/sample-data.pcap ``` Windows PowerShell + ```powershell & 'C:\Program Files\Wireshark\tshark.exe' -r .\assets\sample-data.pcap ``` Example outpout + ```bash 1 0.000000000 127.0.0.1 → 127.0.0.1 TCP 74 60698 → 7447 [SYN] Seq=0 Win=65495 Len=0 MSS=65495 SACK_PERM TSval=1530879817 TSecr=0 WS=128 2 0.000021385 127.0.0.1 → 127.0.0.1 TCP 74 7447 → 60698 [SYN, ACK] Seq=0 Ack=1 Win=65483 Len=0 MSS=65495 SACK_PERM TSval=1530879817 TSecr=1530879817 WS=128 diff --git a/epan-sys/README.md b/epan-sys/README.md index 68610a5..0440ff8 100644 --- a/epan-sys/README.md +++ b/epan-sys/README.md @@ -3,10 +3,10 @@ Epan, Enhanced Packet ANalyzer, is the packet analyzing engine in Wireshark. It provides rich APIs to let users develop their dissectors. We use bindgen to generate a Rust FFI bindings based on its c library. - ## Usage Link and build the library + ```bash cargo build --release ```