Skip to content

Commit

Permalink
F*k-up in a local 'git'. Hope it's recovered now.
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanem committed Sep 14, 2020
1 parent f6a6865 commit 80edfd1
Show file tree
Hide file tree
Showing 21 changed files with 3,949 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Auto detect text files and perform LF normalization
# * text=auto
*.c eol=crlf
*.h eol=crlf
Makefile.* eol=crlf
wsock_trace eol=crlf
55 changes: 55 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
t
*.map
*.a
*.tmp
*.exe
*.pdb
*.dll
*.exp
*.lib
*.mak
*.obj
*.BIN
*.xz
src/enum_proto.*
src/.depend.*
src/CLANG_obj/*
src/Cygwin_obj/*
src/Debug/*
src/MSVC_obj/*
src/MSVC_obj_x64/*
src/MinGW_obj/*
src/MingW-utils/*
src/UpgradeLog.htm
src/VC6_obj/*
src/Watcom_obj/*
src/rcp/*
src/wsock_trace_mw.def
src/wsock_trace_mw_x64.def
src/wsock_trace_x64.def
src/test/*
src/geoip-gen*.c
src/misc-stuff/*
src/.vs/*
src/Wsock-trace.VC.db
src/Wsock-trace.vcxproj.user
src/get_caller-notes.txt
src/*.i
src/Release/*
src/Debug/*
src/compile_lua_*bit.bat
src/cyg-ver.c
src/init.lua
src/luac.out
src/iso3166-countrycodes.txt
src/libbacktrace/*
cpp_filter.py
asndrop.txt
backup/*
hosts
wsock_trace.appveyor
ws_trace.lck
ws_trace.hnd
ws_trace.hnd-journal
doc/doxygen.log
doc/output/
406 changes: 406 additions & 0 deletions README.md

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions appveyor-script.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
::
:: This .bat is currently called from 'appveyor.yml' at the
:: 'build_script:' stage and then with the 'init' argument.
:: The 'clean' argument is only meant to be used when running
:: this .bat file locally.

@echo off

if %1. == init. goto init
if %1. == clean. goto clean

echo Usage: %0 "init / clean"
exit /b 1

:init
::
:: The "CPU" and "BUILDER" agnostic init-stage.
::
echo Generating %CD%\wsock_trace.appveyor...
echo # > wsock_trace.appveyor
echo # This file was generated from %0. >> wsock_trace.appveyor
echo # >> wsock_trace.appveyor
echo [core] >> wsock_trace.appveyor
echo trace_level = %%WSOCK_TRACE_LEVEL%% >> wsock_trace.appveyor
echo trace_indent = 2 >> wsock_trace.appveyor
echo trace_caller = 1 >> wsock_trace.appveyor
echo trace_report = %%WSOCK_TRACE_LEVEL%% >> wsock_trace.appveyor
echo trace_time = relative >> wsock_trace.appveyor
echo trace_max_len = %%COLUMNS%% >> wsock_trace.appveyor
echo callee_level = 1 >> wsock_trace.appveyor
echo cpp_demangle = 1 >> wsock_trace.appveyor
echo short_errors = 1 >> wsock_trace.appveyor
echo use_full_path = 1 >> wsock_trace.appveyor
echo use_toolhlp32 = 1 >> wsock_trace.appveyor
echo dump_modules = 0 >> wsock_trace.appveyor
echo dump_select = 1 >> wsock_trace.appveyor
echo dump_hostent = 1 >> wsock_trace.appveyor
echo dump_protoent = 1 >> wsock_trace.appveyor
echo dump_servent = 1 >> wsock_trace.appveyor
echo dump_nameinfo = 1 >> wsock_trace.appveyor
echo dump_wsaprotocol_info = 1 >> wsock_trace.appveyor
echo dump_wsanetwork_events = 1 >> wsock_trace.appveyor
echo dump_data = 1 >> wsock_trace.appveyor
echo max_data = 5000 >> wsock_trace.appveyor
echo max_displacement = 1000 >> wsock_trace.appveyor
echo exclude = htons,htonl,inet_addr >> wsock_trace.appveyor
echo hosts_file = %CD%\appveyor-hosts >> wsock_trace.appveyor
echo use_winhttp = 0 >> wsock_trace.appveyor
echo [geoip] >> wsock_trace.appveyor
echo enable = 1 >> wsock_trace.appveyor
echo use_generated = 0 >> wsock_trace.appveyor
echo max_days = 10 >> wsock_trace.appveyor
echo geoip4_file = %CD%\geoip >> wsock_trace.appveyor
echo geoip6_file = %CD%\geoip6 >> wsock_trace.appveyor
echo ip2location_bin_file = %CD%\IP46-COUNTRY.BIN >> wsock_trace.appveyor
echo [idna] >> wsock_trace.appveyor
echo enable = 1 >> wsock_trace.appveyor
echo [lua] >> wsock_trace.appveyor
echo enable = %%WSOCK_LUA_ENABLE%% >> wsock_trace.appveyor
echo trace_level = 1 >> wsock_trace.appveyor
echo lua_init = %CD%\src\wsock_trace_init.lua >> wsock_trace.appveyor
echo lua_exit = %CD%\src\wsock_trace_exit.lua >> wsock_trace.appveyor
echo [dnsbl] >> wsock_trace.appveyor
echo enable = 1 >> wsock_trace.appveyor
echo test = %%WSOCK_DNSBL_TEST%% >> wsock_trace.appveyor
echo max_days = 1 >> wsock_trace.appveyor
echo drop_file = %CD%\drop.txt >> wsock_trace.appveyor
echo edrop_file = %CD%\edrop.txt >> wsock_trace.appveyor
echo dropv6_file = %CD%\dropv6.txt >> wsock_trace.appveyor
echo drop_url = http://www.spamhaus.org/drop/drop.txt >> wsock_trace.appveyor
echo edrop_url = http://www.spamhaus.org/drop/edrop.txt >> wsock_trace.appveyor
echo dropv6_url = http://www.spamhaus.org/drop/dropv6.txt >> wsock_trace.appveyor
echo [firewall] >> wsock_trace.appveyor
echo enable = 0 >> wsock_trace.appveyor
echo show_ipv4 = 1 >> wsock_trace.appveyor
echo show_ipv6 = 0 >> wsock_trace.appveyor
echo show_all = 0 >> wsock_trace.appveyor
echo api_level = 3 >> wsock_trace.appveyor

::
:: Windows-Defender thinks generating a 'hosts' file is suspicious.
:: Even generating 'appveyor-hosts' triggers Windows-Defender.
:: Therefore generate it by the 'type' command below.
::
:: Ref:
:: https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?name=Trojan%3aBAT%2fQhost!gen&threatid=2147649092
::
echo Generating appveyor-hosts file...
type appveyor_hosts_content.txt > appveyor-hosts

::
:: These should survive until 'build_script' for 'msvc', 'mingw', 'cygwin', or 'watcom' get to run.
::
set WSOCK_TRACE=%CD%\wsock_trace.appveyor
set WSOCK_TRACE_LEVEL=2
set COLUMNS=120

::
:: Some issue with the Cygwin builds forces me to put the generated
:: 'wsock_trace.appveyor' in AppVeyor's %APPDATA% directory.
::
copy wsock_trace.appveyor c:\Users\appveyor\AppData\Roaming\wsock_trace > NUL
exit /b 0

::
:: Cleanup after a local 'appveyor-script <builder>'.
:: This is not used by AppVeyor itself (not refered in appveyor.yml).
::
:clean
del /Q IP46-COUNTRY.BIN xz.exe wsock_trace.appveyor appveyor-hosts watcom20.zip 2> NUL
echo Cleaning done.
exit /b 0
160 changes: 160 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
version: 1.0.{build}

#
# Skipping commits affecting these files.
#
skip_commits:
files:
- '**/*.md'
- '**/*.png'
- '**/*.jpg'

environment:
global:
CL: -nologo -MP
matrix:
- BUILDER: msvc
CPU: x86
- BUILDER: msvc
CPU: x64
- BUILDER: mingw
CPU: x86
- BUILDER: mingw
CPU: x64
- BUILDER: cygwin
CPU: x86
- BUILDER: cygwin
CPU: x64
- BUILDER: watcom
CPU: x86

matrix:
#
# Immediately finish build if one of the above jobs fails.
#
fast_finish: true
allow_failures:
- BUILDER: watcom
- BUILDER: cygwin

#
# todo: Get better version string.
#
cache:
- wsock-trace-%APPVEYOR_BUILD_NUMBER%

before_build:
#
# clone the submodules.
#
- cmd: git submodule update --init --recursive

#
# Download IP2Location Database (with IPv4+IP6 addresses) and decompress using '7z'.
#
- cmd: curl -O -# http://www.watt-32.net/CI/IP46-COUNTRY.BIN.xz
- cmd: 7z x IP46-COUNTRY.BIN.xz > NUL

install:
#
# Add a few locations to our PATH.
# And setup the compiler environment for Watcom
# (it seems it cannot be done in 'appveyor-script.bat init')
#
- cmd: set WATCOM=%APPVEYOR_BUILD_FOLDER%\watcom
- cmd: set PATH=%APPVEYOR_BUILD_FOLDER%\src;%WATCOM%\binnt;%PATH%
- cmd: set NT_INCLUDE=%WATCOM%\h;%WATCOM%\h\nt
- cmd: set DISABLEDELAYEDEXPANSION=0
- cmd: set CYGWIN_OPT=-qgnNdOA -l c:\cygwin\var\cache\setup -R c:\cygwin -s http://cygwin.mirror.constant.com

#
# Set compiler environment for MSVC first.
#
- cmd: if %BUILDER%-%CPU%. == msvc-x86. call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
- cmd: if %BUILDER%-%CPU%. == msvc-x64. call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
- cmd: if %BUILDER%-%CPU%. == mingw-x86. set PATH=c:\msys64\MinGW32\bin;c:\msys64\usr\bin;%PATH%
- cmd: if %BUILDER%-%CPU%. == mingw-x64. set PATH=c:\msys64\MinGW64\bin;c:\msys64\usr\bin;%PATH%
- cmd: if %BUILDER%-%CPU%. == cygwin-x86. c:\cygwin\setup-x86.exe %CYGWIN_OPT% & set PATH=c:\cygwin\bin;c:\msys64\usr\bin;%PATH%
- cmd: if %BUILDER%-%CPU%. == cygwin-x64. set PATH=c:\msys64\usr\bin;%PATH%

build_script:
- cmd: appveyor-script.bat init

#
# Download and extract OpenWatcom 2.0 using 'curl'
#
- cmd: if %BUILDER%. == watcom. (
curl -O -# http://www.watt-32.net/CI/watcom20.zip &
7z x -o%WATCOM% watcom20.zip > NUL)

- cmd: cd %APPVEYOR_BUILD_FOLDER%\src
- cmd: set USE_LUA=1
- cmd: set USE_IP2LOCATION=1
- cmd: set PLATFORM=%CPU%
- cmd: set CYGWIN=nodosfilewarning

- cmd: if %BUILDER%. == msvc. nmake -nologo -f Makefile.vc6
- cmd: if %BUILDER%. == mingw. make -f Makefile.MinGW CPU=%CPU% USE_CRT_DEBUG=0
- cmd: if %BUILDER%. == cygwin. make -f Makefile.CygWin CPU=%CPU% USE_CRT_DEBUG=0
- cmd: if %BUILDER%. == watcom. wmake -h -f Makefile.Watcom CPU=%CPU%

test_script:
- cmd: set WSOCK_TRACE_LEVEL=1 & test.exe
- cmd: set WSOCK_TRACE_LEVEL=0 & chcp 865 & idna.exe www.seoghør.no
- cmd: set WSOCK_TRACE_LEVEL=0 & idna.exe -c1252 -w www.seoghør.no
- cmd: set WSOCK_TRACE_LEVEL=0 & geoip-test.bat --ip2loc_4
- cmd: set WSOCK_TRACE_LEVEL=0 & geoip-test.bat --ip2loc_6
- cmd: set WSOCK_TRACE_LEVEL=1 & set WSOCK_LUA_ENABLE=1 & test.exe WSAStartup WSACleanup
- cmd: set WSOCK_TRACE_LEVEL=1 & set WSOCK_LUA_ENABLE=0 & set WSOCK_DNSBL_TEST=1 & test.exe WSAStartup WSACleanup

#
# Create a %ZIP_FILE% of the files needed to run the produced .exe-files (no source-files).
# Prevent the 'watcom' directory to end up in 'artifacts'.
#
after_test:
- cmd: set ZIP_FILE=wsock_trace-%BUILDER%-%CPU%-%APPVEYOR_BUILD_NUMBER%.zip
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- cmd: if %BUILDER%. == watcom. (echo Removing Watcom tree & rm -fR watcom/* & rmdir watcom)
- cmd: 7z a %ZIP_FILE% .\README.md .\wsock_trace .\geoip .\geoip6 .\drop.txt .\dropv6.txt .\edrop.txt src\*.dll src\*.pdb src\*.lib src\*.a src\*.exe src\*.lua > NUL

#
# Push %ZIP_FILE% as an artifact.
# (cannot use the ZIP_FILE env-var here!)
#
artifacts:
- path: wsock_trace-%BUILDER%-%CPU%-%APPVEYOR_BUILD_NUMBER%.zip
name: Wsock-Trace

#
# Run build only if one of the following files is modified on commit
#
only_commits:
files:
- appveyor*
- src/*.c
- src/*.h
- src/Makefile.*

#
# todo: One day...
#
# deploy:
# Deploying to NuGet feed
# - provider: NuGet
# server: https://my.nuget.server/feed
# api_key:
# secure: FYWX6NfjZIVw==
# skip_symbols: false
# symbol_server: https://your.symbol.server/feed
# artifact: MyPackage.nupkg

#
# Deploy to GitHub Releases
#
# - provider: GitHub
# artifact: /.*\.nupkg/ # upload all NuGet packages to release assets
# draft: false
# prerelease: false
# on:
# branch: master # release from master branch only
# appveyor_repo_tag: true # deploy on tag push only
13 changes: 13 additions & 0 deletions appveyor_hosts_content.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# This text will generate a 'appveyor-hosts' file.
# This file was generated from %0.
#
127.0.0.1 localhost
::1 localhost
127.0.0.1 mpa.one.microsoft.com
8.8.8.8 google-public-dns-a.google.com
#
# This hostname is used in test.exe
# check that it prints "from 'hosts' file".
#
10.0.0.20 www.no-such-host.com
24 changes: 24 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# This is a GNU-make Makefile for Wsock-Trace's './doc/wsock_trace.chm'
#
LOG_FILE = doxygen.log

DOC_GENERATED = wsock_trace.chm wsock_trace.chw doxygen.log
OUTPUT_GENERATED = $(addprefix ./output/, \
*.css *.html *.js *.png *.map *.md5 index.{hhc,hhk,hhp} )

all: wsock_trace.chm

wsock_trace.chm: Makefile wsock_trace.Doxyfile main_page.dox wsock_trace.css ../src/*.[ch]
rm -f output/msc*.png ; \
doxygen wsock_trace.Doxyfile > $(LOG_FILE) ; \
cd output ; \
hhc index.hhp ; \
mv -f wsock_trace.chm ..
@echo 'Doxygen done. Look in "$(LOG_FILE)" for messages.'

clean:
rm -f $(OUTPUT_GENERATED)
rm -f $(DOC_GENERATED)
- rmdir output
@echo '"clean" done.'
Loading

0 comments on commit 80edfd1

Please sign in to comment.