-
Notifications
You must be signed in to change notification settings - Fork 0
992 lines (946 loc) · 36.6 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
# This file is part of Aeronautical Wireshark Plugin.
#
# Copyright (C) 2023 Airbus CyberSecurity SAS
#
# Aeronautical Wireshark Plugin is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Aeronautical Wireshark Plugin is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Aeronautical Wireshark Plugin. If not, see <https://www.gnu.org/licenses/>.
name: CI
on:
push:
env:
# Variables to update in case of new versions
LUABITOP_VERSION: "1.0.2"
WIRESHARK_VERSION: "4.2.5"
LUA_VERSION: "5.2.4"
WIRESHARK_BUILD_OPTS: "-DBUILD_logray=OFF -DBUILD_tfshark=OFF -DBUILD_rawshark=OFF -DBUILD_dumpcap=OFF -DBUILD_text2pcap=OFF -DBUILD_mergecap=OFF -DBUILD_reordercap=OFF -DBUILD_editcap=OFF -DBUILD_capinfos=OFF -DBUILD_captype=OFF -DBUILD_randpkt=OFF -DBUILD_dftest=OFF -DBUILD_corbaidl2wrs=OFF -DBUILD_dcerpcidl2wrs=OFF -DBUILD_xxx2deb=OFF -DBUILD_androiddump=OFF -DBUILD_sshdump=OFF -DBUILD_ciscodump=OFF -DBUILD_dpauxmon=OFF -DBUILD_randpktdump=OFF -DBUILD_wifidump=OFF -DBUILD_etwdump=OFF -DBUILD_sdjournal=OFF -DBUILD_udpdump=OFF -DBUILD_falcodump=OFF -DBUILD_sharkd=OFF -DBUILD_mmdbresolve=OFF -DBUILD_fuzzshark=OFF -DENABLE_PCAP=OFF -DENABLE_AIRPCAP=OFF -DENABLE_ZLIB=OFF -DENABLE_MINIZIP=OFF -DENABLE_LZ4=OFF -DENABLE_BROTLI=OFF -DENABLE_SNAPPY=OFF -DENABLE_ZSTD=OFF -DENABLE_NGHTTP2=OFF -DENABLE_NGHTTP3=OFF -DENABLE_LUA=ON -DENABLE_SMI=OFF -DENABLE_GNUTLS=OFF -DENABLE_KERBEROS=OFF -DENABLE_SBC=OFF -DENABLE_SPANDSP=OFF -DENABLE_BCG729=OFF -DENABLE_AMRNB=OFF -DENABLE_ILBC=OFF -DENABLE_LIBXML2=OFF -DENABLE_OPUS=OFF -DENABLE_SINSP=OFF"
jobs:
# Dependency download for all builds
dependency_download:
runs-on: ubuntu-latest
env:
LUA_URL: https://www.lua.org/ftp
LUA_BITOP_URL: http://bitop.luajit.org/download
WIRESHARK_URL: https://2.na.dl.wireshark.org
MACPORTS_URL: https://github.com/macports/macports-base/releases/download/
steps:
# Get all sources
- name: Get Wireshark sources
run: wget ${WIRESHARK_URL}/src/wireshark-${WIRESHARK_VERSION}.tar.xz -O wireshark.tar.xz
- name: Get Wireshark Windows installer
run: wget ${WIRESHARK_URL}/win64/Wireshark-${WIRESHARK_VERSION}-x64.exe -O wireshark.exe
- name: Get Lua sources
run: wget ${LUA_URL}/lua-${LUA_VERSION}.tar.gz -O lua.tar.gz
- name: Get LuaBitOp sources
run: wget ${LUA_BITOP_URL}/LuaBitOp-${LUABITOP_VERSION}.zip -O bitop.zip
# Store Sources as artifacts for future stages
- name: Archive Wireshark sources as artifact
uses: actions/upload-artifact@v4
with:
name: Wireshark-Sources
path: wireshark.tar.xz
if-no-files-found: error
- name: Archive Winreshark Windows installer as artifact
uses: actions/upload-artifact@v4
with:
name: Wireshark-Windows-Installer
path: wireshark.exe
if-no-files-found: error
- name: Archive Lua sources as artifact
uses: actions/upload-artifact@v4
with:
name: Lua-Sources
path: lua.tar.gz
if-no-files-found: error
- name: Archive LuaBitOp sources as artifact
uses: actions/upload-artifact@v4
with:
name: LuaBitOp-Sources
path: bitop.zip
if-no-files-found: error
# Windows build
luabitop_windows_build:
runs-on: windows-latest
needs: dependency_download
steps:
# Get all sources
- name: Download LuaBitOp sources
uses: actions/download-artifact@v4
with:
name: LuaBitOp-Sources
- name: Download Wireshark installer
uses: actions/download-artifact@v4
with:
name: Wireshark-Windows-Installer
- name: Download Lua sources
uses: actions/download-artifact@v4
with:
name: Lua-Sources
# Extract / rename folders and delete downloads
- name: Unzip DLL source code
run: tar -xf bitop.zip
- name: Normalize DLL source code folder
run: mv LuaBitOp* dll
- name: Delete DLL source code archive
run: rm bitop.zip
- name: Unzip Lua source code
run: tar -xf lua.tar.gz
- name: Normalize Lua source code folder
run: mv lua-* lua
- name: Delete Lua source code archive
run: rm lua.tar.gz
- name: Extract lua52.dll from wireshark.exe
run: 7z e wireshark.exe lua52.dll
- name: Rename Lua DLL with the right name for the build
run: mv lua52.dll lua51.dll
- name: Delete Wireshark executable
run: rm wireshark.exe
# Copy everything in build directory (dll) and compile
- name: Copy Lua Source code to build directory
run: cp lua\src\* dll
- name: Compile
run: cd dll && mingw32-make -f Makefile.mingw
- name: Move DLL to working directory
run: mv dll/bit.dll bit.dll
# Store LuaBitOp DLL as artifact for future usage
- name: Archive LuaBitOp DLL as artifact
uses: actions/upload-artifact@v4
with:
name: LuaBitOp-DLL
path: bit.dll
if-no-files-found: error
package_windows_plugin:
runs-on: windows-latest
needs: luabitop_windows_build
steps:
- name: Get Plugin
uses: actions/checkout@v4
with:
sparse-checkout: .
- name: Download LuaBitOp DLL
uses: actions/download-artifact@v4
with:
name: LuaBitOp-DLL
- name: Create directory structure
run: mkdir -p Wireshark/plugins
- name: Move plugin files
run: mv cyber_*.lua,LICENSE,README.md,COPYING Wireshark/plugins
- name: Move LuaBitOp DLL and user_dlts
run: mv bit.dll,user_dlts Wireshark
- name: Package plugin
run: Compress-Archive -Path Wireshark -DestinationPath Wireshark_plugin.zip
# Store Wireshark plugin as artifact for future usage
- name: Archive plugin as artifact
uses: actions/upload-artifact@v4
with:
name: Wireshark-plugin-windows
path: Wireshark_plugin.zip
if-no-files-found: error
test_a429_windows:
runs-on: windows-latest
needs: package_windows_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download Wireshark plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-windows
- name: Download Wireshark
uses: actions/download-artifact@v4
with:
name: Wireshark-Windows-Installer
- name: Install Wireshark
run: |
.\wireshark.exe /S
Start-Sleep -Seconds 30
- name: Test TShark availability
run: '& "${env:PROGRAMFILES}\Wireshark\tshark.exe" --version'
- name: Install plugin
run: Expand-Archive Wireshark_plugin.zip ${ENV:PROGRAMFILES} -Force
- name: Run TShark on ARINC429 traffic
run: '& "${env:PROGRAMFILES}\Wireshark\tshark.exe" -e A429.LABEL -e A429.WORD -e A429.SDI -e A429.SSM -e A429.DATA -e A429.PARITY -E header=y -T fields -r pcapng_files/arinc429_broadcast.pcapng | tee a429_broadcast.output'
- name: Run diff
run: fc.exe a429_broadcast.output test/a429_broadcast.output
test_discrete_windows:
runs-on: windows-latest
needs: package_windows_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download Wireshark plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-windows
- name: Download Wireshark
uses: actions/download-artifact@v4
with:
name: Wireshark-Windows-Installer
- name: Install Wireshark
run: |
.\wireshark.exe /S
Start-Sleep -Seconds 30
- name: Test TShark availability
run: '& "${env:PROGRAMFILES}\Wireshark\tshark.exe" --version'
- name: Install plugin
run: Expand-Archive Wireshark_plugin.zip ${ENV:PROGRAMFILES} -Force
- name: Run TShark on discrete traffic
run: '& "${env:PROGRAMFILES}\Wireshark\tshark.exe" -e DISCRETE.VALUE -E header=y -T fields -r pcapng_files/discrete.pcapng | tee discrete.output'
- name: Run diff
run: fc.exe discrete.output test/discrete.output
release_windows_plugin:
runs-on: ubuntu-latest
needs: [test_a429_windows, test_discrete_windows]
permissions:
contents: write
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-windows
- name: Rename archive
run: mv Wireshark_plugin.zip Wireshark_plugin-windows-${{ github.ref_name }}.zip
- name: Release Windows plugin
uses: softprops/action-gh-release@v2
with:
files: Wireshark_plugin-windows-${{ github.ref_name }}.zip
fail_on_unmatched_files: true
# Ubuntu and debian derivatives build
package_ubuntu_plugin:
runs-on: ubuntu-latest
steps:
- name: Get Plugin
uses: actions/checkout@v4
with:
sparse-checkout: .
- name: Create directory structure
run: mkdir -p lib/x86_64-linux-gnu/wireshark/plugins share/wireshark
- name: Move plugin files
run: mv cyber_*.lua LICENSE README.md COPYING lib/x86_64-linux-gnu/wireshark/plugins
- name: Move user_dlts file
run: mv user_dlts share/wireshark
- name: Package plugin
run: zip -r Wireshark_plugin.zip share lib
# Store Wireshark plugin as artifact for future usage
- name: Archive plugin as artifact
uses: actions/upload-artifact@v4
with:
name: Wireshark-plugin-ubuntu
path: Wireshark_plugin.zip
if-no-files-found: error
test_a429_ubuntu:
runs-on: ubuntu-latest
needs: package_ubuntu_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-ubuntu
- name: Install luabitop
run: sudo apt-get install lua-bitop
- name: Install TShark
run: sudo apt-get install tshark
- name: Test TShark availability
run: tshark --version
- name: Extract Wireshark plugin
run: sudo unzip Wireshark_plugin.zip -d /usr
- name: Run TShark on ARINC429 traffic
run: tshark -e A429.LABEL -e A429.WORD -e A429.SDI -e A429.SSM -e A429.DATA -e A429.PARITY -E header=y -T fields -r pcapng_files/arinc429_broadcast.pcapng | tee a429_broadcast.output
- name: Run diff
run: diff a429_broadcast.output test/a429_broadcast.output
test_discrete_ubuntu:
runs-on: ubuntu-latest
needs: package_ubuntu_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-ubuntu
- name: Install TShark
run: sudo apt-get install tshark
- name: Test TShark availability
run: tshark --version
- name: Extract Wireshark plugin
run: sudo unzip Wireshark_plugin.zip -d /usr
- name: Run TShark on discrete traffic
run: tshark -e DISCRETE.VALUE -E header=y -T fields -r pcapng_files/discrete.pcapng | tee discrete.output
- name: Run diff
run: diff discrete.output test/discrete.output
test_a429_debian:
runs-on: ubuntu-latest
needs: package_ubuntu_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-ubuntu
- name: Run TShark on ARINC429 traffic
run: >
docker run -v .:/test debian sh -c "
apt-get update &&
apt-get install -y tshark lua-bitop unzip &&
unzip /test/Wireshark_plugin.zip -d /usr &&
tshark -e A429.LABEL -e A429.WORD -e A429.SDI -e A429.SSM -e A429.DATA -e A429.PARITY -E header=y -T fields -r /test/pcapng_files/arinc429_broadcast.pcapng | tee /test/a429_broadcast.output
"
- name: Run diff
run: diff a429_broadcast.output test/a429_broadcast.output
test_discrete_debian:
runs-on: ubuntu-latest
needs: package_ubuntu_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-ubuntu
- name: Run TShark on ARINC429 traffic
run: >
docker run -v .:/test debian sh -c "
apt-get update &&
apt-get install -y tshark unzip &&
unzip /test/Wireshark_plugin.zip -d /usr &&
tshark -e DISCRETE.VALUE -E header=y -T fields -r /test/pcapng_files/discrete.pcapng | tee /test/discrete.output
"
- name: Run diff
run: diff discrete.output test/discrete.output
release_ubuntu_plugin:
runs-on: ubuntu-latest
needs: [test_a429_ubuntu, test_discrete_ubuntu, test_a429_debian, test_discrete_debian]
permissions:
contents: write
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-ubuntu
- name: Rename archive
run: mv Wireshark_plugin.zip Wireshark_plugin-ubuntu-${{ github.ref_name }}.zip
- name: Release Ubuntu plugin
uses: softprops/action-gh-release@v2
with:
files: Wireshark_plugin-ubuntu-${{ github.ref_name }}.zip
fail_on_unmatched_files: true
# Standard build (alpine, archlinux)
package_standard_plugin:
runs-on: ubuntu-latest
steps:
- name: Get Plugin
uses: actions/checkout@v4
with:
sparse-checkout: .
- name: Create directory structure
run: mkdir -p lib/wireshark/plugins share/wireshark
- name: Move plugin files
run: mv cyber_*.lua LICENSE README.md COPYING lib/wireshark/plugins
- name: Move user_dlts file
run: mv user_dlts share/wireshark
- name: Package plugin
run: zip -r Wireshark_plugin.zip share lib
# Store Wireshark plugin as artifact for future usage
- name: Archive plugin as artifact
uses: actions/upload-artifact@v4
with:
name: Wireshark-plugin-standard
path: Wireshark_plugin.zip
if-no-files-found: error
test_a429_alpine:
runs-on: ubuntu-latest
needs: package_standard_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-standard
- name: Run TShark on ARINC429 traffic
run: >
docker run -v .:/test alpine sh -c "
apk add tshark lua5.2-bitop &&
unzip /test/Wireshark_plugin.zip -d /usr &&
tshark -e A429.LABEL -e A429.WORD -e A429.SDI -e A429.SSM -e A429.DATA -e A429.PARITY -E header=y -T fields -r /test/pcapng_files/arinc429_broadcast.pcapng | tee /test/a429_broadcast.output
"
- name: Run diff
run: diff a429_broadcast.output test/a429_broadcast.output
test_discrete_alpine:
runs-on: ubuntu-latest
needs: package_standard_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-standard
- name: Run TShark on ARINC429 traffic
run: >
docker run -v .:/test alpine sh -c "
apk add tshark &&
unzip /test/Wireshark_plugin.zip -d /usr &&
tshark -e DISCRETE.VALUE -E header=y -T fields -r /test/pcapng_files/discrete.pcapng | tee /test/discrete.output
"
- name: Run diff
run: diff discrete.output test/discrete.output
test_a429_archlinux:
runs-on: ubuntu-latest
needs: package_standard_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-standard
- name: Run TShark on ARINC429 traffic
run: >
docker run -v .:/test archlinux sh -c "
pacman -Syu --noconfirm unzip wireshark-cli lua52-bitop diffutils &&
unzip /test/Wireshark_plugin.zip -d /usr &&
tshark -e A429.LABEL -e A429.WORD -e A429.SDI -e A429.SSM -e A429.DATA -e A429.PARITY -E header=y -T fields -r /test/pcapng_files/arinc429_broadcast.pcapng | tee /test/a429_broadcast.output
"
- name: Run diff
run: diff a429_broadcast.output test/a429_broadcast.output
test_discrete_archlinux:
runs-on: ubuntu-latest
needs: package_standard_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-standard
- name: Run TShark on ARINC429 traffic
run: >
docker run -v .:/test archlinux sh -c "
pacman -Syu --noconfirm unzip wireshark-cli diffutils &&
unzip /test/Wireshark_plugin.zip -d /usr &&
tshark -e DISCRETE.VALUE -E header=y -T fields -r /test/pcapng_files/discrete.pcapng | tee /test/discrete.output
"
- name: Run diff
run: diff discrete.output test/discrete.output
release_standard_plugin:
runs-on: ubuntu-latest
needs: [test_a429_alpine, test_discrete_alpine, test_a429_archlinux, test_discrete_archlinux]
permissions:
contents: write
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-standard
- name: Rename archive
run: mv Wireshark_plugin.zip Wireshark_plugin-standard-${{ github.ref_name }}.zip
- name: Release Standard plugin
uses: softprops/action-gh-release@v2
with:
files: Wireshark_plugin-standard-${{ github.ref_name }}.zip
fail_on_unmatched_files: true
# RHEL-like build
package_centos_plugin:
runs-on: ubuntu-latest
steps:
- name: Get Plugin
uses: actions/checkout@v4
with:
sparse-checkout: .
- name: Create directory structure
run: mkdir -p lib64/wireshark/plugins share/wireshark
- name: Move plugin files
run: mv cyber_*.lua LICENSE README.md COPYING lib64/wireshark/plugins
- name: Move user_dlts file
run: mv user_dlts share/wireshark
- name: Package plugin
run: zip -r Wireshark_plugin.zip share lib64
# Store Wireshark plugin as artifact for future usage
- name: Archive plugin as artifact
uses: actions/upload-artifact@v4
with:
name: Wireshark-plugin-centos
path: Wireshark_plugin.zip
if-no-files-found: error
test_a429_centos_amazonlinux:
runs-on: ubuntu-latest
needs: [package_centos_plugin, dependency_download]
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-centos
- name: Download LuaBitOp sources
uses: actions/download-artifact@v4
with:
name: LuaBitOp-Sources
- name: Download Lua sources
uses: actions/download-artifact@v4
with:
name: Lua-Sources
- name: Download Wireshark sources
uses: actions/download-artifact@v4
with:
name: Wireshark-Sources
- name: Compile and run TShark on ARINC429 traffic
run: >
docker run -v .:/test amazonlinux sh -c "
yum install -y xz cmake g++ glib2-devel libgcrypt-devel c-ares-devel flex patch readline-devel unzip tar gzip &&
tar -xvf /test/lua.tar.gz &&
cd lua-* &&
make "MYCFLAGS=-fPIC" linux install &&
cd .. &&
tar -xvf /test/wireshark.tar.xz &&
cd wireshark-* &&
cmake ${WIRESHARK_BUILD_OPTS} -DENABLE_LUA=ON -DFETCH_lua=OFF -DBUILD_wireshark=OFF -DBUILD_tshark=ON . &&
make tshark install &&
cd .. &&
unzip /test/Wireshark_plugin.zip -d /usr/local &&
unzip /test/bitop.zip &&
cd LuaBitOp-* &&
make install &&
cd .. &&
tshark -e A429.LABEL -e A429.WORD -e A429.SDI -e A429.SSM -e A429.DATA -e A429.PARITY -E header=y -T fields -r /test/pcapng_files/arinc429_broadcast.pcapng | tee /test/a429_broadcast.output
"
- name: Run diff
run: diff a429_broadcast.output test/a429_broadcast.output
test_discrete_centos_amazonlinux:
runs-on: ubuntu-latest
needs: [package_centos_plugin, dependency_download]
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-centos
- name: Download Wireshark sources
uses: actions/download-artifact@v4
with:
name: Wireshark-Sources
- name: Compile and run TShark on ARINC429 traffic
run: >
docker run -v .:/test amazonlinux sh -c "
yum install -y xz cmake g++ glib2-devel libgcrypt-devel c-ares-devel flex patch readline-devel unzip tar gzip &&
tar -xvf test/wireshark.tar.xz &&
cd wireshark-* &&
cmake ${WIRESHARK_BUILD_OPTS} -DENABLE_LUA=ON -DFETCH_lua=ON -DBUILD_wireshark=OFF -DBUILD_tshark=ON . &&
make tshark install &&
cd .. &&
unzip /test/Wireshark_plugin.zip -d /usr/local &&
tshark -e DISCRETE.VALUE -E header=y -T fields -r /test/pcapng_files/discrete.pcapng | tee /test/discrete.output
"
- name: Run diff
run: diff discrete.output test/discrete.output
test_a429_centos_stream9:
runs-on: ubuntu-latest
needs: [package_centos_plugin, dependency_download]
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-centos
- name: Download LuaBitOp sources
uses: actions/download-artifact@v4
with:
name: LuaBitOp-Sources
- name: Download Lua sources
uses: actions/download-artifact@v4
with:
name: Lua-Sources
- name: Download Wireshark sources
uses: actions/download-artifact@v4
with:
name: Wireshark-Sources
- name: Compile and run TShark on ARINC429 traffic
run: >
docker run -v .:/test quay.io/centos/centos:stream9 sh -c "
yum install -y xz cmake g++ glib2-devel libgcrypt-devel c-ares-devel flex patch readline-devel unzip &&
tar -xvf /test/lua.tar.gz &&
cd lua-* &&
make "MYCFLAGS=-fPIC" linux install &&
cd .. &&
tar -xvf /test/wireshark.tar.xz &&
cd wireshark-* &&
cmake ${WIRESHARK_BUILD_OPTS} -DENABLE_LUA=ON -DFETCH_lua=OFF -DBUILD_wireshark=OFF -DBUILD_tshark=ON . &&
make tshark install &&
cd .. &&
unzip /test/Wireshark_plugin.zip -d /usr/local &&
unzip /test/bitop.zip &&
cd LuaBitOp-* &&
make install &&
cd .. &&
tshark -e A429.LABEL -e A429.WORD -e A429.SDI -e A429.SSM -e A429.DATA -e A429.PARITY -E header=y -T fields -r /test/pcapng_files/arinc429_broadcast.pcapng | tee /test/a429_broadcast.output
"
- name: Run diff
run: diff a429_broadcast.output test/a429_broadcast.output
test_discrete_centos_stream9:
runs-on: ubuntu-latest
needs: [package_centos_plugin, dependency_download]
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-centos
- name: Download Wireshark sources
uses: actions/download-artifact@v4
with:
name: Wireshark-Sources
- name: Compile and run TShark on ARINC429 traffic
run: >
docker run -v .:/test quay.io/centos/centos:stream9 sh -c "
yum install -y xz cmake g++ glib2-devel libgcrypt-devel c-ares-devel flex patch readline-devel unzip &&
tar -xvf /test/wireshark.tar.xz &&
cd wireshark-* &&
cmake ${WIRESHARK_BUILD_OPTS} -DENABLE_LUA=ON -DFETCH_lua=ON -DBUILD_wireshark=OFF -DBUILD_tshark=ON . &&
make tshark install &&
cd .. &&
unzip /test/Wireshark_plugin.zip -d /usr/local &&
tshark -e DISCRETE.VALUE -E header=y -T fields -r /test/pcapng_files/discrete.pcapng | tee /test/discrete.output
"
- name: Run diff
run: diff discrete.output test/discrete.output
test_a429_centos_almalinux:
runs-on: ubuntu-latest
needs: [package_centos_plugin, dependency_download]
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-centos
- name: Download LuaBitOp sources
uses: actions/download-artifact@v4
with:
name: LuaBitOp-Sources
- name: Download Lua sources
uses: actions/download-artifact@v4
with:
name: Lua-Sources
- name: Download Wireshark sources
uses: actions/download-artifact@v4
with:
name: Wireshark-Sources
- name: Compile and run TShark on ARINC429 traffic
run: >
docker run -v .:/test almalinux sh -c "
yum install -y xz cmake g++ glib2-devel libgcrypt-devel c-ares-devel flex patch readline-devel unzip &&
tar -xvf /test/lua.tar.gz &&
cd lua-* &&
make "MYCFLAGS=-fPIC" linux install &&
cd .. &&
tar -xvf /test/wireshark.tar.xz &&
cd wireshark-* &&
cmake ${WIRESHARK_BUILD_OPTS} -DENABLE_LUA=ON -DFETCH_lua=OFF -DBUILD_wireshark=OFF -DBUILD_tshark=ON . &&
make tshark install &&
cd .. &&
unzip /test/Wireshark_plugin.zip -d /usr/local &&
unzip /test/bitop.zip &&
cd LuaBitOp-* &&
make install &&
cd .. &&
tshark -e A429.LABEL -e A429.WORD -e A429.SDI -e A429.SSM -e A429.DATA -e A429.PARITY -E header=y -T fields -r /test/pcapng_files/arinc429_broadcast.pcapng | tee /test/a429_broadcast.output
"
- name: Run diff
run: diff a429_broadcast.output test/a429_broadcast.output
test_discrete_centos_almalinux:
runs-on: ubuntu-latest
needs: [package_centos_plugin, dependency_download]
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-centos
- name: Download Wireshark sources
uses: actions/download-artifact@v4
with:
name: Wireshark-Sources
- name: Compile and run TShark on ARINC429 traffic
run: >
docker run -v .:/test almalinux sh -c "
yum install -y xz cmake g++ glib2-devel libgcrypt-devel c-ares-devel flex patch readline-devel unzip &&
tar -xvf /test/wireshark.tar.xz &&
cd wireshark-* &&
cmake ${WIRESHARK_BUILD_OPTS} -DENABLE_LUA=ON -DFETCH_lua=ON -DBUILD_wireshark=OFF -DBUILD_tshark=ON . &&
make tshark install &&
cd .. &&
unzip /test/Wireshark_plugin.zip -d /usr/local &&
tshark -e DISCRETE.VALUE -E header=y -T fields -r /test/pcapng_files/discrete.pcapng | tee /test/discrete.output
"
- name: Run diff
run: diff discrete.output test/discrete.output
test_a429_centos_fedora:
runs-on: ubuntu-latest
needs: package_centos_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-centos
- name: Run TShark on ARINC429 traffic
run: >
docker run -v .:/test fedora sh -c "
yum install -y wireshark-cli unzip &&
unzip /test/Wireshark_plugin.zip -d /usr &&
tshark -e A429.LABEL -e A429.WORD -e A429.SDI -e A429.SSM -e A429.DATA -e A429.PARITY -E header=y -T fields -r /test/pcapng_files/arinc429_broadcast.pcapng | tee /test/a429_broadcast.output
"
- name: Run diff
run: diff a429_broadcast.output test/a429_broadcast.output
test_discrete_centos_fedora:
runs-on: ubuntu-latest
needs: package_centos_plugin
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-centos
- name: Run TShark on ARINC429 traffic
run: >
docker run -v .:/test fedora sh -c "
yum install -y wireshark-cli unzip &&
unzip /test/Wireshark_plugin.zip -d /usr &&
tshark -e DISCRETE.VALUE -E header=y -T fields -r /test/pcapng_files/discrete.pcapng | tee /test/discrete.output
"
- name: Run diff
run: diff discrete.output test/discrete.output
release_centos_plugin:
runs-on: ubuntu-latest
needs: [test_a429_centos_amazonlinux, test_discrete_centos_amazonlinux, test_a429_centos_stream9, test_discrete_centos_stream9, test_a429_centos_almalinux, test_discrete_centos_almalinux, test_a429_centos_fedora, test_discrete_centos_fedora]
permissions:
contents: write
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-centos
- name: Rename archive
run: mv Wireshark_plugin.zip Wireshark_plugin-centos-${{ github.ref_name }}.zip
- name: Release CentOS plugin
uses: softprops/action-gh-release@v2
with:
files: Wireshark_plugin-centos-${{ github.ref_name }}.zip
fail_on_unmatched_files: true
# MacOS build
package_macos_plugin:
runs-on: ubuntu-latest
steps:
- name: Get Plugin
uses: actions/checkout@v4
with:
sparse-checkout: .
- name: Create directory structure
run: mkdir -p PlugIns/wireshark Resources/share/wireshark
- name: Move plugin files
run: mv cyber_*.lua LICENSE README.md COPYING PlugIns/wireshark
- name: Move user_dlts file
run: mv user_dlts Resources/share/wireshark
- name: Package plugin
run: zip -r Wireshark_plugin.zip PlugIns Resources
# Store Wireshark plugin as artifact for future usage
- name: Archive plugin as artifact
uses: actions/upload-artifact@v4
with:
name: Wireshark-plugin-macos
path: Wireshark_plugin.zip
if-no-files-found: error
test_a429_macos:
runs-on: macos-latest
needs: [package_macos_plugin]
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-macos
- uses: melusina-org/setup-macports@v1
- name: Install wireshark (with brew)
run: brew install --cask wireshark
- name: Tshark version
run: tshark --version
- name: Install lua54-bitop (with macports)
run: sudo port install lua54-luabitop
# - name: bit.so search
# run: sudo find / -name bit.so || true
# - name: List app
# run: ls -h /Applications/Wireshark.app
# - name: bit.so linkage
# run: sudo ln -s /opt/local/lib/lua/5.4/bit.so /Applications/Wireshark.app/bit.so
- name: Which tshark
run: ls -lhR /opt/local/lib/lua
- name: Which tshark
run: which tshark
- name: Configure rpath for tshark
run: sudo cp /opt/local/lib/lua/5.4/bit.so /opt/homebrew/bin/
- name: Unzip plugin
run: sudo unzip Wireshark_plugin.zip -d /Applications/Wireshark.app/Contents/
- name: Run ARINC429 test
run: export DYLD_LIBRARY_PATH=/opt/local/lib:$DYLD_LIBRARY_PATH && tshark -e A429.LABEL -e A429.WORD -e A429.SDI -e A429.SSM -e A429.DATA -e A429.PARITY -E header=y -T fields -r pcapng_files/arinc429_broadcast.pcapng | tee a429_broadcast.output
- name: Run diff
run: diff a429_broadcast.output test/a429_broadcast.output
test_discrete_macos:
runs-on: macos-latest
needs: [package_macos_plugin]
steps:
- name: Get test files
uses: actions/checkout@v4
with:
sparse-checkout: |
test
pcapng_files
sparse-checkout-cone-mode: false
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-macos
- name: Intall wireshark
run: brew install --cask wireshark
- name: Unzip plugin
run: sudo unzip Wireshark_plugin.zip -d /Applications/Wireshark.app/Contents/
- name: Run discrete test
run: tshark -e DISCRETE.VALUE -E header=y -T fields -r pcapng_files/discrete.pcapng | tee discrete.output
- name: Run diff
run: diff discrete.output test/discrete.output
release_macos_plugin:
runs-on: ubuntu-latest
needs: [test_a429_macos, test_discrete_macos]
permissions:
contents: write
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Download plugin
uses: actions/download-artifact@v4
with:
name: Wireshark-plugin-standard
- name: Rename archive
run: mv Wireshark_plugin.zip Wireshark_plugin-macos-${{ github.ref_name }}.zip
- name: Release MacOS plugin
uses: softprops/action-gh-release@v2
with:
files: Wireshark_plugin-macos-${{ github.ref_name }}.zip
fail_on_unmatched_files: true