From 36fe29e3d5c05d20dad8418c86cde2d011f0d009 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 22 Apr 2025 17:57:53 +0200 Subject: [PATCH] Adding upstream version 1.0.2. Signed-off-by: Daniel Baumann --- .clang-format | 6 + .copr/Makefile | 23 + .github/FUNDING.yml | 1 + .gitignore | 93 + .gitmodules | 3 + .lgtm.yml | 23 + .travis.yml | 26 + CHANGES | 42 + LICENSE | 674 + Makefile.am | 32 + README.md | 158 + autogen.sh | 21 + config.rpath | 1 + configure.ac | 91 + fmt.sh | 7 + m4/ax_append_flag.m4 | 50 + m4/ax_cflags_warn_all.m4 | 158 + m4/ax_compiler_vendor.m4 | 117 + m4/ax_prepend_flag.m4 | 51 + m4/ax_pthread.m4 | 486 + m4/ax_require_defined.m4 | 37 + m4/dl.sh | 27 + rpm/dnsmeter.spec | 115 + src/Makefile.am | 472 + src/dns_receiver_thread.cpp | 90 + src/dns_receiver_thread.h | 52 + src/dns_sender.cpp | 571 + src/dns_sender.h | 112 + src/dns_sender_thread.cpp | 332 + src/dns_sender_thread.h | 97 + src/dnsmeter.1.in | 276 + src/exceptions.h | 39 + src/main.cpp | 40 + src/packet.cpp | 220 + src/packet.h | 62 + src/payload_file.cpp | 172 + src/payload_file.h | 46 + src/pplib/.cproject | 409 + src/pplib/.gitignore | 16 + src/pplib/.project | 93 + .../com.googlecode.cppcheclipse.core.prefs | 4 + src/pplib/.settings/language.settings.xml | 12 + .../org.eclipse.cdt.codan.core.prefs | 73 + .../org.eclipse.core.resources.prefs | 3 + .../org.eclipse.ltk.core.refactoring.prefs | 3 + src/pplib/Doxyfile | 2507 + src/pplib/HISTORY.TXT | 1675 + src/pplib/LICENSE.TXT | 22 + src/pplib/Makefile.in | 2702 + src/pplib/PPL7.vcxproj | 334 + src/pplib/PPL7.vcxproj.filters | 322 + src/pplib/README.TXT | 133 + src/pplib/TODO.TXT | 3 + src/pplib/acinclude.m4 | 115 + src/pplib/aclocal.m4 | 1849 + src/pplib/autoconf/ax_cc_maxopt.m4 | 180 + src/pplib/autoconf/ax_check_compiler_flags.m4 | 78 + src/pplib/autoconf/ax_check_openssl.m4 | 130 + src/pplib/autoconf/ax_check_zlib.m4 | 142 + src/pplib/autoconf/ax_cxx_compile_stdcxx.m4 | 558 + .../autoconf/ax_cxx_compile_stdcxx_11.m4 | 39 + src/pplib/autoconf/ax_gcc_archflag.m4 | 225 + src/pplib/autoconf/ax_gcc_x86_cpuid.m4 | 79 + src/pplib/autoconf/ax_have_qt.m4 | 515 + src/pplib/autoconf/ax_lib_crypto.m4 | 85 + src/pplib/autoconf/ax_lib_gcrypt.m4 | 108 + src/pplib/autoconf/ax_lib_mysql.m4 | 147 + src/pplib/autoconf/ax_lib_postgresql.m4 | 155 + src/pplib/autoconf/ax_lib_sqlite3.m4 | 156 + src/pplib/autoconf/ax_path_lib_pcre.m4 | 101 + src/pplib/autoconf/ax_pthread.m4 | 317 + src/pplib/autoconf/bzip2.m4 | 64 + src/pplib/autoconf/checkfuncs.m4 | 64 + src/pplib/autoconf/compile | 347 + src/pplib/autoconf/config.guess | 1547 + src/pplib/autoconf/config.rpath | 666 + src/pplib/autoconf/config.sub | 1807 + src/pplib/autoconf/freetds.m4 | 63 + src/pplib/autoconf/freetype.m4 | 190 + src/pplib/autoconf/gtest.m4 | 49 + src/pplib/autoconf/iconv.m4 | 180 + src/pplib/autoconf/imagemagick.m4 | 48 + src/pplib/autoconf/imlib.m4 | 301 + src/pplib/autoconf/install-sh | 527 + src/pplib/autoconf/jpeg.m4 | 42 + src/pplib/autoconf/lame.m4 | 57 + src/pplib/autoconf/ldns.m4 | 65 + src/pplib/autoconf/lib-link.m4 | 764 + src/pplib/autoconf/libbind.m4 | 197 + src/pplib/autoconf/libcdio.m4 | 82 + src/pplib/autoconf/libcurl.m4 | 272 + src/pplib/autoconf/libidn.m4 | 68 + src/pplib/autoconf/libidn2.m4 | 91 + src/pplib/autoconf/libjpeg-turbo.m4 | 42 + src/pplib/autoconf/libmcrypt.m4 | 251 + src/pplib/autoconf/libmicrohttpd.m4 | 53 + src/pplib/autoconf/libtiff.m4 | 59 + src/pplib/autoconf/missing | 215 + src/pplib/autoconf/mpg123.m4 | 49 + src/pplib/autoconf/nasm.m4 | 61 + src/pplib/autoconf/ogg.m4 | 116 + src/pplib/autoconf/png.m4 | 81 + src/pplib/autoconf/sdl2.m4 | 238 + src/pplib/autoconf/shout.m4 | 79 + src/pplib/build_binary.sh | 533 + src/pplib/conf.sh | 159 + src/pplib/configure | 19232 +++ src/pplib/configure.ac | 868 + src/pplib/docs/CDrawable.png | Bin 0 -> 4168 bytes src/pplib/docs/CWStringSetFunctions.dox | 8 + src/pplib/docs/CWikiParser_diagram.png | Bin 0 -> 13308 bytes src/pplib/docs/Class_Point.png | Bin 0 -> 2952 bytes src/pplib/docs/DoxygenLayout.xml | 182 + src/pplib/docs/credits.dox | 255 + src/pplib/docs/datenbanken.dox | 35 + src/pplib/docs/datentypen.dox | 40 + .../docs/examples/CThread_ThreadMain.cpp | 32 + src/pplib/docs/examples/IcecastExample.cpp | 69 + src/pplib/docs/examples/db_examples.cpp | 384 + src/pplib/docs/examples/nasm.rules | 76 + src/pplib/docs/examples/ppl7.m4 | 95 + src/pplib/docs/formate.dox | 12 + src/pplib/docs/formate/PFPVersion1.dox | 72 + src/pplib/docs/formate/PFPVersion2.dox | 86 + src/pplib/docs/formate/PFPVersion3.dox | 113 + src/pplib/docs/formate/PPLResVersion6.dox | 43 + src/pplib/docs/formate/SocketMessage.dox | 53 + src/pplib/docs/groups.dox | 73 + src/pplib/docs/gtest.dox | 33 + src/pplib/docs/header-bg.png | Bin 0 -> 206 bytes src/pplib/docs/header.html | 35 + src/pplib/docs/icecast_status.png | Bin 0 -> 57504 bytes src/pplib/docs/installation.dox | 234 + src/pplib/docs/main.dox | 153 + src/pplib/docs/pcrenote.dox | 13 + src/pplib/docs/ppl7style.css | 3 + src/pplib/docs/pregexpr.dox | 52 + src/pplib/docs/sockets.dox | 0 src/pplib/docs/sprintf.dox | 239 + src/pplib/docs/strftime.dox | 103 + src/pplib/docs/structures.dox | 111 + src/pplib/docs/threads.dox | 104 + src/pplib/docs/verwendung.dox | 161 + src/pplib/docs/win32-vc9-clr.png | Bin 0 -> 26819 bytes src/pplib/docs/win32-vc9-rl.png | Bin 0 -> 25865 bytes src/pplib/genConfigure | 47 + src/pplib/genMakefile.in | 542 + src/pplib/include/.gitignore | 4 + src/pplib/include/compat.h | 174 + src/pplib/include/config.h.in | 466 + src/pplib/include/crypto.h | 41 + src/pplib/include/ppl7-algorithms.h | 481 + src/pplib/include/ppl7-audio.h | 686 + src/pplib/include/ppl7-config.h.in | 70 + src/pplib/include/ppl7-crypto.h | 196 + src/pplib/include/ppl7-db.h | 338 + src/pplib/include/ppl7-exceptions.h | 255 + src/pplib/include/ppl7-grafix.h | 1153 + src/pplib/include/ppl7-inet.h | 770 + src/pplib/include/ppl7-ppl6compat.h | 119 + src/pplib/include/ppl7-tk.h | 786 + src/pplib/include/ppl7-types.h | 1205 + src/pplib/include/ppl7-visualc-config.h | 80 + src/pplib/include/ppl7.h | 1330 + src/pplib/include/prolog.h | 53 + src/pplib/include/socket.h | 55 + src/pplib/include/threads.h | 74 + src/pplib/makedist.sh | 84 + src/pplib/ppl7-config.in | 324 + src/pplib/resource/.cvsignore | 2 + src/pplib/resource/ButtonSymbols.png | Bin 0 -> 762 bytes src/pplib/resource/SymbolsAlpha.png | Bin 0 -> 6954 bytes src/pplib/resource/cursor.png | Bin 0 -> 7202 bytes src/pplib/resource/icons.png | Bin 0 -> 71697 bytes src/pplib/resource/liberationmono2.fnt6 | Bin 0 -> 32596 bytes src/pplib/resource/liberationsans2.fnt6 | Bin 0 -> 175079 bytes src/pplib/resource/makefonts.sh | 106 + src/pplib/resource/mimetypes.png | Bin 0 -> 6529 bytes src/pplib/resource/ppl7-icon-128x128.png | Bin 0 -> 26692 bytes src/pplib/resource/ppl7-icon-16x16.png | Bin 0 -> 897 bytes src/pplib/resource/ppl7-icon-256x256.png | Bin 0 -> 81296 bytes src/pplib/resource/ppl7-icon-32x32.png | Bin 0 -> 2733 bytes src/pplib/resource/ppl7-icon-48x48.png | Bin 0 -> 5433 bytes src/pplib/resource/ppl7-icon-64x64.png | Bin 0 -> 8685 bytes src/pplib/resource/ppl7.ico | Bin 0 -> 3310 bytes src/pplib/resource/res.h | 23278 +++ src/pplib/resource/resourcen.lst | 94 + src/pplib/resource/toolbar.png | Bin 0 -> 39905 bytes src/pplib/resource/wikistyle.css | 257 + src/pplib/src/asm/blt.asm | 679 + src/pplib/src/asm/blt_blend.asm | 440 + src/pplib/src/asm/chromakey.asm | 530 + src/pplib/src/asm/colors.asm | 195 + src/pplib/src/asm/common.asm | 115 + src/pplib/src/asm/cpu.asm | 302 + src/pplib/src/asm/fonts.asm | 866 + src/pplib/src/asm/pixel.asm | 338 + src/pplib/src/asm/rect.asm | 282 + src/pplib/src/audio/AudioCD.cpp | 330 + src/pplib/src/audio/AudioDecoder_Aiff.cpp | 138 + src/pplib/src/audio/AudioDecoder_MP3.cpp | 265 + src/pplib/src/audio/AudioDecoder_Ogg.cpp | 48 + src/pplib/src/audio/AudioDecoder_Wave.cpp | 140 + src/pplib/src/audio/AudioEncoder_Aiff.cpp | 49 + src/pplib/src/audio/AudioEncoder_MP3.cpp | 482 + src/pplib/src/audio/AudioEncoder_Ogg.cpp | 49 + src/pplib/src/audio/AudioEncoder_Wave.cpp | 49 + src/pplib/src/audio/AudioInfo.cpp | 262 + src/pplib/src/audio/Cddb.cpp | 342 + src/pplib/src/audio/ID3Tag.cpp | 1944 + src/pplib/src/audio/Icecast.cpp | 945 + src/pplib/src/audio/Mp3.cpp | 427 + src/pplib/src/core/AVLTree.cpp | 1224 + src/pplib/src/core/Compat.cpp | 667 + src/pplib/src/core/Compression.cpp | 1182 + src/pplib/src/core/ConfigParser.cpp | 664 + src/pplib/src/core/Dir.cpp | 1187 + src/pplib/src/core/DirEntry.cpp | 340 + src/pplib/src/core/Exceptions.cpp | 362 + src/pplib/src/core/File.cpp | 1760 + src/pplib/src/core/FileObject.cpp | 1144 + src/pplib/src/core/Functions.cpp | 816 + src/pplib/src/core/GzFile.cpp | 531 + src/pplib/src/core/Iconv.cpp | 399 + src/pplib/src/core/Json.cpp | 378 + src/pplib/src/core/Logger.cpp | 720 + src/pplib/src/core/MemFile.cpp | 604 + src/pplib/src/core/MemoryGroup.cpp | 342 + src/pplib/src/core/MemoryHeap.cpp | 504 + src/pplib/src/core/Mutex.cpp | 318 + src/pplib/src/core/PFPFile.cpp | 1252 + src/pplib/src/core/PerlHelper.cpp | 106 + src/pplib/src/core/PythonHelper.cpp | 131 + src/pplib/src/core/Resource.cpp | 583 + src/pplib/src/core/Resourcen.cpp | 70 + src/pplib/src/core/Signal.cpp | 109 + src/pplib/src/core/StringFunctions.cpp | 747 + src/pplib/src/core/ThreadPool.cpp | 365 + src/pplib/src/core/Threads.cpp | 1030 + src/pplib/src/core/Time.cpp | 842 + src/pplib/src/core/cpu.cpp | 107 + src/pplib/src/crypto/Crypt.cpp | 56 + src/pplib/src/crypto/Digest.cpp | 423 + src/pplib/src/crypto/MCrypt.cpp | 1292 + src/pplib/src/database/DBPool.cpp | 323 + src/pplib/src/database/DBPoolOfPools.cpp | 58 + src/pplib/src/database/Database.cpp | 1258 + src/pplib/src/database/MySQL.cpp | 805 + src/pplib/src/database/PostgreSQL.cpp | 736 + src/pplib/src/database/ResultSet.cpp | 388 + src/pplib/src/database/Sqlite3.cpp | 573 + src/pplib/src/grafix/Color.cpp | 753 + src/pplib/src/grafix/Drawable.cpp | 600 + src/pplib/src/grafix/DrawableBlit.cpp | 1114 + src/pplib/src/grafix/DrawableColor.cpp | 305 + src/pplib/src/grafix/DrawableLines.cpp | 632 + src/pplib/src/grafix/DrawablePixel.cpp | 252 + src/pplib/src/grafix/DrawableShapes.cpp | 659 + src/pplib/src/grafix/Font4.cpp | 1046 + src/pplib/src/grafix/Font5.cpp | 691 + src/pplib/src/grafix/Font6.cpp | 1187 + src/pplib/src/grafix/FontFreeType.cpp | 418 + src/pplib/src/grafix/Fonts.cpp | 592 + src/pplib/src/grafix/Grafix.cpp | 304 + src/pplib/src/grafix/Image.cpp | 461 + src/pplib/src/grafix/ImageFilter.cpp | 284 + src/pplib/src/grafix/ImageFilter_BMP.cpp | 327 + src/pplib/src/grafix/ImageFilter_GIF.cpp | 599 + .../src/grafix/ImageFilter_ImageMagick.cpp | 154 + src/pplib/src/grafix/ImageFilter_JPEG.cpp | 600 + src/pplib/src/grafix/ImageFilter_PNG.cpp | 559 + src/pplib/src/grafix/ImageFilter_PPM.cpp | 192 + src/pplib/src/grafix/ImageFilter_TGA.cpp | 253 + src/pplib/src/grafix/ImageFilter_TIFF.cpp | 233 + src/pplib/src/grafix/ImageList.cpp | 238 + src/pplib/src/grafix/Point.cpp | 414 + src/pplib/src/grafix/Point3D.cpp | 335 + src/pplib/src/grafix/RGBFormat.cpp | 582 + src/pplib/src/grafix/Rect.cpp | 348 + src/pplib/src/grafix/Size.cpp | 196 + src/pplib/src/grafix/Sprite.cpp | 410 + src/pplib/src/internet/SocketMessage.cpp | 408 + src/pplib/src/internet/TCPSocket.cpp | 1530 + src/pplib/src/internet/UDPSocket.cpp | 1380 + src/pplib/src/internet/Webserver.cpp | 369 + src/pplib/src/internet/WikiParser.cpp | 1098 + src/pplib/src/internet/curl.cpp | 998 + src/pplib/src/internet/inet_functions.cpp | 427 + src/pplib/src/internet/ipaddress.cpp | 328 + src/pplib/src/internet/ipnetwork.cpp | 358 + src/pplib/src/internet/openssl.cpp | 1229 + src/pplib/src/internet/resolver.cpp | 421 + src/pplib/src/internet/sockaddr.cpp | 331 + src/pplib/src/math/calc.cpp | 251 + src/pplib/src/math/crc32.cpp | 111 + src/pplib/src/math/md5.cpp | 533 + src/pplib/src/math/random.cpp | 552 + src/pplib/src/toolkit/Button.cpp | 309 + src/pplib/src/toolkit/Divider.cpp | 137 + src/pplib/src/toolkit/Event.cpp | 362 + src/pplib/src/toolkit/Frame.cpp | 169 + src/pplib/src/toolkit/Label.cpp | 175 + src/pplib/src/toolkit/Layout.cpp | 154 + src/pplib/src/toolkit/LineInput.cpp | 281 + src/pplib/src/toolkit/Surface.cpp | 155 + src/pplib/src/toolkit/Widget.cpp | 586 + src/pplib/src/toolkit/Window.cpp | 246 + src/pplib/src/toolkit/WindowManager.cpp | 264 + src/pplib/src/toolkit/WindowManager_SDL2.cpp | 1338 + src/pplib/src/types/Array.cpp | 1375 + src/pplib/src/types/AssocArray.cpp | 1955 + src/pplib/src/types/ByteArray.cpp | 735 + src/pplib/src/types/ByteArrayPtr.cpp | 496 + src/pplib/src/types/DateTime.cpp | 1635 + src/pplib/src/types/Pointer.cpp | 229 + src/pplib/src/types/String.cpp | 3484 + src/pplib/src/types/Variant.cpp | 1055 + src/pplib/src/types/WideString.cpp | 3308 + src/pplib/tests/.cproject | 124 + src/pplib/tests/.gitignore | 36 + src/pplib/tests/.project | 28 + .../org.eclipse.cdt.codan.core.prefs | 66 + src/pplib/tests/Makefile.in | 502 + src/pplib/tests/create_postgres_db.sh | 43 + src/pplib/tests/gcovr | 1975 + src/pplib/tests/ppl7-tests.h | 53 + .../tests/src/audio/audio_decoder_aiff.cpp | 84 + .../tests/src/audio/audio_decoder_mp3.cpp | 64 + .../tests/src/audio/audio_decoder_wave.cpp | 64 + .../tests/src/audio/audio_encoder_aiff.cpp | 63 + .../tests/src/audio/audio_encoder_mp3.cpp | 97 + .../tests/src/audio/audio_encoder_wave.cpp | 63 + src/pplib/tests/src/audio/audioinfo.cpp | 198 + src/pplib/tests/src/audio/id3tag.cpp | 890 + src/pplib/tests/src/core/array.cpp | 695 + src/pplib/tests/src/core/assocarray.cpp | 900 + src/pplib/tests/src/core/avltree.cpp | 166 + src/pplib/tests/src/core/bytearray.cpp | 140 + src/pplib/tests/src/core/bytearrayptr.cpp | 424 + src/pplib/tests/src/core/configparser.cpp | 764 + src/pplib/tests/src/core/datetime.cpp | 701 + src/pplib/tests/src/core/dir.cpp | 360 + src/pplib/tests/src/core/file.cpp | 215 + src/pplib/tests/src/core/filestatic.cpp | 463 + src/pplib/tests/src/core/functions.cpp | 519 + src/pplib/tests/src/core/gzfile.cpp | 326 + src/pplib/tests/src/core/iconv.cpp | 140 + src/pplib/tests/src/core/json.cpp | 285 + src/pplib/tests/src/core/list.cpp | 158 + src/pplib/tests/src/core/logger.cpp | 87 + src/pplib/tests/src/core/math.cpp | 136 + src/pplib/tests/src/core/memorygroup.cpp | 70 + src/pplib/tests/src/core/memoryheap.cpp | 210 + src/pplib/tests/src/core/perlhelper.cpp | 258 + src/pplib/tests/src/core/pointer.cpp | 72 + src/pplib/tests/src/core/pythonhelper.cpp | 250 + src/pplib/tests/src/core/stringfunctions.cpp | 103 + src/pplib/tests/src/core/strings.cpp | 1425 + src/pplib/tests/src/core/time.cpp | 87 + src/pplib/tests/src/core/variant.cpp | 749 + src/pplib/tests/src/core/widestrings.cpp | 1282 + src/pplib/tests/src/crypto/crypto.cpp | 69 + src/pplib/tests/src/crypto/digest.cpp | 468 + src/pplib/tests/src/crypto/mcrypt.cpp | 276 + src/pplib/tests/src/database/db_mysql.cpp | 518 + src/pplib/tests/src/database/db_postgres.cpp | 546 + src/pplib/tests/src/database/db_sqlite.cpp | 510 + src/pplib/tests/src/gfxreftest.cpp | 1476 + src/pplib/tests/src/grafix/grafix.cpp | 71 + src/pplib/tests/src/grafix/grafix_color.cpp | 71 + .../tests/src/grafix/grafix_drawable.cpp | 325 + src/pplib/tests/src/grafix/grafix_font.cpp | 71 + src/pplib/tests/src/grafix/grafix_image.cpp | 100 + .../tests/src/grafix/grafix_imagefilter.cpp | 89 + src/pplib/tests/src/grafix/grafix_point.cpp | 120 + src/pplib/tests/src/grafix/grafix_point3d.cpp | 71 + src/pplib/tests/src/grafix/grafix_rect.cpp | 307 + .../tests/src/grafix/grafix_rgbformat.cpp | 71 + src/pplib/tests/src/grafix/grafix_size.cpp | 71 + src/pplib/tests/src/inet/inet.cpp | 150 + src/pplib/tests/src/inet/ipaddress.cpp | 380 + src/pplib/tests/src/inet/ipnetwork.cpp | 354 + src/pplib/tests/src/inet/resolver.cpp | 512 + src/pplib/tests/src/inet/sockaddr.cpp | 173 + src/pplib/tests/src/inet/tcpsocket.cpp | 241 + src/pplib/tests/src/inet/wikiparser.cpp | 83 + src/pplib/tests/src/loggertest.cpp | 56 + src/pplib/tests/src/main.cpp | 111 + src/pplib/tests/src/ppl6/assocarray.cpp | 137 + src/pplib/tests/src/ppl6/strings.cpp | 108 + src/pplib/tests/src/stringspeed.cpp | 122 + src/pplib/tests/src/textsnippets.cpp | 45 + src/pplib/tests/src/threadtest.cpp | 78 + src/pplib/tests/src/toolkit.cpp | 211 + src/pplib/tests/src/toolkit.h | 85 + src/pplib/tests/src/wordlist.cpp | 124333 +++++++++++++++ src/pplib/tests/test.conf | 19 + src/pplib/tests/testdata/compression.txt | 29832 ++++ src/pplib/tests/testdata/compression.txt.gz | Bin 0 -> 19737 bytes src/pplib/tests/testdata/cover.jpg | Bin 0 -> 28402 bytes src/pplib/tests/testdata/database/mysql.sql | 50 + .../tests/testdata/database/postgresql.sql | 67 + src/pplib/tests/testdata/database/sqlite3.sql | 50 + src/pplib/tests/testdata/dirwalk/LICENSE.TXT | 22 + src/pplib/tests/testdata/dirwalk/afile.txt | 39 + src/pplib/tests/testdata/dirwalk/file1.txt | 19 + src/pplib/tests/testdata/dirwalk/file2.txt | 19 + src/pplib/tests/testdata/dirwalk/file3.txt | 19 + src/pplib/tests/testdata/dirwalk/file4äöü.txt | 17 + src/pplib/tests/testdata/dirwalk/testfile.txt | 29832 ++++ src/pplib/tests/testdata/dirwalk/zfile.txt | 39 + src/pplib/tests/testdata/example.conf | 83 + src/pplib/tests/testdata/filenameUSASCII.txt | 31 + src/pplib/tests/testdata/filenameUTF8äöü.txt | 31 + .../testdata/fonts/LiberationSans-Bold.ttf | Bin 0 -> 140252 bytes src/pplib/tests/testdata/fonts/freesans4.fnt5 | Bin 0 -> 269349 bytes .../tests/testdata/fonts/liberationsans8.fnt5 | Bin 0 -> 280820 bytes src/pplib/tests/testdata/fonts/segoeui4.fnt5 | Bin 0 -> 228963 bytes src/pplib/tests/testdata/jsontest1.json | 27 + src/pplib/tests/testdata/jsontest2.json | 6 + src/pplib/tests/testdata/jsontest3.json | 6 + src/pplib/tests/testdata/jsontest4.json | 7 + src/pplib/tests/testdata/lame.h | 1323 + src/pplib/tests/testdata/lame_API.txt | 107 + src/pplib/tests/testdata/mpg123.h | 1441 + src/pplib/tests/testdata/ppl7-icon-64x64.png | Bin 0 -> 8685 bytes src/pplib/tests/testdata/reference.png | Bin 0 -> 239844 bytes src/pplib/tests/testdata/screenshot1.png | Bin 0 -> 59627 bytes src/pplib/tests/testdata/tags_at_eof.aiff | Bin 0 -> 102204 bytes src/pplib/tests/testdata/test-pal-trans.png | Bin 0 -> 8957 bytes src/pplib/tests/testdata/test-pal.png | Bin 0 -> 8976 bytes src/pplib/tests/testdata/test.bmp | Bin 0 -> 34254 bytes src/pplib/tests/testdata/test.gif | Bin 0 -> 10117 bytes src/pplib/tests/testdata/test.jpg | Bin 0 -> 7835 bytes src/pplib/tests/testdata/test.pcx | Bin 0 -> 33872 bytes src/pplib/tests/testdata/test.png | Bin 0 -> 23150 bytes src/pplib/tests/testdata/test.ppm | Bin 0 -> 34244 bytes src/pplib/tests/testdata/test.tga | Bin 0 -> 30032 bytes src/pplib/tests/testdata/test.tif | Bin 0 -> 26704 bytes src/pplib/tests/testdata/test_192cbr.mp3 | Bin 0 -> 95920 bytes .../tests/testdata/test_192cbr_tagged.mp3 | Bin 0 -> 97072 bytes .../testdata/test_192cbr_taggedWithCover.mp3 | Bin 0 -> 125073 bytes src/pplib/tests/testdata/test_192vbr.mp3 | Bin 0 -> 87901 bytes src/pplib/tests/testdata/test_320cbr.mp3 | Bin 0 -> 159868 bytes src/pplib/tests/testdata/test_44kHz.aiff | Bin 0 -> 694834 bytes src/pplib/tests/testdata/test_44kHz.wav | Bin 0 -> 694824 bytes .../tests/testdata/test_44kHz_tagged.aiff | Bin 0 -> 695866 bytes .../tests/testdata/test_44kHz_tagged.wav | Bin 0 -> 694824 bytes .../testdata/test_44kHz_taggedWithCover.aiff | Bin 0 -> 723867 bytes src/pplib/tests/testdata/unicodeUSASCII.txt | Bin 0 -> 7976 bytes src/pplib/tests/testdata/unicodeUtf8äöü.txt | Bin 0 -> 7976 bytes src/pplib/tests/testdata/unittest.bmp | Bin 0 -> 16438 bytes src/pplib/tests/testdata/unittest.png | Bin 0 -> 1572 bytes src/pplib/tests/valgrind.suppressions | 53 + src/query.cpp | 118 + src/query.h | 53 + src/raw_socket_receiver.cpp | 402 + src/raw_socket_receiver.h | 65 + src/raw_socket_sender.cpp | 94 + src/raw_socket_sender.h | 49 + src/system_stat.cpp | 362 + src/system_stat.h | 112 + src/test/Makefile.am | 7 + src/test/test1.sh | 3 + 464 files changed, 372850 insertions(+) create mode 100644 .clang-format create mode 100644 .copr/Makefile create mode 100644 .github/FUNDING.yml create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 .lgtm.yml create mode 100644 .travis.yml create mode 100644 CHANGES create mode 100644 LICENSE create mode 100644 Makefile.am create mode 100644 README.md create mode 100755 autogen.sh create mode 120000 config.rpath create mode 100644 configure.ac create mode 100755 fmt.sh create mode 100644 m4/ax_append_flag.m4 create mode 100644 m4/ax_cflags_warn_all.m4 create mode 100644 m4/ax_compiler_vendor.m4 create mode 100644 m4/ax_prepend_flag.m4 create mode 100644 m4/ax_pthread.m4 create mode 100644 m4/ax_require_defined.m4 create mode 100755 m4/dl.sh create mode 100644 rpm/dnsmeter.spec create mode 100644 src/Makefile.am create mode 100644 src/dns_receiver_thread.cpp create mode 100644 src/dns_receiver_thread.h create mode 100644 src/dns_sender.cpp create mode 100644 src/dns_sender.h create mode 100644 src/dns_sender_thread.cpp create mode 100644 src/dns_sender_thread.h create mode 100644 src/dnsmeter.1.in create mode 100644 src/exceptions.h create mode 100644 src/main.cpp create mode 100644 src/packet.cpp create mode 100644 src/packet.h create mode 100644 src/payload_file.cpp create mode 100644 src/payload_file.h create mode 100644 src/pplib/.cproject create mode 100644 src/pplib/.gitignore create mode 100644 src/pplib/.project create mode 100644 src/pplib/.settings/com.googlecode.cppcheclipse.core.prefs create mode 100644 src/pplib/.settings/language.settings.xml create mode 100644 src/pplib/.settings/org.eclipse.cdt.codan.core.prefs create mode 100644 src/pplib/.settings/org.eclipse.core.resources.prefs create mode 100644 src/pplib/.settings/org.eclipse.ltk.core.refactoring.prefs create mode 100644 src/pplib/Doxyfile create mode 100644 src/pplib/HISTORY.TXT create mode 100644 src/pplib/LICENSE.TXT create mode 100644 src/pplib/Makefile.in create mode 100644 src/pplib/PPL7.vcxproj create mode 100644 src/pplib/PPL7.vcxproj.filters create mode 100644 src/pplib/README.TXT create mode 100644 src/pplib/TODO.TXT create mode 100644 src/pplib/acinclude.m4 create mode 100644 src/pplib/aclocal.m4 create mode 100644 src/pplib/autoconf/ax_cc_maxopt.m4 create mode 100644 src/pplib/autoconf/ax_check_compiler_flags.m4 create mode 100644 src/pplib/autoconf/ax_check_openssl.m4 create mode 100644 src/pplib/autoconf/ax_check_zlib.m4 create mode 100644 src/pplib/autoconf/ax_cxx_compile_stdcxx.m4 create mode 100644 src/pplib/autoconf/ax_cxx_compile_stdcxx_11.m4 create mode 100644 src/pplib/autoconf/ax_gcc_archflag.m4 create mode 100644 src/pplib/autoconf/ax_gcc_x86_cpuid.m4 create mode 100644 src/pplib/autoconf/ax_have_qt.m4 create mode 100644 src/pplib/autoconf/ax_lib_crypto.m4 create mode 100644 src/pplib/autoconf/ax_lib_gcrypt.m4 create mode 100644 src/pplib/autoconf/ax_lib_mysql.m4 create mode 100644 src/pplib/autoconf/ax_lib_postgresql.m4 create mode 100644 src/pplib/autoconf/ax_lib_sqlite3.m4 create mode 100644 src/pplib/autoconf/ax_path_lib_pcre.m4 create mode 100644 src/pplib/autoconf/ax_pthread.m4 create mode 100644 src/pplib/autoconf/bzip2.m4 create mode 100644 src/pplib/autoconf/checkfuncs.m4 create mode 100755 src/pplib/autoconf/compile create mode 100755 src/pplib/autoconf/config.guess create mode 100644 src/pplib/autoconf/config.rpath create mode 100755 src/pplib/autoconf/config.sub create mode 100644 src/pplib/autoconf/freetds.m4 create mode 100644 src/pplib/autoconf/freetype.m4 create mode 100644 src/pplib/autoconf/gtest.m4 create mode 100644 src/pplib/autoconf/iconv.m4 create mode 100644 src/pplib/autoconf/imagemagick.m4 create mode 100644 src/pplib/autoconf/imlib.m4 create mode 100755 src/pplib/autoconf/install-sh create mode 100644 src/pplib/autoconf/jpeg.m4 create mode 100644 src/pplib/autoconf/lame.m4 create mode 100644 src/pplib/autoconf/ldns.m4 create mode 100644 src/pplib/autoconf/lib-link.m4 create mode 100644 src/pplib/autoconf/libbind.m4 create mode 100644 src/pplib/autoconf/libcdio.m4 create mode 100644 src/pplib/autoconf/libcurl.m4 create mode 100644 src/pplib/autoconf/libidn.m4 create mode 100644 src/pplib/autoconf/libidn2.m4 create mode 100644 src/pplib/autoconf/libjpeg-turbo.m4 create mode 100644 src/pplib/autoconf/libmcrypt.m4 create mode 100644 src/pplib/autoconf/libmicrohttpd.m4 create mode 100644 src/pplib/autoconf/libtiff.m4 create mode 100755 src/pplib/autoconf/missing create mode 100644 src/pplib/autoconf/mpg123.m4 create mode 100644 src/pplib/autoconf/nasm.m4 create mode 100644 src/pplib/autoconf/ogg.m4 create mode 100644 src/pplib/autoconf/png.m4 create mode 100644 src/pplib/autoconf/sdl2.m4 create mode 100644 src/pplib/autoconf/shout.m4 create mode 100755 src/pplib/build_binary.sh create mode 100755 src/pplib/conf.sh create mode 100755 src/pplib/configure create mode 100644 src/pplib/configure.ac create mode 100644 src/pplib/docs/CDrawable.png create mode 100644 src/pplib/docs/CWStringSetFunctions.dox create mode 100644 src/pplib/docs/CWikiParser_diagram.png create mode 100644 src/pplib/docs/Class_Point.png create mode 100644 src/pplib/docs/DoxygenLayout.xml create mode 100644 src/pplib/docs/credits.dox create mode 100644 src/pplib/docs/datenbanken.dox create mode 100644 src/pplib/docs/datentypen.dox create mode 100644 src/pplib/docs/examples/CThread_ThreadMain.cpp create mode 100644 src/pplib/docs/examples/IcecastExample.cpp create mode 100644 src/pplib/docs/examples/db_examples.cpp create mode 100644 src/pplib/docs/examples/nasm.rules create mode 100644 src/pplib/docs/examples/ppl7.m4 create mode 100644 src/pplib/docs/formate.dox create mode 100644 src/pplib/docs/formate/PFPVersion1.dox create mode 100644 src/pplib/docs/formate/PFPVersion2.dox create mode 100644 src/pplib/docs/formate/PFPVersion3.dox create mode 100644 src/pplib/docs/formate/PPLResVersion6.dox create mode 100644 src/pplib/docs/formate/SocketMessage.dox create mode 100644 src/pplib/docs/groups.dox create mode 100644 src/pplib/docs/gtest.dox create mode 100644 src/pplib/docs/header-bg.png create mode 100644 src/pplib/docs/header.html create mode 100644 src/pplib/docs/icecast_status.png create mode 100644 src/pplib/docs/installation.dox create mode 100644 src/pplib/docs/main.dox create mode 100644 src/pplib/docs/pcrenote.dox create mode 100644 src/pplib/docs/ppl7style.css create mode 100644 src/pplib/docs/pregexpr.dox create mode 100644 src/pplib/docs/sockets.dox create mode 100644 src/pplib/docs/sprintf.dox create mode 100644 src/pplib/docs/strftime.dox create mode 100644 src/pplib/docs/structures.dox create mode 100644 src/pplib/docs/threads.dox create mode 100644 src/pplib/docs/verwendung.dox create mode 100644 src/pplib/docs/win32-vc9-clr.png create mode 100644 src/pplib/docs/win32-vc9-rl.png create mode 100755 src/pplib/genConfigure create mode 100755 src/pplib/genMakefile.in create mode 100644 src/pplib/include/.gitignore create mode 100644 src/pplib/include/compat.h create mode 100644 src/pplib/include/config.h.in create mode 100644 src/pplib/include/crypto.h create mode 100644 src/pplib/include/ppl7-algorithms.h create mode 100644 src/pplib/include/ppl7-audio.h create mode 100644 src/pplib/include/ppl7-config.h.in create mode 100644 src/pplib/include/ppl7-crypto.h create mode 100644 src/pplib/include/ppl7-db.h create mode 100644 src/pplib/include/ppl7-exceptions.h create mode 100644 src/pplib/include/ppl7-grafix.h create mode 100644 src/pplib/include/ppl7-inet.h create mode 100644 src/pplib/include/ppl7-ppl6compat.h create mode 100644 src/pplib/include/ppl7-tk.h create mode 100644 src/pplib/include/ppl7-types.h create mode 100644 src/pplib/include/ppl7-visualc-config.h create mode 100644 src/pplib/include/ppl7.h create mode 100644 src/pplib/include/prolog.h create mode 100644 src/pplib/include/socket.h create mode 100644 src/pplib/include/threads.h create mode 100755 src/pplib/makedist.sh create mode 100644 src/pplib/ppl7-config.in create mode 100644 src/pplib/resource/.cvsignore create mode 100644 src/pplib/resource/ButtonSymbols.png create mode 100644 src/pplib/resource/SymbolsAlpha.png create mode 100644 src/pplib/resource/cursor.png create mode 100644 src/pplib/resource/icons.png create mode 100644 src/pplib/resource/liberationmono2.fnt6 create mode 100644 src/pplib/resource/liberationsans2.fnt6 create mode 100644 src/pplib/resource/makefonts.sh create mode 100644 src/pplib/resource/mimetypes.png create mode 100755 src/pplib/resource/ppl7-icon-128x128.png create mode 100755 src/pplib/resource/ppl7-icon-16x16.png create mode 100755 src/pplib/resource/ppl7-icon-256x256.png create mode 100755 src/pplib/resource/ppl7-icon-32x32.png create mode 100755 src/pplib/resource/ppl7-icon-48x48.png create mode 100755 src/pplib/resource/ppl7-icon-64x64.png create mode 100644 src/pplib/resource/ppl7.ico create mode 100644 src/pplib/resource/res.h create mode 100644 src/pplib/resource/resourcen.lst create mode 100644 src/pplib/resource/toolbar.png create mode 100644 src/pplib/resource/wikistyle.css create mode 100644 src/pplib/src/asm/blt.asm create mode 100644 src/pplib/src/asm/blt_blend.asm create mode 100644 src/pplib/src/asm/chromakey.asm create mode 100644 src/pplib/src/asm/colors.asm create mode 100644 src/pplib/src/asm/common.asm create mode 100644 src/pplib/src/asm/cpu.asm create mode 100644 src/pplib/src/asm/fonts.asm create mode 100644 src/pplib/src/asm/pixel.asm create mode 100644 src/pplib/src/asm/rect.asm create mode 100644 src/pplib/src/audio/AudioCD.cpp create mode 100644 src/pplib/src/audio/AudioDecoder_Aiff.cpp create mode 100644 src/pplib/src/audio/AudioDecoder_MP3.cpp create mode 100644 src/pplib/src/audio/AudioDecoder_Ogg.cpp create mode 100644 src/pplib/src/audio/AudioDecoder_Wave.cpp create mode 100644 src/pplib/src/audio/AudioEncoder_Aiff.cpp create mode 100644 src/pplib/src/audio/AudioEncoder_MP3.cpp create mode 100644 src/pplib/src/audio/AudioEncoder_Ogg.cpp create mode 100644 src/pplib/src/audio/AudioEncoder_Wave.cpp create mode 100644 src/pplib/src/audio/AudioInfo.cpp create mode 100644 src/pplib/src/audio/Cddb.cpp create mode 100644 src/pplib/src/audio/ID3Tag.cpp create mode 100644 src/pplib/src/audio/Icecast.cpp create mode 100644 src/pplib/src/audio/Mp3.cpp create mode 100644 src/pplib/src/core/AVLTree.cpp create mode 100644 src/pplib/src/core/Compat.cpp create mode 100644 src/pplib/src/core/Compression.cpp create mode 100644 src/pplib/src/core/ConfigParser.cpp create mode 100644 src/pplib/src/core/Dir.cpp create mode 100644 src/pplib/src/core/DirEntry.cpp create mode 100644 src/pplib/src/core/Exceptions.cpp create mode 100644 src/pplib/src/core/File.cpp create mode 100644 src/pplib/src/core/FileObject.cpp create mode 100644 src/pplib/src/core/Functions.cpp create mode 100644 src/pplib/src/core/GzFile.cpp create mode 100644 src/pplib/src/core/Iconv.cpp create mode 100644 src/pplib/src/core/Json.cpp create mode 100644 src/pplib/src/core/Logger.cpp create mode 100644 src/pplib/src/core/MemFile.cpp create mode 100644 src/pplib/src/core/MemoryGroup.cpp create mode 100644 src/pplib/src/core/MemoryHeap.cpp create mode 100644 src/pplib/src/core/Mutex.cpp create mode 100644 src/pplib/src/core/PFPFile.cpp create mode 100644 src/pplib/src/core/PerlHelper.cpp create mode 100644 src/pplib/src/core/PythonHelper.cpp create mode 100644 src/pplib/src/core/Resource.cpp create mode 100644 src/pplib/src/core/Resourcen.cpp create mode 100644 src/pplib/src/core/Signal.cpp create mode 100644 src/pplib/src/core/StringFunctions.cpp create mode 100644 src/pplib/src/core/ThreadPool.cpp create mode 100644 src/pplib/src/core/Threads.cpp create mode 100644 src/pplib/src/core/Time.cpp create mode 100644 src/pplib/src/core/cpu.cpp create mode 100644 src/pplib/src/crypto/Crypt.cpp create mode 100644 src/pplib/src/crypto/Digest.cpp create mode 100644 src/pplib/src/crypto/MCrypt.cpp create mode 100644 src/pplib/src/database/DBPool.cpp create mode 100644 src/pplib/src/database/DBPoolOfPools.cpp create mode 100644 src/pplib/src/database/Database.cpp create mode 100644 src/pplib/src/database/MySQL.cpp create mode 100644 src/pplib/src/database/PostgreSQL.cpp create mode 100644 src/pplib/src/database/ResultSet.cpp create mode 100644 src/pplib/src/database/Sqlite3.cpp create mode 100644 src/pplib/src/grafix/Color.cpp create mode 100644 src/pplib/src/grafix/Drawable.cpp create mode 100644 src/pplib/src/grafix/DrawableBlit.cpp create mode 100644 src/pplib/src/grafix/DrawableColor.cpp create mode 100644 src/pplib/src/grafix/DrawableLines.cpp create mode 100644 src/pplib/src/grafix/DrawablePixel.cpp create mode 100644 src/pplib/src/grafix/DrawableShapes.cpp create mode 100644 src/pplib/src/grafix/Font4.cpp create mode 100644 src/pplib/src/grafix/Font5.cpp create mode 100644 src/pplib/src/grafix/Font6.cpp create mode 100644 src/pplib/src/grafix/FontFreeType.cpp create mode 100644 src/pplib/src/grafix/Fonts.cpp create mode 100644 src/pplib/src/grafix/Grafix.cpp create mode 100644 src/pplib/src/grafix/Image.cpp create mode 100644 src/pplib/src/grafix/ImageFilter.cpp create mode 100644 src/pplib/src/grafix/ImageFilter_BMP.cpp create mode 100644 src/pplib/src/grafix/ImageFilter_GIF.cpp create mode 100644 src/pplib/src/grafix/ImageFilter_ImageMagick.cpp create mode 100644 src/pplib/src/grafix/ImageFilter_JPEG.cpp create mode 100644 src/pplib/src/grafix/ImageFilter_PNG.cpp create mode 100644 src/pplib/src/grafix/ImageFilter_PPM.cpp create mode 100644 src/pplib/src/grafix/ImageFilter_TGA.cpp create mode 100644 src/pplib/src/grafix/ImageFilter_TIFF.cpp create mode 100644 src/pplib/src/grafix/ImageList.cpp create mode 100644 src/pplib/src/grafix/Point.cpp create mode 100644 src/pplib/src/grafix/Point3D.cpp create mode 100644 src/pplib/src/grafix/RGBFormat.cpp create mode 100644 src/pplib/src/grafix/Rect.cpp create mode 100644 src/pplib/src/grafix/Size.cpp create mode 100644 src/pplib/src/grafix/Sprite.cpp create mode 100644 src/pplib/src/internet/SocketMessage.cpp create mode 100644 src/pplib/src/internet/TCPSocket.cpp create mode 100644 src/pplib/src/internet/UDPSocket.cpp create mode 100644 src/pplib/src/internet/Webserver.cpp create mode 100644 src/pplib/src/internet/WikiParser.cpp create mode 100644 src/pplib/src/internet/curl.cpp create mode 100644 src/pplib/src/internet/inet_functions.cpp create mode 100644 src/pplib/src/internet/ipaddress.cpp create mode 100644 src/pplib/src/internet/ipnetwork.cpp create mode 100644 src/pplib/src/internet/openssl.cpp create mode 100644 src/pplib/src/internet/resolver.cpp create mode 100644 src/pplib/src/internet/sockaddr.cpp create mode 100644 src/pplib/src/math/calc.cpp create mode 100644 src/pplib/src/math/crc32.cpp create mode 100644 src/pplib/src/math/md5.cpp create mode 100644 src/pplib/src/math/random.cpp create mode 100644 src/pplib/src/toolkit/Button.cpp create mode 100644 src/pplib/src/toolkit/Divider.cpp create mode 100644 src/pplib/src/toolkit/Event.cpp create mode 100644 src/pplib/src/toolkit/Frame.cpp create mode 100644 src/pplib/src/toolkit/Label.cpp create mode 100644 src/pplib/src/toolkit/Layout.cpp create mode 100644 src/pplib/src/toolkit/LineInput.cpp create mode 100644 src/pplib/src/toolkit/Surface.cpp create mode 100644 src/pplib/src/toolkit/Widget.cpp create mode 100644 src/pplib/src/toolkit/Window.cpp create mode 100644 src/pplib/src/toolkit/WindowManager.cpp create mode 100644 src/pplib/src/toolkit/WindowManager_SDL2.cpp create mode 100644 src/pplib/src/types/Array.cpp create mode 100644 src/pplib/src/types/AssocArray.cpp create mode 100644 src/pplib/src/types/ByteArray.cpp create mode 100644 src/pplib/src/types/ByteArrayPtr.cpp create mode 100644 src/pplib/src/types/DateTime.cpp create mode 100644 src/pplib/src/types/Pointer.cpp create mode 100644 src/pplib/src/types/String.cpp create mode 100644 src/pplib/src/types/Variant.cpp create mode 100644 src/pplib/src/types/WideString.cpp create mode 100644 src/pplib/tests/.cproject create mode 100644 src/pplib/tests/.gitignore create mode 100644 src/pplib/tests/.project create mode 100644 src/pplib/tests/.settings/org.eclipse.cdt.codan.core.prefs create mode 100644 src/pplib/tests/Makefile.in create mode 100644 src/pplib/tests/create_postgres_db.sh create mode 100755 src/pplib/tests/gcovr create mode 100644 src/pplib/tests/ppl7-tests.h create mode 100644 src/pplib/tests/src/audio/audio_decoder_aiff.cpp create mode 100644 src/pplib/tests/src/audio/audio_decoder_mp3.cpp create mode 100644 src/pplib/tests/src/audio/audio_decoder_wave.cpp create mode 100644 src/pplib/tests/src/audio/audio_encoder_aiff.cpp create mode 100644 src/pplib/tests/src/audio/audio_encoder_mp3.cpp create mode 100644 src/pplib/tests/src/audio/audio_encoder_wave.cpp create mode 100644 src/pplib/tests/src/audio/audioinfo.cpp create mode 100644 src/pplib/tests/src/audio/id3tag.cpp create mode 100644 src/pplib/tests/src/core/array.cpp create mode 100644 src/pplib/tests/src/core/assocarray.cpp create mode 100644 src/pplib/tests/src/core/avltree.cpp create mode 100644 src/pplib/tests/src/core/bytearray.cpp create mode 100644 src/pplib/tests/src/core/bytearrayptr.cpp create mode 100644 src/pplib/tests/src/core/configparser.cpp create mode 100644 src/pplib/tests/src/core/datetime.cpp create mode 100644 src/pplib/tests/src/core/dir.cpp create mode 100644 src/pplib/tests/src/core/file.cpp create mode 100644 src/pplib/tests/src/core/filestatic.cpp create mode 100644 src/pplib/tests/src/core/functions.cpp create mode 100644 src/pplib/tests/src/core/gzfile.cpp create mode 100644 src/pplib/tests/src/core/iconv.cpp create mode 100644 src/pplib/tests/src/core/json.cpp create mode 100644 src/pplib/tests/src/core/list.cpp create mode 100644 src/pplib/tests/src/core/logger.cpp create mode 100644 src/pplib/tests/src/core/math.cpp create mode 100644 src/pplib/tests/src/core/memorygroup.cpp create mode 100644 src/pplib/tests/src/core/memoryheap.cpp create mode 100644 src/pplib/tests/src/core/perlhelper.cpp create mode 100644 src/pplib/tests/src/core/pointer.cpp create mode 100644 src/pplib/tests/src/core/pythonhelper.cpp create mode 100644 src/pplib/tests/src/core/stringfunctions.cpp create mode 100644 src/pplib/tests/src/core/strings.cpp create mode 100644 src/pplib/tests/src/core/time.cpp create mode 100644 src/pplib/tests/src/core/variant.cpp create mode 100644 src/pplib/tests/src/core/widestrings.cpp create mode 100644 src/pplib/tests/src/crypto/crypto.cpp create mode 100644 src/pplib/tests/src/crypto/digest.cpp create mode 100644 src/pplib/tests/src/crypto/mcrypt.cpp create mode 100644 src/pplib/tests/src/database/db_mysql.cpp create mode 100644 src/pplib/tests/src/database/db_postgres.cpp create mode 100644 src/pplib/tests/src/database/db_sqlite.cpp create mode 100644 src/pplib/tests/src/gfxreftest.cpp create mode 100644 src/pplib/tests/src/grafix/grafix.cpp create mode 100644 src/pplib/tests/src/grafix/grafix_color.cpp create mode 100644 src/pplib/tests/src/grafix/grafix_drawable.cpp create mode 100644 src/pplib/tests/src/grafix/grafix_font.cpp create mode 100644 src/pplib/tests/src/grafix/grafix_image.cpp create mode 100644 src/pplib/tests/src/grafix/grafix_imagefilter.cpp create mode 100644 src/pplib/tests/src/grafix/grafix_point.cpp create mode 100644 src/pplib/tests/src/grafix/grafix_point3d.cpp create mode 100644 src/pplib/tests/src/grafix/grafix_rect.cpp create mode 100644 src/pplib/tests/src/grafix/grafix_rgbformat.cpp create mode 100644 src/pplib/tests/src/grafix/grafix_size.cpp create mode 100644 src/pplib/tests/src/inet/inet.cpp create mode 100644 src/pplib/tests/src/inet/ipaddress.cpp create mode 100644 src/pplib/tests/src/inet/ipnetwork.cpp create mode 100644 src/pplib/tests/src/inet/resolver.cpp create mode 100644 src/pplib/tests/src/inet/sockaddr.cpp create mode 100644 src/pplib/tests/src/inet/tcpsocket.cpp create mode 100644 src/pplib/tests/src/inet/wikiparser.cpp create mode 100644 src/pplib/tests/src/loggertest.cpp create mode 100644 src/pplib/tests/src/main.cpp create mode 100644 src/pplib/tests/src/ppl6/assocarray.cpp create mode 100644 src/pplib/tests/src/ppl6/strings.cpp create mode 100644 src/pplib/tests/src/stringspeed.cpp create mode 100644 src/pplib/tests/src/textsnippets.cpp create mode 100644 src/pplib/tests/src/threadtest.cpp create mode 100644 src/pplib/tests/src/toolkit.cpp create mode 100644 src/pplib/tests/src/toolkit.h create mode 100644 src/pplib/tests/src/wordlist.cpp create mode 100644 src/pplib/tests/test.conf create mode 100644 src/pplib/tests/testdata/compression.txt create mode 100644 src/pplib/tests/testdata/compression.txt.gz create mode 100644 src/pplib/tests/testdata/cover.jpg create mode 100644 src/pplib/tests/testdata/database/mysql.sql create mode 100644 src/pplib/tests/testdata/database/postgresql.sql create mode 100644 src/pplib/tests/testdata/database/sqlite3.sql create mode 100644 src/pplib/tests/testdata/dirwalk/LICENSE.TXT create mode 100644 src/pplib/tests/testdata/dirwalk/afile.txt create mode 100644 src/pplib/tests/testdata/dirwalk/file1.txt create mode 100644 src/pplib/tests/testdata/dirwalk/file2.txt create mode 100644 src/pplib/tests/testdata/dirwalk/file3.txt create mode 100644 src/pplib/tests/testdata/dirwalk/file4äöü.txt create mode 100644 src/pplib/tests/testdata/dirwalk/testfile.txt create mode 100644 src/pplib/tests/testdata/dirwalk/zfile.txt create mode 100644 src/pplib/tests/testdata/example.conf create mode 100644 src/pplib/tests/testdata/filenameUSASCII.txt create mode 100644 src/pplib/tests/testdata/filenameUTF8äöü.txt create mode 100644 src/pplib/tests/testdata/fonts/LiberationSans-Bold.ttf create mode 100644 src/pplib/tests/testdata/fonts/freesans4.fnt5 create mode 100644 src/pplib/tests/testdata/fonts/liberationsans8.fnt5 create mode 100644 src/pplib/tests/testdata/fonts/segoeui4.fnt5 create mode 100644 src/pplib/tests/testdata/jsontest1.json create mode 100644 src/pplib/tests/testdata/jsontest2.json create mode 100644 src/pplib/tests/testdata/jsontest3.json create mode 100644 src/pplib/tests/testdata/jsontest4.json create mode 100644 src/pplib/tests/testdata/lame.h create mode 100644 src/pplib/tests/testdata/lame_API.txt create mode 100644 src/pplib/tests/testdata/mpg123.h create mode 100755 src/pplib/tests/testdata/ppl7-icon-64x64.png create mode 100644 src/pplib/tests/testdata/reference.png create mode 100644 src/pplib/tests/testdata/screenshot1.png create mode 100644 src/pplib/tests/testdata/tags_at_eof.aiff create mode 100644 src/pplib/tests/testdata/test-pal-trans.png create mode 100644 src/pplib/tests/testdata/test-pal.png create mode 100644 src/pplib/tests/testdata/test.bmp create mode 100644 src/pplib/tests/testdata/test.gif create mode 100644 src/pplib/tests/testdata/test.jpg create mode 100644 src/pplib/tests/testdata/test.pcx create mode 100644 src/pplib/tests/testdata/test.png create mode 100644 src/pplib/tests/testdata/test.ppm create mode 100644 src/pplib/tests/testdata/test.tga create mode 100644 src/pplib/tests/testdata/test.tif create mode 100644 src/pplib/tests/testdata/test_192cbr.mp3 create mode 100644 src/pplib/tests/testdata/test_192cbr_tagged.mp3 create mode 100644 src/pplib/tests/testdata/test_192cbr_taggedWithCover.mp3 create mode 100644 src/pplib/tests/testdata/test_192vbr.mp3 create mode 100644 src/pplib/tests/testdata/test_320cbr.mp3 create mode 100644 src/pplib/tests/testdata/test_44kHz.aiff create mode 100644 src/pplib/tests/testdata/test_44kHz.wav create mode 100644 src/pplib/tests/testdata/test_44kHz_tagged.aiff create mode 100644 src/pplib/tests/testdata/test_44kHz_tagged.wav create mode 100644 src/pplib/tests/testdata/test_44kHz_taggedWithCover.aiff create mode 100644 src/pplib/tests/testdata/unicodeUSASCII.txt create mode 100644 src/pplib/tests/testdata/unicodeUtf8äöü.txt create mode 100644 src/pplib/tests/testdata/unittest.bmp create mode 100644 src/pplib/tests/testdata/unittest.png create mode 100644 src/pplib/tests/valgrind.suppressions create mode 100644 src/query.cpp create mode 100644 src/query.h create mode 100644 src/raw_socket_receiver.cpp create mode 100644 src/raw_socket_receiver.h create mode 100644 src/raw_socket_sender.cpp create mode 100644 src/raw_socket_sender.h create mode 100644 src/system_stat.cpp create mode 100644 src/system_stat.h create mode 100644 src/test/Makefile.am create mode 100755 src/test/test1.sh diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..1bd4430 --- /dev/null +++ b/.clang-format @@ -0,0 +1,6 @@ +BasedOnStyle: webkit +IndentWidth: 4 +AlignConsecutiveAssignments: true +AlignConsecutiveDeclarations: true +AlignOperands: true +SortIncludes: false diff --git a/.copr/Makefile b/.copr/Makefile new file mode 100644 index 0000000..29ed0bc --- /dev/null +++ b/.copr/Makefile @@ -0,0 +1,23 @@ +top=.. + +all: srpm + +prereq: $(top)/rpmbuild + rpm -q git rpm-build >/dev/null || dnf -y install git rpm-build + +update-dist-tools: $(top)/dist-tools + ( cd "$(top)/dist-tools" && git pull ) + +$(top)/dist-tools: + git clone https://github.com/jelu/dist-tools.git "$(top)/dist-tools" + +$(top)/rpmbuild: + mkdir -p "$(top)"/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + +srpm: prereq update-dist-tools + test -f .gitmodules && git submodule update --init || true + echo "$(spec)" | grep -q "develop.spec" && auto_build_number=`date --utc +%s` message="Auto build `date --utc --iso-8601=seconds`" "$(top)/dist-tools/spec-new-changelog-entry" || true + overwrite=yes nosign=yes "$(top)/dist-tools/create-source-packages" rpm + cp ../*.orig.tar.gz "$(top)/rpmbuild/SOURCES/" + echo "$(spec)" | grep -q "develop.spec" && rpmbuild -bs --define "%_topdir $(top)/rpmbuild" --undefine=dist rpm/*.spec || rpmbuild -bs --define "%_topdir $(top)/rpmbuild" --undefine=dist "$(spec)" + cp "$(top)"/rpmbuild/SRPMS/*.src.rpm "$(outdir)" diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..38cc1c4 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://www.dns-oarc.net/donate diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a906e0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,93 @@ +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +# Automake +Makefile.in +aclocal.m4 +ar-lib +autom4te.cache +compile +config.guess +config.sub +configure +depcomp +install-sh +ltmain.sh +m4/libtool.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/ltversion.m4 +m4/lt~obsolete.m4 +missing +config.h.in +config.h.in~ +test-driver + +# Configure +Makefile +config.log +config.status +libtool +.deps +src/config.h +src/stamp-h1 +build +.dirstamp + +# Project specific files +src/dnsmeter +src/dnsmeter.1 +src/test/test-suite.log +src/test/test*.sh.log +src/test/test*.sh.trs +src/test/*.dist diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..60a913b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/pplib"] + path = src/pplib + url = https://github.com/DNS-OARC/pplib.git diff --git a/.lgtm.yml b/.lgtm.yml new file mode 100644 index 0000000..e8a57b0 --- /dev/null +++ b/.lgtm.yml @@ -0,0 +1,23 @@ +path_classifiers: + library: + - "src/pplib/*" +extraction: + cpp: + prepare: + packages: + - build-essential + - automake + - autoconf + - libtool + - pkg-config + - libbind-dev + - libssl-dev + - libbz2-dev + - libidn2-dev + - zlib1g-dev + - libpcap-dev + - libpcre3-dev + configure: + command: + - ./autogen.sh + - ./configure diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..502926b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +dist: bionic +addons: + apt: + update: true + packages: + - libbind-dev + - libssl-dev + - libbz2-dev + - libidn2-dev + - zlib1g-dev + - libpcap-dev + - libpcre3-dev +language: cpp +compiler: + - gcc +install: ./autogen.sh +script: + - ./configure --enable-warn-all + - make dist + - tar zxvf *.tar.gz + - cd dnsmeter-*[0-9] + - mkdir build + - cd build + - ../configure --enable-warn-all + - make + - make test diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..6dd11e7 --- /dev/null +++ b/CHANGES @@ -0,0 +1,42 @@ +2021-06-02 Jerry Lundström + + Release 1.0.2 + + This release fixes an issue with source port being static when only + using `-q` to generate traffic from one host/IP. The source port is + now randomized for every DNS query. + + Other changes is mainly about build system, packages and fixed issues + detected by code analysis tools. + + 05000cc Typo, random source port + 6a71707 Coverage + 1c724ce SonarCloud + 0776d20 Badges + c274884 LGTM + 5a12c61 COPR + f77efed Build dependency + a359b66 iconv + +2019-10-07 Jerry Lundström + + Release 1.0.1 + + This release fixes a few minor bugs and a dependency issue which made + `dnsmeter` throw an exception when using the `-r` option. + + Bugfixes: + - Use existing `rtt_avg`, was showing total RTT divided by number of threads + - Fix an issue which missed the first 8 bytes of a text payload + + 72197b5 PCAP detect + 665be2d RTT average + 3fe7b66 pplib dependencies, RTT average + e565d42 Funding + 1a1ea40 README + +2019-09-23 Jerry Lundström + + Release 1.0.0 + + Initial release after project was moved from DENIC to DNS-OARC. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program 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. + + This program 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 this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..9a00f7e --- /dev/null +++ b/Makefile.am @@ -0,0 +1,32 @@ +# Copyright (c) 2019-2021, OARC, Inc. +# Copyright (c) 2019, DENIC eG +# All rights reserved. +# +# This file is part of dnsmeter. +# +# dnsmeter 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. +# +# dnsmeter 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 dnsmeter. If not, see . + +ACLOCAL_AMFLAGS = -I m4 + +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in \ + $(srcdir)/src/config.h.in~ \ + $(srcdir)/configure + +SUBDIRS = src + +dist_doc_DATA = CHANGES README.md LICENSE + +EXTRA_DIST = m4 + +test: check diff --git a/README.md b/README.md new file mode 100644 index 0000000..45c5eae --- /dev/null +++ b/README.md @@ -0,0 +1,158 @@ +# dnsmeter + +[![Build Status](https://travis-ci.com/DNS-OARC/dnsmeter.svg?branch=develop)](https://travis-ci.com/DNS-OARC/dnsmeter) [![Total alerts](https://img.shields.io/lgtm/alerts/g/DNS-OARC/dnsmeter.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/DNS-OARC/dnsmeter/alerts/) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=dns-oarc%3Adnsmeter&metric=bugs)](https://sonarcloud.io/dashboard?id=dns-oarc%3Adnsmeter) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=dns-oarc%3Adnsmeter&metric=security_rating)](https://sonarcloud.io/dashboard?id=dns-oarc%3Adnsmeter) + +`dnsmeter` is a tool for testing performance of a nameserver and the +infrastructure around it. It generates DNS queries and sends them via UDP +to a target nameserver and counts the answers. + +Features: +- payload can be given as a text file or a PCAP file +- can automatically run different load steps, which can be given as a list or ranges +- results per load step can be stored in a CSV file +- sender addresses can be spoofed from a given network or from the addresses found in the PCAP file +- answers are counted, even if source address is spoofed, if answers get routed back to the load generator +- round-trip-times are measured (average, min, mix) +- the amount of DNSSEC queries can be given as percentage of total traffic +- optimized for high amount of packets, on an Intel(R) Xeon(R) CPU E5-2430 v2 @ 2.50GHz it can generate more than 900.000 packets per second +- runs on Linux and FreeBSD + +## Dependencies + +`dnsmeter` requires a couple of libraries beside a normal C++ compiling +environment with autoconf, automake and libtool. + +`dnsmeter` has a non-optional dependency on the PCRE library, `libresolv` +and PCAP library. + +`dnsmeter` also includes [pplib](https://github.com/DNS-OARC/pplib), +collection of C++ functions and classes, and it has non-optional dependency +on OpenSSL, bzip2, IDN2 (or IDN1) library and zlib. + +To install the dependencies under Debian/Ubuntu: +``` +apt-get install -y libssl-dev libbz2-dev libidn2-dev zlib1g-dev libpcap-dev libpcre3-dev gettext +``` + +NOTE: If your system does not have `libidn2-dev`, please use `libidn11-dev` instead. + +To install the dependencies under CentOS (with EPEL enabled): +``` +yum install -y openssl-devel bzip2-devel libidn2-devel zlib-devel libpcap-devel pcre-devel gettext-devel +``` + +NOTE: If your using openSUSE/SLE then bzip2's package is `libbz2-devel`. + +To install the dependencies under FreeBSD 10+ using `pkg`: +``` +pkg install -y openssl libidn2 libpcap pcre gettext +``` + +## Building from source tarball + +The [source tarball from DNS-OARC](https://www.dns-oarc.net/tools/dnsmeter) +comes prepared with `configure`: + +``` +tar zxvf dnsmeter-version.tar.gz +cd dnsmeter-version +./configure [options] +make +make install +``` + +NOTE: If building fails on FreeBSD, try adding these configure +options: `--with-extra-cflags="-I /usr/local/include" --with-extra-ldflags="-L/usr/local/lib"`. + +## Building from Git repository + +If you are building `dnsmeter` from it's Git repository you will first need +to initiate the Git submodules that exists and later create autoconf/automake +files, this will require a build environment with autoconf, automake and +libtool to be installed. + +``` +git clone https://github.com/DNS-OARC/dnsmeter.git +cd dnsmeter +git submodule update --init +./autogen.sh +./configure [options] +make +make install +``` + +## Usage + +Once installed please see `man dnsmeter` for usage. + +## Example + +Lets assume the following scenario: + +- load generator runs on FreeBSD +- network interface an which the traffic goes out and comes back is `igb0` +- source IP on the load generator is 192.168.155.20 +- target nameserver has IP 192.168.0.1, port 53 +- we want to spoof the sender address from the network 10.0.0.0/8 +- the payload file is found here: `/home/testdata/payload.txt` +- the nameserver is running on CentOS and we need to set a route back to the load generator: `ip route add 10.0.0.0/8 via 192.168.155.20` +- we want to test the following load steps: 30000,40000,45000,50000,100000,150000 +- results should be written to `results.csv` +- DNSSEC rate should be 70% + +This makes the following command: + +``` +dnsmeter -p /home/testdata/payload.txt \ + -r 30000,40000,45000,50000,100000,150000 \ + -s 10.0.0.0/8 \ + -z 192.168.0.1:53 \ + -e igb0 \ + -d 70 \ + -c results.csv +``` + +In the second example, we want to use a PCAP file as payload and want +to spoof with the addresses from that file: + +``` +dnsmeter -p /home/testdata/pcap.file1 \ + -r 30000,40000,45000,50000,100000,150000 \ + -s pcap \ + -z 192.168.0.1:53 \ + -e igb0 \ + -c results_pcap.csv +``` + +## Author(s) + +- Patrick Fedick [@pfedick](https://github.com/pfedick) + +## Contributor(s) + +- Jerry Lundström [@jelu](https://github.com/jelu) + +## Copyright + +Copyright (c) 2019-2021, OARC, Inc. + +Copyright (c) 2019, DENIC eG + +All rights reserved. + +``` +This file is part of dnsmeter. + +dnsmeter 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. + +dnsmeter 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 dnsmeter. If not, see . +``` diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..21da32a --- /dev/null +++ b/autogen.sh @@ -0,0 +1,21 @@ +#!/bin/sh -e +# Copyright (c) 2019-2021, OARC, Inc. +# Copyright (c) 2019, DENIC eG +# All rights reserved. +# +# This file is part of dnsmeter. +# +# dnsmeter 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. +# +# dnsmeter 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 dnsmeter. If not, see . + +autoreconf --force --install --no-recursive --include=m4 diff --git a/config.rpath b/config.rpath new file mode 120000 index 0000000..503953f --- /dev/null +++ b/config.rpath @@ -0,0 +1 @@ +src/pplib/autoconf/config.rpath \ No newline at end of file diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..97a5e23 --- /dev/null +++ b/configure.ac @@ -0,0 +1,91 @@ +# Copyright (c) 2019-2021, OARC, Inc. +# Copyright (c) 2019, DENIC eG +# All rights reserved. +# +# This file is part of dnsmeter. +# +# dnsmeter 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. +# +# dnsmeter 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 dnsmeter. If not, see . + +AC_PREREQ(2.69) +AC_INIT([dnsmeter], [1.0.2], [admin@dns-oarc.net], [dnsmeter], [https://github.com/DNS-OARC/dnsmeter/issues]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) +AC_CONFIG_SRCDIR([src/main.cpp]) +AC_CONFIG_HEADER([src/config.h]) +AC_CONFIG_MACRO_DIR([m4]) + +# Checks for programs. +AC_PROG_CXX +AC_CANONICAL_HOST +LT_INIT([disable-static]) + +# Check --enable-warn-all +AC_ARG_ENABLE([warn-all], [AS_HELP_STRING([--enable-warn-all], [Enable all compiler warnings])], [AX_CFLAGS_WARN_ALL()]) + +# Check --with-extra-cflags +AC_ARG_WITH([extra-cflags], [AS_HELP_STRING([--with-extra-cflags=CFLAGS], [Add extra CFLAGS/CXXFLAGS])], [ + AC_MSG_NOTICE([appending extra CFLAGS/CXXFLAGS... $withval]) + AS_VAR_APPEND(CFLAGS, [" $withval"]) + AS_VAR_APPEND(CXXFLAGS, [" $withval"]) +]) + +# Check --with-extra-ldflags +AC_ARG_WITH([extra-ldflags], [AS_HELP_STRING([--with-extra-ldflags=LDFLAGS], [Add extra LDFLAGS])], [ + AC_MSG_NOTICE([appending extra LDFLAGS... $withval]) + AS_VAR_APPEND(LDFLAGS, [" $withval"]) +]) + +# Check --enable-gcov +AC_ARG_ENABLE([gcov], [AS_HELP_STRING([--enable-gcov], [Enable coverage testing])], [ + coverage_cxxflags="--coverage -g -O0 -fno-inline -fno-inline-small-functions -fno-default-inline" + AC_MSG_NOTICE([enabling coverage testing... $coverage_cxxflags]) + AS_VAR_APPEND(CXXFLAGS, [" $coverage_cxxflags"]) +]) +AM_CONDITIONAL([ENABLE_GCOV], [test "x$enable_gcov" != "xno"]) +AM_EXTRA_RECURSIVE_TARGETS([gcov]) + +# Checks for support. +AX_PTHREAD +AC_CHECK_LIB([pcap], [pcap_open_live], [], [AC_MSG_ERROR([libpcap not found])]) +AC_CHECK_LIB([m], [sqrt]) +AC_CHECK_LIB([bind], [ns_initparse], [], [AC_CHECK_LIB([bind], [__ns_initparse])]) +AC_CHECK_LIB([resolv], [res_mkquery], [], [ + AC_CHECK_LIB([resolv], [__res_mkquery], [], [ + AC_CHECK_LIB([resolv], [res_9_mkquery]) + ]) +]) +AC_CHECK_LIB([idn], [idna_to_ascii_4z]) +AC_CHECK_LIB([idn2], [idn2_to_ascii_4z]) +AC_CHECK_LIB([pcre], [pcre_exec]) + +sinclude(src/pplib/autoconf/iconv.m4) + +# Check for OS specific libraries +case "$host_os" in + freebsd*) + AC_CHECK_LIB([kvm], [kvm_open]) + AM_ICONV + ICONV_CFLAGS="$INCICONV" + ICONV_LIBS="$LIBICONV" + AC_SUBST(ICONV_CFLAGS) + AC_SUBST(ICONV_LIBS) + ;; +esac + +# Output Makefiles +AC_CONFIG_FILES([ + Makefile + src/Makefile + src/test/Makefile +]) +AC_OUTPUT diff --git a/fmt.sh b/fmt.sh new file mode 100755 index 0000000..86e9053 --- /dev/null +++ b/fmt.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +clang-format-4.0 \ + -style=file \ + -i \ + src/*.cpp \ + src/*.h diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4 new file mode 100644 index 0000000..dd6d8b6 --- /dev/null +++ b/m4/ax_append_flag.m4 @@ -0,0 +1,50 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) +# +# DESCRIPTION +# +# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space +# added in between. +# +# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. +# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains +# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly +# FLAG. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2011 Maarten Bosmans +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 8 + +AC_DEFUN([AX_APPEND_FLAG], +[dnl +AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF +AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) +AS_VAR_SET_IF(FLAGS,[ + AS_CASE([" AS_VAR_GET(FLAGS) "], + [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], + [ + AS_VAR_APPEND(FLAGS,[" $1"]) + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) + ], + [ + AS_VAR_SET(FLAGS,[$1]) + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) +AS_VAR_POPDEF([FLAGS])dnl +])dnl AX_APPEND_FLAG diff --git a/m4/ax_cflags_warn_all.m4 b/m4/ax_cflags_warn_all.m4 new file mode 100644 index 0000000..9235a18 --- /dev/null +++ b/m4/ax_cflags_warn_all.m4 @@ -0,0 +1,158 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])] +# AX_CXXFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])] +# AX_FCFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])] +# +# DESCRIPTION +# +# Specify compiler options that enable most reasonable warnings. For the +# GNU Compiler Collection (GCC), for example, it will be "-Wall". The +# result is added to shellvar, one of CFLAGS, CXXFLAGS or FCFLAGS if the +# first parameter is not specified. +# +# Each of these macros accepts the following optional arguments: +# +# - $1 - shellvar +# shell variable to use (CFLAGS, CXXFLAGS or FCFLAGS if not +# specified, depending on macro) +# +# - $2 - default +# value to use for flags if compiler vendor cannot be determined (by +# default, "") +# +# - $3 - action-if-found +# action to take if the compiler vendor has been successfully +# determined (by default, add the appropriate compiler flags to +# shellvar) +# +# - $4 - action-if-not-found +# action to take if the compiler vendor has not been determined or +# is unknown (by default, add the default flags, or "" if not +# specified, to shellvar) +# +# These macros use AX_COMPILER_VENDOR to determine which flags should be +# returned for a given compiler. Not all compilers currently have flags +# defined for them; patches are welcome. If need be, compiler flags may +# be made language-dependent: use a construct like the following: +# +# [vendor_name], [m4_if(_AC_LANG_PREFIX,[C], VAR="--relevant-c-flags",dnl +# m4_if(_AC_LANG_PREFIX,[CXX], VAR="--relevant-c++-flags",dnl +# m4_if(_AC_LANG_PREFIX,[FC], VAR="--relevant-fortran-flags",dnl +# VAR="$2"; FOUND="no")))], +# +# Note: These macros also depend on AX_PREPEND_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2010 Rhys Ulerich +# Copyright (c) 2018 John Zaitseff +# +# This program 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. +# +# This program 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 this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 25 + +AC_DEFUN([AX_FLAGS_WARN_ALL], [ + AX_REQUIRE_DEFINED([AX_PREPEND_FLAG])dnl + AC_REQUIRE([AX_COMPILER_VENDOR])dnl + + AS_VAR_PUSHDEF([FLAGS], [m4_default($1,_AC_LANG_PREFIX[]FLAGS)])dnl + AS_VAR_PUSHDEF([VAR], [ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl + AS_VAR_PUSHDEF([FOUND], [ac_save_[]_AC_LANG_ABBREV[]flags_warn_all_found])dnl + + AC_CACHE_CHECK([FLAGS for most reasonable warnings], VAR, [ + VAR="" + FOUND="yes" + dnl Cases are listed in the order found in ax_compiler_vendor.m4 + AS_CASE("$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor", + [intel], [VAR="-w2"], + [ibm], [VAR="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd"], + [pathscale], [], + [clang], [VAR="-Wall"], + [cray], [VAR="-h msglevel 2"], + [fujitsu], [], + [sdcc], [], + [sx], [VAR="-pvctl[,]fullmsg"], + [portland], [], + [gnu], [VAR="-Wall"], + [sun], [VAR="-v"], + [hp], [VAR="+w1"], + [dec], [VAR="-verbose -w0 -warnprotos"], + [borland], [], + [comeau], [], + [kai], [], + [lcc], [], + [sgi], [VAR="-fullwarn"], + [microsoft], [], + [metrowerks], [], + [watcom], [], + [tcc], [], + [unknown], [ + VAR="$2" + FOUND="no" + ], + [ + AC_MSG_WARN([Unknown compiler vendor returned by [AX_COMPILER_VENDOR]]) + VAR="$2" + FOUND="no" + ] + ) + + AS_IF([test "x$FOUND" = "xyes"], [dnl + m4_default($3, [AS_IF([test "x$VAR" != "x"], [AX_PREPEND_FLAG([$VAR], [FLAGS])])]) + ], [dnl + m4_default($4, [m4_ifval($2, [AX_PREPEND_FLAG([$VAR], [FLAGS])], [true])]) + ])dnl + ])dnl + + AS_VAR_POPDEF([FOUND])dnl + AS_VAR_POPDEF([VAR])dnl + AS_VAR_POPDEF([FLAGS])dnl +])dnl AX_FLAGS_WARN_ALL + +AC_DEFUN([AX_CFLAGS_WARN_ALL], [dnl + AC_LANG_PUSH([C]) + AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) + AC_LANG_POP([C]) +])dnl + +AC_DEFUN([AX_CXXFLAGS_WARN_ALL], [dnl + AC_LANG_PUSH([C++]) + AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) + AC_LANG_POP([C++]) +])dnl + +AC_DEFUN([AX_FCFLAGS_WARN_ALL], [dnl + AC_LANG_PUSH([Fortran]) + AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) + AC_LANG_POP([Fortran]) +])dnl diff --git a/m4/ax_compiler_vendor.m4 b/m4/ax_compiler_vendor.m4 new file mode 100644 index 0000000..f06e865 --- /dev/null +++ b/m4/ax_compiler_vendor.m4 @@ -0,0 +1,117 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPILER_VENDOR +# +# DESCRIPTION +# +# Determine the vendor of the C, C++ or Fortran compiler. The vendor is +# returned in the cache variable $ax_cv_c_compiler_vendor for C, +# $ax_cv_cxx_compiler_vendor for C++ or $ax_cv_fc_compiler_vendor for +# (modern) Fortran. The value is one of "intel", "ibm", "pathscale", +# "clang" (LLVM), "cray", "fujitsu", "sdcc", "sx", "portland" (PGI), "gnu" +# (GCC), "sun" (Oracle Developer Studio), "hp", "dec", "borland", +# "comeau", "kai", "lcc", "sgi", "microsoft", "metrowerks", "watcom", +# "tcc" (Tiny CC) or "unknown" (if the compiler cannot be determined). +# +# To check for a Fortran compiler, you must first call AC_FC_PP_SRCEXT +# with an appropriate preprocessor-enabled extension. For example: +# +# AC_LANG_PUSH([Fortran]) +# AC_PROG_FC +# AC_FC_PP_SRCEXT([F]) +# AX_COMPILER_VENDOR +# AC_LANG_POP([Fortran]) +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# Copyright (c) 2018-19 John Zaitseff +# +# This program 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. +# +# This program 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 this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 30 + +AC_DEFUN([AX_COMPILER_VENDOR], [dnl + AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [dnl + dnl If you modify this list of vendors, please add similar support + dnl to ax_compiler_version.m4 if at all possible. + dnl + dnl Note: Do NOT check for GCC first since some other compilers + dnl define __GNUC__ to remain compatible with it. Compilers that + dnl are very slow to start (such as Intel) are listed first. + + vendors=" + intel: __ICC,__ECC,__INTEL_COMPILER + ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ + pathscale: __PATHCC__,__PATHSCALE__ + clang: __clang__ + cray: _CRAYC + fujitsu: __FUJITSU + sdcc: SDCC,__SDCC + sx: _SX + portland: __PGI + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ + comeau: __COMO__ + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + tcc: __TINYC__ + unknown: UNKNOWN + " + for ventest in $vendors; do + case $ventest in + *:) + vendor=$ventest + continue + ;; + *) + vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" + ;; + esac + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ +#if !($vencpp) + thisisanerror; +#endif + ]])], [break]) + done + + ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` + ]) +])dnl diff --git a/m4/ax_prepend_flag.m4 b/m4/ax_prepend_flag.m4 new file mode 100644 index 0000000..adac8c5 --- /dev/null +++ b/m4/ax_prepend_flag.m4 @@ -0,0 +1,51 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_prepend_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PREPEND_FLAG(FLAG, [FLAGS-VARIABLE]) +# +# DESCRIPTION +# +# FLAG is added to the front of the FLAGS-VARIABLE shell variable, with a +# space added in between. +# +# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. +# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains +# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly +# FLAG. +# +# NOTE: Implementation based on AX_APPEND_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2011 Maarten Bosmans +# Copyright (c) 2018 John Zaitseff +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 2 + +AC_DEFUN([AX_PREPEND_FLAG], +[dnl +AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF +AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) +AS_VAR_SET_IF(FLAGS,[ + AS_CASE([" AS_VAR_GET(FLAGS) "], + [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], + [ + FLAGS="$1 $FLAGS" + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) + ], + [ + AS_VAR_SET(FLAGS,[$1]) + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) +AS_VAR_POPDEF([FLAGS])dnl +])dnl AX_PREPEND_FLAG diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 new file mode 100644 index 0000000..4920e07 --- /dev/null +++ b/m4/ax_pthread.m4 @@ -0,0 +1,486 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also to link with them as well. For example, you might link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threaded programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2011 Daniel Richard G. +# +# This program 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. +# +# This program 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 this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 25 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_PROG_SED]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on Tru64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) + AC_MSG_RESULT([$ax_pthread_ok]) + if test "x$ax_pthread_ok" = "xno"; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case $host_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], + [ +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + ], + [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) + ;; + + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" + ;; +esac + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +AS_IF([test "x$GCC" = "xyes"], + [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"]) + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $host_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" + ;; + + aix*) + ax_pthread_check_macro="_THREAD_SAFE" + ;; + + *) + ax_pthread_check_macro="--" + ;; +esac +AS_IF([test "x$ax_pthread_check_macro" = "x--"], + [ax_pthread_check_cond=0], + [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) + +# Are we compiling with Clang? + +AC_CACHE_CHECK([whether $CC is Clang], + [ax_cv_PTHREAD_CLANG], + [ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], + [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + ], + [ax_cv_PTHREAD_CLANG=yes]) + fi + ]) +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + +ax_pthread_clang_warning=no + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + PTHREAD_CFLAGS="-pthread" + PTHREAD_LIBS= + + ax_pthread_ok=yes + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [ac_link="$ax_pthread_2step_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [break]) + ]) + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + ]) + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do + + case $ax_pthread_try_flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -mt,pthread) + AC_MSG_CHECKING([whether pthreads work with -mt -lpthread]) + PTHREAD_CFLAGS="-mt" + PTHREAD_LIBS="-lpthread" + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) + PTHREAD_CFLAGS="$ax_pthread_try_flag" + ;; + + pthread-config) + AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) + AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) + PTHREAD_LIBS="-l$ax_pthread_try_flag" + ;; + esac + + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + AC_MSG_RESULT([$ax_pthread_ok]) + AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_CACHE_CHECK([for joinable pthread attribute], + [ax_cv_PTHREAD_JOINABLE_ATTR], + [ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $ax_pthread_attr; return attr /* ; */])], + [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], + []) + done + ]) + AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes"], + [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], + [$ax_cv_PTHREAD_JOINABLE_ATTR], + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + ax_pthread_joinable_attr_defined=yes + ]) + + AC_CACHE_CHECK([whether more special flags are required for pthreads], + [ax_cv_PTHREAD_SPECIAL_FLAGS], + [ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + ]) + AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes"], + [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes]) + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + [ax_cv_PTHREAD_PRIO_INHERIT], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT; + return i;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes"], + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) + ax_pthread_prio_inherit_defined=yes + ]) + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != "xyes"; then + case $host_os in + aix*) + AS_CASE(["x/$CC"], + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], + [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + +AC_SUBST([PTHREAD_LIBS]) +AC_SUBST([PTHREAD_CFLAGS]) +AC_SUBST([PTHREAD_CC]) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test "x$ax_pthread_ok" = "xyes"; then + ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff --git a/m4/ax_require_defined.m4 b/m4/ax_require_defined.m4 new file mode 100644 index 0000000..17c3eab --- /dev/null +++ b/m4/ax_require_defined.m4 @@ -0,0 +1,37 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_REQUIRE_DEFINED(MACRO) +# +# DESCRIPTION +# +# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have +# been defined and thus are available for use. This avoids random issues +# where a macro isn't expanded. Instead the configure script emits a +# non-fatal: +# +# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found +# +# It's like AC_REQUIRE except it doesn't expand the required macro. +# +# Here's an example: +# +# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) +# +# LICENSE +# +# Copyright (c) 2014 Mike Frysinger +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 2 + +AC_DEFUN([AX_REQUIRE_DEFINED], [dnl + m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) +])dnl AX_REQUIRE_DEFINED diff --git a/m4/dl.sh b/m4/dl.sh new file mode 100755 index 0000000..9874dbd --- /dev/null +++ b/m4/dl.sh @@ -0,0 +1,27 @@ +#!/bin/sh -e +# Copyright (c) 2019-2021, OARC, Inc. +# Copyright (c) 2019, DENIC eG +# All rights reserved. +# +# This file is part of dnsmeter. +# +# dnsmeter 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. +# +# dnsmeter 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 dnsmeter. If not, see . + +m4_files="ax_append_flag.m4 ax_cflags_warn_all.m4 ax_compiler_vendor.m4 \ + ax_prepend_flag.m4 ax_pthread.m4 ax_require_defined.m4" + +for ax in $m4_files; do + rm -f "$ax" + wget -O "$ax" "http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/$ax" +done diff --git a/rpm/dnsmeter.spec b/rpm/dnsmeter.spec new file mode 100644 index 0000000..35601f9 --- /dev/null +++ b/rpm/dnsmeter.spec @@ -0,0 +1,115 @@ +Name: dnsmeter +Version: 1.0.2 +Release: 1%{?dist} +Summary: DNS performance and infrastructure testing +Group: Productivity/Networking/DNS/Utilities + +License: GPL-3.0 +URL: https://www.dns-oarc.net/tools/dnsmeter +# Source needs to be generated by dist-tools/create-source-packages, see +# https://github.com/jelu/dist-tools +Source0: https://github.com/DNS-OARC/dnsmeter/archive/v%{version}.tar.gz?/%{name}_%{version}.orig.tar.gz + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRequires: gcc-c++ +BuildRequires: bind-devel +BuildRequires: openssl-devel +%if 0%{?suse_version} || 0%{?sle_version} +BuildRequires: libbz2-devel +%else +BuildRequires: bzip2-devel +%endif +BuildRequires: libidn2-devel +BuildRequires: zlib-devel +BuildRequires: libpcap-devel +BuildRequires: pcre-devel +BuildRequires: gettext-devel + +%description +DNSMeter is a tool for testing performance of nameserver and/or +infrastructure around it. +It generates dns queries and sends them via UDP to a target nameserver +and counts the answers. + +Features: +- payload can be given as text file or pcap file +- can automatically run different load steps, which can be given as + list or ranges +- results per load step can be stored in CSV file +- sender address can be spoofed from a given network or from pcap file, + if payload is a pcap file +- answers are counted, even if source address is spoofed, if answers get + routed back to the load generator +- roundtrip-times are measured (average, min, mix) +- amount of DNSSEC queries can be given as percentage of total traffic +- optimized for high amount of packets. On an Intel(R) Xeon(R) CPU E5-2430 + v2 @ 2.50GHz it can generate more than 900.000 packets per second + + +%prep +%setup -q -n %{name}_%{version} + + +%build +sh autogen.sh +%configure +make %{?_smp_mflags} + + +%check +#make test +true + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root) +%{_bindir}/dnsmeter +%{_datadir}/doc/* +%{_mandir}/man1/* + + +%changelog +* Wed Jun 02 2021 Jerry Lundström 1.0.2-1 +- Release 1.0.2 + * This release fixes an issue with source port being static when only + using `-q` to generate traffic from one host/IP. The source port is + now randomized for every DNS query. + * Other changes is mainly about build system, packages and fixed issues + detected by code analysis tools. + * Commits: + 05000cc Typo, random source port + 6a71707 Coverage + 1c724ce SonarCloud + 0776d20 Badges + c274884 LGTM + 5a12c61 COPR + f77efed Build dependency + a359b66 iconv +* Mon Oct 07 2019 Jerry Lundström 1.0.1-1 +- Release 1.0.1 + * This release fixes a few minor bugs and a dependency issue which made + `dnsmeter` throw an exception when using the `-r` option. + * Bugfixes: + - Use existing `rtt_avg`, was showing total RTT divided by number of threads + - Fix an issue which missed the first 8 bytes of a text payload + * Commits: + 72197b5 PCAP detect + 665be2d RTT average + 3fe7b66 pplib dependencies, RTT average + e565d42 Funding + 1a1ea40 README +* Mon Sep 23 2019 Jerry Lundström 1.0.0-1 +- Release 1.0.0 +* Wed Sep 18 2019 Jerry Lundström 0.9.0-1 +- First package release diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..e39c1e8 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,472 @@ +# Copyright (c) 2019-2021, OARC, Inc. +# Copyright (c) 2019, DENIC eG +# All rights reserved. +# +# This file is part of dnsmeter. +# +# dnsmeter 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. +# +# dnsmeter 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 dnsmeter. If not, see . + +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in +DISTCLEANFILES = $(srcdir)/pplib/include/ppl7-config.h \ + $(srcdir)/pplib/release/libppl7.a +CLEANFILES = dnsmeter.1 *.gcda *.gcno *.gcov + +SUBDIRS = test + +AM_CXXFLAGS = -I$(srcdir) \ + -I$(top_srcdir) \ + -I$(srcdir)/pplib/include \ + $(PTHREAD_CFLAGS) $(ICONV_CFLAGS) + +bin_PROGRAMS = dnsmeter + +dnsmeter_SOURCES = dns_receiver_thread.cpp dns_sender.cpp \ + dns_sender_thread.cpp main.cpp packet.cpp payload_file.cpp query.cpp \ + raw_socket_receiver.cpp raw_socket_sender.cpp system_stat.cpp +dist_dnsmeter_SOURCES = dns_receiver_thread.h dns_sender.h \ + dns_sender_thread.h exceptions.h packet.h payload_file.h query.h \ + raw_socket_receiver.h raw_socket_sender.h system_stat.h +dnsmeter_LDADD = $(PTHREAD_LIBS) $(ICONV_LIBS) \ + $(srcdir)/pplib/release/libppl7.a + +BUILT_SOURCES = pplib/include/ppl7-config.h + +pplib/include/ppl7-config.h: + cd "$(srcdir)/pplib" && ./configure --disable-oggtest \ +--disable-freetypetest --disable-sdltest --disable-sdlframework \ +--without-jpeg --without-libjpegturbo --without-libpng \ +--without-libmicrohttpd --without-libmcrypt-prefix \ +--without-libtiff --without-libcurl --without-mpg123 \ +--without-lame --without-ogg --without-libcdio --without-libiconv-prefix \ +--without-imlib --without-mysql --without-postgresql \ +--without-sqlite3 --without-libldn --without-nasm + +$(srcdir)/pplib/release/libppl7.a: pplib/include/ppl7-config.h + cd "$(srcdir)/pplib" && make + +man1_MANS = dnsmeter.1 + +dnsmeter.1: dnsmeter.1.in Makefile + sed -e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \ +-e 's,[@]PACKAGE_URL[@],$(PACKAGE_URL),g' \ +-e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \ +< $(srcdir)/dnsmeter.1.in > dnsmeter.1 + +if ENABLE_GCOV +gcov-local: + for src in $(dnsmeter_SOURCES); do \ + gcov -l -r -s "$(srcdir)" "$$src"; \ + done +endif + +EXTRA_DIST = dnsmeter.1.in \ + pplib/Makefile.in \ + pplib/src/types/ByteArrayPtr.cpp \ + pplib/src/types/ByteArray.cpp \ + pplib/src/types/Array.cpp \ + pplib/src/types/Pointer.cpp \ + pplib/src/types/WideString.cpp \ + pplib/src/types/AssocArray.cpp \ + pplib/src/types/String.cpp \ + pplib/src/types/Variant.cpp \ + pplib/src/types/DateTime.cpp \ + pplib/src/math/crc32.cpp \ + pplib/src/math/calc.cpp \ + pplib/src/math/md5.cpp \ + pplib/src/math/random.cpp \ + pplib/src/database/MySQL.cpp \ + pplib/src/database/ResultSet.cpp \ + pplib/src/database/Database.cpp \ + pplib/src/database/PostgreSQL.cpp \ + pplib/src/database/DBPool.cpp \ + pplib/src/database/DBPoolOfPools.cpp \ + pplib/src/database/Sqlite3.cpp \ + pplib/src/audio/AudioCD.cpp \ + pplib/src/audio/AudioEncoder_MP3.cpp \ + pplib/src/audio/AudioDecoder_Ogg.cpp \ + pplib/src/audio/AudioInfo.cpp \ + pplib/src/audio/Cddb.cpp \ + pplib/src/audio/AudioDecoder_MP3.cpp \ + pplib/src/audio/AudioDecoder_Aiff.cpp \ + pplib/src/audio/AudioEncoder_Wave.cpp \ + pplib/src/audio/Icecast.cpp \ + pplib/src/audio/AudioEncoder_Ogg.cpp \ + pplib/src/audio/ID3Tag.cpp \ + pplib/src/audio/AudioDecoder_Wave.cpp \ + pplib/src/audio/Mp3.cpp \ + pplib/src/audio/AudioEncoder_Aiff.cpp \ + pplib/src/toolkit/Divider.cpp \ + pplib/src/toolkit/WindowManager.cpp \ + pplib/src/toolkit/Window.cpp \ + pplib/src/toolkit/LineInput.cpp \ + pplib/src/toolkit/WindowManager_SDL2.cpp \ + pplib/src/toolkit/Layout.cpp \ + pplib/src/toolkit/Widget.cpp \ + pplib/src/toolkit/Surface.cpp \ + pplib/src/toolkit/Frame.cpp \ + pplib/src/toolkit/Label.cpp \ + pplib/src/toolkit/Button.cpp \ + pplib/src/toolkit/Event.cpp \ + pplib/src/asm/common.asm \ + pplib/src/asm/colors.asm \ + pplib/src/asm/pixel.asm \ + pplib/src/asm/chromakey.asm \ + pplib/src/asm/cpu.asm \ + pplib/src/asm/blt_blend.asm \ + pplib/src/asm/rect.asm \ + pplib/src/asm/fonts.asm \ + pplib/src/asm/blt.asm \ + pplib/src/internet/WikiParser.cpp \ + pplib/src/internet/Webserver.cpp \ + pplib/src/internet/ipaddress.cpp \ + pplib/src/internet/sockaddr.cpp \ + pplib/src/internet/resolver.cpp \ + pplib/src/internet/UDPSocket.cpp \ + pplib/src/internet/ipnetwork.cpp \ + pplib/src/internet/curl.cpp \ + pplib/src/internet/SocketMessage.cpp \ + pplib/src/internet/inet_functions.cpp \ + pplib/src/internet/openssl.cpp \ + pplib/src/internet/TCPSocket.cpp \ + pplib/src/crypto/Digest.cpp \ + pplib/src/crypto/Crypt.cpp \ + pplib/src/crypto/MCrypt.cpp \ + pplib/src/core/Signal.cpp \ + pplib/src/core/Compat.cpp \ + pplib/src/core/Mutex.cpp \ + pplib/src/core/ThreadPool.cpp \ + pplib/src/core/Functions.cpp \ + pplib/src/core/MemoryGroup.cpp \ + pplib/src/core/MemFile.cpp \ + pplib/src/core/StringFunctions.cpp \ + pplib/src/core/Dir.cpp \ + pplib/src/core/File.cpp \ + pplib/src/core/ConfigParser.cpp \ + pplib/src/core/DirEntry.cpp \ + pplib/src/core/Resourcen.cpp \ + pplib/src/core/Exceptions.cpp \ + pplib/src/core/FileObject.cpp \ + pplib/src/core/PerlHelper.cpp \ + pplib/src/core/Json.cpp \ + pplib/src/core/Iconv.cpp \ + pplib/src/core/AVLTree.cpp \ + pplib/src/core/Logger.cpp \ + pplib/src/core/Threads.cpp \ + pplib/src/core/PythonHelper.cpp \ + pplib/src/core/Compression.cpp \ + pplib/src/core/Time.cpp \ + pplib/src/core/cpu.cpp \ + pplib/src/core/MemoryHeap.cpp \ + pplib/src/core/PFPFile.cpp \ + pplib/src/core/Resource.cpp \ + pplib/src/core/GzFile.cpp \ + pplib/src/grafix/Point.cpp \ + pplib/src/grafix/ImageFilter_PPM.cpp \ + pplib/src/grafix/Font5.cpp \ + pplib/src/grafix/ImageFilter_JPEG.cpp \ + pplib/src/grafix/Rect.cpp \ + pplib/src/grafix/DrawableBlit.cpp \ + pplib/src/grafix/Point3D.cpp \ + pplib/src/grafix/RGBFormat.cpp \ + pplib/src/grafix/ImageFilter_GIF.cpp \ + pplib/src/grafix/Fonts.cpp \ + pplib/src/grafix/ImageFilter_TGA.cpp \ + pplib/src/grafix/ImageFilter_PNG.cpp \ + pplib/src/grafix/FontFreeType.cpp \ + pplib/src/grafix/Grafix.cpp \ + pplib/src/grafix/Font6.cpp \ + pplib/src/grafix/DrawablePixel.cpp \ + pplib/src/grafix/ImageFilter_BMP.cpp \ + pplib/src/grafix/Sprite.cpp \ + pplib/src/grafix/ImageFilter_TIFF.cpp \ + pplib/src/grafix/Size.cpp \ + pplib/src/grafix/ImageList.cpp \ + pplib/src/grafix/DrawableLines.cpp \ + pplib/src/grafix/DrawableColor.cpp \ + pplib/src/grafix/DrawableShapes.cpp \ + pplib/src/grafix/Image.cpp \ + pplib/src/grafix/ImageFilter.cpp \ + pplib/src/grafix/ImageFilter_ImageMagick.cpp \ + pplib/src/grafix/Font4.cpp \ + pplib/src/grafix/Drawable.cpp \ + pplib/src/grafix/Color.cpp \ + pplib/genConfigure \ + pplib/genMakefile.in \ + pplib/aclocal.m4 \ + pplib/conf.sh \ + pplib/include/crypto.h \ + pplib/include/ppl7-ppl6compat.h \ + pplib/include/ppl7.h \ + pplib/include/ppl7-tk.h \ + pplib/include/ppl7-visualc-config.h \ + pplib/include/ppl7-config.h.in \ + pplib/include/config.h.in \ + pplib/include/ppl7-inet.h \ + pplib/include/ppl7-audio.h \ + pplib/include/threads.h \ + pplib/include/ppl7-grafix.h \ + pplib/include/socket.h \ + pplib/include/ppl7-crypto.h \ + pplib/include/prolog.h \ + pplib/include/ppl7-types.h \ + pplib/include/ppl7-algorithms.h \ + pplib/include/ppl7-exceptions.h \ + pplib/include/ppl7-db.h \ + pplib/include/compat.h \ + pplib/tests/Makefile.in \ + pplib/tests/src/toolkit.h \ + pplib/tests/src/stringspeed.cpp \ + pplib/tests/src/database/db_mysql.cpp \ + pplib/tests/src/database/db_sqlite.cpp \ + pplib/tests/src/database/db_postgres.cpp \ + pplib/tests/src/audio/id3tag.cpp \ + pplib/tests/src/audio/audio_decoder_aiff.cpp \ + pplib/tests/src/audio/audio_decoder_mp3.cpp \ + pplib/tests/src/audio/audio_encoder_mp3.cpp \ + pplib/tests/src/audio/audioinfo.cpp \ + pplib/tests/src/audio/audio_encoder_aiff.cpp \ + pplib/tests/src/audio/audio_encoder_wave.cpp \ + pplib/tests/src/audio/audio_decoder_wave.cpp \ + pplib/tests/src/ppl6/strings.cpp \ + pplib/tests/src/ppl6/assocarray.cpp \ + pplib/tests/src/crypto/mcrypt.cpp \ + pplib/tests/src/crypto/crypto.cpp \ + pplib/tests/src/crypto/digest.cpp \ + pplib/tests/src/wordlist.cpp \ + pplib/tests/src/core/stringfunctions.cpp \ + pplib/tests/src/core/iconv.cpp \ + pplib/tests/src/core/functions.cpp \ + pplib/tests/src/core/json.cpp \ + pplib/tests/src/core/filestatic.cpp \ + pplib/tests/src/core/strings.cpp \ + pplib/tests/src/core/gzfile.cpp \ + pplib/tests/src/core/pythonhelper.cpp \ + pplib/tests/src/core/memoryheap.cpp \ + pplib/tests/src/core/avltree.cpp \ + pplib/tests/src/core/variant.cpp \ + pplib/tests/src/core/pointer.cpp \ + pplib/tests/src/core/math.cpp \ + pplib/tests/src/core/dir.cpp \ + pplib/tests/src/core/configparser.cpp \ + pplib/tests/src/core/time.cpp \ + pplib/tests/src/core/bytearray.cpp \ + pplib/tests/src/core/datetime.cpp \ + pplib/tests/src/core/memorygroup.cpp \ + pplib/tests/src/core/bytearrayptr.cpp \ + pplib/tests/src/core/widestrings.cpp \ + pplib/tests/src/core/array.cpp \ + pplib/tests/src/core/perlhelper.cpp \ + pplib/tests/src/core/file.cpp \ + pplib/tests/src/core/logger.cpp \ + pplib/tests/src/core/assocarray.cpp \ + pplib/tests/src/core/list.cpp \ + pplib/tests/src/loggertest.cpp \ + pplib/tests/src/grafix/grafix_image.cpp \ + pplib/tests/src/grafix/grafix_rect.cpp \ + pplib/tests/src/grafix/grafix_imagefilter.cpp \ + pplib/tests/src/grafix/grafix_size.cpp \ + pplib/tests/src/grafix/grafix_font.cpp \ + pplib/tests/src/grafix/grafix_rgbformat.cpp \ + pplib/tests/src/grafix/grafix_point3d.cpp \ + pplib/tests/src/grafix/grafix_point.cpp \ + pplib/tests/src/grafix/grafix.cpp \ + pplib/tests/src/grafix/grafix_color.cpp \ + pplib/tests/src/grafix/grafix_drawable.cpp \ + pplib/tests/src/gfxreftest.cpp \ + pplib/tests/src/toolkit.cpp \ + pplib/tests/src/textsnippets.cpp \ + pplib/tests/src/main.cpp \ + pplib/tests/src/threadtest.cpp \ + pplib/tests/src/inet/tcpsocket.cpp \ + pplib/tests/src/inet/ipaddress.cpp \ + pplib/tests/src/inet/wikiparser.cpp \ + pplib/tests/src/inet/sockaddr.cpp \ + pplib/tests/src/inet/resolver.cpp \ + pplib/tests/src/inet/inet.cpp \ + pplib/tests/src/inet/ipnetwork.cpp \ + pplib/tests/create_postgres_db.sh \ + pplib/tests/valgrind.suppressions \ + pplib/tests/gcovr \ + pplib/tests/test.conf \ + pplib/tests/ppl7-tests.h \ + pplib/tests/testdata/test_192cbr_taggedWithCover.mp3 \ + pplib/tests/testdata/test_192vbr.mp3 \ + pplib/tests/testdata/unittest.png \ + pplib/tests/testdata/ppl7-icon-64x64.png \ + pplib/tests/testdata/test_44kHz_tagged.wav \ + pplib/tests/testdata/test.pcx \ + pplib/tests/testdata/unicodeUSASCII.txt \ + pplib/tests/testdata/test-pal-trans.png \ + pplib/tests/testdata/fonts/liberationsans8.fnt5 \ + pplib/tests/testdata/fonts/LiberationSans-Bold.ttf \ + pplib/tests/testdata/fonts/freesans4.fnt5 \ + pplib/tests/testdata/fonts/segoeui4.fnt5 \ + pplib/tests/testdata/filenameUSASCII.txt \ + pplib/tests/testdata/database/postgresql.sql \ + pplib/tests/testdata/database/mysql.sql \ + pplib/tests/testdata/database/sqlite3.sql \ + pplib/tests/testdata/test_192cbr_tagged.mp3 \ + pplib/tests/testdata/test.tga \ + pplib/tests/testdata/test.png \ + pplib/tests/testdata/jsontest2.json \ + pplib/tests/testdata/jsontest4.json \ + pplib/tests/testdata/compression.txt \ + pplib/tests/testdata/mpg123.h \ + pplib/tests/testdata/test.gif \ + pplib/tests/testdata/cover.jpg \ + pplib/tests/testdata/unittest.bmp \ + pplib/tests/testdata/screenshot1.png \ + pplib/tests/testdata/lame.h \ + pplib/tests/testdata/example.conf \ + pplib/tests/testdata/test.tif \ + pplib/tests/testdata/dirwalk/testfile.txt \ + pplib/tests/testdata/dirwalk/zfile.txt \ + pplib/tests/testdata/dirwalk/file1.txt \ + pplib/tests/testdata/dirwalk/LICENSE.TXT \ + pplib/tests/testdata/dirwalk/file3.txt \ + pplib/tests/testdata/dirwalk/file4äöü.txt \ + pplib/tests/testdata/dirwalk/afile.txt \ + pplib/tests/testdata/dirwalk/file2.txt \ + pplib/tests/testdata/test.jpg \ + pplib/tests/testdata/reference.png \ + pplib/tests/testdata/lame_API.txt \ + pplib/tests/testdata/filenameUTF8äöü.txt \ + pplib/tests/testdata/tags_at_eof.aiff \ + pplib/tests/testdata/test_44kHz.aiff \ + pplib/tests/testdata/test_44kHz_tagged.aiff \ + pplib/tests/testdata/compression.txt.gz \ + pplib/tests/testdata/test_44kHz_taggedWithCover.aiff \ + pplib/tests/testdata/test_192cbr.mp3 \ + pplib/tests/testdata/test_44kHz.wav \ + pplib/tests/testdata/test.ppm \ + pplib/tests/testdata/jsontest1.json \ + pplib/tests/testdata/unicodeUtf8äöü.txt \ + pplib/tests/testdata/jsontest3.json \ + pplib/tests/testdata/test_320cbr.mp3 \ + pplib/tests/testdata/test.bmp \ + pplib/tests/testdata/test-pal.png \ + pplib/LICENSE.TXT \ + pplib/configure \ + pplib/autoconf/iconv.m4 \ + pplib/autoconf/imlib.m4 \ + pplib/autoconf/libidn.m4 \ + pplib/autoconf/imagemagick.m4 \ + pplib/autoconf/freetds.m4 \ + pplib/autoconf/ax_lib_gcrypt.m4 \ + pplib/autoconf/checkfuncs.m4 \ + pplib/autoconf/libtiff.m4 \ + pplib/autoconf/ldns.m4 \ + pplib/autoconf/bzip2.m4 \ + pplib/autoconf/ax_lib_crypto.m4 \ + pplib/autoconf/ax_lib_sqlite3.m4 \ + pplib/autoconf/lib-link.m4 \ + pplib/autoconf/ax_check_compiler_flags.m4 \ + pplib/autoconf/ax_path_lib_pcre.m4 \ + pplib/autoconf/nasm.m4 \ + pplib/autoconf/missing \ + pplib/autoconf/libcdio.m4 \ + pplib/autoconf/libjpeg-turbo.m4 \ + pplib/autoconf/libmicrohttpd.m4 \ + pplib/autoconf/ax_gcc_x86_cpuid.m4 \ + pplib/autoconf/ogg.m4 \ + pplib/autoconf/compile \ + pplib/autoconf/ax_pthread.m4 \ + pplib/autoconf/sdl2.m4 \ + pplib/autoconf/ax_cxx_compile_stdcxx.m4 \ + pplib/autoconf/ax_check_openssl.m4 \ + pplib/autoconf/ax_lib_mysql.m4 \ + pplib/autoconf/ax_lib_postgresql.m4 \ + pplib/autoconf/ax_have_qt.m4 \ + pplib/autoconf/ax_gcc_archflag.m4 \ + pplib/autoconf/gtest.m4 \ + pplib/autoconf/ax_check_zlib.m4 \ + pplib/autoconf/shout.m4 \ + pplib/autoconf/jpeg.m4 \ + pplib/autoconf/libcurl.m4 \ + pplib/autoconf/config.rpath \ + pplib/autoconf/ax_cc_maxopt.m4 \ + pplib/autoconf/freetype.m4 \ + pplib/autoconf/install-sh \ + pplib/autoconf/config.sub \ + pplib/autoconf/lame.m4 \ + pplib/autoconf/libbind.m4 \ + pplib/autoconf/config.guess \ + pplib/autoconf/libidn2.m4 \ + pplib/autoconf/png.m4 \ + pplib/autoconf/mpg123.m4 \ + pplib/autoconf/libmcrypt.m4 \ + pplib/autoconf/ax_cxx_compile_stdcxx_11.m4 \ + pplib/TODO.TXT \ + pplib/docs/threads.dox \ + pplib/docs/credits.dox \ + pplib/docs/CWikiParser_diagram.png \ + pplib/docs/groups.dox \ + pplib/docs/formate.dox \ + pplib/docs/pcrenote.dox \ + pplib/docs/CWStringSetFunctions.dox \ + pplib/docs/pregexpr.dox \ + pplib/docs/verwendung.dox \ + pplib/docs/win32-vc9-clr.png \ + pplib/docs/header-bg.png \ + pplib/docs/ppl7style.css \ + pplib/docs/CDrawable.png \ + pplib/docs/Class_Point.png \ + pplib/docs/datentypen.dox \ + pplib/docs/main.dox \ + pplib/docs/DoxygenLayout.xml \ + pplib/docs/sprintf.dox \ + pplib/docs/strftime.dox \ + pplib/docs/examples/nasm.rules \ + pplib/docs/examples/db_examples.cpp \ + pplib/docs/examples/CThread_ThreadMain.cpp \ + pplib/docs/examples/IcecastExample.cpp \ + pplib/docs/examples/ppl7.m4 \ + pplib/docs/installation.dox \ + pplib/docs/gtest.dox \ + pplib/docs/sockets.dox \ + pplib/docs/icecast_status.png \ + pplib/docs/formate/PFPVersion1.dox \ + pplib/docs/formate/PFPVersion2.dox \ + pplib/docs/formate/SocketMessage.dox \ + pplib/docs/formate/PFPVersion3.dox \ + pplib/docs/formate/PPLResVersion6.dox \ + pplib/docs/structures.dox \ + pplib/docs/header.html \ + pplib/docs/win32-vc9-rl.png \ + pplib/docs/datenbanken.dox \ + pplib/Doxyfile \ + pplib/configure.ac \ + pplib/HISTORY.TXT \ + pplib/acinclude.m4 \ + pplib/ppl7-config.in \ + pplib/resource/ppl7-icon-16x16.png \ + pplib/resource/ppl7-icon-64x64.png \ + pplib/resource/toolbar.png \ + pplib/resource/wikistyle.css \ + pplib/resource/liberationsans2.fnt6 \ + pplib/resource/resourcen.lst \ + pplib/resource/ppl7.ico \ + pplib/resource/ppl7-icon-256x256.png \ + pplib/resource/ppl7-icon-32x32.png \ + pplib/resource/ButtonSymbols.png \ + pplib/resource/ppl7-icon-128x128.png \ + pplib/resource/ppl7-icon-48x48.png \ + pplib/resource/cursor.png \ + pplib/resource/makefonts.sh \ + pplib/resource/mimetypes.png \ + pplib/resource/liberationmono2.fnt6 \ + pplib/resource/res.h \ + pplib/resource/SymbolsAlpha.png \ + pplib/resource/icons.png \ + pplib/README.TXT diff --git a/src/dns_receiver_thread.cpp b/src/dns_receiver_thread.cpp new file mode 100644 index 0000000..91ac8b2 --- /dev/null +++ b/src/dns_receiver_thread.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include "config.h" + +#include "dns_receiver_thread.h" + +DNSReceiverThread::DNSReceiverThread() +{ +} + +DNSReceiverThread::~DNSReceiverThread() +{ +} + +void DNSReceiverThread::setInterface(const ppl7::String& Device) +{ + Socket.initInterface(Device); +} + +void DNSReceiverThread::setSource(const ppl7::IPAddress& ip, int port) +{ + Socket.setSource(ip, port); +} + +void DNSReceiverThread::run() +{ + counter.clear(); + while (1) { + if (Socket.socketReady()) + Socket.receive(counter); + if (this->threadShouldStop()) + break; + } +} + +ppluint64 DNSReceiverThread::getPacketsReceived() const +{ + return counter.num_pkgs; +} + +ppluint64 DNSReceiverThread::getBytesReceived() const +{ + return counter.bytes_rcv; +} + +double DNSReceiverThread::getDuration() const +{ + return counter.rtt_total; +} + +double DNSReceiverThread::getRoundTripTimeAverage() const +{ + if (counter.num_pkgs) + return counter.rtt_total / counter.num_pkgs; //NOSONAR + return 0.0f; +} + +double DNSReceiverThread::getRoundTripTimeMin() const +{ + return counter.rtt_min; +} + +double DNSReceiverThread::getRoundTripTimeMax() const +{ + return counter.rtt_max; +} + +const RawSocketReceiver::Counter& DNSReceiverThread::getCounter() const +{ + return counter; +} diff --git a/src/dns_receiver_thread.h b/src/dns_receiver_thread.h new file mode 100644 index 0000000..b0a4abf --- /dev/null +++ b/src/dns_receiver_thread.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include "raw_socket_receiver.h" + +#include +#include + +#ifndef __dnsmeter_dns_receiver_thread_h +#define __dnsmeter_dns_receiver_thread_h + +class DNSReceiverThread : public ppl7::Thread { +private: + RawSocketReceiver Socket; + RawSocketReceiver::Counter counter; + +public: + DNSReceiverThread(); + ~DNSReceiverThread(); + void setInterface(const ppl7::String& Device); + void setSource(const ppl7::IPAddress& ip, int port); + void run(); + + ppluint64 getPacketsReceived() const; + ppluint64 getBytesReceived() const; + + double getDuration() const; + double getRoundTripTimeAverage() const; + double getRoundTripTimeMin() const; + double getRoundTripTimeMax() const; + const RawSocketReceiver::Counter& getCounter() const; +}; + +#endif diff --git a/src/dns_sender.cpp b/src/dns_sender.cpp new file mode 100644 index 0000000..ccb7cf3 --- /dev/null +++ b/src/dns_sender.cpp @@ -0,0 +1,571 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include "config.h" + +#include "dns_sender.h" +#include "exceptions.h" +#include "dns_sender_thread.h" + +#include +#include + +static const char* rcode_names[] = { + "OK", "FORMAT", "SRVFAIL", "NAME", "NOTIMPL", "REFUSED", + "YXDOMAIN", "YXRRSET", "NXRRSET", "NOTAUTH", "NOTZONE", + "11", "12", "13", "14", "15", + NULL +}; + +bool stopFlag = false; + +void sighandler(int sig) +{ + stopFlag = true; + printf("Stopping...\n"); +} + +void DNSSender::help() +{ + ppl7::String name, underline; + name.setf("dnsmeter %s", PACKAGE_VERSION); + underline.repeat("=", name.size()); + name.printnl(); + underline.printnl(); + printf("\nUsage:\n" + " -h shows this help\n" + " -q HOST hostname or IP address of sender if you don't want to spoof\n" + " (see -s)\n" + " -s NET|pcap spoof sender address. Use random IP from the given network\n" + " (example: 192.168.0.0/16). Only works when running as root!\n" + " If payload is a pcap file, you can use \"-s pcap\" to use the\n" + " source addresses and ports from the pcap file.\n" + " -e ETH interface on which the packet receiver should listen\n" + " (FreeBSD only)\n" + " -z HOST:PORT hostname or IP address and port of the target nameserver\n" + " -p FILE file with queries/payload or pcap file\n" + " -l # runtime in seconds (default=10 seconds)\n" + " -t # timeout in seconds (default=2 seconds)\n" + " -n # number of worker threads (default=1)\n" + " -r # queryrate (Default=as much as possible)\n" + " can be a single value, a comma separated list (rate,rate,...)\n" + " or a range and a step value (start - end, step)\n" + " -d # amount of queries in percent on which the DNSSEC-flags are set\n" + " (default=0)\n" + " -c FILE CSV-file for results\n" + " --ignore answers are ignored and therefor not counted. In this mode\n" + " the tool only generates traffic." + "\n"); +} + +DNSSender::Results::Results() +{ + queryrate = 0; + counter_send = 0; + counter_received = 0; + bytes_send = 0; + bytes_received = 0; + counter_errors = 0; + packages_lost = 0; + counter_0bytes = 0; + for (int i = 0; i < 255; i++) + counter_errorcodes[i] = 0; + rtt_avg = 0.0f; + rtt_total = 0.0f; + rtt_min = 0.0f; + rtt_max = 0.0f; + for (int i = 0; i < 16; i++) + rcodes[i] = 0; + truncated = 0; +} + +void DNSSender::Results::clear() +{ + queryrate = 0; + counter_send = 0; + counter_received = 0; + bytes_send = 0; + bytes_received = 0; + counter_errors = 0; + packages_lost = 0; + counter_0bytes = 0; + for (int i = 0; i < 255; i++) + counter_errorcodes[i] = 0; + rtt_avg = 0.0f; + rtt_total = 0.0f; + rtt_min = 0.0f; + rtt_max = 0.0f; + for (int i = 0; i < 16; i++) + rcodes[i] = 0; + truncated = 0; +} + +DNSSender::Results operator-(const DNSSender::Results& second, const DNSSender::Results& first) +{ + DNSSender::Results r; + r.queryrate = second.queryrate - first.queryrate; + r.counter_send = second.counter_send - first.counter_send; + r.counter_received = second.counter_received - first.counter_received; + r.bytes_send = second.bytes_send - first.bytes_send; + r.bytes_received = second.bytes_received - first.bytes_received; + r.counter_errors = second.counter_errors - first.counter_errors; + r.packages_lost = second.packages_lost - first.packages_lost; + r.counter_0bytes = second.counter_0bytes - first.counter_0bytes; + for (int i = 0; i < 255; i++) + r.counter_errorcodes[i] = second.counter_errorcodes[i] - first.counter_errorcodes[i]; + r.rtt_total = second.rtt_total - first.rtt_total; + if (r.counter_received) + r.rtt_avg = r.rtt_total / r.counter_received; //NOSONAR + else + r.rtt_avg = 0.0; + r.rtt_min = second.rtt_min - first.rtt_min; + r.rtt_max = second.rtt_max - first.rtt_max; + + for (int i = 0; i < 16; i++) + r.rcodes[i] = second.rcodes[i] - first.rcodes[i]; + r.truncated = second.truncated - first.truncated; + return r; +} + +DNSSender::DNSSender() +{ + ppl7::InitSockets(); + Runtime = 10; + Timeout = 2; + ThreadCount = 1; + Timeslices = 1.0f; + ignoreResponses = false; + DnssecRate = 0; + TargetPort = 53; + spoofingEnabled = false; + Receiver = NULL; + spoofFromPcap = false; +} + +DNSSender::~DNSSender() +{ + if (Receiver) + delete Receiver; +} + +ppl7::Array DNSSender::getQueryRates(const ppl7::String& QueryRates) +{ + ppl7::Array rates; + if (QueryRates.isEmpty()) { + rates.add("0"); + } else { + ppl7::Array matches; + if (QueryRates.pregMatch("/^([0-9]+)-([0-9]+),([0-9]+)$", matches)) { + for (ppluint64 i = matches[1].toUnsignedInt64(); i <= matches[2].toUnsignedInt64(); i += matches[3].toUnsignedInt64()) { + rates.addf("%llu", i); + } + } else { + rates.explode(QueryRates, ","); + } + } + return rates; +} + +void DNSSender::getTarget(int argc, char** argv) +{ + if (!ppl7::HaveArgv(argc, argv, "-z")) { + throw MissingCommandlineParameter("target IP/hostname or port missing (-z IP:PORT)"); + } + ppl7::String Tmp = ppl7::GetArgv(argc, argv, "-z"); + ppl7::Array Tok(Tmp, ":"); + if (Tok.size() != 2) { + if (Tok.size() != 1) + throw InvalidCommandlineParameter("-z IP:PORT"); + TargetPort = 53; + } else { + TargetPort = Tok[1].toInt(); + } + if (TargetPort < 1 || TargetPort > 65535) + throw InvalidCommandlineParameter("-z IP:PORT, Invalid Port"); + std::list Result; + size_t num = ppl7::GetHostByName(Tok[0], Result, ppl7::af_inet); + if (!num) + throw InvalidCommandlineParameter("-z IP:PORT, Invalid IP or could not resolve Hostname"); + TargetIP = Result.front(); + //printf ("num=%d, %s\n",num, (const char*)TargetIP.toString()); +} + +void DNSSender::getSource(int argc, char** argv) +{ + if (ppl7::HaveArgv(argc, argv, "-s")) { + ppl7::String Tmp = ppl7::GetArgv(argc, argv, "-s").toLowerCase(); + if (Tmp == "pcap") { + spoofFromPcap = true; + } else { + SourceNet.set(Tmp); + if (SourceNet.family() != ppl7::IPAddress::IPv4) + throw UnsupportedIPFamily("only IPv4 works"); + } + spoofingEnabled = true; + } else { + ppl7::String Tmp = ppl7::GetArgv(argc, argv, "-q"); + std::list Result; + size_t num = ppl7::GetHostByName(Tmp, Result, ppl7::af_inet); + if (!num) + throw InvalidCommandlineParameter("-q HOST, Invalid IP or could not resolve Hostname"); + SourceIP = Result.front(); + if (SourceIP.family() != ppl7::IPAddress::IPv4) + throw UnsupportedIPFamily("only IPv4 works"); + spoofingEnabled = false; + } +} + +int DNSSender::getParameter(int argc, char** argv) +{ + if (ppl7::HaveArgv(argc, argv, "-q") && ppl7::HaveArgv(argc, argv, "-s")) { + printf("ERROR: could not use parameters -q and -s together\n\n"); + help(); + return 1; + } + if ((!ppl7::HaveArgv(argc, argv, "-q")) && (!ppl7::HaveArgv(argc, argv, "-s"))) { + printf("ERROR: source IP/hostname or network for source address spoofing missing (-q IP | -s NETWORK)\n\n"); + help(); + return 1; + } + ignoreResponses = ppl7::HaveArgv(argc, argv, "--ignore"); + + if (ppl7::HaveArgv(argc, argv, "-e")) { + InterfaceName = ppl7::GetArgv(argc, argv, "-e"); + } + + try { + getTarget(argc, argv); + getSource(argc, argv); + } catch (const ppl7::Exception& e) { + printf("ERROR: missing or invalid parameter\n"); + e.print(); + printf("\n"); + help(); + return 1; + } + + Runtime = ppl7::GetArgv(argc, argv, "-l").toInt(); + Timeout = ppl7::GetArgv(argc, argv, "-t").toInt(); + ThreadCount = ppl7::GetArgv(argc, argv, "-n").toInt(); + ppl7::String QueryRates = ppl7::GetArgv(argc, argv, "-r"); + CSVFileName = ppl7::GetArgv(argc, argv, "-c"); + QueryFilename = ppl7::GetArgv(argc, argv, "-p"); + if (ppl7::HaveArgv(argc, argv, "-d")) { + DnssecRate = ppl7::GetArgv(argc, argv, "-d").toInt(); + if (DnssecRate < 0 || DnssecRate > 100) { + printf("ERROR: DNSSEC-Rate must be an integer between 0 and 100 (-d #)\n\n"); + help(); + return 1; + } + } + if (!ThreadCount) + ThreadCount = 1; + if (!Runtime) + Runtime = 10; + if (!Timeout) + Timeout = 2; + if (QueryFilename.isEmpty()) { + printf("ERROR: Payload-File is missing (-p FILENAME)\n\n"); + help(); + return 1; + } + rates = getQueryRates(QueryRates); + return 0; +} + +int DNSSender::openFiles() +{ + if (CSVFileName.notEmpty()) { + try { + openCSVFile(CSVFileName); + } catch (const ppl7::Exception& e) { + printf("ERROR: could not open CSV-file for writing\n"); + e.print(); + return 1; + } + } + try { + payload.openQueryFile(QueryFilename); + } catch (const ppl7::Exception& e) { + printf("ERROR: could not open payload file or it does not contain any queries\n"); + e.print(); + return 1; + } + return 0; +} + +int DNSSender::main(int argc, char** argv) +{ + if (ppl7::HaveArgv(argc, argv, "-h") || ppl7::HaveArgv(argc, argv, "--help") || argc < 2) { + help(); + return 0; + } + if (getParameter(argc, argv) != 0) + return 1; + if (openFiles() != 0) + return 1; + + signal(SIGINT, sighandler); + signal(SIGKILL, sighandler); + + DNSSender::Results results; + try { + if (!ignoreResponses) { + Receiver = new DNSReceiverThread(); + Receiver->setSource(TargetIP, TargetPort); + try { + Receiver->setInterface(InterfaceName); + } catch (const ppl7::Exception& e) { + printf("ERROR: could not bind on device [%s]\n", (const char*)InterfaceName); + e.print(); + printf("\n"); + help(); + return 1; + } + } + prepareThreads(); + for (size_t i = 0; i < rates.size(); i++) { + results.queryrate = rates[i].toInt(); + run(rates[i].toInt()); + getResults(results); + presentResults(results); + saveResultsToCsv(results); + } + threadpool.destroyAllThreads(); + } catch (const ppl7::OperationInterruptedException&) { + getResults(results); + presentResults(results); + saveResultsToCsv(results); + } catch (const ppl7::Exception& e) { + e.print(); + return 1; + } + return 0; +} + +void DNSSender::prepareThreads() +{ + for (int i = 0; i < ThreadCount; i++) { + DNSSenderThread* thread = new DNSSenderThread(); + thread->setDestination(TargetIP, TargetPort); + thread->setRuntime(Runtime); + thread->setTimeout(Timeout); + thread->setTimeslice(Timeslices); + thread->setDNSSECRate(DnssecRate); + thread->setVerbose(false); + thread->setPayload(payload); + if (spoofingEnabled) { + if (spoofFromPcap) + thread->setSourcePcap(); + else + thread->setSourceNet(SourceNet); + } else { + thread->setSourceIP(SourceIP); + } + threadpool.addThread(thread); + } +} + +void DNSSender::openCSVFile(const ppl7::String& Filename) +{ + CSVFile.open(Filename, ppl7::File::APPEND); + if (CSVFile.size() == 0) { + CSVFile.putsf("#QPS Send; QPS Received; QPS Errors; Lostrate; " + "rtt_avg; rtt_min; rtt_max;" + "\n"); + CSVFile.flush(); + } +} + +void DNSSender::showCurrentStats(ppl7::ppl_time_t start_time) +{ + DNSSender::Results result, diff; + ppl7::ppl_time_t runtime = ppl7::GetTime() - start_time; + getResults(result); + diff = result - vis_prev_results; + vis_prev_results = result; + + int h = (int)(runtime / 3600); + runtime -= h * 3600; + int m = (int)(runtime / 60); + int s = runtime - (m * 60); + + printf("%02d:%02d:%02d Queries send: %7llu, rcv: %7llu, ", h, m, s, + diff.counter_send, diff.counter_received); + printf("Data send: %6llu KB, rcv: %6llu KB", diff.bytes_send / 1024, diff.bytes_received / 1024); + printf("\n"); +} + +void DNSSender::calcTimeslice(int queryrate) +{ + Timeslices = (1000.0f / queryrate) * ThreadCount; //NOSONAR + //if (Zeitscheibe<1.0f) Zeitscheibe=1.0f; + if (Timeslices < 0.1f) + Timeslices = 0.1f; +} + +void DNSSender::run(int queryrate) +{ + printf("###############################################################################\n"); + if (queryrate) { + calcTimeslice(queryrate); + printf("# Start Session with Threads: %d, Queryrate: %d, Timeslot: %0.6f ms\n", + ThreadCount, queryrate, Timeslices); + } else { + printf("# Start Session with Threads: %d, Queryrate: unlimited\n", + ThreadCount); + } + + ppl7::ThreadPool::iterator it; + for (it = threadpool.begin(); it != threadpool.end(); ++it) { + ((DNSSenderThread*)(*it))->setQueryRate(queryrate / ThreadCount); + ((DNSSenderThread*)(*it))->setTimeslice(Timeslices); + } + vis_prev_results.clear(); + sampleSensorData(sys1); + if (Receiver) + Receiver->threadStart(); + threadpool.startThreads(); + ppl7::ppl_time_t start = ppl7::GetTime(); + ppl7::ppl_time_t report = start + 1; + ppl7::MSleep(500); + while (threadpool.running() == true && stopFlag == false) { + ppl7::MSleep(100); + ppl7::ppl_time_t now = ppl7::GetTime(); + if (now >= report) { + report = now + 1; + showCurrentStats(start); + } + } + if (Receiver) + Receiver->threadStop(); + sampleSensorData(sys2); + if (stopFlag == true) { + threadpool.stopThreads(); + throw ppl7::OperationInterruptedException("test aborted"); + } +} + +void DNSSender::getResults(DNSSender::Results& result) +{ + ppl7::ThreadPool::iterator it; + result.clear(); + + for (it = threadpool.begin(); it != threadpool.end(); ++it) { + result.counter_send += ((DNSSenderThread*)(*it))->getPacketsSend(); + result.bytes_send += ((DNSSenderThread*)(*it))->getBytesSend(); + result.counter_errors += ((DNSSenderThread*)(*it))->getErrors(); + result.counter_0bytes += ((DNSSenderThread*)(*it))->getCounter0Bytes(); + for (int i = 0; i < 255; i++) + result.counter_errorcodes[i] += ((DNSSenderThread*)(*it))->getCounterErrorCode(i); + } + if (Receiver) { + const RawSocketReceiver::Counter& counter = Receiver->getCounter(); + result.counter_received = counter.num_pkgs; + result.bytes_received = counter.bytes_rcv; + result.rtt_total = counter.rtt_total; + if (counter.num_pkgs) + result.rtt_avg = counter.rtt_total / counter.num_pkgs; //NOSONAR + else + result.rtt_avg = 0.0; + result.rtt_min = counter.rtt_min; + result.rtt_max = counter.rtt_max; + for (int i = 0; i < 16; i++) + result.rcodes[i] = counter.rcodes[i]; + result.truncated = counter.truncated; + } + + result.packages_lost = result.counter_send - result.counter_received; + if (result.counter_received > result.counter_send) + result.packages_lost = 0; +} + +void DNSSender::saveResultsToCsv(const DNSSender::Results& result) +{ + + if (CSVFile.isOpen()) { + CSVFile.putsf("%llu;%llu;%llu;%0.3f;%0.4f;%0.4f;%0.4f;\n", + (ppluint64)((double)result.counter_send / (double)Runtime), + (ppluint64)((double)result.counter_received / (double)Runtime), + (ppluint64)((double)result.counter_errors / (double)Runtime), + (double)result.packages_lost * 100.0 / (double)result.counter_send, + result.rtt_avg * 1000.0, + result.rtt_min * 1000.0, + result.rtt_max * 1000.0); + CSVFile.flush(); + } +} + +void DNSSender::presentResults(const DNSSender::Results& result) +{ + printf("===============================================================================\n"); + const SystemStat::Interface& net1 = sys1.interfaces[InterfaceName]; + const SystemStat::Interface& net2 = sys2.interfaces[InterfaceName]; + SystemStat::Network transmit = SystemStat::Network::getDelta(net1.transmit, net2.transmit); + SystemStat::Network received = SystemStat::Network::getDelta(net1.receive, net2.receive); + printf("network if %s Pkt send: %lu, rcv: %lu, Data send: %lu KB, rcv: %lu KB\n", + (const char*)InterfaceName, + transmit.packets, received.packets, transmit.bytes / 1024, received.bytes / 1024); + + ppluint64 qps_send = (ppluint64)((double)result.counter_send / (double)Runtime); + ppluint64 bps_send = (ppluint64)((double)result.bytes_send / (double)Runtime); + ppluint64 qps_received = (ppluint64)((double)result.counter_received / (double)Runtime); + ppluint64 bps_received = (ppluint64)((double)result.bytes_received / (double)Runtime); + + printf("DNS Queries send: %10llu, Qps: %7llu, Data send: %7llu KB = %6llu MBit\n", + result.counter_send, qps_send, result.bytes_send / 1024, bps_send / (1024 * 1024)); + + printf("DNS Queries rcv: %10llu, Qps: %7llu, Data rcv: %7llu KB = %6llu MBit\n", + result.counter_received, qps_received, result.bytes_received / 1024, bps_received / (1024 * 1024)); + + printf("DNS Queries lost: %10llu = %0.3f %%\n", result.packages_lost, + (double)result.packages_lost * 100.0 / (double)result.counter_send); + + printf("DNS rtt average: %0.4f ms, " + "min: %0.4f ms, " + "max: %0.4f ms\n", + result.rtt_avg * 1000.0, + result.rtt_min * 1000.0, + result.rtt_max * 1000.0); + printf("DNS truncated: %llu\nDNS RCODES: ", result.truncated); + for (int i = 0; i < 15; i++) { + if (result.rcodes[i]) { + printf("%s: %llu, ", rcode_names[i], result.rcodes[i]); + } + } + printf("\n"); + + if (result.counter_errors) { + printf("Errors: %10llu, Qps: %10llu\n", result.counter_errors, + (ppluint64)((double)result.counter_errors / (double)Runtime)); + } + if (result.counter_0bytes) { + printf("Errors 0Byte: %10llu, Qps: %10llu\n", result.counter_0bytes, + (ppluint64)((double)result.counter_0bytes / (double)Runtime)); + } + for (int i = 0; i < 255; i++) { + if (result.counter_errorcodes[i] > 0) { + printf("Errors %3d: %10llu, Qps: %10llu [%s]\n", i, result.counter_errorcodes[i], + (ppluint64)((double)result.counter_errorcodes[i] / (double)Runtime), + strerror(i)); + } + } +} diff --git a/src/dns_sender.h b/src/dns_sender.h new file mode 100644 index 0000000..d01408e --- /dev/null +++ b/src/dns_sender.h @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include "dns_receiver_thread.h" +#include "payload_file.h" +#include "system_stat.h" + +#include + +#ifndef __dnsmeter_dns_sender_h +#define __dnsmeter_dns_sender_h + +class DNSSender { +private: +#if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L + DNSSender& operator=(const DNSSender& other); + DNSSender(DNSSender &&other) noexcept; + DNSSender const & operator=(DNSSender &&other); +#endif + +public: + class Results { + public: + int queryrate; + ppluint64 counter_send; + ppluint64 counter_received; + ppluint64 bytes_send; + ppluint64 bytes_received; + ppluint64 counter_errors; + ppluint64 packages_lost; + ppluint64 counter_0bytes; + ppluint64 counter_errorcodes[255]; + ppluint64 rcodes[16]; + ppluint64 truncated; + double rtt_total; + double rtt_avg; + double rtt_min; + double rtt_max; + Results(); + void clear(); + }; + +private: + ppl7::ThreadPool threadpool; + ppl7::IPAddress TargetIP; + ppl7::IPAddress SourceIP; + ppl7::IPNetwork SourceNet; + ppl7::String CSVFileName; + ppl7::String QueryFilename; + ppl7::File CSVFile; + ppl7::Array rates; + ppl7::String InterfaceName; + PayloadFile payload; + DNSReceiverThread* Receiver; + DNSSender::Results vis_prev_results; + SystemStat sys1, sys2; + + int TargetPort; + int Runtime; + int Timeout; + int ThreadCount; + int DnssecRate; + float Timeslices; + bool ignoreResponses; + bool spoofingEnabled; + bool spoofFromPcap; + + void openCSVFile(const ppl7::String& Filename); + void run(int queryrate); + void presentResults(const DNSSender::Results& result); + void saveResultsToCsv(const DNSSender::Results& result); + void prepareThreads(); + void getResults(DNSSender::Results& result); + ppl7::Array getQueryRates(const ppl7::String& QueryRates); + void readSourceIPList(const ppl7::String& filename); + + void getTarget(int argc, char** argv); + void getSource(int argc, char** argv); + int getParameter(int argc, char** argv); + int openFiles(); + void calcTimeslice(int queryrate); + + void showCurrentStats(ppl7::ppl_time_t start_time); + +public: + DNSSender(); + ~DNSSender(); + void help(); + int main(int argc, char** argv); +}; + +DNSSender::Results operator-(const DNSSender::Results& first, const DNSSender::Results& second); + +#endif diff --git a/src/dns_sender_thread.cpp b/src/dns_sender_thread.cpp new file mode 100644 index 0000000..b5c560a --- /dev/null +++ b/src/dns_sender_thread.cpp @@ -0,0 +1,332 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include "config.h" + +#include "dns_sender_thread.h" +#include "query.h" +#include "exceptions.h" + +#include +#include +#include +#include +#include +#include +#include + +DNSSenderThread::DNSSenderThread() +{ + buffer = (unsigned char*)malloc(4096); + if (!buffer) + throw ppl7::OutOfMemoryException(); + Timeslice = 0.0f; + runtime = 10; + timeout = 5; + queryrate = 0; + counter_packets_send = 0; + counter_bytes_send = 0; + errors = 0; + counter_0bytes = 0; + duration = 0.0; + for (int i = 0; i < 255; i++) + counter_errorcodes[i] = 0; + verbose = false; + spoofingEnabled = false; + DnssecRate = 0; + dnsseccounter = 0; + payload = NULL; + spoofing_net_start = 0; + spoofing_net_size = 0; + payloadIsPcap = false; + spoofingFromPcap = false; +} + +DNSSenderThread::~DNSSenderThread() +{ + free(buffer); +} + +void DNSSenderThread::setDestination(const ppl7::IPAddress& ip, int port) +{ + Socket.setDestination(ip, port); + pkt.setDestination(ip, port); +} + +void DNSSenderThread::setPayload(PayloadFile& payload) +{ + this->payload = &payload; + this->payloadIsPcap = payload.isPcap(); +} + +void DNSSenderThread::setRuntime(int seconds) +{ + runtime = seconds; +} + +void DNSSenderThread::setTimeout(int seconds) +{ + timeout = seconds; +} + +void DNSSenderThread::setDNSSECRate(int rate) +{ + DnssecRate = rate; +} + +void DNSSenderThread::setQueryRate(ppluint64 qps) +{ + queryrate = qps; +} + +void DNSSenderThread::setTimeslice(float ms) +{ + if (ms == 0.0f || ms > 1000.0f) + throw ppl7::InvalidArgumentsException(); + //if ((1000 % ms)!=0) throw ppl7::InvalidArgumentsException(); + Timeslice = (double)ms / 1000; +} + +void DNSSenderThread::setSourceIP(const ppl7::IPAddress& ip) +{ + sourceip = ip; + spoofingEnabled = false; +} + +void DNSSenderThread::setSourceNet(const ppl7::IPNetwork& net) +{ + sourcenet = net; + spoofingEnabled = true; + spoofing_net_start = ntohl(*(in_addr_t*)net.first().addr()); + spoofing_net_size = powl(2, 32 - net.prefixlen()); +} + +void DNSSenderThread::setSourcePcap() +{ + spoofingEnabled = true; + spoofingFromPcap = true; +} + +void DNSSenderThread::setVerbose(bool verbose) +{ + this->verbose = verbose; +} + +#define PCAP_HEADER_SIZE 14 + sizeof(struct ip) + sizeof(struct udphdr) + +void DNSSenderThread::sendPacket() +{ + size_t query_size; + while (1) { + try { + const ppl7::ByteArrayPtr& bap = payload->getQuery(); + query_size = bap.size(); + if (payloadIsPcap) { + query_size -= PCAP_HEADER_SIZE; + memcpy(buffer, ((const char*)bap.ptr()) + PCAP_HEADER_SIZE, query_size); + } else { + memcpy(buffer, bap.ptr(), query_size); + dnsseccounter += DnssecRate; + if (dnsseccounter >= 100) { + query_size = AddDnssecToQuery(buffer, 4096, query_size); + dnsseccounter -= 100; + } + } + pkt.setPayload(buffer, query_size); + if (spoofingEnabled) { + if (spoofingFromPcap) { + pkt.useSourceFromPcap((const char*)bap.ptr(), bap.size()); + } else { + pkt.randomSourceIP(spoofing_net_start, spoofing_net_size); + pkt.randomSourcePort(); + } + } else { + pkt.randomSourcePort(); + } + pkt.setDnsId(getQueryTimestamp()); + ssize_t n = Socket.send(pkt); + if (n > 0 && (size_t)n == pkt.size()) { + counter_packets_send++; + counter_bytes_send += pkt.size(); + } else if (n < 0) { + if (errno < 255) + counter_errorcodes[errno]++; + errors++; + } else { + counter_0bytes++; + } + return; + } catch (const UnknownRRType& exp) { + continue; + } catch (const InvalidDNSQuery& exp) { + continue; + } + } +} + +void DNSSenderThread::run() +{ + if (!payload) + throw ppl7::NullPointerException("payload not set!"); + if (!spoofingEnabled) { + pkt.setSource(sourceip, 0x4567); + } + dnsseccounter = 0; + counter_packets_send = 0; + counter_bytes_send = 0; + counter_0bytes = 0; + errors = 0; + duration = 0.0; + for (int i = 0; i < 255; i++) + counter_errorcodes[i] = 0; + double start = ppl7::GetMicrotime(); + if (queryrate > 0) { + runWithRateLimit(); + } else { + runWithoutRateLimit(); + } + duration = ppl7::GetMicrotime() - start; + waitForTimeout(); +} + +void DNSSenderThread::runWithoutRateLimit() +{ + double start = ppl7::GetMicrotime(); + double end = start + (double)runtime; + double now; + int pc = 0; + while (1) { + sendPacket(); + pc++; + if (pc > 10000) { + pc = 0; + if (this->threadShouldStop()) + break; + now = ppl7::GetMicrotime(); + if (now > end) + break; + } + } +} + +static inline double getNsec() +{ + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + return (double)ts.tv_sec + ((double)ts.tv_nsec / 1000000000.0); +} + +void DNSSenderThread::runWithRateLimit() +{ + struct timespec ts; + ppluint64 total_timeslices = runtime * 1000 / (Timeslice * 1000.0); + ppluint64 queries_rest = runtime * queryrate; + ppl7::SockAddr addr = Socket.getSockAddr(); + verbose = true; + if (verbose) { + //printf ("qps=%d, runtime=%d\n",queryrate, runtime); + printf("runtime: %d s, timeslice: %0.6f s, total timeslices: %llu, Qpts: %llu, Source: %s:%d\n", + runtime, Timeslice, total_timeslices, + queries_rest / total_timeslices, + (const char*)addr.toIPAddress().toString(), addr.port()); + } + double now = getNsec(); + double next_timeslice = now; + double next_checktime = now + 0.1; + + double start = ppl7::GetMicrotime(); + double end = start + (double)runtime; + double total_idle = 0.0; + + for (ppluint64 z = 0; z < total_timeslices; z++) { + next_timeslice += Timeslice; + ppluint64 timeslices_rest = total_timeslices - z; + ppluint64 queries_per_timeslice = queries_rest / timeslices_rest; + if (timeslices_rest == 1) + queries_per_timeslice = queries_rest; + for (ppluint64 i = 0; i < queries_per_timeslice; i++) { + sendPacket(); + } + + queries_rest -= queries_per_timeslice; + while ((now = getNsec()) < next_timeslice) { + if (now < next_timeslice) { + total_idle += next_timeslice - now; + ts.tv_sec = 0; + ts.tv_nsec = (next_timeslice - now) * 1000000000; + nanosleep(&ts, NULL); + } + } + if (now > next_checktime) { + next_checktime = now + 0.1; + if (this->threadShouldStop()) + break; + if (ppl7::GetMicrotime() >= end) + break; + //printf ("Zeitscheiben rest: %llu\n", z); + } + } + if (verbose) { + //printf ("total idle: %0.6f\n",total_idle); + } +} + +void DNSSenderThread::waitForTimeout() +{ + double start = ppl7::GetMicrotime(); + double end = start + (double)timeout; + double now, next_checktime = start + 0.1; + while ((now = ppl7::GetMicrotime()) < end) { + if (now > next_checktime) { + next_checktime = now + 0.1; + if (this->threadShouldStop()) + break; + } + ppl7::MSleep(10); + } +} + +ppluint64 DNSSenderThread::getPacketsSend() const +{ + return counter_packets_send; +} + +ppluint64 DNSSenderThread::getBytesSend() const +{ + return counter_bytes_send; +} + +ppluint64 DNSSenderThread::getErrors() const +{ + return errors; +} + +ppluint64 DNSSenderThread::getCounter0Bytes() const +{ + return counter_0bytes; +} + +ppluint64 DNSSenderThread::getCounterErrorCode(int err) const +{ + if (err < 255) + return counter_errorcodes[err]; + return 0; +} diff --git a/src/dns_sender_thread.h b/src/dns_sender_thread.h new file mode 100644 index 0000000..e2b251a --- /dev/null +++ b/src/dns_sender_thread.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include "raw_socket_sender.h" +#include "payload_file.h" + +#include + +#ifndef __dnsmeter_dns_sender_thread_h +#define __dnsmeter_dns_sender_thread_h + +class DNSSenderThread : public ppl7::Thread { +private: +#if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L + DNSSenderThread& operator=(const DNSSenderThread& other); + DNSSenderThread(DNSSenderThread &&other) noexcept; + DNSSenderThread const & operator=(DNSSenderThread &&other); +#endif + + RawSocketSender Socket; + Packet pkt; + + ppl7::IPAddress destination; + ppl7::IPAddress sourceip; + ppl7::IPNetwork sourcenet; + + PayloadFile* payload; + unsigned char* buffer; + ppluint64 queryrate; + ppluint64 counter_packets_send, errors, counter_0bytes; + ppluint64 counter_bytes_send; + ppluint64 counter_errorcodes[255]; + + unsigned int spoofing_net_start; + unsigned int spoofing_net_size; + + int runtime; + int timeout; + int DnssecRate; + int dnsseccounter; + double Timeslice; + + double duration; + bool spoofingEnabled; + bool verbose; + bool payloadIsPcap; + bool spoofingFromPcap; + + void sendPacket(); + void waitForTimeout(); + bool socketReady(); + + void runWithoutRateLimit(); + void runWithRateLimit(); + +public: + DNSSenderThread(); + ~DNSSenderThread(); + void setDestination(const ppl7::IPAddress& ip, int port); + void setSourceIP(const ppl7::IPAddress& ip); + void setSourceNet(const ppl7::IPNetwork& net); + void setSourcePcap(); + void setRandomSource(const ppl7::IPNetwork& net); + void setRuntime(int seconds); + void setTimeout(int seconds); + void setDNSSECRate(int rate); + void setQueryRate(ppluint64 qps); + void setTimeslice(float ms); + void setVerbose(bool verbose); + void setPayload(PayloadFile& payload); + void run(); + ppluint64 getPacketsSend() const; + ppluint64 getBytesSend() const; + ppluint64 getErrors() const; + ppluint64 getCounter0Bytes() const; + ppluint64 getCounterErrorCode(int err) const; +}; + +#endif diff --git a/src/dnsmeter.1.in b/src/dnsmeter.1.in new file mode 100644 index 0000000..96a4a4c --- /dev/null +++ b/src/dnsmeter.1.in @@ -0,0 +1,276 @@ +.\" Copyright (c) 2019-2021, OARC, Inc. +.\" Copyright (c) 2019, DENIC eG +.\" All rights reserved. +.\" +.\" This file is part of dnsmeter. +.\" +.\" dnsmeter 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. +.\" +.\" dnsmeter 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 dnsmeter. If not, see . +.TH dnsmeter 1 "@PACKAGE_VERSION@" "dnsmeter" +.SH NAME +dnsmeter \- DNS performance and infrastructure testing +.SH SYNOPSIS +.hy 0 +.ad l +\fBdnsmeter\fR\ [\fB\-h\fR] +[\fB\-q\ \fIHOST\fR] +[\fB\-s\ \fINET|pcap\fR] +[\fB\-e\ \fIETH\fR] +[\fB\-z\ \fIHOST:PORT\fR] +[\fB\-p\ \fIFILE\fR] +[\fB\-l\ \fI#\fR] +[\fB\-t\ \fI#\fR] +[\fB\-n\ \fI#\fR] +[\fB\-r\ \fI#\fR] +[\fB\-d\ \fI#\fR] +[\fB\-c\ \fIFILE\fR] +[\fB\--ignore\fR] +.ad +.hy +.SH DESCRIPTION +DNSMeter is a tool for testing performance of nameserver and/or +infrastructure around it. +It generates dns queries and sends them via UDP to a target nameserver +and counts the answers. + +Features: +.br +- payload can be given as text file or PCAP file +.br +- can automatically run different load steps, which can be given as +list or ranges +.br +- results per load step can be stored in CSV file +.br +- sender address can be spoofed from a given network or from PCAP file, +if payload is a PCAP file +.br +- answers are counted, even if source address is spoofed, if answers get +routed back to the load generator +.br +- roundtrip-times are measured (average, min, mix) +.br +- amount of DNSSEC queries can be given as percentage of total traffic +.br +- optimized for high amount of packets. On an Intel(R) Xeon(R) CPU E5-2430 +v2 @ 2.50GHz it can generate more than 900.000 packets per second +.SH OPTIONS +.TP +.B -h +Show option help. +.TP +.BI -q \ HOST +Hostname or IP address of sender if you don't want to spoof (see +.IR -s ). +.TP +.BI -s \ NET|pcap +Spoof sender address. +Use random IP from the given network (example: +.IR 192.168.0.0/16 ). +Only works when running as root! +If payload is a PCAP file, you can use +.BI -s pcap +to use the source addresses and ports from the PCAP file. +.TP +.BI -e \ ETH +Interface on which the packet receiver should listen (FreeBSD only). +.TP +.BI -z \ HOST:PORT +Hostname or IP address and port of the target nameserver. +.TP +.BI -p \ FILE +File with queries/payload or PCAP file. +.TP +.BI -l \ # +Runtime in seconds (default=10 seconds). +.TP +.BI -t \ # +Timeout in seconds (default=2 seconds). +.TP +.BI -n \ # +Number of worker threads (default=1). +.TP +.BI -r \ # +Query rate (Default=as much as possible) can be a single value, a comma +separated list (rate,rate,...) or a range and a step value (start - end, +step). +.TP +.BI -d \ # +Amount of queries in percent on which the DNSSEC-flags are set (default=0). +.TP +.BI -c \ FILE +CSV-file for results. +.TP +.B --ignore +Answers are ignored and therefor not counted. +In this mode the tool only generates traffic. +.SH USAGE +This section contains additional usage information not covered by +the options documentation. + +.BI -q \ HOST +| +.BI -s \ NETWORK +| +.BI -s \ pcap + +Source IP, hostname or network from which the packets should be send. +If you dont't want to spoof, use +.I -q +with a single IP address or hostname. +Use +.I -s +followed by a network, if you want to spoof the source address. +.B dnsmeter +will generated random IP addresses inside this network. +Example: +.B -s +.IR 10.0.0.0/8 . + +If payload is a PCAP file, you can use the source addresses and ports +from the PCAP file, if you use +.B -s +.IR pcap . + +.BI -e \ ETH + +Ignored on Linux, but on FreeBSD you have to enter the name of the +network interface on which the tool should listen for the answers. + +.BI -p \ FILE + +File with payload in text format or PCAP file. +When using a text format each line must contain one query with name +and record type. + +Example: + + www.denic.de A + denic.de NS + ... + +.IR NOTE : +the file should not be too big, because it is completely +loaded into memory and pre-compiled to DNS query packets. + +.BI -n \ # + +Number of worker threads, recommendation: +.br +- less than 200000 packets per second: 1 Thread +.br +- 200000 - 500000 packets per second: 2 Threads +.br +- more than 500000 packets per second: 4 Threads + +.BI NOTE : +this is CPU dependent! +If you have a fast CPU, you may need lesser threads, on a slow CPU you +may need more threads. +Don't use more threads than cores available on your CPU, minus one! + +.BI -r \ #[,#,#] + +Query rate or load steps. +Can be a single value if you want to test a specific query rate, a comma +separated list or a range with step with. + +Examples: +.br +- Single value: -r 100000 +.br +- a list of query rates: -r 10000,20000,30000,40000,50000,60000 +.br +- a range with step: -r 10000-200000,10000 + +.BI -d \ # + +Amount of DNSSEC queries in percentage between 0 and 100. +Is ignored, if using PCAP file as payload. + +.BI -c \ FILENAME + +Filename for results in CSV format. + +.BI NOTE : +if file exists, results are appended! + +.SH EXAMPLE + +Lets assume the following scenario: +.br +- load generator runs on FreeBSD +.br +- network interface an which the traffic goes out and comes back is "igb0" +.br +- source ip on the load generator is 192.168.155.20 +.br +- target nameserver has ip 192.168.0.1, port 53 +.br +- we want to spoof the sender address from the network 10.0.0.0/8 +.br +- the payload file is found here: /home/testdata/payload.txt +.br +- the nameserver is running on CentOS and we need to set a route back to the load generator: +.br + ip route add 10.0.0.0/8 via 192.168.155.20 +.br +- we want to test the following load steps: 30000,40000,45000,50000,100000,150000 +.br +- results should be written to results.csv +.br +- DNSSEC rate should be 70% + +This makes the following command: + + dnsmeter -p /home/testdata/payload.txt \\ + -r 30000,40000,45000,50000,100000,150000 \\ + -s 10.0.0.0/8 \\ + -z 192.168.0.1:53 \\ + -e igb0 \\ + -d 70 \\ + -c results.csv + +In the second example, we want to use a PCAP file as payload and want +to spoof with the addresses from that file: + + dnsmeter -p /home/testdata/pcap.file1 \\ + -r 30000,40000,45000,50000,100000,150000 \\ + -s pcap \\ + -z 192.168.0.1:53 \\ + -e igb0 \\ + -c results_pcap.csv + +.SH AUTHOR +Patrick Fedick +.RI ( https://github.com/pfedick ) +.LP +Maintained by DNS-OARC +.LP +.RS +.I https://www.dns-oarc.net/ +.RE +.LP +.SH BUGS +For issues and feature requests please use: +.LP +.RS +\fI@PACKAGE_URL@\fP +.RE +.LP +For question and help please use: +.LP +.RS +\fI@PACKAGE_BUGREPORT@\fP +.RE +.LP diff --git a/src/exceptions.h b/src/exceptions.h new file mode 100644 index 0000000..c116021 --- /dev/null +++ b/src/exceptions.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include + +#ifndef __dnsmeter_exceptions_h +#define __dnsmeter_exceptions_h + +PPL7EXCEPTION(MissingCommandlineParameter, Exception); +PPL7EXCEPTION(InvalidCommandlineParameter, Exception); +PPL7EXCEPTION(InvalidDNSQuery, Exception); +PPL7EXCEPTION(UnknownRRType, Exception); +PPL7EXCEPTION(BufferOverflow, Exception); +PPL7EXCEPTION(UnknownDestination, Exception); +PPL7EXCEPTION(InvalidQueryFile, Exception); +PPL7EXCEPTION(UnsupportedIPFamily, Exception); +PPL7EXCEPTION(FailedToInitializePacketfilter, Exception); +PPL7EXCEPTION(KernelAccessFailed, Exception); +PPL7EXCEPTION(SystemCallFailed, Exception); + +#endif diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..36e5bbf --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include "config.h" + +#include "dns_sender.h" + +#include +#include +#include + +int main(int argc, char** argv) +{ + res_init(); + // For unknown reason, res_mkquery is much slower (factor 3) when not + // setting the following options: + _res.options |= RES_USE_EDNS0; + _res.options |= RES_USE_DNSSEC; + + DNSSender Sender; + return Sender.main(argc, argv); +} diff --git a/src/packet.cpp b/src/packet.cpp new file mode 100644 index 0000000..2e242eb --- /dev/null +++ b/src/packet.cpp @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include "config.h" + +#include "packet.h" +#include "exceptions.h" +#include "query.h" + +#define __FAVOR_BSD 1 +#include +#include +#include +#include +#include + +#define USZ sizeof(struct udphdr) +#define ISZ sizeof(struct ip) +#define HDRSZ ISZ + USZ +#define MAXPACKETSIZE 4096 + +static unsigned short in_cksum(unsigned short* addr, int len) +{ + int nleft = len; + unsigned short* w = addr; + int sum = 0; + unsigned short answer = 0; + while (nleft > 1) { + sum += *w++; + nleft -= 2; + } + if (nleft == 1) { + *(unsigned char*)(&answer) = *(unsigned char*)w; + sum += answer; + } + sum = (sum >> 16) + (sum & 0xffff); + sum += (sum >> 16); + answer = ~sum; + return (answer); +} + +static unsigned short udp_cksum(const struct ip* iphdr, const struct udphdr* udp, const unsigned char* payload, size_t payload_size) +{ + unsigned char cbuf[MAXPACKETSIZE]; + memset(cbuf, 0, sizeof(cbuf)); + unsigned char* p = (unsigned char*)cbuf; + *(unsigned int*)p = iphdr->ip_src.s_addr; + p += sizeof(unsigned int); + *(unsigned int*)p = iphdr->ip_dst.s_addr; + p += sizeof(unsigned int); + *(unsigned char*)p++ = 0; + *(unsigned char*)p++ = iphdr->ip_p; + *(unsigned short*)p = udp->uh_ulen; + p += sizeof(unsigned short); + memcpy(p, udp, USZ); + p += USZ; + memcpy(p, payload, payload_size); + return in_cksum((unsigned short*)cbuf, sizeof(uint) * 3 + sizeof(struct udphdr) + payload_size + (payload_size % 2)); +} + +Packet::Packet() +{ + buffersize = MAXPACKETSIZE; + payload_size = 0; + buffer = (unsigned char*)calloc(1, buffersize); + if (!buffer) + throw ppl7::OutOfMemoryException(); + + struct ip* iphdr = (struct ip*)buffer; + struct udphdr* udp = (struct udphdr*)(buffer + ISZ); + + iphdr->ip_hl = ISZ >> 2; + iphdr->ip_v = IPVERSION; + iphdr->ip_tos = 0; + iphdr->ip_off = 0; + iphdr->ip_ttl = 64; + iphdr->ip_p = IPPROTO_UDP; + iphdr->ip_sum = 0; + iphdr->ip_id = 0; + iphdr->ip_src.s_addr = 0; + iphdr->ip_dst.s_addr = 0; + iphdr->ip_len = htons(HDRSZ + payload_size); + iphdr->ip_sum = in_cksum((unsigned short*)iphdr, ISZ); + + udp->uh_ulen = htons(USZ + payload_size); + chksum_valid = false; +} + +Packet::~Packet() +{ + free(buffer); +} + +void Packet::setSource(const ppl7::IPAddress& ip_addr, int port) +{ + struct ip* iphdr = (struct ip*)buffer; + struct udphdr* udp = (struct udphdr*)(buffer + ISZ); + iphdr->ip_src.s_addr = *(in_addr_t*)ip_addr.addr(); + udp->uh_sport = htons(port); + chksum_valid = false; +} + +void Packet::randomSourcePort() +{ + struct udphdr* udp = (struct udphdr*)(buffer + ISZ); + udp->uh_sport = htons(ppl7::rand(1024, 65535)); + chksum_valid = false; +} + +void Packet::randomSourceIP(const ppl7::IPNetwork& net) +{ + struct ip* iphdr = (struct ip*)buffer; + in_addr_t start = ntohl(*(in_addr_t*)net.first().addr()); + size_t size = powl(2, 32 - net.prefixlen()); + iphdr->ip_src.s_addr = htonl(ppl7::rand(start, start + size - 1)); + chksum_valid = false; +} + +void Packet::randomSourceIP(unsigned int start, unsigned int size) +{ + struct ip* iphdr = (struct ip*)buffer; + iphdr->ip_src.s_addr = htonl(ppl7::rand(start, start + size - 1)); + chksum_valid = false; +} + +void Packet::useSourceFromPcap(const char* pkt, size_t size) +{ + const struct ip* s_iphdr = (const struct ip*)(pkt + 14); + const struct udphdr* s_udp = (const struct udphdr*)(pkt + 14 + sizeof(struct ip)); + struct ip* iphdr = (struct ip*)buffer; + struct udphdr* udp = (struct udphdr*)(buffer + ISZ); + iphdr->ip_src.s_addr = s_iphdr->ip_src.s_addr; + udp->uh_sport = s_udp->uh_sport; +} + +void Packet::setDestination(const ppl7::IPAddress& ip_addr, int port) +{ + struct ip* iphdr = (struct ip*)buffer; + struct udphdr* udp = (struct udphdr*)(buffer + ISZ); + iphdr->ip_dst.s_addr = *(in_addr_t*)ip_addr.addr(); + udp->uh_dport = htons(port); + chksum_valid = false; +} + +void Packet::setIpId(unsigned short id) +{ + struct ip* iphdr = (struct ip*)buffer; + iphdr->ip_id = htons(id); + chksum_valid = false; +} + +void Packet::setDnsId(unsigned short id) +{ + *((unsigned short*)(buffer + HDRSZ)) = htons(id); + chksum_valid = false; +} + +void Packet::setPayload(const void* payload, size_t size) +{ + if (size + HDRSZ > MAXPACKETSIZE) + throw BufferOverflow("%zd > %zd", size, MAXPACKETSIZE - HDRSZ); + memcpy(buffer + HDRSZ, payload, size); + payload_size = size; + struct ip* iphdr = (struct ip*)buffer; + struct udphdr* udp = (struct udphdr*)(buffer + ISZ); + iphdr->ip_len = htons(HDRSZ + payload_size); + udp->uh_ulen = htons(USZ + payload_size); + chksum_valid = false; +} + +void Packet::setPayloadDNSQuery(const ppl7::String& query, bool dnssec) +{ + payload_size = MakeQuery(query, buffer + HDRSZ, buffersize - HDRSZ, dnssec); + struct ip* iphdr = (struct ip*)buffer; + struct udphdr* udp = (struct udphdr*)(buffer + ISZ); + iphdr->ip_len = htons(HDRSZ + payload_size); + udp->uh_ulen = htons(USZ + payload_size); + chksum_valid = false; +} + +void Packet::updateChecksums() +{ + struct ip* iphdr = (struct ip*)buffer; + struct udphdr* udp = (struct udphdr*)(buffer + ISZ); + iphdr->ip_sum = 0; + iphdr->ip_sum = in_cksum((unsigned short*)iphdr, ISZ); + udp->uh_sum = 0; + udp->uh_sum = udp_cksum(iphdr, udp, buffer + HDRSZ, payload_size); + chksum_valid = true; +} + +size_t Packet::size() const +{ + return HDRSZ + payload_size; +} + +unsigned char* Packet::ptr() +{ + if (!chksum_valid) + updateChecksums(); + return buffer; +} diff --git a/src/packet.h b/src/packet.h new file mode 100644 index 0000000..91650c7 --- /dev/null +++ b/src/packet.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include +#include + +#ifndef __dnsmeter_packet_h +#define __dnsmeter_packet_h + +class Packet { +private: +#if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L + Packet& operator=(const Packet& other); + Packet(Packet &&other) noexcept; + Packet const & operator=(Packet &&other); +#endif + + unsigned char* buffer; + int buffersize; + int payload_size; + bool chksum_valid; + + void updateChecksums(); + +public: + Packet(); + ~Packet(); + void setSource(const ppl7::IPAddress& ip_addr, int port); + void setDestination(const ppl7::IPAddress& ip_addr, int port); + void setPayload(const void* payload, size_t size); + void setPayloadDNSQuery(const ppl7::String& query, bool dnssec = false); + void setDnsId(unsigned short id); + void setIpId(unsigned short id); + + void randomSourceIP(const ppl7::IPNetwork& net); + void randomSourceIP(unsigned int start, unsigned int size); + void randomSourcePort(); + void useSourceFromPcap(const char* pkt, size_t size); + + size_t size() const; + unsigned char* ptr(); +}; + +#endif diff --git a/src/payload_file.cpp b/src/payload_file.cpp new file mode 100644 index 0000000..5c42a1e --- /dev/null +++ b/src/payload_file.cpp @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include "config.h" + +#include "payload_file.h" +#include "exceptions.h" +#include "query.h" + +#define __FAVOR_BSD 1 +#include +#include +#include +#include +#include + +#pragma pack(push) /* push current alignment to stack */ +#pragma pack(1) /* set alignment to 1 byte boundary */ +struct ETHER { + unsigned char destination[6]; + unsigned char source[6]; + unsigned short type; +}; +#pragma pack(pop) /* restore original alignment from stack */ + +PayloadFile::PayloadFile() +{ + validLinesInQueryFile = 0; + payloadIsPcap = false; +} + +bool PayloadFile::detectPcap(ppl7::File& ff) +{ + unsigned char buffer[8]; + if (ff.read(buffer, 8) != 8) { + ff.seek(0); + return false; + } + ff.seek(0); + unsigned int magic = ppl7::Peek32(buffer + 0); + if (magic == 0xa1b2c3d4 || magic == 0xa1b23c4d) + return true; + if (magic == 0xd4c3b2a1 || magic == 0x4d3cb2a1) + return true; + return false; +} + +void PayloadFile::openQueryFile(const ppl7::String& Filename) +{ + if (Filename.isEmpty()) + throw InvalidQueryFile("File not given"); + ppl7::File QueryFile; + QueryFile.open(Filename, ppl7::File::READ); + if (QueryFile.size() == 0) { + throw InvalidQueryFile("File is empty [%s]", (const char*)Filename); + } + printf("INFO: Loading and precompile payload. This could take some time...\n"); + if (detectPcap(QueryFile)) { + loadAndCompilePcapFile(Filename); + } else { + loadAndCompile(QueryFile); + } + printf("INFO: %llu queries loaded\n", validLinesInQueryFile); + it = querycache.begin(); +} + +void PayloadFile::loadAndCompile(ppl7::File& ff) +{ + ppl7::ByteArray buf(4096); + ppl7::String buffer; + validLinesInQueryFile = 0; + unsigned char* compiled_query = (unsigned char*)buf.ptr(); + while (1) { + try { + if (ff.eof()) + throw ppl7::EndOfFileException(); + ff.gets(buffer, 1024); + buffer.trim(); + if (buffer.isEmpty()) + continue; + if (buffer.c_str()[0] == '#') + continue; + try { + // Precompile Query + int size = MakeQuery(buffer, compiled_query, 4096, false); + querycache.push_back(ppl7::ByteArray(compiled_query, size)); + validLinesInQueryFile++; + } catch (...) { + // ignore invalid queries + continue; + } + } catch (const ppl7::EndOfFileException&) { + if (validLinesInQueryFile == 0) { + throw InvalidQueryFile("No valid Queries found in Queryfile"); + } + return; + } + } +} + +void PayloadFile::loadAndCompilePcapFile(const ppl7::String& Filename) +{ + char errorbuffer[PCAP_ERRBUF_SIZE]; + struct pcap_pkthdr hdr; + payloadIsPcap = true; + validLinesInQueryFile = 0; + pcap_t* pp = pcap_open_offline((const char*)Filename, errorbuffer); + if (!pp) + throw InvalidQueryFile("%s", errorbuffer); + ppluint64 pkts_total = 0; + const u_char* pkt; + while ((pkt = pcap_next(pp, &hdr)) != NULL) { + pkts_total++; + //printf ("len=%d, caplen=%d\n",hdr.len,hdr.caplen); + const struct ETHER* eth = (const struct ETHER*)pkt; + if (hdr.caplen > 4096) + continue; + if (eth->type != htons(0x0800)) + continue; + const struct ip* iphdr = (const struct ip*)(pkt + 14); + if (iphdr->ip_v != 4) + continue; + const struct udphdr* udp = (const struct udphdr*)(pkt + 14 + sizeof(struct ip)); + if (udp->uh_dport != htons(53)) + continue; + const struct DNS_HEADER* dns = (const struct DNS_HEADER*)(pkt + 14 + sizeof(struct ip) + sizeof(struct udphdr)); + if (dns->qr != 0 || dns->opcode != 0) + continue; + querycache.push_back(ppl7::ByteArray(pkt, hdr.caplen)); + validLinesInQueryFile++; + } + printf("Packets read from pcap file: %llu, valid UDP DNS queries: %llu\n", + pkts_total, validLinesInQueryFile); + pcap_close(pp); + if (validLinesInQueryFile == 0) { + throw InvalidQueryFile("No valid Queries found in pcap file [%s]", (const char*)Filename); + } +} + +const ppl7::ByteArrayPtr& PayloadFile::getQuery() +{ + QueryMutex.lock(); + const ppl7::ByteArrayPtr& bap = *it; + ++it; + if (it == querycache.end()) + it = querycache.begin(); + QueryMutex.unlock(); + return bap; +} + +bool PayloadFile::isPcap() +{ + return payloadIsPcap; +} diff --git a/src/payload_file.h b/src/payload_file.h new file mode 100644 index 0000000..154f771 --- /dev/null +++ b/src/payload_file.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2019-2021, OARC, Inc. + * Copyright (c) 2019, DENIC eG + * All rights reserved. + * + * This file is part of dnsmeter. + * + * dnsmeter 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. + * + * dnsmeter 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 dnsmeter. If not, see . + */ + +#include +#include + +#ifndef __dnsmeter_payload_file_h +#define __dnsmeter_payload_file_h + +class PayloadFile { +private: + ppl7::Mutex QueryMutex; + ppluint64 validLinesInQueryFile; + std::list querycache; + std::list::const_iterator it; + bool payloadIsPcap; + bool detectPcap(ppl7::File& ff); + void loadAndCompile(ppl7::File& ff); + void loadAndCompilePcapFile(const ppl7::String& Filename); + +public: + PayloadFile(); + void openQueryFile(const ppl7::String& Filename); + const ppl7::ByteArrayPtr& getQuery(); + bool isPcap(); +}; + +#endif diff --git a/src/pplib/.cproject b/src/pplib/.cproject new file mode 100644 index 0000000..37111ba --- /dev/null +++ b/src/pplib/.cproject @@ -0,0 +1,409 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + make + -j6 + install_debug + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/pplib/.gitignore b/src/pplib/.gitignore new file mode 100644 index 0000000..7699c3f --- /dev/null +++ b/src/pplib/.gitignore @@ -0,0 +1,16 @@ +/debug/ +/release/ +/config.log +/config.status +/Makefile +/ppl7-config +/autom4te.cache +/PPL7.config +/PPL7.creator +/PPL7.creator.user +/PPL7.files +/PPL7.includes +/x64/ +/documentation/ +/.settings/ +.vscode/ diff --git a/src/pplib/.project b/src/pplib/.project new file mode 100644 index 0000000..1fef60a --- /dev/null +++ b/src/pplib/.project @@ -0,0 +1,93 @@ + + + PPL7 + + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + install_debug + + + org.eclipse.cdt.make.core.buildArguments + -j1 + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + true + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.environment + + + + org.eclipse.cdt.make.core.fullBuildTarget + install_debug + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.eclipse.wst.common.project.facet.core.nature + + diff --git a/src/pplib/.settings/com.googlecode.cppcheclipse.core.prefs b/src/pplib/.settings/com.googlecode.cppcheclipse.core.prefs new file mode 100644 index 0000000..7f2851a --- /dev/null +++ b/src/pplib/.settings/com.googlecode.cppcheclipse.core.prefs @@ -0,0 +1,4 @@ +advancedArgument=-I include -j4 -isrc/core/Resourcen.cpp -UTODO -DHAVE_CONFIG_H -DPPL7LIB -UDEBUGLOG -UMINGW32 -U_M_ALPHA -U_M_IX86 --enable\=all --platform\=unix64 +eclipse.preferences.version=1 +problems=memsetZeroBytes\=true;1;\!redundantCondition\=true;1;\!nonreentrantFunctionsctermid\=true;0;\!nonreentrantFunctionstempnam\=true;0;\!sizeofsizeof\=true;1;\!nonreentrantFunctionsgetspnam\=true;0;\!unnecessaryForwardDeclaration\=true;1;\!deallocuse\=true;2;\!nonreentrantFunctionsgetpwent\=true;0;\!pointerSize\=true;1;\!IOWithoutPositioning\=true;2;\!uselessCallsRemove\=true;1;\!assignmentInAssert\=true;1;\!nonreentrantFunctionsgethostbyname2\=true;0;\!literalWithCharPtrCompare\=true;1;\!obsoleteFunctionsctime_r\=true;1;\!obsoleteFunctionsbzero\=true;1;\!obsoleteFunctionsrindex\=true;1;\!publicAllocationError\=true;1;\!unusedPrivateFunction\=true;1;\!nonreentrantFunctionsgetlogin\=true;0;\!redundantNextPrevious\=true;1;\!wrongmathcall\=true;2;\!uninitMemberVar\=true;1;\!memleak\=true;2;\!duplInheritedMember\=true;1;\!nonreentrantFunctionsgcvt\=true;0;\!obsoleteFunctionsswapcontext\=true;1;\!uselessCallsEmpty\=true;1;\!operatorEq\=true;1;\!operatorEqVarError\=true;1;\!variableHidingEnum\=true;1;\!nonreentrantFunctionsgetpwnam\=true;0;\!outOfBounds\=true;2;\!fflushOnInputStream\=true;2;\!variableScope\=true;1;\!obsoleteFunctionsgetwd\=true;1;\!nonreentrantFunctionsgethostent\=true;0;\!redundantCopyInSwitch\=true;1;\!functionStatic\=true;0;\!toomanyconfigs\=true;0;\!invalidFunctionArgBool\=true;2;\!nanInArithmeticExpression\=true;1;\!unusedAllocatedMemory\=true;1;\!obsoleteFunctionsgethostbyaddr\=true;1;\!constStatement\=true;1;\!CastAddressToIntegerAtReturn\=true;0;\!udivError\=true;2;\!zerodiv\=true;2;\!stlIfStrFind\=true;0;\!complexPatternError\=true;2;\!staticStringCompare\=true;1;\!incorrectLogicOperator\=true;1;\!redundantAssignment\=true;0;\!pointerOutOfBounds\=true;0;\!returnTempReference\=true;2;\!invalidPrintfArgType_sint\=true;1;\!obsoleteFunctionsutime\=true;1;\!cstyleCast\=true;1;\!comparisonOfBoolWithBoolError\=true;1;\!noConstructor\=true;1;\!invalidScanfArgType_int\=true;1;\!derefInvalidIterator\=true;1;\!nonreentrantFunctionsgethostbyname\=true;0;\!useAutoPointerArray\=true;2;\!initializerList\=true;1;\!sprintfOverlappingData\=true;2;\!returnReference\=true;2;\!obsoleteFunctionstmpnam\=true;1;\!checkCastIntToCharAndBack\=true;1;\!redundantCopyLocalConst\=true;0;\!catchExceptionByValue\=true;1;\!invalidPrintfArgType_float\=true;1;\!CastIntegerToAddressAtReturn\=true;0;\!sizeofwithsilentarraypointer\=true;2;\!boostForeachError\=true;2;\!unsafeClassCanLeak\=true;1;\!copyCtorPointerCopying\=true;1;\!obsoleteFunctionsecvt\=true;1;\!duplicateBreak\=true;1;\!assertWithSideEffect\=true;1;\!exceptDeallocThrow\=true;1;\!charArrayIndex\=true;1;\!possibleBufferAccessOutOfBounds\=true;1;\!useAutoPointerContainer\=true;2;\!terminateStrncpy\=true;1;\!wrongPrintfScanfParameterPositionError\=true;1;\!missingIncludeSystem\=true;0;\!noCopyConstructor\=true;1;\!mismatchingContainers\=true;2;\!unreadVariable\=true;1;\!useAutoPointerCopy\=true;1;\!nonreentrantFunctionsgetservbyname\=true;0;\!uninitdata\=true;2;\!invalidFunctionArg\=true;2;\!obsoleteFunctionsscalbln\=true;1;\!functionConst\=true;1;\!argumentSize\=true;1;\!operatorEqToSelf\=true;1;\!invalidPrintfArgType_uint\=true;1;\!unassignedVariable\=true;1;\!eraseDereference\=true;2;\!stlIfFind\=true;1;\!missingInclude\=true;0;\!unusedFunction\=true;1;\!invalidPointerCast\=true;1;\!uselessCallsSwap\=true;0;\!iterators\=true;2;\!returnAddressOfAutoVariable\=true;2;\!wrongPrintfScanfArgNum\=true;2;\!invalidScanfArgType_s\=true;1;\!nonreentrantFunctionscrypt\=true;0;\!autovarInvalidDeallocation\=true;2;\!obsoleteFunctionsrand_r\=true;1;\!nonreentrantFunctionsgetservbyport\=true;0;\!wrongPipeParameterSize\=true;2;\!arithOperationsOnVoidPointer\=true;0;\!nonreentrantFunctionsfcvt\=true;0;\!obsoleteFunctionsgetcontext\=true;1;\!unsignedLessThanZero\=true;1;\!nonreentrantFunctionsgetspent\=true;0;\!comparisonError\=true;1;\!unusedVariable\=true;1;\!preprocessorErrorDirective\=true;2;\!bufferNotZeroTerminated\=true;1;\!operatorEqRetRefThis\=true;1;\!useClosedFile\=true;2;\!postfixOperator\=true;0;\!arrayIndexThenCheck\=true;1;\!duplicateBranch\=true;1;\!stlcstr\=true;2;\!mismatchSize\=true;2;\!obsoleteFunctionsbcmp\=true;1;\!stlOutOfBounds\=true;2;\!obsoleteFunctionsftime\=true;1;\!obsoleteFunctionstmpnam_r\=true;1;\!comparisonOfBoolWithInt\=true;1;\!AssignmentIntegerToAddress\=true;0;\!returnAddressOfFunctionParameter\=true;2;\!divideSizeof\=true;1;\!uninitstring\=true;2;\!mallocOnClassWarning\=true;1;\!syntaxError\=true;2;\!comparisonOfTwoFuncsReturningBoolError\=true;1;\!commaSeparatedReturn\=true;1;\!nonreentrantFunctionsttyname\=true;0;\!duplicateExpression\=true;1;\!shiftNegative\=true;2;\!stlcstrParam\=true;0;\!obsoleteFunctionsvfork\=true;1;\!suspiciousCase\=true;1;\!stlcstrReturn\=true;0;\!clarifyStatement\=true;1;\!uselessCallsSubstr\=true;0;\!obsoleteFunctionswcswcs\=true;1;\!uselessCallsCompare\=true;1;\!nonreentrantFunctionsgmtime\=true;0;\!mallocOnClassError\=true;2;\!obsoleteFunctionsmakecontext\=true;1;\!redundantCopy\=true;0;\!invalidScanfArgType_float\=true;1;\!nonreentrantFunctionsgetgrent\=true;0;\!leakReturnValNotUsed\=true;2;\!sizeofVoid\=true;0;\!exceptRethrowCopy\=true;1;\!compareBoolExpressionWithInt\=true;1;\!incrementboolean\=true;1;\!simplePatternError\=true;1;\!nonreentrantFunctionsgetprotobyname\=true;0;\!returnLocalVariable\=true;2;\!writeReadOnlyFile\=true;2;\!nonreentrantFunctionsstrtok\=true;0;\!pointerLessThanZero\=true;1;\!nonreentrantFunctionsgetnetbyname\=true;0;\!unsignedPositive\=true;1;\!virtualDestructor\=true;2;\!obsoleteFunctionsbsd_signal\=true;1;\!memsetClass\=true;2;\!ConfigurationNotChecked\=true;0;\!uninitStructMember\=true;2;\!duplicateIf\=true;1;\!obsoleteFunctionsbcopy\=true;1;\!useInitializationList\=true;0;\!thisSubtraction\=true;1;\!unknownPattern\=true;2;\!sizeofwithnumericparameter\=true;1;\!suspiciousEqualityComparison\=true;1;\!possibleReadlinkBufferOverrun\=true;1;\!exceptThrowInDestructor\=true;2;\!insecureCmdLineArgs\=true;2;\!nonreentrantFunctionsgetgrnam\=true;0;\!zerodivcond\=true;1;\!selfAssignment\=true;1;\!mismatchingBitAnd\=true;1;\!autoVariables\=true;2;\!arrayIndexOutOfBounds\=true;2;\!redundantAssignInSwitch\=true;1;\!nonreentrantFunctionsgetpwuid\=true;0;\!nonreentrantFunctionsecvt\=true;0;\!sizeofCalculation\=true;1;\!nonreentrantFunctionsreaddir\=true;0;\!invalidPointer\=true;2;\!comparisonFunctionIsAlwaysTrueOrFalse\=true;1;\!sizeofDereferencedVoidPointer\=true;0;\!obsoleteFunctionsfcvt\=true;1;\!obsoleteFunctionspthread_attr_setstackaddr\=true;1;\!oppositeInnerCondition\=true;1;\!deallocret\=true;2;\!unusedScopedObject\=true;2;\!strPlusChar\=true;2;\!AssignmentAddressToInteger\=true;0;\!uninitvar\=true;2;\!memleakOnRealloc\=true;2;\!nonreentrantFunctionsgetrpcbyname\=true;0;\!readWriteOnlyFile\=true;2;\!incorrectStringBooleanError\=true;1;\!resourceLeak\=true;2;\!deallocDealloc\=true;2;\!invalidscanf\=true;1;\!charBitOp\=true;1;\!unusedStructMember\=true;1;\!nonreentrantFunctionsfgetpwent\=true;0;\!suspiciousSemicolon\=true;1;\!nonreentrantFunctionsgetrpcent\=true;0;\!invalidPrintfArgType_int\=true;1;\!writeOutsideBufferSize\=true;2;\!pointerArithBool\=true;2;\!nonreentrantFunctionsgetrpcbynumber\=true;0;\!stringCompare\=true;1;\!switchCaseFallThrough\=true;1;\!obsoleteFunctionsusleep\=true;1;\!stlBoundaries\=true;2;\!variableHidingTypedef\=true;1;\!coutCerrMisusage\=true;2;\!StlMissingComparison\=true;1;\!invalidIterator1\=true;2;\!unreachableCode\=true;1;\!invalidIterator2\=true;2;\!nonreentrantFunctionsfgetspent\=true;0;\!obsoleteFunctionsasctime_r\=true;1;\!obsoleteFunctionspthread_attr_getstackaddr\=true;1;\!assignIfError\=true;1;\!incorrectStringCompare\=true;1;\!comparisonOfFuncReturningBoolError\=true;1;\!stlSize\=true;0;\!doubleFree\=true;2;\!multiplySizeof\=true;1;\!nullPointer\=true;2;\!nonreentrantFunctionsfgetgrent\=true;0;\!redundantIfRemove\=true;1;\!obsoleteFunctionsgethostbyname\=true;1;\!nonreentrantFunctionslocaltime\=true;0;\!moduloAlwaysTrueFalse\=true;1;\!nonreentrantFunctionsgetservent\=true;0;\!obsoleteFunctionsualarm\=true;1;\!nonreentrantFunctionsgetnetgrent\=true;0;\!varFuncNullUB\=true;0;\!obsoleteFunctionsgcvt\=true;1;\!negativeIndex\=true;2;\!incompleteArrayFill\=true;1;\!obsoleteFunctionsindex\=true;1;\!leakNoVarFunctionCall\=true;2;\!nonreentrantFunctionsgethostbyaddr\=true;0;\!missingPercentCharacter\=true;2;\!bitwiseOnBoolean\=true;1;\!passedByValue\=true;0;\!nonreentrantFunctionsgetnetbyaddr\=true;0;\!cppcheckError\=true;2;\!bufferAccessOutOfBounds\=true;2;\!invalidPrintfArgType_s\=true;1;\!clarifyCalculation\=true;1;\!invalidPrintfArgType_p\=true;1;\!pointerPositive\=true;1;\!uselessAssignmentPtrArg\=true;1;\!clarifyCondition\=true;1;\!assignBoolToPointer\=true;2;\!mismatchAllocDealloc\=true;2;\!invalidPrintfArgType_n\=true;1;\!multiCondition\=true;1;\!unnecessaryQualification\=true;0;\!nonreentrantFunctionsgetgrgid\=true;0;\! +suppressions=rO0ABXNyAAxqYXZhLmlvLkZpbGUELaRFDg3k/wMAAUwABHBhdGh0ABJMamF2YS9sYW5nL1N0cmluZzt4cHQAFHNyYy9jb3JlL0FWTFRyZWUuY3BwdwIAL3g\=;unusedFunction;2147483647\!rO0ABXNyAAxqYXZhLmlvLkZpbGUELaRFDg3k/wMAAUwABHBhdGh0ABJMamF2YS9sYW5nL1N0cmluZzt4cHQAEXNyYy9jb3JlL0ZpbGUuY3BwdwIAL3g\=;IOWithoutPositioning;1388\!rO0ABXNyAAxqYXZhLmlvLkZpbGUELaRFDg3k/wMAAUwABHBhdGh0ABJMamF2YS9sYW5nL1N0cmluZzt4cHQAFHNyYy9ncmFmaXgvSW1hZ2UuY3BwdwIAL3g\=;memsetZeroBytes;305\! diff --git a/src/pplib/.settings/language.settings.xml b/src/pplib/.settings/language.settings.xml new file mode 100644 index 0000000..e91abd3 --- /dev/null +++ b/src/pplib/.settings/language.settings.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/pplib/.settings/org.eclipse.cdt.codan.core.prefs b/src/pplib/.settings/org.eclipse.cdt.codan.core.prefs new file mode 100644 index 0000000..b15c484 --- /dev/null +++ b/src/pplib/.settings/org.eclipse.cdt.codan.core.prefs @@ -0,0 +1,73 @@ +eclipse.preferences.version=1 +org.eclipse.cdt.codan.checkers.errnoreturn=Warning +org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return\\")",implicit\=>false} +org.eclipse.cdt.codan.checkers.errreturnvalue=Error +org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused return value\\")"} +org.eclipse.cdt.codan.checkers.nocommentinside=-Error +org.eclipse.cdt.codan.checkers.nocommentinside.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Nesting comments\\")"} +org.eclipse.cdt.codan.checkers.nolinecomment=-Error +org.eclipse.cdt.codan.checkers.nolinecomment.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Line comments\\")"} +org.eclipse.cdt.codan.checkers.noreturn=Error +org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return value\\")",implicit\=>false} +org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error +org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Abstract class cannot be instantiated\\")"} +org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error +org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Ambiguous problem\\")"} +org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning +org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment in condition\\")"} +org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error +org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment to itself\\")"} +org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning +org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No break at end of case\\")",no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false} +org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning +org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Catching by reference is recommended\\")",unknown\=>false,exceptions\=>()} +org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error +org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Circular inheritance\\")"} +org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=Warning +org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class members should be properly initialized\\")",skip\=>true} +org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error +org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Field cannot be resolved\\")"} +org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error +org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Function cannot be resolved\\")"} +org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error +org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid arguments\\")"} +org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error +org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid template argument\\")"} +org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error +org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Label statement not found\\")"} +org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error +org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Member declaration not found\\")"} +org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error +org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Method cannot be resolved\\")"} +org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info +org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Name convention for function\\")",pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} +org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning +org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class has a virtual method and non-virtual destructor\\")"} +org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error +org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid overload\\")"} +org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error +org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redeclaration\\")"} +org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error +org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redefinition\\")"} +org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning +org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return with parenthesis\\")"} +org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=Warning +org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Format String Vulnerability\\")"} +org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning +org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Statement has no effect\\")",macro\=>true,exceptions\=>()} +org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning +org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suggested parenthesis around expression\\")",paramNot\=>false} +org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning +org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suspicious semicolon\\")",else\=>false,afterelse\=>false} +org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error +org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Type cannot be resolved\\")"} +org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning +org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused function declaration\\")",macro\=>true} +org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning +org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused static function\\")",macro\=>true} +org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning +org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused variable declaration in file scope\\")",macro\=>true,exceptions\=>("@(\#)","$Id")} +org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error +org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol is not resolved\\")"} +org.eclipse.cdt.qt.core.qtproblem=Warning +org.eclipse.cdt.qt.core.qtproblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>false,RUN_ON_INC_BUILD\=>false,RUN_ON_FILE_OPEN\=>true,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>null} diff --git a/src/pplib/.settings/org.eclipse.core.resources.prefs b/src/pplib/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..bf97e40 --- /dev/null +++ b/src/pplib/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +encoding//src/core/File.cpp=UTF-8 +encoding/=UTF-8 diff --git a/src/pplib/.settings/org.eclipse.ltk.core.refactoring.prefs b/src/pplib/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 0000000..721e997 --- /dev/null +++ b/src/pplib/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Sat Nov 03 10:37:37 CET 2012 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/src/pplib/Doxyfile b/src/pplib/Doxyfile new file mode 100644 index 0000000..d4a1520 --- /dev/null +++ b/src/pplib/Doxyfile @@ -0,0 +1,2507 @@ +# Doxyfile 1.8.14 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = PPLib + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = 7.0.0 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = documentation + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = German + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = NO + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class " \ + "The $name widget " \ + "The $name file " \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = YES + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = /home/patrickf/cvs-priv/ppl/ppl7 \ + /home/patrick/cvs/ppl/ppl7 + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. + +ALIASES = "header=\par Include: \n " \ + "desc=\par Beschreibung: " \ + "example=\par Beispiel: " \ + "descr=\par Beschreibung: " + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = YES + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = YES + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = NO + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = YES + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = YES + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = YES + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = NO + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = docs/DoxygenLayout.xml + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = docs/ \ + src/ \ + include/ \ + HISTORY.TXT + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.PY \ + HISTORY.TXT \ + *.TXT \ + *.txt + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = include/grafix.h + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = docs/ \ + ./ \ + docs/examples/ + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = resource/ \ + docs + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = NO + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = docs/header.html + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = docs/ppl7style.css + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via Javascript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have Javascript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = YES + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = YES + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = de.pfp.ppl7 + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /