forked from lenticularis39/axpbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Windows github action to use winpcap and run test of axpbox rom
- Loading branch information
Remy van Elst
committed
May 1, 2024
1 parent
f3bd6f4
commit 8e5cf21
Showing
322 changed files
with
56,547 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# - Try to find libpcap include dirs and libraries | ||
# | ||
# Usage of this module as follows: | ||
# | ||
# find_package(PCAP) | ||
# | ||
# Variables used by this module, they can change the default behaviour and need | ||
# to be set before calling find_package: | ||
# | ||
# PCAP_ROOT_DIR Set this variable to the root installation of | ||
# libpcap if the module has problems finding the | ||
# proper installation path. | ||
# | ||
# Variables defined by this module: | ||
# | ||
# PCAP_FOUND System has libpcap, include and library dirs found | ||
# PCAP_INCLUDE_DIR The libpcap include directories. | ||
# PCAP_LIBRARY The libpcap library (possibly includes a thread | ||
# library e.g. required by pf_ring's libpcap) | ||
# HAVE_PF_RING If a found version of libpcap supports PF_RING | ||
# HAVE_PCAP_IMMEDIATE_MODE If the version of libpcap found supports immediate mode | ||
|
||
find_path(PCAP_ROOT_DIR | ||
NAMES include/pcap.h | ||
) | ||
|
||
find_path(PCAP_INCLUDE_DIR | ||
NAMES pcap.h | ||
HINTS ${PCAP_ROOT_DIR}/include | ||
) | ||
|
||
set (HINT_DIR ${PCAP_ROOT_DIR}/lib) | ||
|
||
# On x64 windows, we should look also for the .lib at /lib/x64/ | ||
# as this is the default path for the WinPcap developer's pack | ||
if (${CMAKE_SIZEOF_VOID_P} EQUAL 8 AND WIN32) | ||
set (HINT_DIR ${PCAP_ROOT_DIR}/lib/x64/ ${HINT_DIR}) | ||
endif () | ||
|
||
find_library(PCAP_LIBRARY | ||
NAMES pcap wpcap | ||
HINTS ${HINT_DIR} | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(PCAP DEFAULT_MSG | ||
PCAP_LIBRARY | ||
PCAP_INCLUDE_DIR | ||
) | ||
|
||
include(CheckCXXSourceCompiles) | ||
set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY}) | ||
check_cxx_source_compiles("int main() { return 0; }" PCAP_LINKS_SOLO) | ||
set(CMAKE_REQUIRED_LIBRARIES) | ||
|
||
# check if linking against libpcap also needs to link against a thread library | ||
if (NOT PCAP_LINKS_SOLO) | ||
find_package(Threads) | ||
if (THREADS_FOUND) | ||
set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) | ||
check_cxx_source_compiles("int main() { return 0; }" PCAP_NEEDS_THREADS) | ||
set(CMAKE_REQUIRED_LIBRARIES) | ||
endif (THREADS_FOUND) | ||
if (THREADS_FOUND AND PCAP_NEEDS_THREADS) | ||
set(_tmp ${PCAP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) | ||
list(REMOVE_DUPLICATES _tmp) | ||
set(PCAP_LIBRARY ${_tmp} | ||
CACHE STRING "Libraries needed to link against libpcap" FORCE) | ||
else (THREADS_FOUND AND PCAP_NEEDS_THREADS) | ||
message(FATAL_ERROR "Couldn't determine how to link against libpcap") | ||
endif (THREADS_FOUND AND PCAP_NEEDS_THREADS) | ||
endif (NOT PCAP_LINKS_SOLO) | ||
|
||
include(CheckFunctionExists) | ||
set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY}) | ||
check_function_exists(pcap_get_pfring_id HAVE_PF_RING) | ||
check_function_exists(pcap_set_immediate_mode HAVE_PCAP_IMMEDIATE_MODE) | ||
check_function_exists(pcap_set_tstamp_precision HAVE_PCAP_TIMESTAMP_PRECISION) | ||
set(CMAKE_REQUIRED_LIBRARIES) | ||
|
||
mark_as_advanced( | ||
PCAP_ROOT_DIR | ||
PCAP_INCLUDE_DIR | ||
PCAP_LIBRARY | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Download the firmware | ||
Invoke-WebRequest -Uri 'http://raymii.org/s/inc/downloads/es40-srmon/cl67srmrom.exe' -OutFile 'cl67srmrom.exe' | ||
|
||
# Start AXPbox | ||
Start-Process '..\..\..\build\Release\axpbox' -ArgumentList 'run' -NoNewWindow -RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt | ||
|
||
# Wait for AXPbox to start | ||
Start-Sleep -Seconds 5 | ||
|
||
# Connect to terminal | ||
Start-Process -FilePath 'nc' -ArgumentList '-t', '127.0.0.1', '21000' -NoNewWindow -RedirectStandardOutput 'axp.log' | ||
|
||
# Wait for the last line of log to become P00>>> | ||
$timeout = 600 | ||
while ($true) { | ||
if ($timeout -eq 0) { | ||
Write-Host "waiting for SRM prompt timed out" -ForegroundColor Red | ||
exit 1 | ||
} | ||
|
||
# echo "=== start axp.log ===" | ||
# Get-Content -Path 'axp.log' -Raw | ||
# echo "=== end axp.log ===" | ||
|
||
$content = Get-Content -Path 'axp.log' -Raw | ||
$contentWithoutNullBytes = $content -replace '\0', '' | ||
|
||
if ($contentWithoutNullBytes -match "P00>>>") { | ||
break | ||
} | ||
|
||
Start-Sleep -Seconds 1 | ||
$timeout-- | ||
} | ||
|
||
Stop-Process -Name 'nc' | ||
|
||
# Diff logs | ||
Write-Host -NoNewline -ForegroundColor DarkRed "" | ||
Compare-Object -ReferenceObject (Get-Content 'axp_correct.log') -DifferenceObject (Get-Content 'axp.log') | Format-Table | ||
Write-Host -NoNewline -ForegroundColor DarkGreen "diff clean" | ||
$result = $LASTEXITCODE | ||
Write-Host -NoNewline -ForegroundColor White "" | ||
|
||
Remove-Item -Path 'axp.log', 'cl67*', '*.rom' | ||
exit $result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Makefile for cygwin gcc | ||
# Nate Lawson <nate@rootlabs.com> | ||
|
||
SUBDIRS = basic_dump basic_dump_ex iflist pcap_filter pktdump_ex readfile readfile_ex savedump sendpack UDPdump | ||
|
||
all clean install uninstall: ${SUBDIRS} | ||
for subdir in ${SUBDIRS}; do \ | ||
echo "Entering $$subdir"; \ | ||
(cd $$subdir && ${MAKE} $@) \ | ||
done; |
Oops, something went wrong.