DNS Decoder create version
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
build*/
|
||||
cmake-build-vscode/*
|
||||
.vscode/
|
||||
*.si4project
|
||||
205
.gitlab-ci.yml
Normal file
205
.gitlab-ci.yml
Normal file
@@ -0,0 +1,205 @@
|
||||
variables:
|
||||
GIT_STRATEGY: "clone"
|
||||
BUILD_IMAGE_CENTOS7: "git.mesalab.cn:7443/mesa_platform/build-env:master"
|
||||
BUILD_IMAGE_CENTOS8: "git.mesalab.cn:7443/mesa_platform/build-env:rockylinux"
|
||||
BUILD_PADDING_PREFIX: /tmp/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX/
|
||||
INSTALL_PREFIX: "/opt/tsg/"
|
||||
INSTALL_DEPENDENCY_LIBRARY: libMESA_handle_logger-devel libMESA_prof_load-devel libMESA_htable libMESA_jump_layer
|
||||
libMESA_field_stat2-devel libfieldstat3-devel sapp-devel libcjson-devel libbreakpad_mini
|
||||
framework_env libasan stellar-on-sapp-devel libfieldstat4-devel
|
||||
SYMBOL_TARGET: dns_decoder
|
||||
REPO_PREFIX: protocol
|
||||
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- upload
|
||||
|
||||
.everything_before_script: &everything_before_script
|
||||
- mkdir -p $BUILD_PADDING_PREFIX/$CI_PROJECT_NAMESPACE/
|
||||
- ln -s $CI_PROJECT_DIR $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
||||
- cd $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
||||
- chmod +x ./ci/travis.sh
|
||||
- yum makecache --disablerepo="*" --enablerepo="mesa-framework,platform"
|
||||
- yum install -y $INSTALL_DEPENDENCY_LIBRARY
|
||||
- source /etc/profile.d/framework.sh
|
||||
|
||||
###############################################################################
|
||||
# build
|
||||
###############################################################################
|
||||
|
||||
.build_before_script:
|
||||
before_script: *everything_before_script
|
||||
script:
|
||||
- ./ci/travis.sh
|
||||
variables:
|
||||
BUILD_TEST: "ON"
|
||||
BUILD_TYPE: Debug
|
||||
tags:
|
||||
- share
|
||||
|
||||
# .build_by_travis_for_centos7:
|
||||
# extends: .build_before_script
|
||||
# stage: build
|
||||
# image: $BUILD_IMAGE_CENTOS7
|
||||
|
||||
|
||||
# develop_build_for_centos7:
|
||||
# extends: .build_by_travis_for_centos7
|
||||
# variables:
|
||||
# BUILD_TYPE: RelWithDebInfo
|
||||
# artifacts:
|
||||
# name: "$SYMBOL_TARGET-$CI_COMMIT_REF_NAME-debug"
|
||||
# paths:
|
||||
# - build/*
|
||||
# except:
|
||||
# - tags
|
||||
|
||||
# release_build_debug_for_centos7:
|
||||
# extends: .build_by_travis_for_centos7
|
||||
# variables:
|
||||
# BUILD_TYPE: Debug
|
||||
# PACKAGE: 1
|
||||
# ASAN_OPTION: "ADDRESS"
|
||||
# script:
|
||||
# - source /opt/rh/devtoolset-7/enable || true
|
||||
# - ./ci/travis.sh
|
||||
# artifacts:
|
||||
# name: "$SYMBOL_TARGET-$CI_COMMIT_REF_NAME-release"
|
||||
# paths:
|
||||
# - build/*
|
||||
# only:
|
||||
# - tags
|
||||
|
||||
# release_build_for_centos7:
|
||||
# extends: .build_by_travis_for_centos7
|
||||
# variables:
|
||||
# BUILD_TYPE: RelWithDebInfo
|
||||
# PACKAGE: 1
|
||||
# artifacts:
|
||||
# name: "$SYMBOL_TARGET-$CI_COMMIT_REF_NAME-release"
|
||||
# paths:
|
||||
# - build/*
|
||||
# only:
|
||||
# - tags
|
||||
|
||||
.build_by_travis_for_centos8:
|
||||
stage: build
|
||||
image: $BUILD_IMAGE_CENTOS8
|
||||
extends: .build_before_script
|
||||
|
||||
develop_build_for_centos8:
|
||||
extends: .build_by_travis_for_centos8
|
||||
variables:
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
artifacts:
|
||||
name: "$SYMBOL_TARGET-$CI_COMMIT_REF_NAME-debug"
|
||||
paths:
|
||||
- build/*
|
||||
except:
|
||||
- tags
|
||||
|
||||
release_build_debug_for_centos8:
|
||||
extends: .build_by_travis_for_centos8
|
||||
variables:
|
||||
BUILD_TYPE: Debug
|
||||
PACKAGE: 1
|
||||
ASAN_OPTION: "ADDRESS"
|
||||
artifacts:
|
||||
name: "$SYMBOL_TARGET-$CI_COMMIT_REF_NAME-release"
|
||||
paths:
|
||||
- build/*
|
||||
only:
|
||||
- tags
|
||||
|
||||
release_build_for_centos8:
|
||||
extends: .build_by_travis_for_centos8
|
||||
variables:
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
PACKAGE: 1
|
||||
artifacts:
|
||||
name: "$SYMBOL_TARGET-$CI_COMMIT_REF_NAME-release"
|
||||
paths:
|
||||
- build/*
|
||||
only:
|
||||
- tags
|
||||
|
||||
###############################################################################
|
||||
# test
|
||||
###############################################################################
|
||||
fix_env_version_test_in_centos8:
|
||||
stage: test
|
||||
image: $BUILD_IMAGE_CENTOS8
|
||||
allow_failure: false
|
||||
script:
|
||||
- *everything_before_script
|
||||
- cd build; make test ARGS="-V"
|
||||
dependencies:
|
||||
- develop_build_for_centos8
|
||||
- release_build_for_centos8
|
||||
tags:
|
||||
- share
|
||||
|
||||
|
||||
latest_env_version_test_in_centos8:
|
||||
stage: test
|
||||
image: $BUILD_IMAGE_CENTOS8
|
||||
allow_failure: false
|
||||
script:
|
||||
- *everything_before_script
|
||||
- mkdir /tmp/rpm/
|
||||
- yum install --downloadonly --downloaddir=/tmp/rpm/ sapp stellar-on-sapp -y
|
||||
- rpm -ihv /tmp/rpm/*.rpm
|
||||
- cd build; make test ARGS="-V"
|
||||
dependencies:
|
||||
- develop_build_for_centos8
|
||||
- release_build_for_centos8
|
||||
tags:
|
||||
- share
|
||||
|
||||
###############################################################################
|
||||
# upload
|
||||
###############################################################################
|
||||
# .define_before_upload_centos7:
|
||||
# stage: upload
|
||||
# image: $BUILD_IMAGE_CENTOS7
|
||||
# before_script:
|
||||
# - pwd; ls -l ; cd build ; ls -l
|
||||
# - cp /root/rpm_upload_tools.py ./
|
||||
# variables:
|
||||
# PULP3_REPO_NAME: $REPO_PREFIX-stable-x86_64.el7
|
||||
# PULP3_DIST_NAME: $REPO_PREFIX-stable-x86_64.el7
|
||||
# only:
|
||||
# - tags
|
||||
# tags:
|
||||
# - share
|
||||
|
||||
# rpm_upload_for_centos7:
|
||||
# extends: .define_before_upload_centos7
|
||||
# dependencies:
|
||||
# - release_build_debug_for_centos7
|
||||
# - release_build_for_centos7
|
||||
# script:
|
||||
# - python3 rpm_upload_tools.py $PULP3_REPO_NAME $PULP3_DIST_NAME *.rpm
|
||||
|
||||
.define_before_upload_centos8:
|
||||
stage: upload
|
||||
image: $BUILD_IMAGE_CENTOS8
|
||||
before_script:
|
||||
- pwd; ls -l ; cd build ; ls -l
|
||||
- cp /root/rpm_upload_tools.py ./
|
||||
variables:
|
||||
PULP3_REPO_NAME: $REPO_PREFIX-stable-x86_64.el8
|
||||
PULP3_DIST_NAME: $REPO_PREFIX-stable-x86_64.el8
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- share
|
||||
|
||||
rpm_upload_for_centos8:
|
||||
extends: .define_before_upload_centos8
|
||||
dependencies:
|
||||
- release_build_debug_for_centos8
|
||||
- release_build_for_centos8
|
||||
script:
|
||||
- python3 rpm_upload_tools.py $PULP3_REPO_NAME $PULP3_DIST_NAME *.rpm
|
||||
66
CMakeLists.txt
Normal file
66
CMakeLists.txt
Normal file
@@ -0,0 +1,66 @@
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
|
||||
set(lib_name dns_decoder)
|
||||
|
||||
project (${lib_name})
|
||||
|
||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
||||
include(Version)
|
||||
|
||||
set(CMAKE_MACOSX_RPATH 0)
|
||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wall)
|
||||
|
||||
find_program(CMAKE_CXX_CPPCHECK NAMES cppcheck)
|
||||
if (CMAKE_CXX_CPPCHECK)
|
||||
list(
|
||||
APPEND CMAKE_CXX_CPPCHECK
|
||||
"--enable=all"
|
||||
"--error-exitcode=1"
|
||||
"--suppress=unusedFunction"
|
||||
"--suppress=missingInclude"
|
||||
"--suppress=uselessAssignmentPtrArg"
|
||||
"--suppress=unmatchedSuppression"
|
||||
"--suppress=internalAstError"
|
||||
"--suppress=constParameter"
|
||||
"--suppress=variableScope"
|
||||
"--suppress=unreadVariable"
|
||||
"--suppress=unusedStructMember"
|
||||
)
|
||||
set(CMAKE_C_CPPCHECK ${CMAKE_CXX_CPPCHECK})
|
||||
else()
|
||||
message(FATAL_ERROR "Could not find the program cppcheck.")
|
||||
endif()
|
||||
|
||||
|
||||
#for ASAN
|
||||
set(ASAN_OPTION "OFF" CACHE STRING " set asan type chosen by the user, using OFF as default")
|
||||
set_property(CACHE ASAN_OPTION PROPERTY STRINGS OFF ADDRESS THREAD)
|
||||
message(STATUS "ASAN_OPTION='${ASAN_OPTION}'")
|
||||
|
||||
if(ASAN_OPTION MATCHES "ADDRESS")
|
||||
set(CMAKE_C_FLAGS "${CMAKADDRESS} -g -DCMAKE_BUILD_TYPE=Debug -fsanitize=address -fno-omit-frame-pointer")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DCMAKE_BUILD_TYPE=Debug -fsanitize=address -fno-omit-frame-pointer")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lasan")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lasan")
|
||||
elseif(ASAN_OPTION MATCHES "THREAD")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -DCMAKE_BUILD_TYPE=Debug -fsanitize=thread -fno-omit-frame-pointer")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DCMAKE_BUILD_TYPE=Debug -fsanitize=thread -fno-omit-frame-pointer")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lasan")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lasan")
|
||||
endif()
|
||||
# end of for ASAN
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
include_directories(/opt/MESA/include/MESA/)
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX /opt/tsg/)
|
||||
|
||||
enable_testing()
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(test)
|
||||
|
||||
install(FILES bin/dns_decoder.toml DESTINATION ${CMAKE_INSTALL_PREFIX}/sapp/etc/dns/ COMPONENT PROFILE)
|
||||
install(FILES bin/dns_decoder_local_stat.sh DESTINATION ${CMAKE_INSTALL_PREFIX}/framework/bin/ COMPONENT PROFILE)
|
||||
install(FILES include/dns_decoder.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/decoder/ COMPONENT HEADER)
|
||||
|
||||
include(Package)
|
||||
34
autorelease.sh
Normal file
34
autorelease.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
if [ $# -lt 8 ] ; then
|
||||
echo "USAGE: ./autorelease.sh [API_V4_URL] [PROJECT_URL]
|
||||
[PROJECT_ID] [TOKEN]
|
||||
[COMMIT_TAG] [JOB] [PROJECT_NAME] [USER_DEFINE]"
|
||||
echo "$1; $2; $3; $4; $5; $6; $7; $8"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
CI_API_V4_URL=$1
|
||||
CI_PROJECT_URL=$2
|
||||
CI_PROJECT_ID=$3
|
||||
CI_TOKEN=$4
|
||||
CI_COMMIT_TAG=$5
|
||||
ARTIFACTS_JOB=$6
|
||||
CI_PROJECT_NAME=$7
|
||||
USER_DEFINE=$8
|
||||
|
||||
res=`echo -e "curl --header \"PRIVATE-TOKEN: $CI_TOKEN\" $CI_API_V4_URL/projects/$CI_PROJECT_ID/releases/$CI_COMMIT_TAG -o /dev/null -s -w %{http_code}"| /bin/bash`
|
||||
|
||||
if [[ $res == "200" ]]; then
|
||||
eval $(echo -e "curl --request POST --header \"PRIVATE-TOKEN: $CI_TOKEN\" \
|
||||
--data name=\"$CI_PROJECT_NAME-$USER_DEFINE-$CI_COMMIT_TAG.zip\" \
|
||||
--data url=\"$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_TAG/download?job=$ARTIFACTS_JOB\"\
|
||||
$CI_API_V4_URL/projects/$CI_PROJECT_ID/releases/$CI_COMMIT_TAG/assets/links")
|
||||
else
|
||||
eval $(echo -e "curl --header 'Content-Type: application/json' --header \
|
||||
\"PRIVATE-TOKEN: $CI_TOKEN\" --data '{ \"name\": \"$CI_COMMIT_TAG\", \
|
||||
\"tag_name\": \"$CI_COMMIT_TAG\", \"description\": \"auto_release\",\
|
||||
\"assets\": { \"links\": [{ \"name\": \
|
||||
\"$CI_PROJECT_NAME-$USER_DEFINE-$CI_COMMIT_TAG.zip\", \"url\": \
|
||||
\"$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_TAG/download?job=$ARTIFACTS_JOB\"\
|
||||
}] } }' --request POST $CI_API_V4_URL/projects/$CI_PROJECT_ID/releases/")
|
||||
fi
|
||||
1268
autorevision.sh
Normal file
1268
autorevision.sh
Normal file
File diff suppressed because it is too large
Load Diff
14
bin/dns_decoder.toml
Normal file
14
bin/dns_decoder.toml
Normal file
@@ -0,0 +1,14 @@
|
||||
[decoder]
|
||||
[decoder.dns]
|
||||
port=[53,5353]
|
||||
|
||||
[decoder.dns.limited]
|
||||
max_rr_num=256
|
||||
max_cache_trans_num=16
|
||||
|
||||
[decoder.dns.local_stat]
|
||||
# stat_per_thread_enable value in [yes,no]
|
||||
stat_per_thread_enable="no"
|
||||
stat_name="DNS_DECODER"
|
||||
stat_interval_time_s=5
|
||||
stat_output="metrics/dns_decoder_local_stat.json"
|
||||
37
bin/dns_decoder_local_stat.sh
Normal file
37
bin/dns_decoder_local_stat.sh
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
ARGC=$#
|
||||
EXPORTER=/opt/tsg/framework/bin/fieldstat_exporter.py
|
||||
TARGET=/opt/tsg/sapp/metrics/dns_decoder_local_stat.json
|
||||
|
||||
case $1 in
|
||||
-h|--help)
|
||||
echo "$0"
|
||||
echo "Usage: [exporter] [target]"
|
||||
echo " exporter: path of exporter, default is $EXPORTER"
|
||||
echo " target: path of target file, default is $TARGET"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
case $ARGC in
|
||||
1)
|
||||
EXPORTER=$1
|
||||
;;
|
||||
2)
|
||||
EXPORTER=$1
|
||||
TARGET=$2
|
||||
;;
|
||||
esac
|
||||
#new version
|
||||
python3 $EXPORTER local -j $TARGET -e -t '
|
||||
{{"dns decoder message"}}
|
||||
{{ print_tables("message_type", ["send", "#Speed<send>", "recv", "#Speed<recv>"], True )}} {{"\n"}}
|
||||
|
||||
{{"dns decoder memory"}}
|
||||
{{ print_tables("memory", ["new", "#Speed<new>", "free", "#Speed<free>"], True )}} {{"\n"}}
|
||||
|
||||
{{"dns decoder decode status"}}
|
||||
{{ print_tables("decode_field", ["error", "#Speed<error>"], True )}} {{"\n"}}
|
||||
|
||||
'
|
||||
48
ci/get-nprocessors.sh
Normal file
48
ci/get-nprocessors.sh
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2017 Google Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following disclaimer
|
||||
# in the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# * Neither the name of Google Inc. nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# This file is typically sourced by another script.
|
||||
# if possible, ask for the precise number of processors,
|
||||
# otherwise take 2 processors as reasonable default; see
|
||||
# https://docs.travis-ci.com/user/speeding-up-the-build/#Makefile-optimization
|
||||
if [ -x /usr/bin/getconf ]; then
|
||||
NPROCESSORS=$(/usr/bin/getconf _NPROCESSORS_ONLN)
|
||||
else
|
||||
NPROCESSORS=2
|
||||
fi
|
||||
|
||||
# as of 2017-09-04 Travis CI reports 32 processors, but GCC build
|
||||
# crashes if parallelized too much (maybe memory consumption problem),
|
||||
# so limit to 4 processors for the time being.
|
||||
if [ $NPROCESSORS -gt 4 ] ; then
|
||||
echo "$0:Note: Limiting processors to use by make from $NPROCESSORS to 4."
|
||||
NPROCESSORS=4
|
||||
fi
|
||||
3
ci/perpare_pulp3_netrc.sh
Normal file
3
ci/perpare_pulp3_netrc.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env sh
|
||||
set -evx
|
||||
echo "machine ${PULP3_SERVER_URL}\nlogin ${PULP3_SERVER_LOGIN}\npassword ${PULP3_SERVER_PASSWORD}\n" > ~/.netrc
|
||||
68
ci/travis.sh
Normal file
68
ci/travis.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env sh
|
||||
set -evx
|
||||
|
||||
chmod +x ci/get-nprocessors.sh
|
||||
. ci/get-nprocessors.sh
|
||||
|
||||
# if possible, ask for the precise number of processors,
|
||||
# otherwise take 2 processors as reasonable default; see
|
||||
# https://docs.travis-ci.com/user/speeding-up-the-build/#Makefile-optimization
|
||||
if [ -x /usr/bin/getconf ]; then
|
||||
NPROCESSORS=$(/usr/bin/getconf _NPROCESSORS_ONLN)
|
||||
else
|
||||
NPROCESSORS=2
|
||||
fi
|
||||
|
||||
# as of 2017-09-04 Travis CI reports 32 processors, but GCC build
|
||||
# crashes if parallelized too much (maybe memory consumption problem),
|
||||
# so limit to 4 processors for the time being.
|
||||
if [ $NPROCESSORS -gt 4 ] ; then
|
||||
echo "$0:Note: Limiting processors to use by make from $NPROCESSORS to 4."
|
||||
NPROCESSORS=4
|
||||
fi
|
||||
|
||||
# Tell make to use the processors. No preceding '-' required.
|
||||
MAKEFLAGS="j${NPROCESSORS}"
|
||||
export MAKEFLAGS
|
||||
|
||||
env | sort
|
||||
|
||||
# Set default values to OFF for these variables if not specified.
|
||||
: "${NO_EXCEPTION:=OFF}"
|
||||
: "${NO_RTTI:=OFF}"
|
||||
: "${COMPILER_IS_GNUCXX:=OFF}"
|
||||
|
||||
# Install dependency from YUM
|
||||
if [ -n "${INSTALL_DEPENDENCY_FRAMEWORK}" ]; then
|
||||
yum install -y $INSTALL_DEPENDENCY_FRAMEWORK
|
||||
source /etc/profile.d/framework.sh
|
||||
fi
|
||||
|
||||
if [ -n "${INSTALL_DEPENDENCY_PLATFORM}" ]; then
|
||||
yum install -y $INSTALL_DEPENDENCY_PLATFORM
|
||||
fi
|
||||
|
||||
if [ $ASAN_OPTION ] && [ -f "/opt/rh/devtoolset-7/enable" ] ;then
|
||||
source /opt/rh/devtoolset-7/enable
|
||||
fi
|
||||
|
||||
mkdir build || true
|
||||
cd build
|
||||
|
||||
cmake3 -DCMAKE_CXX_FLAGS=$CXX_FLAGS \
|
||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
|
||||
-DASAN_OPTION=$ASAN_OPTION \
|
||||
-DVERSION_DAILY_BUILD=$TESTING_VERSION_BUILD \
|
||||
..
|
||||
|
||||
make
|
||||
|
||||
if [ -n "${PACKAGE}" ]; then
|
||||
make package
|
||||
fi
|
||||
|
||||
if [ -n "${UPLOAD_RPM}" ]; then
|
||||
cp ~/rpm_upload_tools.py ./
|
||||
python3 rpm_upload_tools.py ${PULP3_REPO_NAME} ${PULP3_DIST_NAME} *.rpm
|
||||
fi
|
||||
5
cmake/.gitignore
vendored
Normal file
5
cmake/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
build
|
||||
__view
|
||||
*.o
|
||||
*.so
|
||||
*.a
|
||||
56
cmake/Package.cmake
Normal file
56
cmake/Package.cmake
Normal file
@@ -0,0 +1,56 @@
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(MY_RPM_NAME_PREFIX "${lib_name}-debug")
|
||||
else()
|
||||
set(MY_RPM_NAME_PREFIX "${lib_name}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Package: ${MY_RPM_NAME_PREFIX}")
|
||||
|
||||
set(CPACK_PACKAGE_VECDOR "MESA")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}.${VERSION_BUILD}")
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
set(CPACK_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_BUILD}")
|
||||
|
||||
execute_process(COMMAND sh changelog.sh ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/cmake)
|
||||
SET(CPACK_RPM_CHANGELOG_FILE ${CMAKE_BINARY_DIR}/changelog.txt)
|
||||
|
||||
# RPM Build
|
||||
set(CPACK_GENERATOR "RPM")
|
||||
set(CPACK_RPM_AUTO_GENERATED_FILE_NAME ON)
|
||||
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
|
||||
set(CPACK_RPM_PACKAGE_VENDOR "MESA")
|
||||
set(CPACK_RPM_PACKAGE_AUTOREQPROV "yes")
|
||||
set(CPACK_RPM_PACKAGE_RELEASE_DIST "on")
|
||||
set(CPACK_RPM_DEBUGINFO_PACKAGE "on")
|
||||
|
||||
set(CPACK_RPM_COMPONENT_INSTALL ON)
|
||||
set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
|
||||
set(CPACK_COMPONENTS_GROUPING ONE_PER_GROUP)
|
||||
set(CPACK_COMPONENT_HEADER_DISPLAY_NAME "develop")
|
||||
|
||||
set(CPACK_COMPONENT_LIBRARIES_REQUIRED TRUE)
|
||||
set(CPACK_RPM_LIBRARIES_PACKAGE_NAME ${MY_RPM_NAME_PREFIX})
|
||||
set(CPACK_COMPONENT_LIBRARIES_GROUP "LIBRARIES")
|
||||
set(CPACK_COMPONENT_PROFILE_GROUP "LIBRARIES")
|
||||
|
||||
set(CPACK_COMPONENT_HEADER_REQUIRED TRUE)
|
||||
set(CPACK_RPM_HEADER_PACKAGE_NAME "${MY_RPM_NAME_PREFIX}-devel")
|
||||
set(CPACK_COMPONENT_HEADER_GROUP "HEADER")
|
||||
|
||||
set(CPACK_RPM_HEADER_PACKAGE_REQUIRES_PRE ${CPACK_RPM_LIBRARIES_PACKAGE_NAME})
|
||||
set(CPACK_RPM_HEADER_PACKAGE_CONFLICTS ${CPACK_RPM_HEADER_PACKAGE_NAME})
|
||||
|
||||
set(CPACK_COMPONENTS_ALL LIBRARIES HEADER PROFILE)
|
||||
|
||||
SET(CPACK_RPM_LIBRARIES_PRE_INSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/cmake/preInstall.sh")
|
||||
SET(CPACK_RPM_LIBRARIES_PRE_UNINSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/cmake/preUninstall.sh")
|
||||
|
||||
set(CPACK_BUILD_SOURCE_DIRS "${CMAKE_SOURCE_DIR}")
|
||||
|
||||
# Must uninstall the debug package before install release package
|
||||
set(CPACK_RPM_PACKAGE_CONFLICTS ${MY_RPM_NAME_PREFIX})
|
||||
|
||||
# set(CPACK_STRIP_FILES TRUE)
|
||||
include(CPack)
|
||||
54
cmake/Version.cmake
Normal file
54
cmake/Version.cmake
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
# Using autorevision.sh to generate version information
|
||||
|
||||
set(__SOURCE_AUTORESIVISION ${CMAKE_SOURCE_DIR}/autorevision.sh)
|
||||
set(__AUTORESIVISION ${CMAKE_BINARY_DIR}/autorevision.sh)
|
||||
set(__VERSION_CACHE ${CMAKE_BINARY_DIR}/version.txt)
|
||||
set(__VERSION_CONFIG ${CMAKE_BINARY_DIR}/version.cmake)
|
||||
|
||||
file(COPY ${__SOURCE_AUTORESIVISION} DESTINATION ${CMAKE_BINARY_DIR}
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
|
||||
WORLD_READ WORLD_EXECUTE)
|
||||
|
||||
# execute autorevision.sh to generate version information
|
||||
execute_process(COMMAND ${__AUTORESIVISION} -t cmake -o ${__VERSION_CACHE}
|
||||
OUTPUT_FILE ${__VERSION_CONFIG} ERROR_QUIET)
|
||||
include(${__VERSION_CONFIG})
|
||||
|
||||
# extract major, minor, patch version from git tag
|
||||
string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VCS_TAG}")
|
||||
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${VCS_TAG}")
|
||||
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${VCS_TAG}")
|
||||
string(REGEX REPLACE "[T\\:\\+\\-]" "" VERSION_DATE "${VCS_DATE}")
|
||||
|
||||
if(VERSION_DAILY_BUILD)
|
||||
set(VERSION_PATCH ${VERSION_PATCH}.${VERSION_DATE})
|
||||
endif()
|
||||
|
||||
if(NOT VERSION_MAJOR)
|
||||
set(VERSION_MAJOR 1)
|
||||
endif()
|
||||
|
||||
if(NOT VERSION_MINOR)
|
||||
set(VERSION_MINOR 0)
|
||||
endif()
|
||||
|
||||
if(NOT VERSION_PATCH)
|
||||
set(VERSION_PATCH 0)
|
||||
endif()
|
||||
|
||||
set(VERSION "${VERSION_MAJOR}_${VERSION_MINOR}_${VERSION_PATCH}")
|
||||
set(VERSION_BUILD "${VCS_SHORT_HASH}")
|
||||
|
||||
# print information
|
||||
message(STATUS "Version: ${VERSION}-${VERSION_BUILD}")
|
||||
|
||||
option(DEFINE_GIT_VERSION "Set DEFINE_GIT_VERSION to TRUE or FALSE" TRUE)
|
||||
|
||||
if(DEFINE_GIT_VERSION)
|
||||
set(GIT_VERSION
|
||||
"${VERSION}-${CMAKE_BUILD_TYPE}-${VERSION_BUILD}-${VCS_BRANCH}-${VCS_TAG}-${VCS_DATE}")
|
||||
string(REGEX REPLACE "[-:+/\\.]" "_" GIT_VERSION ${GIT_VERSION})
|
||||
|
||||
add_definitions(-DGIT_VERSION=${GIT_VERSION})
|
||||
endif()
|
||||
4
cmake/changelog.sh
Normal file
4
cmake/changelog.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
work_path=$1
|
||||
branch=`git status | grep branch | awk '{print $NF}'`
|
||||
git log --branches=$branch --no-merges --date=local --show-signature --pretty="* %ad %an %ae %nhash: %H%ncommit:%n%B" | awk -F"-" '{print "- "$0}' | sed 's/- \*/\*/g' | sed 's/- $//g' | sed 's/-/ -/g' | sed 's/[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}//g' > $work_path/changelog.txt
|
||||
14
cmake/preInstall.sh
Normal file
14
cmake/preInstall.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
INSTALL_PREFIX=${RPM_INSTALL_PREFIX}/sapp/
|
||||
|
||||
mkdir ${RPM_INSTALL_PREFIX}/sapp/stellar_plugin/ -p
|
||||
touch ${RPM_INSTALL_PREFIX}/sapp/stellar_plugin/spec.toml
|
||||
|
||||
if [[ -z `grep -rn 'dns_decoder' ${RPM_INSTALL_PREFIX}/sapp/stellar_plugin/spec.toml` ]];then
|
||||
echo -e "" >> ${RPM_INSTALL_PREFIX}/sapp/stellar_plugin/spec.toml
|
||||
echo -e "[[plugin]]" >> ${RPM_INSTALL_PREFIX}/sapp/stellar_plugin/spec.toml
|
||||
echo -e "path=\"./stellar_plugin/dns_decoder.so\"" >> ${RPM_INSTALL_PREFIX}/sapp/stellar_plugin//spec.toml
|
||||
echo -e "init=\"dns_decoder_init\"" >> ${RPM_INSTALL_PREFIX}/sapp/stellar_plugin/spec.toml
|
||||
echo -e "exit=\"dns_decoder_exit\"" >> ${RPM_INSTALL_PREFIX}/sapp/stellar_plugin/spec.toml
|
||||
fi
|
||||
|
||||
13
cmake/preUninstall.sh
Normal file
13
cmake/preUninstall.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
if [ $1 == 0 ]; then
|
||||
DST=${RPM_INSTALL_PREFIX}
|
||||
|
||||
mkdir -p ${DST}/plug/protocol/
|
||||
touch ${DST}/plug/conflist.inf
|
||||
|
||||
mkdir -p ${DST}/etc/
|
||||
touch ${DST}/etc/entrylist.conf
|
||||
|
||||
sed -i '/dns.inf/d' ${DST}/plug/conflist.inf
|
||||
sed -i '/DNS/d' ${DST}/etc/entrylist.conf
|
||||
fi
|
||||
3
deps/toml/CMakeLists.txt
vendored
Normal file
3
deps/toml/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
set(CMAKE_C_FLAGS "-std=c99")
|
||||
add_definitions(-fPIC)
|
||||
add_library(toml STATIC toml.c)
|
||||
2379
deps/toml/toml.c
vendored
Normal file
2379
deps/toml/toml.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
175
deps/toml/toml.h
vendored
Normal file
175
deps/toml/toml.h
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) CK Tan
|
||||
https://github.com/cktan/tomlc99
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef TOML_H
|
||||
#define TOML_H
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable: 4996)
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define TOML_EXTERN extern "C"
|
||||
#else
|
||||
#define TOML_EXTERN extern
|
||||
#endif
|
||||
|
||||
typedef struct toml_timestamp_t toml_timestamp_t;
|
||||
typedef struct toml_table_t toml_table_t;
|
||||
typedef struct toml_array_t toml_array_t;
|
||||
typedef struct toml_datum_t toml_datum_t;
|
||||
|
||||
/* Parse a file. Return a table on success, or 0 otherwise.
|
||||
* Caller must toml_free(the-return-value) after use.
|
||||
*/
|
||||
TOML_EXTERN toml_table_t *toml_parse_file(FILE *fp, char *errbuf, int errbufsz);
|
||||
|
||||
/* Parse a string containing the full config.
|
||||
* Return a table on success, or 0 otherwise.
|
||||
* Caller must toml_free(the-return-value) after use.
|
||||
*/
|
||||
TOML_EXTERN toml_table_t *toml_parse(char *conf, /* NUL terminated, please. */
|
||||
char *errbuf, int errbufsz);
|
||||
|
||||
/* Free the table returned by toml_parse() or toml_parse_file(). Once
|
||||
* this function is called, any handles accessed through this tab
|
||||
* directly or indirectly are no longer valid.
|
||||
*/
|
||||
TOML_EXTERN void toml_free(toml_table_t *tab);
|
||||
|
||||
/* Timestamp types. The year, month, day, hour, minute, second, z
|
||||
* fields may be NULL if they are not relevant. e.g. In a DATE
|
||||
* type, the hour, minute, second and z fields will be NULLs.
|
||||
*/
|
||||
struct toml_timestamp_t {
|
||||
struct { /* internal. do not use. */
|
||||
int year, month, day;
|
||||
int hour, minute, second, millisec;
|
||||
char z[10];
|
||||
} __buffer;
|
||||
int *year, *month, *day;
|
||||
int *hour, *minute, *second, *millisec;
|
||||
char *z;
|
||||
};
|
||||
|
||||
/*-----------------------------------------------------------------
|
||||
* Enhanced access methods
|
||||
*/
|
||||
struct toml_datum_t {
|
||||
int ok;
|
||||
union {
|
||||
toml_timestamp_t *ts; /* ts must be freed after use */
|
||||
char *s; /* string value. s must be freed after use */
|
||||
int b; /* bool value */
|
||||
int64_t i; /* int value */
|
||||
double d; /* double value */
|
||||
} u;
|
||||
};
|
||||
|
||||
/* on arrays: */
|
||||
/* ... retrieve size of array. */
|
||||
TOML_EXTERN int toml_array_nelem(const toml_array_t *arr);
|
||||
/* ... retrieve values using index. */
|
||||
TOML_EXTERN toml_datum_t toml_string_at(const toml_array_t *arr, int idx);
|
||||
TOML_EXTERN toml_datum_t toml_bool_at(const toml_array_t *arr, int idx);
|
||||
TOML_EXTERN toml_datum_t toml_int_at(const toml_array_t *arr, int idx);
|
||||
TOML_EXTERN toml_datum_t toml_double_at(const toml_array_t *arr, int idx);
|
||||
TOML_EXTERN toml_datum_t toml_timestamp_at(const toml_array_t *arr, int idx);
|
||||
/* ... retrieve array or table using index. */
|
||||
TOML_EXTERN toml_array_t *toml_array_at(const toml_array_t *arr, int idx);
|
||||
TOML_EXTERN toml_table_t *toml_table_at(const toml_array_t *arr, int idx);
|
||||
|
||||
/* on tables: */
|
||||
/* ... retrieve the key in table at keyidx. Return 0 if out of range. */
|
||||
TOML_EXTERN const char *toml_key_in(const toml_table_t *tab, int keyidx);
|
||||
/* ... returns 1 if key exists in tab, 0 otherwise */
|
||||
TOML_EXTERN int toml_key_exists(const toml_table_t *tab, const char *key);
|
||||
/* ... retrieve values using key. */
|
||||
TOML_EXTERN toml_datum_t toml_string_in(const toml_table_t *arr,
|
||||
const char *key);
|
||||
TOML_EXTERN toml_datum_t toml_bool_in(const toml_table_t *arr, const char *key);
|
||||
TOML_EXTERN toml_datum_t toml_int_in(const toml_table_t *arr, const char *key);
|
||||
TOML_EXTERN toml_datum_t toml_double_in(const toml_table_t *arr,
|
||||
const char *key);
|
||||
TOML_EXTERN toml_datum_t toml_timestamp_in(const toml_table_t *arr,
|
||||
const char *key);
|
||||
/* .. retrieve array or table using key. */
|
||||
TOML_EXTERN toml_array_t *toml_array_in(const toml_table_t *tab,
|
||||
const char *key);
|
||||
TOML_EXTERN toml_table_t *toml_table_in(const toml_table_t *tab,
|
||||
const char *key);
|
||||
|
||||
/*-----------------------------------------------------------------
|
||||
* lesser used
|
||||
*/
|
||||
/* Return the array kind: 't'able, 'a'rray, 'v'alue, 'm'ixed */
|
||||
TOML_EXTERN char toml_array_kind(const toml_array_t *arr);
|
||||
|
||||
/* For array kind 'v'alue, return the type of values
|
||||
i:int, d:double, b:bool, s:string, t:time, D:date, T:timestamp, 'm'ixed
|
||||
0 if unknown
|
||||
*/
|
||||
TOML_EXTERN char toml_array_type(const toml_array_t *arr);
|
||||
|
||||
/* Return the key of an array */
|
||||
TOML_EXTERN const char *toml_array_key(const toml_array_t *arr);
|
||||
|
||||
/* Return the number of key-values in a table */
|
||||
TOML_EXTERN int toml_table_nkval(const toml_table_t *tab);
|
||||
|
||||
/* Return the number of arrays in a table */
|
||||
TOML_EXTERN int toml_table_narr(const toml_table_t *tab);
|
||||
|
||||
/* Return the number of sub-tables in a table */
|
||||
TOML_EXTERN int toml_table_ntab(const toml_table_t *tab);
|
||||
|
||||
/* Return the key of a table*/
|
||||
TOML_EXTERN const char *toml_table_key(const toml_table_t *tab);
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
* misc
|
||||
*/
|
||||
TOML_EXTERN int toml_utf8_to_ucs(const char *orig, int len, int64_t *ret);
|
||||
TOML_EXTERN int toml_ucs_to_utf8(int64_t code, char buf[6]);
|
||||
TOML_EXTERN void toml_set_memutil(void *(*xxmalloc)(size_t),
|
||||
void (*xxfree)(void *));
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
* deprecated
|
||||
*/
|
||||
/* A raw value, must be processed by toml_rto* before using. */
|
||||
typedef const char *toml_raw_t;
|
||||
TOML_EXTERN toml_raw_t toml_raw_in(const toml_table_t *tab, const char *key);
|
||||
TOML_EXTERN toml_raw_t toml_raw_at(const toml_array_t *arr, int idx);
|
||||
TOML_EXTERN int toml_rtos(toml_raw_t s, char **ret);
|
||||
TOML_EXTERN int toml_rtob(toml_raw_t s, int *ret);
|
||||
TOML_EXTERN int toml_rtoi(toml_raw_t s, int64_t *ret);
|
||||
TOML_EXTERN int toml_rtod(toml_raw_t s, double *ret);
|
||||
TOML_EXTERN int toml_rtod_ex(toml_raw_t s, double *ret, char *buf, int buflen);
|
||||
TOML_EXTERN int toml_rtots(toml_raw_t s, toml_timestamp_t *ret);
|
||||
|
||||
#endif /* TOML_H */
|
||||
1150
deps/uthash/uthash.h
vendored
Normal file
1150
deps/uthash/uthash.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1073
deps/uthash/utlist.h
vendored
Normal file
1073
deps/uthash/utlist.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
288
include/dns_decoder.h
Normal file
288
include/dns_decoder.h
Normal file
@@ -0,0 +1,288 @@
|
||||
/*
|
||||
**********************************************************************************************
|
||||
* File: dns_decoder.h
|
||||
* Description: dns decoder api
|
||||
* Authors: Liu XueLi <liuxueli@geedgenetworks.com>
|
||||
* Date: 2024-02-07
|
||||
* Copyright: (c) Since 2022 Geedge Networks, Ltd. All rights reserved.
|
||||
***********************************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef _DNS_DECODER_H_
|
||||
#define _DNS_DECODER_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <linux/limits.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define DNS_MESSAGE_TOPIC "TOPIC_DNS"
|
||||
|
||||
#define DNS_NAME_MAX (NAME_MAX + 1)
|
||||
#define HINFO_NAME_MAX (40 + 1) /* https://www.ietf.org/rfc/rfc1010.txt */
|
||||
|
||||
#define DNS_CLASS_UNKNOWN 0
|
||||
#define DNS_CLASS_IN 1
|
||||
#define DNS_CLASS_CS 2
|
||||
#define DNS_CLASS_CH 3
|
||||
#define DNS_CLASS_HS 4
|
||||
#define DNS_CLASS_ANY 255
|
||||
|
||||
/* RR(resource record) type, defined in https://www.ietf.org/rfc/rfc1035.txt */
|
||||
enum dns_rr_type
|
||||
{
|
||||
DNS_RR_TYPE_A = 1,
|
||||
DNS_RR_TYPE_NS,
|
||||
DNS_RR_TYPE_MD, /* Obsolete - use MX, rfc973 */
|
||||
DNS_RR_TYPE_MF, /* Obsolete - use MX, rfc973 */
|
||||
DNS_RR_TYPE_CNAME,
|
||||
DNS_RR_TYPE_SOA,
|
||||
DNS_RR_TYPE_MB, /* EXPERIMENTAL, rfc883,rfc2505 */
|
||||
DNS_RR_TYPE_MG, /* EXPERIMENTAL, rfc883,rfc2505 */
|
||||
DNS_RR_TYPE_MR, /* EXPERIMENTAL, rfc883 */
|
||||
DNS_RR_TYPE_NULL, /* EXPERIMENTAL, rfc1035 */
|
||||
DNS_RR_TYPE_WKS, /* Not to be relied upon, rfc1123 */
|
||||
DNS_RR_TYPE_PTR,
|
||||
DNS_RR_TYPE_HINFO,
|
||||
DNS_RR_TYPE_MINFO,
|
||||
DNS_RR_TYPE_MX,
|
||||
DNS_RR_TYPE_TXT,
|
||||
DNS_RR_TYPE_RP,
|
||||
DNS_RR_TYPE_ISDN = 20,
|
||||
DNS_RR_TYPE_AAAA = 28, /* dns_ipv6 */
|
||||
DNS_RR_TYPE_SRV = 33,
|
||||
DNS_RR_TYPE_DNAME = 39,
|
||||
DNS_RR_TYPE_OPT = 41,
|
||||
DNS_RR_TYPE_DS = 43,
|
||||
DNS_RR_TYPE_RRSIG = 46,
|
||||
DNS_RR_TYPE_NSEC,
|
||||
DNS_RR_TYPE_DNSKEY,
|
||||
DNS_RR_TYPE_NSEC3 = 50,
|
||||
DNS_RR_TYPE_NSEC3PARAM,
|
||||
DNS_RR_TYPE_HTTPS = 65,
|
||||
DNS_RR_TYPE_AXFR = 252,
|
||||
DNS_RR_TYPE_MAILB,
|
||||
DNS_RR_TYPE_MAILA, /* Obsolete - see MX */
|
||||
DNS_RR_TYPE_ANY,
|
||||
DNS_RR_TYPE_DLV = 32769, /* DSNSEC Lokkaside Validation */
|
||||
DNS_RR_TYPE_UNKNOWN = 65534
|
||||
};
|
||||
|
||||
struct dstring
|
||||
{
|
||||
size_t value_sz;
|
||||
uint8_t value[DNS_NAME_MAX];
|
||||
};
|
||||
|
||||
struct rdata_hinfo
|
||||
{
|
||||
struct dstring os;
|
||||
struct dstring cpu;
|
||||
};
|
||||
|
||||
struct rdata_minfo
|
||||
{
|
||||
struct dstring rmailbx;
|
||||
struct dstring emailbx;
|
||||
};
|
||||
|
||||
struct rdata_mx
|
||||
{
|
||||
uint16_t preference;
|
||||
struct dstring exchange;
|
||||
};
|
||||
|
||||
struct rdata_soa
|
||||
{
|
||||
struct dstring mname;
|
||||
struct dstring rname;
|
||||
uint32_t serial;
|
||||
uint32_t refresh;
|
||||
uint32_t retry;
|
||||
uint32_t expire;
|
||||
uint32_t minimum;
|
||||
};
|
||||
|
||||
struct rdata_rp
|
||||
{
|
||||
struct dstring txt_rr;
|
||||
struct dstring mailbox;
|
||||
};
|
||||
|
||||
struct rdata_wks
|
||||
{
|
||||
uint8_t protocol;
|
||||
uint32_t addr;
|
||||
uint32_t size;
|
||||
uint8_t *bitmap;
|
||||
};
|
||||
|
||||
struct rdata_srv
|
||||
{
|
||||
uint16_t priority;
|
||||
uint16_t weight;
|
||||
uint16_t port;
|
||||
struct dstring target;
|
||||
};
|
||||
|
||||
struct rdata_ds
|
||||
{
|
||||
uint16_t key_tag;
|
||||
uint8_t algo;
|
||||
uint8_t digest_type;
|
||||
uint32_t digest_len;
|
||||
uint8_t *digest;
|
||||
};
|
||||
|
||||
struct rdata_rrsig
|
||||
{
|
||||
uint16_t type_covered;
|
||||
uint8_t algo;
|
||||
uint8_t labels;
|
||||
uint32_t original_ttl;
|
||||
uint32_t sig_expiration;
|
||||
uint32_t sig_inception;
|
||||
uint16_t key_tag;
|
||||
uint32_t signature_len;
|
||||
uint8_t *signature;
|
||||
struct dstring signer_name;
|
||||
};
|
||||
|
||||
struct rdata_nsec
|
||||
{
|
||||
uint16_t maps_len;
|
||||
struct dstring next_domain;
|
||||
struct dstring type_bit_maps;
|
||||
};
|
||||
|
||||
struct rdata_dnskey
|
||||
{
|
||||
uint16_t flags;
|
||||
uint8_t protocol;
|
||||
uint8_t algo;
|
||||
uint32_t public_key_len;
|
||||
uint8_t *public_key;
|
||||
};
|
||||
|
||||
struct rdata_nsec3
|
||||
{
|
||||
uint8_t hash_algo;
|
||||
uint8_t flags;
|
||||
uint8_t salt_len;
|
||||
uint8_t hash_len;
|
||||
uint16_t iteration;
|
||||
uint16_t maps_len;
|
||||
uint8_t *salt_value;
|
||||
uint8_t *next_hash_owner;
|
||||
struct dstring type_bit_maps;
|
||||
};
|
||||
|
||||
struct rdata_nsec3param
|
||||
{
|
||||
uint8_t hash_algo;
|
||||
uint8_t flags;
|
||||
uint8_t salt_len;
|
||||
uint16_t iteration;
|
||||
uint8_t *salt_value;
|
||||
};
|
||||
|
||||
/* rr is short for resource record */
|
||||
struct dns_resource_record
|
||||
{
|
||||
struct dstring qname;
|
||||
enum dns_rr_type type;
|
||||
uint16_t rr_class;
|
||||
uint32_t ttl; /* 1byte: extended RCODE; 1byte: version; 2bytes: Z(upper bit) if type is OPT */
|
||||
uint16_t rdlength;
|
||||
union
|
||||
{
|
||||
|
||||
struct dstring cname;
|
||||
struct dstring mb;
|
||||
struct dstring md;
|
||||
struct dstring mf;
|
||||
struct dstring mg;
|
||||
struct dstring mr;
|
||||
struct dstring ns;
|
||||
struct dstring ptr;
|
||||
struct dstring a;
|
||||
struct dstring aaaa;
|
||||
struct dstring dname;
|
||||
struct dstring isdn;
|
||||
struct dstring unknown;
|
||||
|
||||
struct dstring txt;
|
||||
struct dstring null;
|
||||
|
||||
struct rdata_hinfo hinfo;
|
||||
struct rdata_minfo minfo;
|
||||
struct rdata_mx mx;
|
||||
struct rdata_soa soa;
|
||||
struct rdata_rp rp;
|
||||
struct rdata_wks wks;
|
||||
struct rdata_srv srv;
|
||||
struct rdata_ds ds;
|
||||
struct rdata_rrsig rrsig;
|
||||
struct rdata_nsec nsec;
|
||||
struct rdata_dnskey dnskey;
|
||||
struct rdata_nsec3 nsec3;
|
||||
struct rdata_nsec3param nsec3param;
|
||||
struct dstring string;
|
||||
} rdata;
|
||||
};
|
||||
|
||||
struct dns_message;
|
||||
|
||||
|
||||
/*.
|
||||
First call DNS_MESSAGE_TRANSACTION_BEGIN to create the transaction,
|
||||
then publish the transaction's DNS_MESSAGE_QUERY/DNS_MESSAGE_RESPONSE,
|
||||
and finally call DNS_MESSAGE_TRANSACTION_END to release the transaction.
|
||||
*/
|
||||
enum dns_message_type
|
||||
{
|
||||
DNS_MESSAGE_QUERY=1,
|
||||
DNS_MESSAGE_RESPONSE,
|
||||
DNS_MESSAGE_TRANSACTION_BEGIN,
|
||||
DNS_MESSAGE_TRANSACTION_END,
|
||||
DNS_MESSAGE_MAX
|
||||
};
|
||||
|
||||
enum dns_message_type dns_message_type_get(struct dns_message *msg);
|
||||
|
||||
struct dns_flag
|
||||
{
|
||||
uint8_t qr:1;
|
||||
uint8_t opcode:4;
|
||||
uint8_t aa:1;
|
||||
uint8_t tc:1;
|
||||
uint8_t rd:1;
|
||||
uint8_t ra:1;
|
||||
uint8_t z:3;
|
||||
uint8_t rcode:4;
|
||||
};
|
||||
|
||||
struct dns_query_question
|
||||
{
|
||||
enum dns_rr_type qtype;
|
||||
uint16_t qclass;
|
||||
size_t qname_sz;
|
||||
uint8_t qname[DNS_NAME_MAX];
|
||||
};
|
||||
|
||||
int32_t dns_message_header_id_get(struct dns_message *msg);
|
||||
struct dns_flag *dns_message_header_flag_get0(struct dns_message *msg);
|
||||
void dns_message_question_get0(struct dns_message *msg, struct dns_query_question **question, uint16_t *n_question);
|
||||
void dns_message_answer_resource_record_get0(struct dns_message *msg, struct dns_resource_record **answer_rr, uint16_t *n_answer_rr);
|
||||
void dns_message_authority_resource_record_get0(struct dns_message *msg, struct dns_resource_record **authority_rr, uint16_t *n_authority_rr);
|
||||
void dns_message_additional_resource_record_get0(struct dns_message *msg, struct dns_resource_record **additional_rr, uint16_t *n_additional_rr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
15
src/CMakeLists.txt
Normal file
15
src/CMakeLists.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
add_definitions(-fPIC)
|
||||
|
||||
include_directories(/opt/MESA/include/)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/deps/)
|
||||
|
||||
aux_source_directory(${PROJECT_SOURCE_DIR}/deps/toml DEPS_SRC)
|
||||
|
||||
set(DNS_DECODER_SRC ${DEPS_SRC} dns_decoder.cpp)
|
||||
|
||||
add_library(dns_decoder SHARED ${DNS_DECODER_SRC})
|
||||
set_target_properties(dns_decoder PROPERTIES LINK_FLAGS "-Wl,--version-script=${PROJECT_SOURCE_DIR}/src/version.map")
|
||||
target_link_libraries(dns_decoder fieldstat4)
|
||||
set_target_properties(dns_decoder PROPERTIES PREFIX "")
|
||||
|
||||
install(TARGETS dns_decoder LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/sapp/stellar_plugin/ COMPONENT LIBRARIES)
|
||||
1936
src/dns_decoder.cpp
Normal file
1936
src/dns_decoder.cpp
Normal file
File diff suppressed because it is too large
Load Diff
16
src/version.map
Normal file
16
src/version.map
Normal file
@@ -0,0 +1,16 @@
|
||||
VERS_2.4{
|
||||
global:
|
||||
extern "C++" {
|
||||
*dns_decoder_init*;
|
||||
*dns_decoder_exit*;
|
||||
*dns_message_type_get*;
|
||||
*dns_message_header_id_get*;
|
||||
*dns_message_header_flag_get0*;
|
||||
*dns_message_question_get0*;
|
||||
*dns_message_answer_resource_record_get0*;
|
||||
*dns_message_authority_resource_record_get0*;
|
||||
*dns_message_additional_resource_record_get0*;
|
||||
*GIT*;
|
||||
};
|
||||
local: *;
|
||||
};
|
||||
70
test/CMakeLists.txt
Normal file
70
test/CMakeLists.txt
Normal file
@@ -0,0 +1,70 @@
|
||||
add_library(${PROJECT_NAME}_test_plug SHARED dns_decoder_test.cpp)
|
||||
add_dependencies(${PROJECT_NAME}_test_plug ${PROJECT_NAME})
|
||||
target_link_libraries(${PROJECT_NAME}_test_plug MESA_prof_load cjson)
|
||||
set_target_properties(${PROJECT_NAME}_test_plug PROPERTIES PREFIX "")
|
||||
|
||||
set(TEST_RUN_DIR ${CMAKE_CURRENT_BINARY_DIR}/sapp)
|
||||
set(TEST_MAIN ${TEST_RUN_DIR}/plugin_test_main)
|
||||
|
||||
# assemble test env
|
||||
add_test(NAME INSTALL_TEST_MAIN COMMAND sh -c "rpm -i ${CMAKE_CURRENT_SOURCE_DIR}/env/sapp-4.3.57.16ea514-1.el8.x86_64.rpm --prefix=${CMAKE_CURRENT_BINARY_DIR}/sapp --force --nodeps")
|
||||
add_test(NAME INSTALL_STELLAR COMMAND sh -c "rpm -i ${CMAKE_CURRENT_SOURCE_DIR}/env/stellar-on-sapp-2.1.0.0e6d541-1.el8.x86_64.rpm --prefix=${CMAKE_CURRENT_BINARY_DIR}/ --force --nodeps")
|
||||
|
||||
add_test(NAME COPY_TEST_MAIN COMMAND sh -c "cp ${TEST_RUN_DIR}/tools/plugin_test_main ${TEST_RUN_DIR}/plugin_test_main")
|
||||
add_test(NAME COPY_SPEC COMMAND sh -c "cp ${CMAKE_CURRENT_SOURCE_DIR}/env/spec.toml ${TEST_RUN_DIR}/stellar_plugin/spec.toml")
|
||||
add_test(NAME COPY_CONFLIST COMMAND sh -c "cp ${CMAKE_CURRENT_SOURCE_DIR}/env/conflist.inf ${TEST_RUN_DIR}/plug/conflist.inf")
|
||||
add_test(NAME COPY_INF COMMAND sh -c "cp ${CMAKE_CURRENT_SOURCE_DIR}/env/start_loader.inf ${TEST_RUN_DIR}/plug/stellar_on_sapp/start_loader.inf")
|
||||
|
||||
# update config files
|
||||
add_test(NAME UPDATE_SAPP_LOG COMMAND bash -c "sed -i 's/sapp_log.fatal/sapp_log.info/' ${TEST_RUN_DIR}/etc/sapp_log.conf")
|
||||
add_test(NAME UPDATE_SAPP_SYN_MODE COMMAND bash -c "sed -i 's/syn_mandatory=1/syn_mandatory=0/' ${TEST_RUN_DIR}/etc/sapp.toml")
|
||||
add_test(NAME UPDATE_SAPP_REORDER COMMAND bash -c "sed -i 's/reorder_pkt_max=32/reorder_pkt_max=5/' ${TEST_RUN_DIR}/etc/sapp.toml")
|
||||
|
||||
# update plugin to be tested
|
||||
add_test(NAME UPDATE_PLUG_SO COMMAND sh -c "cp ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}.so ${TEST_RUN_DIR}/stellar_plugin/${PROJECT_NAME}.so")
|
||||
add_test(NAME UPDATE_TEST_SO COMMAND sh -c "cp ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_test_plug.so ${TEST_RUN_DIR}/stellar_plugin/${PROJECT_NAME}_test_plug.so")
|
||||
add_test(NAME MKDIR_PLUG_CONF COMMAND sh -c "mkdir -p ${TEST_RUN_DIR}/etc/dns/")
|
||||
add_test(NAME UPDATE_PLUG_CONF COMMAND sh -c "cp ${PROJECT_SOURCE_DIR}/bin/${PROJECT_NAME}.toml ${TEST_RUN_DIR}/etc/dns/${PROJECT_NAME}.toml")
|
||||
|
||||
set_tests_properties(INSTALL_TEST_MAIN UPDATE_SAPP_LOG COPY_CONFLIST COPY_INF COPY_TEST_MAIN COPY_SPEC UPDATE_PLUG_SO UPDATE_TEST_SO MKDIR_PLUG_CONF UPDATE_PLUG_CONF PROPERTIES FIXTURES_SETUP TestFixture)
|
||||
|
||||
# run tests
|
||||
add_test(NAME DNS_QUERY COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/query/query_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/query/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_CNAME COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/cname/cname_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/cname/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_NSEC_RR COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/nsec/nsec_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/nsec/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_NSEC_10_1_RR COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/nsec_10_1/nsec_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/nsec_10_1/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_NSEC3_RR COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/nsec3/nsec3_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/nsec3/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_PTR COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/ptr/ptr_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/ptr/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_SRV COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/srv/srv_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/srv/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_TXT COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/txt/txt_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/txt/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_HTTPS COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/https/https_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/https/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_CERT1 COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/cernet1/cernet1_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/cernet1/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_CERT2 COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/cernet2/cernet2_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/cernet2/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_SEC COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/dnssec/dnssec_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/dnssec/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_TCP_MULTI_TRANSCATION COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/multi_transcation/multi_transcation_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/multi_transcation/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_TCP_MULTI_PKT_TRANS_2BYTES COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/multi_pkt_trans_2bytes/multi_pkt_trans_2bytes_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/multi_pkt_trans_2bytes/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_TCP_LOST_PKT COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/tcp_lost_pkt/lost_pkt_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/tcp_lost_pkt/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_MULTI_SESSION COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/multi_session/multi_session_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/multi_session/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_NS_NSEC3_RRSIG_A_OPT COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/ns_nsec3_rrsig_a_opt/ns_nsec3_rrsig_a_opt_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/ns_nsec3_rrsig_a_opt/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
add_test(NAME DNS_PORT5353 COMMAND ${TEST_MAIN} ${CMAKE_CURRENT_SOURCE_DIR}/case/port5353/port5353_result.json -f "find ${CMAKE_CURRENT_SOURCE_DIR}/case/port5353/ -name *.pcap|sort -V" WORKING_DIRECTORY ${TEST_RUN_DIR})
|
||||
|
||||
set_tests_properties(DNS_QUERY
|
||||
DNS_CNAME
|
||||
DNS_NSEC_RR
|
||||
DNS_NSEC_10_1_RR
|
||||
DNS_NSEC3_RR
|
||||
DNS_PTR
|
||||
DNS_SRV
|
||||
DNS_TXT
|
||||
DNS_HTTPS
|
||||
DNS_CERT1
|
||||
DNS_CERT2
|
||||
DNS_SEC
|
||||
DNS_TCP_MULTI_TRANSCATION
|
||||
DNS_TCP_MULTI_PKT_TRANS_2BYTES
|
||||
DNS_TCP_LOST_PKT
|
||||
DNS_MULTI_SESSION
|
||||
DNS_NS_NSEC3_RRSIG_A_OPT
|
||||
DNS_PORT5353
|
||||
PROPERTIES FIXTURES_REQUIRED TestFixture
|
||||
)
|
||||
BIN
test/case/cernet1/1-dns-response-15_04.pcap
Normal file
BIN
test/case/cernet1/1-dns-response-15_04.pcap
Normal file
Binary file not shown.
3823
test/case/cernet1/cernet1_result.json
Normal file
3823
test/case/cernet1/cernet1_result.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
test/case/cernet2/1-dns-response-15_05.pcap
Normal file
BIN
test/case/cernet2/1-dns-response-15_05.pcap
Normal file
Binary file not shown.
3409
test/case/cernet2/cernet2_result.json
Normal file
3409
test/case/cernet2/cernet2_result.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
test/case/cname/1-dns-query-type-CNAME.pcap
Normal file
BIN
test/case/cname/1-dns-query-type-CNAME.pcap
Normal file
Binary file not shown.
25
test/case/cname/cname_result.json
Normal file
25
test/case/cname/cname_result.json
Normal file
@@ -0,0 +1,25 @@
|
||||
[
|
||||
{
|
||||
"Tuple4": "36.250.92.233.46916>114.114.114.114.53",
|
||||
"dns_qname": "img.soulapp.cn",
|
||||
"dns_qtype": 5,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 1280,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 0,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_1"
|
||||
}
|
||||
]
|
||||
1
test/case/dns_decoder_empty_array.json
Normal file
1
test/case/dns_decoder_empty_array.json
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
BIN
test/case/dnssec/1-dnssec.pcap
Normal file
BIN
test/case/dnssec/1-dnssec.pcap
Normal file
Binary file not shown.
680
test/case/dnssec/dnssec_result.json
Normal file
680
test/case/dnssec/dnssec_result.json
Normal file
@@ -0,0 +1,680 @@
|
||||
[
|
||||
{
|
||||
"Tuple4": "172.16.1.199.54784>75.75.75.75.53",
|
||||
"dns_qname": "www.ietf.org",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_1"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.54784>75.75.75.75.53",
|
||||
"dns_qname": "www.ietf.org",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"answer": [
|
||||
{
|
||||
"name": "www.ietf.org",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 1240,
|
||||
"rdlength": 4,
|
||||
"a": "64.170.98.30"
|
||||
},
|
||||
{
|
||||
"name": "www.ietf.org",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 1240,
|
||||
"rdlength": 284,
|
||||
"type_covered": 1,
|
||||
"algo": 5,
|
||||
"labels": 3,
|
||||
"original_ttl": 1800,
|
||||
"sig_expiration": 1389392327,
|
||||
"sig_inception": 1357852847,
|
||||
"key_tag": 40452,
|
||||
"signer_name": "ietf.org",
|
||||
"signature_len": 256,
|
||||
"signature": "88303c6c99eb004cf78e0627c85466e7aedaefaaa5bf55740aac4e49dfe8f67be73741a564b695a039ae5e96886a8ca96c6c70cf080afcb63a095da4e9258ac227019a910d2f6ea1c328e41733c35bc917de26c586d7ec39bf2961eee7063df6e9a72da7fee21be0d1b8398f9e46018dafb00d893ad5da13b64a99839edf9f7892f7bb6334f082f42f649d102e0d8506f9d5716a56b34b062ba6f63dedd502d47daca43d20e14743c826c6038ea6a2e67818fccd31ec207fde3cab1ae753ca563e4de7416e5380b5641a85a0728da8c1f2c4941a9feab2782ceb30ba16b0f08a53b66c3716c8b1c532d0bca384e677ed7759cc85041df426878e828d014133e5"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4000,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_2"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.48709>75.75.75.75.53",
|
||||
"dns_qname": "ietf.org",
|
||||
"dns_qtype": 48,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_3"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.48709>75.75.75.75.53",
|
||||
"dns_qname": "ietf.org",
|
||||
"dns_qtype": 48,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"answer": [
|
||||
{
|
||||
"name": "ietf.org",
|
||||
"type": 48,
|
||||
"class": 1,
|
||||
"ttl": 1148,
|
||||
"rdlength": 264,
|
||||
"flags": 257,
|
||||
"protocol": 3,
|
||||
"algo": 5,
|
||||
"public_key_len": 260,
|
||||
"public_key": "03010001abe34351faa44f0557c2c63f4c1004554bd0433d0517eac73f69fec67ef00072ab21472dd65c1e838617b0a007938a60cbc63a0cacb98425a0f9706eaed6b395b2c1bbad6d7c86db894c5b2e238a394952c685ad2e44bd4bb8c9d9ae45cfd31a71179cdd574243bec1a213e1c2edae67168e863c3aab9dea50da25d8f570aaf69d7d4dae6311a3022edc3215b466d0266ce9ba4a4355969830c026f0ce6fcf8536bd10951132e00e843bae1b220f5dbb27c8151318cef01d35d778c26a36c545c32d52d1538c7e33ee35cfd99cc3717b20a5ee0b605b9e9c5400711051944ea86b290747bae53eaaa6c39f272042c9505a0c71bfc17512e06f24debab1659f1b"
|
||||
},
|
||||
{
|
||||
"name": "ietf.org",
|
||||
"type": 48,
|
||||
"class": 1,
|
||||
"ttl": 1148,
|
||||
"rdlength": 264,
|
||||
"flags": 256,
|
||||
"protocol": 3,
|
||||
"algo": 5,
|
||||
"public_key_len": 260,
|
||||
"public_key": "03010001d0c409a8c76938df4a8353639f167016a1d41c4f295207073e087cb8dfa8cbe2ba6e2580ab4a64b7bdec3809e7f350acd1061909abe9f2af523ebb71fad95288d9d9c1918b35618243aa67db1c69355736e5cb3394f0ed558e54871e79702eb87da63c888457a32125852c5ba76f98db09e17c0280d82ba00997868304896123041fb08d8650e46b591c114a5570024964e20ad75d1dcb9e39e4953e2e561fde1596e6e11df8b2b4d3d92eb39b8540874fa934b4d13aa612e81e75d653eeafa6c629cfa1a1330fd1f411715b93dd3c5216060a16936fd7155452286f4bafad5bdb3d51d76eb1794c2fc38e91572de16a7577bcd3bb2cce479e2a9a61c9416e19"
|
||||
},
|
||||
{
|
||||
"name": "ietf.org",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 1148,
|
||||
"rdlength": 284,
|
||||
"type_covered": 48,
|
||||
"algo": 5,
|
||||
"labels": 2,
|
||||
"original_ttl": 1800,
|
||||
"sig_expiration": 1389392263,
|
||||
"sig_inception": 1357852847,
|
||||
"key_tag": 45586,
|
||||
"signer_name": "ietf.org",
|
||||
"signature_len": 256,
|
||||
"signature": "16328fe13c5aef54d21a5bda003df90cc6f97df48098a11834522a81c2029ed1ec55b3cf26c673b0927574d0e880720e809b88ff67e9d0b51e0bd4720e89ed0d23e73194729e8e3a3fe2248d07738d908f74a381e699026cac3f9ac017d8d52fc728ef6f3c53a9931d80210df1c1d54c513079793dc88e07e5c3a85360fb0331bc92bb7ad476834048eba6d92fa0d0d7e2e70a914e0feef2322ec9e94d6baf73c19a583edd29e53746d65a39b0ddab110ff9b3ef110a9c30f4becef0010a08290ad8ef3668e3189de241e6b8dcf11efa17306b41d7bf85363aaaefee2f0ee374b52eb9a706e6a4c42c4bdfdde03c599f28314cc52d7f53e1a4696552218ba9c4"
|
||||
},
|
||||
{
|
||||
"name": "ietf.org",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 1148,
|
||||
"rdlength": 284,
|
||||
"type_covered": 48,
|
||||
"algo": 5,
|
||||
"labels": 2,
|
||||
"original_ttl": 1800,
|
||||
"sig_expiration": 1389392277,
|
||||
"sig_inception": 1357852847,
|
||||
"key_tag": 40452,
|
||||
"signer_name": "ietf.org",
|
||||
"signature_len": 256,
|
||||
"signature": "48e629526ded2e7441a4d24978bcf3c3b6b7f8f83abbe6f52cd2864412fc6e2f015b6fe05d0e5527927f445722283fedd52879a2987d5b180ecd8b4713f80a78f095be14a922b510d8c96e15e21d8f8ad8d76df89e13ab34d09cb9830aacc2dad4d76c19bff3d04df01030d4f620b94f0bed377b0d9aaf266efb5e94c96269a2d06bcb25ae1a99f317125bb726071da558c00bc31dcbf3ebe1a435e6235d60889f2dd4aa580035f19f18ceca222c9a59a8240f342849e4056097a71806c53ea7e01c56f7a4bca2ceed52d59e80d59ebfe111335fc9e17a6d7c0318eba946f055dbc79c62834689bed39eb09a93c46a71cfad840a8793b3af69316a929a360e6c"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4000,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_4"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.51634>75.75.75.75.53",
|
||||
"dns_qname": "ietf.org",
|
||||
"dns_qtype": 43,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_5"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.51634>75.75.75.75.53",
|
||||
"dns_qname": "ietf.org",
|
||||
"dns_qtype": 43,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"answer": [
|
||||
{
|
||||
"name": "ietf.org",
|
||||
"type": 43,
|
||||
"class": 1,
|
||||
"ttl": 291,
|
||||
"rdlength": 36,
|
||||
"key_tag": 45586,
|
||||
"algo": 5,
|
||||
"digest_type": 2,
|
||||
"digest_len": 32,
|
||||
"digest": "67fcd7e0b9e0366309f3b6f7476dff931d5226edc5348cd80fd82a081dfcf6ee"
|
||||
},
|
||||
{
|
||||
"name": "ietf.org",
|
||||
"type": 43,
|
||||
"class": 1,
|
||||
"ttl": 291,
|
||||
"rdlength": 24,
|
||||
"key_tag": 45586,
|
||||
"algo": 5,
|
||||
"digest_type": 1,
|
||||
"digest_len": 20,
|
||||
"digest": "d0fdf996d1af2ccdbdc942b02cb02d379629e20b"
|
||||
},
|
||||
{
|
||||
"name": "ietf.org",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 291,
|
||||
"rdlength": 151,
|
||||
"type_covered": 43,
|
||||
"algo": 7,
|
||||
"labels": 2,
|
||||
"original_ttl": 86400,
|
||||
"sig_expiration": 1360252164,
|
||||
"sig_inception": 1358434164,
|
||||
"key_tag": 41790,
|
||||
"signer_name": "org",
|
||||
"signature_len": 128,
|
||||
"signature": "0b34731d7fdb30dbbe61c61ea3504927558817a33dbfa94cde8fb5544286f8a2f35291223b465530c5aba539e1dbbcb1d8acc4568db5aa57c2ba8f4a71302c6974a6e66f77d3867f813f747dc1b6b6c5e5b72ae482e7bd195cec460048f85a30c30a24537eeced81d4d0d47fef1b112729b4d20b3d3f7b87a5d137a71b17c653"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4000,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_6"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.53497>75.75.75.75.53",
|
||||
"dns_qname": "org",
|
||||
"dns_qtype": 48,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_7"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.53497>75.75.75.75.53",
|
||||
"dns_qname": "org",
|
||||
"dns_qtype": 48,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"answer": [
|
||||
{
|
||||
"name": "org",
|
||||
"type": 48,
|
||||
"class": 1,
|
||||
"ttl": 291,
|
||||
"rdlength": 136,
|
||||
"flags": 256,
|
||||
"protocol": 3,
|
||||
"algo": 7,
|
||||
"public_key_len": 132,
|
||||
"public_key": "03010001c203bbb026b7951f39112b6b8f35432ecf270e83ca7d7d5296de3826b31d0ab8c0a0886f0dd3112ab2c04e78df6761f140a6e013bc5fec18a1a0ede74d03b8bb1fc4d04ed742fed4403d94fb2cc04311432a1bc29ebbbd42fb9f4864e3fcd1f85b93272a3a9617692a68a2e9af568c2df4db5b87b85f81eb637ed7e3dff9b83d"
|
||||
},
|
||||
{
|
||||
"name": "org",
|
||||
"type": 48,
|
||||
"class": 1,
|
||||
"ttl": 291,
|
||||
"rdlength": 264,
|
||||
"flags": 257,
|
||||
"protocol": 3,
|
||||
"algo": 7,
|
||||
"public_key_len": 260,
|
||||
"public_key": "030100018a587e3dda691cf3931590a8c765ed813163cd4d7584affaa6b2b990e876767d20c8746f031c61a5547733406d5789f2077a8ead6c47756f3ff491dfa9a61acb1b57851d9793910edaa264fd930cd0c7c449ca2935fe8d67f2b59793edddc06d2cc1282d2feee66b33a3367a826797a89debaac4526402da9f43aeb0e0f45ead5c2f420ffcc2effcbe04d36988e7673390d793b1e1666eeb6bd13b96d2f5de1da6c7b904814f1eea7a49942a178eb688060503b6162ce3c5bfb1d4c32eeecde7dae3086f9ba6297e73ca19f5fecd477aa6493a533f59bce91a94427544ae27eb1fc2a30ea2fedf0cd4745e400a4630b755e13d53d4fb04889736da010378f4f5"
|
||||
},
|
||||
{
|
||||
"name": "org",
|
||||
"type": 48,
|
||||
"class": 1,
|
||||
"ttl": 291,
|
||||
"rdlength": 264,
|
||||
"flags": 257,
|
||||
"protocol": 3,
|
||||
"algo": 7,
|
||||
"public_key_len": 260,
|
||||
"public_key": "0301000194e36c83b9908a71594b725dcf1abec2b21c8219f8b8c2d83bfc9da3be4f3e97d9fab30c2d5b76aec7959c2d91aa9390c55527ef2013d148ade189e1cf06d4675b8d081b3f53b26081bb3874dce21bf94f6365c96afa93a405cfdf10e33c052064c556fc01866acc0d8b0e4ed5da90ae90c07a2f035fbcdc1b14002c6589da7007485069c6c3eb1f88d91083cd8b93ce3eb826fd3ff57b17e80615dde6dc827e212f58c84767896325e5ac0a16c5dcf1716fffe7278be51556ba14717a39a74959c2bb191f4b8010e3ce4a1f6b6975b59c0a8a4b259b3ab70f2ade359ca531b3761fefdf17587cda5035c3c898597102e9f706d3913c0dabf2d8ba30da091075"
|
||||
},
|
||||
{
|
||||
"name": "org",
|
||||
"type": 48,
|
||||
"class": 1,
|
||||
"ttl": 291,
|
||||
"rdlength": 136,
|
||||
"flags": 256,
|
||||
"protocol": 3,
|
||||
"algo": 7,
|
||||
"public_key_len": 132,
|
||||
"public_key": "03010001aee525535ede9c367389e83e73d2b79c6c9fcabbdd1f16a20c742a2bbb687cf1c5fc49ab71d7b2cc445759eb8626b66eb5fbd5d4873644d216ef531071bf88cc856af1406545059984e41b6eba6d0cae2cf9baa46e9e7a603a0dc95237c383ec8882d298c32a28e33a8b8183582ad43fed0d7d3b5f1dd8e308b7da6b17bf3a9d"
|
||||
},
|
||||
{
|
||||
"name": "org",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 291,
|
||||
"rdlength": 279,
|
||||
"type_covered": 48,
|
||||
"algo": 7,
|
||||
"labels": 1,
|
||||
"original_ttl": 900,
|
||||
"sig_expiration": 1360252164,
|
||||
"sig_inception": 1358434164,
|
||||
"key_tag": 21366,
|
||||
"signer_name": "org",
|
||||
"signature_len": 256,
|
||||
"signature": "8177117681857bd566cbb18c9802de1ea18292e8cfa0f5dff4caa266c7e9fd07a65e1fc18eacef358c91232232c2dff53ffc97d45e38182f2319dca28fa9f177855cca7ae6f790df3e606b6b22b6a09db478d8b77096d34e6fc140a3bbd741f750a248a0b282e22bfbba123eb30587667fb24206bd8e5a7afe917a6c5b3c402ed2d04196b9ba5063ab7cc918408bf05325b7ec16161957d01514e64d5d8b2ee411cc79022daea67194fc0abe95a4886428477b401f3d1cba0545909293b5e888c0e8b4948ba12710c7d37ea48d7ba97a6729408cb5f1aedd5fbeb2d713c91042931836d2624a60749952c8ebee99d69e064d89bf9605b6ef9bed9a55723b5a87"
|
||||
},
|
||||
{
|
||||
"name": "org",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 291,
|
||||
"rdlength": 151,
|
||||
"type_covered": 48,
|
||||
"algo": 7,
|
||||
"labels": 1,
|
||||
"original_ttl": 900,
|
||||
"sig_expiration": 1360252164,
|
||||
"sig_inception": 1358434164,
|
||||
"key_tag": 41790,
|
||||
"signer_name": "org",
|
||||
"signature_len": 128,
|
||||
"signature": "05c6b040d4cb8e57ffe633bae78b5a8b7a3a7b9b8e9ae20cd83997e01d925911a4308768c3f8e21f81de0586fd8133beef8e395f790c13ba0306a3305a8121640e38c9eb2c8313eed9459e97198f798cf762479595a871398798b01c9dce4983d374ce18037351a79d2b693e07d687e71547a3529e7a3fe381ef3886dc7838ba"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4000,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_8"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.51906>75.75.75.75.53",
|
||||
"dns_qname": "org",
|
||||
"dns_qtype": 43,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_9"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.51906>75.75.75.75.53",
|
||||
"dns_qname": "org",
|
||||
"dns_qtype": 43,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"answer": [
|
||||
{
|
||||
"name": "org",
|
||||
"type": 43,
|
||||
"class": 1,
|
||||
"ttl": 52759,
|
||||
"rdlength": 24,
|
||||
"key_tag": 21366,
|
||||
"algo": 7,
|
||||
"digest_type": 1,
|
||||
"digest_len": 20,
|
||||
"digest": "e6c1716cfb6bdc84e84ce1ab5510dac69173b5b2"
|
||||
},
|
||||
{
|
||||
"name": "org",
|
||||
"type": 43,
|
||||
"class": 1,
|
||||
"ttl": 52759,
|
||||
"rdlength": 36,
|
||||
"key_tag": 21366,
|
||||
"algo": 7,
|
||||
"digest_type": 2,
|
||||
"digest_len": 32,
|
||||
"digest": "96eeb2ffd9b00cd4694e78278b5efdab0a80446567b69f634da078f0d90f01ba"
|
||||
},
|
||||
{
|
||||
"name": "org",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 52759,
|
||||
"rdlength": 147,
|
||||
"type_covered": 43,
|
||||
"algo": 8,
|
||||
"labels": 1,
|
||||
"original_ttl": 86400,
|
||||
"sig_expiration": 1359417600,
|
||||
"sig_inception": 1358809200,
|
||||
"key_tag": 40323,
|
||||
"signature_len": 128,
|
||||
"signature": "40999bb0a73b10fe268d378c9dfec0deb56022a0237d37be8998e0b9d4f77882a8494ecce64ad06c887d5fdab1c0b2b7179736f5fbe954798334fdb5f1b5bbae2c1e25b642477c832618e2a26240571ee15df56f819544d9bcde86dacfaf9d623a20849112d1d86558a009c390465f806be6d360eb31e61c6438043c67505b46"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4000,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_10"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.53559>75.75.75.75.53",
|
||||
"dns_qname": "",
|
||||
"dns_qtype": 48,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_11"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.53559>75.75.75.75.53",
|
||||
"dns_qname": "",
|
||||
"dns_qtype": 48,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"answer": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 48,
|
||||
"class": 1,
|
||||
"ttl": 139162,
|
||||
"rdlength": 264,
|
||||
"flags": 257,
|
||||
"protocol": 3,
|
||||
"algo": 8,
|
||||
"public_key_len": 260,
|
||||
"public_key": "03010001a80020a95566ba42e886bb804cda84e47ef56dbd7aec612615552cec906d2116d0ef207028c51554144dfeafe7c7cb8f005dd18234133ac0710a81182ce1fd14ad2283bc83435f9df2f6313251931a176df0da51e54f42e604860dfb359580250f559cc543c4ffd51cbe3de8cfd06719237f9fc47ee729da06835fa452e825e9a18ebc2ecbcf563474652c33cf56a9033bcdf5d973121797ec8089041b6e03a1b72d0a735b984e03687309332324f27c2dba85e9db15e83a0143382e974b0621c18e625ecec907577d9e7bade95241a81ebbe8a901d4d3276e40b114c0a2e6fc38d19c2e6aab02644b2813f575fc21601e0dee49cd9ee96a43103e524d62873d"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": 48,
|
||||
"class": 1,
|
||||
"ttl": 139162,
|
||||
"rdlength": 136,
|
||||
"flags": 256,
|
||||
"protocol": 3,
|
||||
"algo": 8,
|
||||
"public_key_len": 132,
|
||||
"public_key": "03010001a6029aa28fc2e5ff81c9072b4c61d283cccdb2c047d06194e39fbf11b9dfb18a2acd2cb9ba1fcf2ccd8ec5d92de7c279a8077e34fa1cace457a3f3b37d4bb602511439fd96c65e397b4520fe2dd92a509319754b0f0bd1584d14b6fa0702a10f5cb3ef02a1f7ac2912b2c78a5c0348bf5273095f4ef470080b1cc21e6f42d71d"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 139162,
|
||||
"rdlength": 275,
|
||||
"type_covered": 48,
|
||||
"algo": 8,
|
||||
"labels": 0,
|
||||
"original_ttl": 172800,
|
||||
"sig_expiration": 1360022399,
|
||||
"sig_inception": 1358726400,
|
||||
"key_tag": 19036,
|
||||
"signature_len": 256,
|
||||
"signature": "1ad73d635642115aed3399cedd7ced7b6db89d185e0a0aef9923f642349fc1d1c96eb60707dd36569b9bb8b73f7956129f6aae2280f9cc9ebbc4934a5e0b83744a2c2fc9648b326773eebd66a8565201d6c367c88bc0264795a8c426cfbeb1b0a27afdd91fb84548d02c46df6aa611d12b58927751d49f619f1885a8aa091bc0ffc03538b40e4a8d607c9d6ec9194514f150647ca99355ec41864f298d065697b62e51491cd04dfdd69eda203cf2fcfe8f730995d0e552fb2b3289ae0ee1eb0ccfda6e34d0a0fdad843e60a817aa917acf231e16b99620a1f8df682e99fca6ee07310d2c353b678c79f800d5bbacc04e81fd0139a6679c524f0e6cecf862af9c"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4000,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_12"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.39224>75.75.75.75.53",
|
||||
"dns_qname": "",
|
||||
"dns_qtype": 43,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_13"
|
||||
},
|
||||
{
|
||||
"Tuple4": "172.16.1.199.39224>75.75.75.75.53",
|
||||
"dns_qname": "",
|
||||
"dns_qtype": 43,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"authority": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 47,
|
||||
"class": 1,
|
||||
"ttl": 10800,
|
||||
"rdlength": 13,
|
||||
"next_domain": "ac",
|
||||
"maps_len": 9,
|
||||
"type_bit_maps": "000722000000000380"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 10800,
|
||||
"rdlength": 147,
|
||||
"type_covered": 47,
|
||||
"algo": 8,
|
||||
"labels": 0,
|
||||
"original_ttl": 86400,
|
||||
"sig_expiration": 1359417600,
|
||||
"sig_inception": 1358809200,
|
||||
"key_tag": 40323,
|
||||
"signature_len": 128,
|
||||
"signature": "3d8df58f8c9ab832d7831dff5d1ee56b9dd914ae25d093c848f692e990ff2c8a7cddbe3fe8dc05ebdb2a57160a68184f9468efc7bc6c786d0c8beb846cded8bb264055a441660ee1079e86ec28cbac241fb84dfd069e18d76e04cd2e8c51d42399e5624c6625b31e527475b476e6cdd672b5f1d9bace2d87a705dd6e15a3bd05"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": 6,
|
||||
"class": 1,
|
||||
"ttl": 10800,
|
||||
"rdlength": 64,
|
||||
"mname": "a.root-servers.net",
|
||||
"rname": "nstld.verisign-grs.com",
|
||||
"serial": 2013012201,
|
||||
"refresh": 1800,
|
||||
"retry": 900,
|
||||
"cname": 604800,
|
||||
"minimum": 86400
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 10800,
|
||||
"rdlength": 147,
|
||||
"type_covered": 6,
|
||||
"algo": 8,
|
||||
"labels": 0,
|
||||
"original_ttl": 86400,
|
||||
"sig_expiration": 1359417600,
|
||||
"sig_inception": 1358809200,
|
||||
"key_tag": 40323,
|
||||
"signature_len": 128,
|
||||
"signature": "1c8e2f1df9f586ad479e0931b9b55d1545196bcbf69dba65a836430a5c701e02ec6d60d87fb5f207643e2d257068f0bce448227eb7ddea0909d4dc022058ef0c99b919c1a93bbd08073b4b5d177b2665e6f170c8b70cf4d80bd15f2b7ca2395dbd0d6025a3141efbba1e552da011233b60f45e09dd358fbf8145047df645f5a7"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4000,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_14"
|
||||
}
|
||||
]
|
||||
BIN
test/case/https/1-dns-query-type-HTTPS.pcap
Normal file
BIN
test/case/https/1-dns-query-type-HTTPS.pcap
Normal file
Binary file not shown.
BIN
test/case/https/2-dns-ipv6-query-type-HTTPS-response-SOA.pcap
Normal file
BIN
test/case/https/2-dns-ipv6-query-type-HTTPS-response-SOA.pcap
Normal file
Binary file not shown.
BIN
test/case/https/3-dns-ipv6-query-type-HTTPS.pcap
Normal file
BIN
test/case/https/3-dns-ipv6-query-type-HTTPS.pcap
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
121
test/case/https/https_result.json
Normal file
121
test/case/https/https_result.json
Normal file
@@ -0,0 +1,121 @@
|
||||
[
|
||||
{
|
||||
"Tuple4": "36.249.111.140.13557>119.167.180.139.53",
|
||||
"dns_qname": "stat.umu.cn",
|
||||
"dns_qtype": 65,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 512,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 12
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_1"
|
||||
},
|
||||
{
|
||||
"Tuple4": "218.85.152.149.47030>36.249.51.254.53",
|
||||
"dns_qname": "vpn1.gslb.xiamenair.com.cn",
|
||||
"dns_qtype": 65,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"authority": [
|
||||
{
|
||||
"name": "xiamenair.com.cn",
|
||||
"type": 6,
|
||||
"class": 1,
|
||||
"ttl": 60,
|
||||
"rdlength": 62,
|
||||
"mname": "External-F5-1.xiamenair.com",
|
||||
"rname": "hostmaster.External-F5-1.xiamenair.com",
|
||||
"serial": 532,
|
||||
"refresh": 10800,
|
||||
"retry": 3600,
|
||||
"cname": 604800,
|
||||
"minimum": 60
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_2"
|
||||
},
|
||||
{
|
||||
"Tuple4": "2408:8248:4a81:34:f233:e584:18bc:c39.13687>2408:8000:da00::1.53",
|
||||
"dns_qname": "cdn.ynuf.aliapp.org.w.alikunlun.com.l.longwanservice.cn",
|
||||
"dns_qtype": 65,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {},
|
||||
"name": "DNS_RESULT_3"
|
||||
},
|
||||
{
|
||||
"Tuple4": "59.49.49.242.49230>36.251.191.37.53",
|
||||
"dns_qname": "bi.sdns.yearconsports.com",
|
||||
"dns_qtype": 65,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 0,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_4"
|
||||
},
|
||||
{
|
||||
"Tuple4": "183.207.113.105.47311>36.249.2.210.53",
|
||||
"dns_qname": "slfk.ntkfqjy.com",
|
||||
"dns_qtype": 65,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_5"
|
||||
}
|
||||
]
|
||||
Binary file not shown.
@@ -0,0 +1,159 @@
|
||||
[
|
||||
{
|
||||
"Tuple4": "192.168.137.225.43508>202.14.67.4.53",
|
||||
"dns_qname": "d3l1j2luiza96k.cloudfront.net",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {},
|
||||
"name": "DNS_RESULT_1"
|
||||
},
|
||||
{
|
||||
"Tuple4": "192.168.137.225.43508>202.14.67.4.53",
|
||||
"dns_qname": "d3l1j2luiza96k.cloudfront.net",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"answer": [
|
||||
{
|
||||
"name": "d3l1j2luiza96k.cloudfront.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 60,
|
||||
"rdlength": 4,
|
||||
"a": "13.35.0.151"
|
||||
},
|
||||
{
|
||||
"name": "d3l1j2luiza96k.cloudfront.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 60,
|
||||
"rdlength": 4,
|
||||
"a": "13.35.0.125"
|
||||
},
|
||||
{
|
||||
"name": "d3l1j2luiza96k.cloudfront.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 60,
|
||||
"rdlength": 4,
|
||||
"a": "13.35.0.215"
|
||||
},
|
||||
{
|
||||
"name": "d3l1j2luiza96k.cloudfront.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 60,
|
||||
"rdlength": 4,
|
||||
"a": "13.35.0.10"
|
||||
}
|
||||
],
|
||||
"authority": [
|
||||
{
|
||||
"name": "d3l1j2luiza96k.cloudfront.net",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 1466,
|
||||
"rdlength": 23,
|
||||
"ns": "ns-1091.awsdns-08.org"
|
||||
},
|
||||
{
|
||||
"name": "d3l1j2luiza96k.cloudfront.net",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 1466,
|
||||
"rdlength": 25,
|
||||
"ns": "ns-1967.awsdns-53.co.uk"
|
||||
},
|
||||
{
|
||||
"name": "d3l1j2luiza96k.cloudfront.net",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 1466,
|
||||
"rdlength": 21,
|
||||
"ns": "ns-41.awsdns-05.com"
|
||||
},
|
||||
{
|
||||
"name": "d3l1j2luiza96k.cloudfront.net",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 1466,
|
||||
"rdlength": 19,
|
||||
"ns": "ns-880.awsdns-46.net"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "ns-41.awsdns-05.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 162292,
|
||||
"rdlength": 4,
|
||||
"a": "205.251.192.41"
|
||||
},
|
||||
{
|
||||
"name": "ns-41.awsdns-05.com",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 162292,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2600:9000:5300:2900::1"
|
||||
},
|
||||
{
|
||||
"name": "ns-880.awsdns-46.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 162321,
|
||||
"rdlength": 4,
|
||||
"a": "205.251.195.112"
|
||||
},
|
||||
{
|
||||
"name": "ns-880.awsdns-46.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 162321,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2600:9000:5303:7000::1"
|
||||
},
|
||||
{
|
||||
"name": "ns-1091.awsdns-08.org",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 162308,
|
||||
"rdlength": 4,
|
||||
"a": "205.251.196.67"
|
||||
},
|
||||
{
|
||||
"name": "ns-1091.awsdns-08.org",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 162308,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2600:9000:5304:4300::1"
|
||||
},
|
||||
{
|
||||
"name": "ns-1967.awsdns-53.co.uk",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 162324,
|
||||
"rdlength": 4,
|
||||
"a": "205.251.199.175"
|
||||
},
|
||||
{
|
||||
"name": "ns-1967.awsdns-53.co.uk",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 162324,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2600:9000:5307:af00::1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_2"
|
||||
}
|
||||
]
|
||||
BIN
test/case/multi_session/dns_multiple_session.pcap
Normal file
BIN
test/case/multi_session/dns_multiple_session.pcap
Normal file
Binary file not shown.
1276
test/case/multi_session/multi_session_result.json
Normal file
1276
test/case/multi_session/multi_session_result.json
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
6610
test/case/multi_transcation/multi_transcation_result.json
Normal file
6610
test/case/multi_transcation/multi_transcation_result.json
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
300
test/case/ns_nsec3_rrsig_a_opt/ns_nsec3_rrsig_a_opt_result.json
Normal file
300
test/case/ns_nsec3_rrsig_a_opt/ns_nsec3_rrsig_a_opt_result.json
Normal file
@@ -0,0 +1,300 @@
|
||||
[
|
||||
{
|
||||
"Tuple4": "202.114.200.252.48654>192.54.112.30.53",
|
||||
"dns_qname": "ns-intl-834.awsdns-cn-52.com",
|
||||
"dns_qtype": 28,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"authority": [
|
||||
{
|
||||
"name": "awsdns-cn-52.com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 12,
|
||||
"ns": "g-ns-1076.awsdns-cn-52.com"
|
||||
},
|
||||
{
|
||||
"name": "awsdns-cn-52.com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 12,
|
||||
"ns": "g-ns-2310.awsdns-cn-52.com"
|
||||
},
|
||||
{
|
||||
"name": "awsdns-cn-52.com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 12,
|
||||
"ns": "g-ns-3857.awsdns-cn-52.com"
|
||||
},
|
||||
{
|
||||
"name": "awsdns-cn-52.com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 11,
|
||||
"ns": "g-ns-944.awsdns-cn-52.com"
|
||||
},
|
||||
{
|
||||
"name": "awsdns-cn-52.com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 16,
|
||||
"ns": "g-ns-intl-944.awsdns-cn-52.com"
|
||||
},
|
||||
{
|
||||
"name": "awsdns-cn-52.com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 17,
|
||||
"ns": "g-ns-intl-3857.awsdns-cn-52.com"
|
||||
},
|
||||
{
|
||||
"name": "CK0POJMG874LJREF7EFN8430QVIT8BSM.com",
|
||||
"type": 50,
|
||||
"class": 1,
|
||||
"ttl": 86400,
|
||||
"rdlength": 35,
|
||||
"hash_algo": 1,
|
||||
"flags": 1,
|
||||
"iteration": 0,
|
||||
"salt_len": 0,
|
||||
"hash_len": 20,
|
||||
"next_hash_owner": "6501a0c25720ee156f6c4e39636b3ada0312d92a",
|
||||
"maps_len": 9,
|
||||
"type_bit_maps": "000722000000000290"
|
||||
},
|
||||
{
|
||||
"name": "CK0POJMG874LJREF7EFN8430QVIT8BSM.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 86400,
|
||||
"rdlength": 183,
|
||||
"type_covered": 50,
|
||||
"algo": 8,
|
||||
"labels": 2,
|
||||
"original_ttl": 86400,
|
||||
"sig_expiration": 1636349012,
|
||||
"sig_inception": 1635736412,
|
||||
"key_tag": 15549,
|
||||
"signer_name": "com",
|
||||
"signature_len": 160,
|
||||
"signature": "1f77dc4c5796eda9ced317925c67d91c52922152424c9dca024948c1169e8429053fdf50a23370d9c3dc79de909f2f79475b2c731d6060d1db7b5d294b8ee43c91a57b8a4afa06c25fb13127bfca3fb353c7d5a38eaf093e12ffa1e33bc80bd7118851ca730ed22bd27b6f16673b86b44898785c6e13b3dd3620750492e47bb8ca823ffa6e25225ffa5408184c25e4ff423497802deed0586629d78103b3e6e7"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "g-ns-1076.awsdns-cn-52.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 4,
|
||||
"a": "52.82.180.52"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_1"
|
||||
},
|
||||
{
|
||||
"Tuple4": "202.114.200.252.14994>192.54.112.30.53",
|
||||
"dns_qname": "default.wagbridge.umeng.alibabacorp.com",
|
||||
"dns_qtype": 65,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"authority": [
|
||||
{
|
||||
"name": "alibabacorp.com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 17,
|
||||
"ns": "ns1.alibabadns.com"
|
||||
},
|
||||
{
|
||||
"name": "alibabacorp.com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 6,
|
||||
"ns": "ns2.alibabadns.com"
|
||||
},
|
||||
{
|
||||
"name": "CK0POJMG874LJREF7EFN8430QVIT8BSM.com",
|
||||
"type": 50,
|
||||
"class": 1,
|
||||
"ttl": 86400,
|
||||
"rdlength": 35,
|
||||
"hash_algo": 1,
|
||||
"flags": 1,
|
||||
"iteration": 0,
|
||||
"salt_len": 0,
|
||||
"hash_len": 20,
|
||||
"next_hash_owner": "6501a0c25720ee156f6c4e39636b3ada0312d92a",
|
||||
"maps_len": 9,
|
||||
"type_bit_maps": "000722000000000290"
|
||||
},
|
||||
{
|
||||
"name": "CK0POJMG874LJREF7EFN8430QVIT8BSM.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 86400,
|
||||
"rdlength": 183,
|
||||
"type_covered": 50,
|
||||
"algo": 8,
|
||||
"labels": 2,
|
||||
"original_ttl": 86400,
|
||||
"sig_expiration": 1636349012,
|
||||
"sig_inception": 1635736412,
|
||||
"key_tag": 15549,
|
||||
"signer_name": "com",
|
||||
"signature_len": 160,
|
||||
"signature": "1f77dc4c5796eda9ced317925c67d91c52922152424c9dca024948c1169e8429053fdf50a23370d9c3dc79de909f2f79475b2c731d6060d1db7b5d294b8ee43c91a57b8a4afa06c25fb13127bfca3fb353c7d5a38eaf093e12ffa1e33bc80bd7118851ca730ed22bd27b6f16673b86b44898785c6e13b3dd3620750492e47bb8ca823ffa6e25225ffa5408184c25e4ff423497802deed0586629d78103b3e6e7"
|
||||
},
|
||||
{
|
||||
"name": "UCKI4O10VPFCCTNI53HLPKSNJA9CACLB.com",
|
||||
"type": 50,
|
||||
"class": 1,
|
||||
"ttl": 86400,
|
||||
"rdlength": 34,
|
||||
"hash_algo": 1,
|
||||
"flags": 1,
|
||||
"iteration": 0,
|
||||
"salt_len": 0,
|
||||
"hash_len": 20,
|
||||
"next_hash_owner": "f329294c3ad6e760f049f8464cc530db8b36a122",
|
||||
"maps_len": 8,
|
||||
"type_bit_maps": "0006200000000012"
|
||||
},
|
||||
{
|
||||
"name": "UCKI4O10VPFCCTNI53HLPKSNJA9CACLB.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 86400,
|
||||
"rdlength": 183,
|
||||
"type_covered": 50,
|
||||
"algo": 8,
|
||||
"labels": 2,
|
||||
"original_ttl": 86400,
|
||||
"sig_expiration": 1636086728,
|
||||
"sig_inception": 1635477728,
|
||||
"key_tag": 15549,
|
||||
"signer_name": "com",
|
||||
"signature_len": 160,
|
||||
"signature": "2183d285294593687ebb4a5df4e469ba790df26cbf48e9e7e43df52fd23e5c31efa56a560d7e62715b31257ee7cf834e5c023a11f6f6c795bbe9b1763d3ab5133e32872abd448b0abffe4dca6daf8dc95866dc307d8c788246a8a875db6c9dadca6f4dd1383b2edc8a1db3b6cc634d6b0c197864d629bc5db975526ade670ddbeec64ea993763711bf5caa412cc9e0e516e86f5e4f05254ee1496181708434c8"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "ns1.alibabadns.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 4,
|
||||
"a": "106.11.35.19"
|
||||
},
|
||||
{
|
||||
"name": "ns1.alibabadns.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 4,
|
||||
"a": "140.205.122.66"
|
||||
},
|
||||
{
|
||||
"name": "ns1.alibabadns.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 4,
|
||||
"a": "140.205.67.252"
|
||||
},
|
||||
{
|
||||
"name": "ns1.alibabadns.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 4,
|
||||
"a": "198.11.138.254"
|
||||
},
|
||||
{
|
||||
"name": "ns1.alibabadns.com",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2401:b180:4100::1"
|
||||
},
|
||||
{
|
||||
"name": "ns2.alibabadns.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 4,
|
||||
"a": "106.11.35.18"
|
||||
},
|
||||
{
|
||||
"name": "ns2.alibabadns.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 4,
|
||||
"a": "140.205.122.77"
|
||||
},
|
||||
{
|
||||
"name": "ns2.alibabadns.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 4,
|
||||
"a": "140.205.67.254"
|
||||
},
|
||||
{
|
||||
"name": "ns2.alibabadns.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 4,
|
||||
"a": "198.11.138.252"
|
||||
},
|
||||
{
|
||||
"name": "ns2.alibabadns.com",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 172800,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2401:b180:4100::2"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_2"
|
||||
}
|
||||
]
|
||||
BIN
test/case/nsec/1-dns_long_response.pcap
Normal file
BIN
test/case/nsec/1-dns_long_response.pcap
Normal file
Binary file not shown.
626
test/case/nsec/nsec_result.json
Normal file
626
test/case/nsec/nsec_result.json
Normal file
@@ -0,0 +1,626 @@
|
||||
[
|
||||
{
|
||||
"Tuple4": "98.254.85.75.3074>222.17.192.247.53",
|
||||
"dns_qname": "paypal.com",
|
||||
"dns_qtype": 255,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"answer": [
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 49,
|
||||
"rdlength": 4,
|
||||
"a": "64.4.250.36"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 49,
|
||||
"rdlength": 4,
|
||||
"a": "64.4.250.37"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 47,
|
||||
"class": 1,
|
||||
"ttl": 294,
|
||||
"rdlength": 57,
|
||||
"next_domain": "0cd20b6fe61233e4a24bf70f30c9ba46.paypal.com",
|
||||
"maps_len": 12,
|
||||
"type_bit_maps": "000762018000000380010140"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 6,
|
||||
"class": 1,
|
||||
"ttl": 294,
|
||||
"rdlength": 45,
|
||||
"mname": "ppns1.phx.paypal.com",
|
||||
"rname": "hostmaster.paypal.com",
|
||||
"serial": 2012301931,
|
||||
"refresh": 7200,
|
||||
"retry": 600,
|
||||
"cname": 1209600,
|
||||
"minimum": 300
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 48,
|
||||
"class": 1,
|
||||
"ttl": 50,
|
||||
"rdlength": 264,
|
||||
"flags": 257,
|
||||
"protocol": 3,
|
||||
"algo": 5,
|
||||
"public_key_len": 260,
|
||||
"public_key": "03010001d56d982eb23906f4fb9313e5ecc2f4626c09bd745a4544d6a3006e2940379299d3fc090fee0fd7f581edcb570b44671231f356b2a62ec17345bde6a48f709b471fe6937c04731255f743a7272337219b332ec4289efb3ce0fb9528a6268b8cc794e9f8741a259794d0c9d7264478a9a02f4a1af988db556a8a4eb885d07d10e72dd0e8c444f0f57a6520bf709297b5816e6e40d93e161cb83d1c9ff9ee728608998de9a6462103247f85c425007fc655fb11d2bae716298dd5d6d1217a9b5d51a2006e70860d61936e2f7389a8ba4ab2f346bac37889b09b8d8f9310f971444c5aa1d02017c42650c1fa4a2a58f9bbdec0cf3253e0a01532c5bff0e4914b57e7"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 48,
|
||||
"class": 1,
|
||||
"ttl": 50,
|
||||
"rdlength": 136,
|
||||
"flags": 256,
|
||||
"protocol": 3,
|
||||
"algo": 5,
|
||||
"public_key_len": 132,
|
||||
"public_key": "03010001cffbafbc3aa84839f6fcf27dc2a0226ecade1e37b6094a3898e81722b9971865d9eeef87c0b0be3ddcc0a40771cb2f5aebc02b4ba69934b2b31653d09260c3c824848186899eb73094dc6e87037b3819880feae1e8e98ddae3dbb82ce6608702cc82f41015662cac7c8c2ab5116c3f41a38af358cc873aa865805dc00928b2d7"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 102,
|
||||
"rdlength": 158,
|
||||
"type_covered": 1,
|
||||
"algo": 5,
|
||||
"labels": 2,
|
||||
"original_ttl": 300,
|
||||
"sig_expiration": 1635227563,
|
||||
"sig_inception": 1632634805,
|
||||
"key_tag": 11811,
|
||||
"signer_name": "paypal.com",
|
||||
"signature_len": 128,
|
||||
"signature": "1a9448ee34c445f9865e38cd66b3d555cfffe2a2e04515005245f32280000796ff889bdc400eada1e19659d25cf6f0060dd06e6fecbc1269f093b383e00be88d0c06969d37d449676461a268762661d1c2478ee5b7053d97bee870fdc2d064793fd48b4ac025518cc0437ad94c142b0946a37bd6fd5cb9c84389dc13e0c37e39"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 257,
|
||||
"class": 1,
|
||||
"ttl": 700,
|
||||
"rdlength": 25
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 257,
|
||||
"class": 1,
|
||||
"ttl": 700,
|
||||
"rdlength": 19
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 257,
|
||||
"class": 1,
|
||||
"ttl": 700,
|
||||
"rdlength": 19
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 15,
|
||||
"class": 1,
|
||||
"ttl": 696,
|
||||
"rdlength": 19,
|
||||
"exchange": "mx2.paypalcorp.com",
|
||||
"preference": 10
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 15,
|
||||
"class": 1,
|
||||
"ttl": 696,
|
||||
"rdlength": 8,
|
||||
"exchange": "mx1.paypalcorp.com",
|
||||
"preference": 10
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 86095,
|
||||
"rdlength": 183,
|
||||
"type_covered": 43,
|
||||
"algo": 8,
|
||||
"labels": 2,
|
||||
"original_ttl": 86400,
|
||||
"sig_expiration": 1633580133,
|
||||
"sig_inception": 1632971133,
|
||||
"key_tag": 39343,
|
||||
"signer_name": "com",
|
||||
"signature_len": 160,
|
||||
"signature": "af49968e9f965cf128611bce9c7c90c6e47c2974976491270f3c2c7407439549a50e7d55026ae1ab16c3c56621e2f8f4a0e2af8da6a7c959be9c7e052035ba1d5ce50715c342a41f7455cd01eaff65bcf4c6bd0ee82aab3738582a8bfeee7e8bcf8519f5cef2daec8b6dbac52f3d446302c66bbcc7125be0189a4fa5226f09202322286f543cf0d9842b86d200713fe5e9d0b36f1d667a0cf08bdcfb2088b918"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 43,
|
||||
"class": 1,
|
||||
"ttl": 86095,
|
||||
"rdlength": 36,
|
||||
"key_tag": 21037,
|
||||
"algo": 5,
|
||||
"digest_type": 2,
|
||||
"digest_len": 32,
|
||||
"digest": "0df17b28554954d819e0ceeab98fcfcd56572a4cf4f551f0a9be6d04db2f65c3"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 3402,
|
||||
"rdlength": 158,
|
||||
"type_covered": 257,
|
||||
"algo": 5,
|
||||
"labels": 2,
|
||||
"original_ttl": 3600,
|
||||
"sig_expiration": 1634811814,
|
||||
"sig_inception": 1632217986,
|
||||
"key_tag": 11811,
|
||||
"signer_name": "paypal.com",
|
||||
"signature_len": 128,
|
||||
"signature": "67d69f20731812dba88c94b5d96d0771f362179998b07d6ce0061532348d7cb796808b4e72929276834e43596462a9c4a633fa178c477042e9a69bc375a05432a4fd1fb5461c3fe33ffff0ff583702a03c6f3393688f74fe707db82fd1757c25b5092e18045b2853a82c2ef07ba0561795b261062d869b4e7456f691a6446ba9"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 402,
|
||||
"rdlength": 158,
|
||||
"type_covered": 48,
|
||||
"algo": 5,
|
||||
"labels": 2,
|
||||
"original_ttl": 600,
|
||||
"sig_expiration": 1635136648,
|
||||
"sig_inception": 1632542501,
|
||||
"key_tag": 11811,
|
||||
"signer_name": "paypal.com",
|
||||
"signature_len": 128,
|
||||
"signature": "29bb0cb74b22af3dba99367b25b078f7e8ff976b4d598c7e8e7d7d21729d6b505b6bd79811f9c25da40ef08c4e176954fc2625e2aacba25cfed5fcf2031b16ad4aba1c147cad5e53b145581b32a382cf5ce7b268fd9439bf16960f1b202a59e61ed6a4caad8f9175d1e552c47db6e6b6a3a5a6c1f1228444a13eddb6f8addf67"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 402,
|
||||
"rdlength": 286,
|
||||
"type_covered": 48,
|
||||
"algo": 5,
|
||||
"labels": 2,
|
||||
"original_ttl": 600,
|
||||
"sig_expiration": 1635136648,
|
||||
"sig_inception": 1632542501,
|
||||
"key_tag": 21037,
|
||||
"signer_name": "paypal.com",
|
||||
"signature_len": 256,
|
||||
"signature": "14e65e068797c7eda6d43936d3cdb41546076a1e83dbd91df766115c56a3e6d1fa5ac043bdfc215f1ff8c5f78e7086c20eb16f1e00b33269a936b2b67918feeea560ed892b6a4a5e461744a6332058aea97c7f98e6a0f8d463c1557c9d131305d3be8598a2c968eb6a5a530b395ed7dcc3b3c1fc4037a4f5306e064f9ec446d698bb1a851b0ad04ea6613da967a8e4fdad14d8d34c66a5b4a4eb609e067c6f72682a4c8296d0e6b2f83492d0b4e76225f72ae16ba3ec5b9853ae92d1a57f3918d2c789cdc21cce51e1e87e90595e83ea3a69c024d011e58581161b1130d5a800fe743b2eebb590377dacc82251d0900371b9078f72e7820687b93c563d2635d5"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 294,
|
||||
"rdlength": 158,
|
||||
"type_covered": 47,
|
||||
"algo": 5,
|
||||
"labels": 2,
|
||||
"original_ttl": 300,
|
||||
"sig_expiration": 1635389589,
|
||||
"sig_inception": 1632794998,
|
||||
"key_tag": 11811,
|
||||
"signer_name": "paypal.com",
|
||||
"signature_len": 128,
|
||||
"signature": "7176a00d8700689c1adf145e5fac07344800603003989f38f4285eab81c429a3e8df7791389e0024814027dc2f5e71af4a54a2ae6b8a6a93c8a7676d8c50d19b07b3da559e7e5ac8c090658dfde1fa2316c04f8902fd5749e9c05b8bb08038205aca7b9bdadda7a9f232b689e3fbb8ce92777c2c268ff76945af88d36bf61889"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 102,
|
||||
"rdlength": 158,
|
||||
"type_covered": 16,
|
||||
"algo": 5,
|
||||
"labels": 2,
|
||||
"original_ttl": 300,
|
||||
"sig_expiration": 1634782028,
|
||||
"sig_inception": 1632186783,
|
||||
"key_tag": 11811,
|
||||
"signer_name": "paypal.com",
|
||||
"signature_len": 128,
|
||||
"signature": "47d1d025a0425dbb4cf6078b3f5cfd89d8ffbc7540fe5808c89b9412d88d436f5f80164ac4795bc888479bbc9a1f5e591bee20b71145978bb034546cc70b0d485fa089dcf1f80eb65af86b9c1c782b981b0ed9f5d5694693775cdf01d81fab8b571c8ea0dcec6a7370a73bcc7bdaba2ad835ac7eb17aba8092f32a496195547e"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 3402,
|
||||
"rdlength": 158,
|
||||
"type_covered": 15,
|
||||
"algo": 5,
|
||||
"labels": 2,
|
||||
"original_ttl": 3600,
|
||||
"sig_expiration": 1634757474,
|
||||
"sig_inception": 1632163454,
|
||||
"key_tag": 11811,
|
||||
"signer_name": "paypal.com",
|
||||
"signature_len": 128,
|
||||
"signature": "18a292822241eb924112987fbd88f0c7ba32413dc85cff4271cea273b9f048553f64fa9f30d8f92c6c267b0e3d30346ca3c3f66ac8f8f842ef6b82715ef659fbd7172d9e055af57d7ef5413c321f079785dc4ac0cf5599e885101aa0008c319e35a5a308c9d42612688b51339729ea132dfa78be2f977644e400e89a5a84bebd"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 294,
|
||||
"rdlength": 158,
|
||||
"type_covered": 6,
|
||||
"algo": 5,
|
||||
"labels": 2,
|
||||
"original_ttl": 300,
|
||||
"sig_expiration": 1635650618,
|
||||
"sig_inception": 1633055018,
|
||||
"key_tag": 11811,
|
||||
"signer_name": "paypal.com",
|
||||
"signature_len": 128,
|
||||
"signature": "27e610ebe0c337d24136294885909db576a61911d593212bb2fd7740d999dfa5a998aa3c39432766025a64803016cd5e2e4d7b6c183acd88f408ec579cbb1895852187832fc02b4b08ed6f4371ad82a22a10db0c201cae553ab09deabcf9285b81637b74793bcba4ceb08366ea964058f1c08443278d1ab08c84d6045882dd26"
|
||||
},
|
||||
{
|
||||
"name": "paypal.com",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 294,
|
||||
"rdlength": 158,
|
||||
"type_covered": 2,
|
||||
"algo": 5,
|
||||
"labels": 2,
|
||||
"original_ttl": 300,
|
||||
"sig_expiration": 1635156818,
|
||||
"sig_inception": 1632563118,
|
||||
"key_tag": 11811,
|
||||
"signer_name": "paypal.com",
|
||||
"signature_len": 128,
|
||||
"signature": "211edec16ca058012e8396cef732869b3b343286f20a10f10919c15513990f6cf46f1d9a87704a1b7e9070c427d21a1b016bd80940af675605cb351f301d204080dff7c0db068847accc28bdece9d739bcb7696dd646164f47066c63a0ba4ef6acbedea637ead554342c429552516d9663bca8eb367a84f25bc70332fdf51872"
|
||||
}
|
||||
],
|
||||
"authority": [
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 20,
|
||||
"ns": "j.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "e.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "l.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "f.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "c.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "i.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "d.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "b.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "g.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "k.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "h.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "a.gtld-servers.net"
|
||||
},
|
||||
{
|
||||
"name": "com",
|
||||
"type": 2,
|
||||
"class": 1,
|
||||
"ttl": 72900,
|
||||
"rdlength": 4,
|
||||
"ns": "m.gtld-servers.net"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "j.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 24,
|
||||
"rdlength": 4,
|
||||
"a": "192.48.79.30"
|
||||
},
|
||||
{
|
||||
"name": "e.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 50201,
|
||||
"rdlength": 4,
|
||||
"a": "192.12.94.30"
|
||||
},
|
||||
{
|
||||
"name": "g.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 13379,
|
||||
"rdlength": 4,
|
||||
"a": "192.42.93.30"
|
||||
},
|
||||
{
|
||||
"name": "m.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 164224,
|
||||
"rdlength": 4,
|
||||
"a": "192.55.83.30"
|
||||
},
|
||||
{
|
||||
"name": "k.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 9591,
|
||||
"rdlength": 4,
|
||||
"a": "192.52.178.30"
|
||||
},
|
||||
{
|
||||
"name": "i.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 1012,
|
||||
"rdlength": 4,
|
||||
"a": "192.43.172.30"
|
||||
},
|
||||
{
|
||||
"name": "h.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 27539,
|
||||
"rdlength": 4,
|
||||
"a": "192.54.112.30"
|
||||
},
|
||||
{
|
||||
"name": "c.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 74369,
|
||||
"rdlength": 4,
|
||||
"a": "192.26.92.30"
|
||||
},
|
||||
{
|
||||
"name": "l.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 4078,
|
||||
"rdlength": 4,
|
||||
"a": "192.41.162.30"
|
||||
},
|
||||
{
|
||||
"name": "d.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 6886,
|
||||
"rdlength": 4,
|
||||
"a": "192.31.80.30"
|
||||
},
|
||||
{
|
||||
"name": "f.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 21484,
|
||||
"rdlength": 4,
|
||||
"a": "192.35.51.30"
|
||||
},
|
||||
{
|
||||
"name": "a.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 80825,
|
||||
"rdlength": 4,
|
||||
"a": "192.5.6.30"
|
||||
},
|
||||
{
|
||||
"name": "b.gtld-servers.net",
|
||||
"type": 1,
|
||||
"class": 1,
|
||||
"ttl": 76063,
|
||||
"rdlength": 4,
|
||||
"a": "192.33.14.30"
|
||||
},
|
||||
{
|
||||
"name": "j.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 8232,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:502:7094::30"
|
||||
},
|
||||
{
|
||||
"name": "e.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 14895,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:502:1ca1::30"
|
||||
},
|
||||
{
|
||||
"name": "g.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 24249,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:503:eea3::30"
|
||||
},
|
||||
{
|
||||
"name": "m.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 169791,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:501:b1f9::30"
|
||||
},
|
||||
{
|
||||
"name": "k.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 13204,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:503:d2d::30"
|
||||
},
|
||||
{
|
||||
"name": "i.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 5983,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:503:39c1::30"
|
||||
},
|
||||
{
|
||||
"name": "h.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 16702,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:502:8cc::30"
|
||||
},
|
||||
{
|
||||
"name": "c.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 57281,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:503:83eb::30"
|
||||
},
|
||||
{
|
||||
"name": "l.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 16251,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:500:d937::30"
|
||||
},
|
||||
{
|
||||
"name": "d.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 31236,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:500:856e::30"
|
||||
},
|
||||
{
|
||||
"name": "f.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 11292,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:503:d414::30"
|
||||
},
|
||||
{
|
||||
"name": "a.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 35359,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:503:a83e::2:30"
|
||||
},
|
||||
{
|
||||
"name": "b.gtld-servers.net",
|
||||
"type": 28,
|
||||
"class": 1,
|
||||
"ttl": 22350,
|
||||
"rdlength": 16,
|
||||
"aaaa": "2001:503:231d::2:30"
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 0,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_1"
|
||||
}
|
||||
]
|
||||
BIN
test/case/nsec3/1-dns-response-type-nsec3.pcap
Normal file
BIN
test/case/nsec3/1-dns-response-type-nsec3.pcap
Normal file
Binary file not shown.
44618
test/case/nsec3/nsec3_result.json
Normal file
44618
test/case/nsec3/nsec3_result.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
test/case/nsec_10_1/1-dns_long_response_paypal.com_53_15635.pcap
Normal file
BIN
test/case/nsec_10_1/1-dns_long_response_paypal.com_53_15635.pcap
Normal file
Binary file not shown.
BIN
test/case/nsec_10_1/2-dns_long_response_paypal.com_53_30698.pcap
Normal file
BIN
test/case/nsec_10_1/2-dns_long_response_paypal.com_53_30698.pcap
Normal file
Binary file not shown.
BIN
test/case/nsec_10_1/3-dns_long_response_paypal.com_53_3074.pcap
Normal file
BIN
test/case/nsec_10_1/3-dns_long_response_paypal.com_53_3074.pcap
Normal file
Binary file not shown.
BIN
test/case/nsec_10_1/4-dns_long_response_paypal.com_53_56839.pcap
Normal file
BIN
test/case/nsec_10_1/4-dns_long_response_paypal.com_53_56839.pcap
Normal file
Binary file not shown.
BIN
test/case/nsec_10_1/5-dns_long_response_paypal.com_53_57320.pcap
Normal file
BIN
test/case/nsec_10_1/5-dns_long_response_paypal.com_53_57320.pcap
Normal file
Binary file not shown.
BIN
test/case/nsec_10_1/6-dns_long_response_paypal.com_53_80_2.pcap
Normal file
BIN
test/case/nsec_10_1/6-dns_long_response_paypal.com_53_80_2.pcap
Normal file
Binary file not shown.
BIN
test/case/nsec_10_1/7-dns_long_response_paypal.com_53_80_3.pcap
Normal file
BIN
test/case/nsec_10_1/7-dns_long_response_paypal.com_53_80_3.pcap
Normal file
Binary file not shown.
BIN
test/case/nsec_10_1/8-dns_long_response_paypal.com_53_80.pcap
Normal file
BIN
test/case/nsec_10_1/8-dns_long_response_paypal.com_53_80.pcap
Normal file
Binary file not shown.
4474
test/case/nsec_10_1/nsec_result.json
Normal file
4474
test/case/nsec_10_1/nsec_result.json
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
157
test/case/port5353/port5353_result.json
Normal file
157
test/case/port5353/port5353_result.json
Normal file
@@ -0,0 +1,157 @@
|
||||
[
|
||||
{
|
||||
"Tuple4": "202.120.2.170.19331>208.67.222.222.5353",
|
||||
"dns_qname": "fuck888.info",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 1,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {
|
||||
"authority": [
|
||||
{
|
||||
"name": "info",
|
||||
"type": 6,
|
||||
"class": 1,
|
||||
"ttl": 834,
|
||||
"rdlength": 48,
|
||||
"mname": "a0.info.afilias-nst.info",
|
||||
"rname": "noc.afilias-nst.info",
|
||||
"serial": 2013016250,
|
||||
"refresh": 3600,
|
||||
"retry": 1800,
|
||||
"cname": 604800,
|
||||
"minimum": 3600
|
||||
},
|
||||
{
|
||||
"name": "info",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 834,
|
||||
"rdlength": 152,
|
||||
"type_covered": 6,
|
||||
"algo": 8,
|
||||
"labels": 1,
|
||||
"original_ttl": 900,
|
||||
"sig_expiration": 1637564279,
|
||||
"sig_inception": 1635746279,
|
||||
"key_tag": 36675,
|
||||
"signer_name": "info",
|
||||
"signature_len": 128,
|
||||
"signature": "8080ab8bdd11d4b44f67263039f58c1ef36bde9013d5e79e5debac8fef427a9fba4a7fa2ed47ac8ea60bd80380a1986b64cb65a8c4c878c10e44b0d8dc4955817224f6e886b8ffdbc3a387801c604dd0c4f944634d6fa812f633f61a16cdb1c7c0970b222bc7165bdab5ddbf43d9aec01bbfb6df6af0a19fd425d5cb2d8c7ea9"
|
||||
},
|
||||
{
|
||||
"name": "dr3kecftk5dlgg1gdcs9q10f5vjs86ll.info",
|
||||
"type": 50,
|
||||
"class": 1,
|
||||
"ttl": 835,
|
||||
"rdlength": 43,
|
||||
"hash_algo": 1,
|
||||
"flags": 1,
|
||||
"iteration": 10,
|
||||
"salt_len": 8,
|
||||
"salt_value": "332539ee7f95c32a",
|
||||
"hash_len": 20,
|
||||
"next_hash_owner": "6ec842182aa72099900758d531cc597d87b214ad",
|
||||
"maps_len": 9,
|
||||
"type_bit_maps": "000722000000000290"
|
||||
},
|
||||
{
|
||||
"name": "dr3kecftk5dlgg1gdcs9q10f5vjs86ll.info",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 835,
|
||||
"rdlength": 152,
|
||||
"type_covered": 50,
|
||||
"algo": 8,
|
||||
"labels": 2,
|
||||
"original_ttl": 3600,
|
||||
"sig_expiration": 1637564279,
|
||||
"sig_inception": 1635746279,
|
||||
"key_tag": 36675,
|
||||
"signer_name": "info",
|
||||
"signature_len": 128,
|
||||
"signature": "8cd1ab9eda160c2c9b1faf96470cb341a9bb0ef22b3f3eb78c2cc026945cec7ae0b1494298a7916abb93859ba69732fe6bf555c14824f5ebb50ac1a358e33bdcbe05d630f9769c5a08a6c589b07648305b8a5cfa9d7768bf760ae4181db62efac4df69fb761309d030a7dd40a629cc2a78b1acb3e51360b566aacf82c90b43cc"
|
||||
},
|
||||
{
|
||||
"name": "h86rqsv2q3bvgrffkbmha95c26s627qi.info",
|
||||
"type": 50,
|
||||
"class": 1,
|
||||
"ttl": 835,
|
||||
"rdlength": 42,
|
||||
"hash_algo": 1,
|
||||
"flags": 1,
|
||||
"iteration": 10,
|
||||
"salt_len": 8,
|
||||
"salt_value": "332539ee7f95c32a",
|
||||
"hash_len": 20,
|
||||
"next_hash_owner": "8a1017b0f60a1464371507323ab366631450e917",
|
||||
"maps_len": 8,
|
||||
"type_bit_maps": "0006200000000012"
|
||||
},
|
||||
{
|
||||
"name": "h86rqsv2q3bvgrffkbmha95c26s627qi.info",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 835,
|
||||
"rdlength": 152,
|
||||
"type_covered": 50,
|
||||
"algo": 8,
|
||||
"labels": 2,
|
||||
"original_ttl": 3600,
|
||||
"sig_expiration": 1636990324,
|
||||
"sig_inception": 1635172324,
|
||||
"key_tag": 36675,
|
||||
"signer_name": "info",
|
||||
"signature_len": 128,
|
||||
"signature": "6bda76201a3ed6203e70c48e36c08a2eec6599ddb93047c9db31c136ad989f09a7edad479089e5786192676fe60100ba49a43b05f118e1ca0e16c37683b5913fab3bc43b69a21e109e682fa0c06c62ab24b5b9c46cf5901dc5b529be078502ac1eae566121f61c0e2159ec33831a1be11f1c55e5f816a502e0ef3acc9519bb68"
|
||||
},
|
||||
{
|
||||
"name": "oa4qcr2e8fbj421h5ds67qe1c79vevk4.info",
|
||||
"type": 50,
|
||||
"class": 1,
|
||||
"ttl": 837,
|
||||
"rdlength": 42,
|
||||
"hash_algo": 1,
|
||||
"flags": 1,
|
||||
"iteration": 10,
|
||||
"salt_len": 8,
|
||||
"salt_value": "332539ee7f95c32a",
|
||||
"hash_len": 20,
|
||||
"next_hash_owner": "c28b6b507db61ad38572e0aff4f22747a74365b2",
|
||||
"maps_len": 8,
|
||||
"type_bit_maps": "0006200000000012"
|
||||
},
|
||||
{
|
||||
"name": "oa4qcr2e8fbj421h5ds67qe1c79vevk4.info",
|
||||
"type": 46,
|
||||
"class": 1,
|
||||
"ttl": 837,
|
||||
"rdlength": 152,
|
||||
"type_covered": 50,
|
||||
"algo": 8,
|
||||
"labels": 2,
|
||||
"original_ttl": 3600,
|
||||
"sig_expiration": 1636990324,
|
||||
"sig_inception": 1635172324,
|
||||
"key_tag": 36675,
|
||||
"signer_name": "info",
|
||||
"signature_len": 128,
|
||||
"signature": "015cf87be64ae76b00a6e283177be7369f8659742e90ce2d831793b282d783c1b25953d0c995212fff75c0d4448f9d953af989388616130717cf77a1cb32c654c9d8ac5f4636f6c079ca543613b0b37d609d080c3886de88d9abd40438e71358b3218e9626b31a869d2274f2be60489877d25dc610ec7e698a22e79c10571ca2"
|
||||
}
|
||||
],
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_1"
|
||||
}
|
||||
]
|
||||
BIN
test/case/ptr/1-dns-query-type-PTR.pcap
Normal file
BIN
test/case/ptr/1-dns-query-type-PTR.pcap
Normal file
Binary file not shown.
25
test/case/ptr/ptr_result.json
Normal file
25
test/case/ptr/ptr_result.json
Normal file
@@ -0,0 +1,25 @@
|
||||
[
|
||||
{
|
||||
"Tuple4": "175.43.16.118.51870>211.138.145.194.53",
|
||||
"dns_qname": "9.8.0.1.4.9.7.e.1.0.0.0.1.0.0.0.1.e.3.d.0.2.0.5.4.3.9.8.9.0.4.2.ip6.arpa",
|
||||
"dns_qtype": 12,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 1432,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_1"
|
||||
}
|
||||
]
|
||||
BIN
test/case/query/1-dns_10_query.pcap
Normal file
BIN
test/case/query/1-dns_10_query.pcap
Normal file
Binary file not shown.
196
test/case/query/query_result.json
Normal file
196
test/case/query/query_result.json
Normal file
@@ -0,0 +1,196 @@
|
||||
[
|
||||
{
|
||||
"Tuple4": "109.194.160.4.57766>95.211.92.14.53",
|
||||
"dns_qname": "picslife.ru",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_1"
|
||||
},
|
||||
{
|
||||
"Tuple4": "109.60.128.2.61396>95.211.92.15.53",
|
||||
"dns_qname": "finance.vtomske.ru",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {},
|
||||
"name": "DNS_RESULT_2"
|
||||
},
|
||||
{
|
||||
"Tuple4": "208.69.33.21.18984>95.211.92.15.53",
|
||||
"dns_qname": "mail.guru-net.com",
|
||||
"dns_qtype": 28,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 1410,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 0,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_3"
|
||||
},
|
||||
{
|
||||
"Tuple4": "80.70.96.161.18784>95.211.92.14.53",
|
||||
"dns_qname": "xage.ru",
|
||||
"dns_qtype": 28,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {},
|
||||
"name": "DNS_RESULT_4"
|
||||
},
|
||||
{
|
||||
"Tuple4": "77.37.251.74.22422>95.211.92.14.53",
|
||||
"dns_qname": "oknakonsalt.ru",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_5"
|
||||
},
|
||||
{
|
||||
"Tuple4": "37.9.88.84.5301>95.211.92.14.53",
|
||||
"dns_qname": "73dom.com",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_6"
|
||||
},
|
||||
{
|
||||
"Tuple4": "109.60.128.2.17115>95.211.92.15.53",
|
||||
"dns_qname": "pogoda.vtomske.ru",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {},
|
||||
"name": "DNS_RESULT_7"
|
||||
},
|
||||
{
|
||||
"Tuple4": "5.45.192.86.5301>95.211.92.14.53",
|
||||
"dns_qname": "rpp.nashaucheba.ru",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_8"
|
||||
},
|
||||
{
|
||||
"Tuple4": "173.252.79.126.21760>95.211.92.14.53",
|
||||
"dns_qname": "mail.yarisvet.com",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_9"
|
||||
},
|
||||
{
|
||||
"Tuple4": "194.9.70.2.56818>95.211.92.14.53",
|
||||
"dns_qname": "kuklazine.ru",
|
||||
"dns_qtype": 1,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "",
|
||||
"type": 41,
|
||||
"udp_payload": 4096,
|
||||
"rcode": 0,
|
||||
"version": 0,
|
||||
"Z": 1,
|
||||
"rdlength": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_10"
|
||||
}
|
||||
]
|
||||
BIN
test/case/srv/1-dns-query-type-SRV.pcap
Normal file
BIN
test/case/srv/1-dns-query-type-SRV.pcap
Normal file
Binary file not shown.
13
test/case/srv/srv_result.json
Normal file
13
test/case/srv/srv_result.json
Normal file
@@ -0,0 +1,13 @@
|
||||
[
|
||||
{
|
||||
"Tuple4": "36.251.139.34.51235>114.114.114.114.53",
|
||||
"dns_qname": "_http._tcp.(null)",
|
||||
"dns_qtype": 33,
|
||||
"dns_qclass": 1,
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 1,
|
||||
"rr": {},
|
||||
"name": "DNS_RESULT_1"
|
||||
}
|
||||
]
|
||||
Binary file not shown.
6452
test/case/tcp_lost_pkt/lost_pkt_result.json
Normal file
6452
test/case/tcp_lost_pkt/lost_pkt_result.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
test/case/txt/1-dns-query-type-TXT.pcap
Normal file
BIN
test/case/txt/1-dns-query-type-TXT.pcap
Normal file
Binary file not shown.
22
test/case/txt/txt_result.json
Normal file
22
test/case/txt/txt_result.json
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"Tuple4": "218.104.251.42.17988>209.222.147.38.53",
|
||||
"dns_qr": 0,
|
||||
"dns_opcode": 0,
|
||||
"dns_rd": 0,
|
||||
"rr": {
|
||||
"additional": [
|
||||
{
|
||||
"name": "secure-dns-version-1.fortinet.com",
|
||||
"type": 16,
|
||||
"class": 1,
|
||||
"ttl": 0,
|
||||
"rdlength": 53,
|
||||
"txt": "FB64+wIIOxABRkdUNUhEMzkxNzgwMjE5OQAHAAQAAAAHAAEAAgHg",
|
||||
"size": 52
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "DNS_RESULT_1"
|
||||
}
|
||||
]
|
||||
373
test/dns_decoder_test.cpp
Normal file
373
test/dns_decoder_test.cpp
Normal file
@@ -0,0 +1,373 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
|
||||
|
||||
#include "cJSON.h"
|
||||
#include "dns_decoder.h"
|
||||
|
||||
#include "stellar/stellar.h"
|
||||
#include "stellar/session.h"
|
||||
#include "stellar/session_exdata.h"
|
||||
#include "stellar/session_mq.h"
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
struct dns_decoder_test_plugin_env
|
||||
{
|
||||
int plugin_id;
|
||||
int topic_id;
|
||||
int result_index;
|
||||
};
|
||||
|
||||
extern "C" int commit_test_result_json(cJSON *node, const char *name);
|
||||
|
||||
void dns_real_result_write_file(char *result_str)
|
||||
{
|
||||
FILE *fp=fopen("dns_real_result.json", "a+");
|
||||
if(fp!=NULL)
|
||||
{
|
||||
fwrite(result_str, 1, strlen(result_str), fp);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
void dns_resource_record_str2hex_append(cJSON *one_rr_object, uint8_t *str, size_t str_sz, const char *key)
|
||||
{
|
||||
if(one_rr_object==NULL || str==NULL || str_sz==0 || key==NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
size_t offset=0;
|
||||
char hex_buff[4096]={0};
|
||||
size_t hex_buff_sz=sizeof(hex_buff);
|
||||
|
||||
for(size_t i=0; i<str_sz && i<hex_buff_sz/2; i++)
|
||||
{
|
||||
offset+=snprintf((char *)(hex_buff+offset), hex_buff_sz-offset, "%02x", str[i]);
|
||||
if(offset+2 >= hex_buff_sz)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(offset>0)
|
||||
{
|
||||
cJSON_AddStringToObject(one_rr_object, key, hex_buff);
|
||||
}
|
||||
}
|
||||
|
||||
void dns_resource_record_dstring_append(cJSON *one_rr_object, struct dstring *dstr, const char *key)
|
||||
{
|
||||
if(dstr->value_sz > 0)
|
||||
{
|
||||
cJSON_AddStringToObject(one_rr_object, key, (char *)(dstr->value));
|
||||
}
|
||||
}
|
||||
|
||||
int dns_resource_record_json_exporter(cJSON *object, struct dns_resource_record *rr_array, uint16_t n_rr, const char *rr_type, int *dns_sec)
|
||||
{
|
||||
if(object==NULL || rr_array==NULL || n_rr==0 || dns_sec==NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
char ip_str[128];
|
||||
cJSON *dns_rr_array=cJSON_CreateArray();
|
||||
|
||||
for(uint16_t i=0; i<n_rr; i++)
|
||||
{
|
||||
cJSON *one_rr_object=cJSON_CreateObject();
|
||||
struct dns_resource_record *dns_rr=&(rr_array[i]);
|
||||
|
||||
if(dns_rr->type == DNS_RR_TYPE_OPT)
|
||||
{
|
||||
cJSON_AddStringToObject(one_rr_object, "name", (const char *)(dns_rr->qname.value));
|
||||
cJSON_AddNumberToObject(one_rr_object, "type", dns_rr->type);
|
||||
cJSON_AddNumberToObject(one_rr_object, "udp_payload", dns_rr->rr_class);
|
||||
cJSON_AddNumberToObject(one_rr_object, "rcode", (int)(dns_rr->ttl>>24));
|
||||
cJSON_AddNumberToObject(one_rr_object, "version", (int)((dns_rr->ttl>>16)&0xFF));
|
||||
cJSON_AddNumberToObject(one_rr_object, "Z", (int)(dns_rr->ttl&&0xFFFF));
|
||||
cJSON_AddNumberToObject(one_rr_object, "rdlength", dns_rr->rdlength);
|
||||
}
|
||||
else
|
||||
{
|
||||
cJSON_AddStringToObject(one_rr_object, "name", (const char *)(dns_rr->qname.value));
|
||||
cJSON_AddNumberToObject(one_rr_object, "type", dns_rr->type);
|
||||
cJSON_AddNumberToObject(one_rr_object, "class", dns_rr->rr_class);
|
||||
cJSON_AddNumberToObject(one_rr_object, "ttl", dns_rr->ttl);
|
||||
cJSON_AddNumberToObject(one_rr_object, "rdlength", dns_rr->rdlength);
|
||||
}
|
||||
|
||||
if(dns_rr->rdlength==0)
|
||||
{
|
||||
cJSON_AddItemToArray(dns_rr_array, one_rr_object);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(dns_rr->type)
|
||||
{
|
||||
case DNS_RR_TYPE_A:
|
||||
inet_ntop(AF_INET, (void *)(dns_rr->rdata.a.value), ip_str, sizeof(ip_str));
|
||||
cJSON_AddStringToObject(one_rr_object, "a", ip_str);
|
||||
break;
|
||||
case DNS_RR_TYPE_AAAA:
|
||||
inet_ntop(AF_INET6, dns_rr->rdata.aaaa.value, ip_str, sizeof(ip_str));
|
||||
cJSON_AddStringToObject(one_rr_object, "aaaa", ip_str);
|
||||
break;
|
||||
case DNS_RR_TYPE_NS:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.ns), "ns");
|
||||
break;
|
||||
case DNS_RR_TYPE_MD:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.md), "md");
|
||||
break;
|
||||
case DNS_RR_TYPE_MF:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.mf), "mf");
|
||||
break;
|
||||
case DNS_RR_TYPE_CNAME:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.cname), "cname");
|
||||
break;
|
||||
case DNS_RR_TYPE_MB:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.mb), "mb");
|
||||
break;
|
||||
case DNS_RR_TYPE_MG:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.mg), "mg");
|
||||
break;
|
||||
case DNS_RR_TYPE_MR:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.mr), "mr");
|
||||
break;
|
||||
case DNS_RR_TYPE_TXT:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.txt), "txt");
|
||||
cJSON_AddNumberToObject(one_rr_object, "size", dns_rr->rdata.txt.value_sz);
|
||||
break;
|
||||
case DNS_RR_TYPE_NULL:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.null), "null");
|
||||
cJSON_AddNumberToObject(one_rr_object, "size", dns_rr->rdata.null.value_sz);
|
||||
break;
|
||||
case DNS_RR_TYPE_PTR:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.ptr), "ptr");
|
||||
break;
|
||||
case DNS_RR_TYPE_HINFO:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.hinfo.cpu), "cpu");
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.hinfo.os), "os");
|
||||
break;
|
||||
case DNS_RR_TYPE_MINFO:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.minfo.rmailbx), "rmailbx");
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.minfo.emailbx), "emailbx");
|
||||
break;
|
||||
case DNS_RR_TYPE_MX:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.mx.exchange), "exchange");
|
||||
cJSON_AddNumberToObject(one_rr_object, "preference", dns_rr->rdata.mx.preference);
|
||||
break;
|
||||
case DNS_RR_TYPE_RP:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.rp.mailbox), "mailbox");
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.rp.txt_rr), "txt_rr");
|
||||
break;
|
||||
case DNS_RR_TYPE_SOA:
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.soa.mname), "mname");
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.soa.rname), "rname");
|
||||
cJSON_AddNumberToObject(one_rr_object, "serial", dns_rr->rdata.soa.serial);
|
||||
cJSON_AddNumberToObject(one_rr_object, "refresh", dns_rr->rdata.soa.refresh);
|
||||
cJSON_AddNumberToObject(one_rr_object, "retry", dns_rr->rdata.soa.retry);
|
||||
cJSON_AddNumberToObject(one_rr_object, "cname", dns_rr->rdata.soa.expire);
|
||||
cJSON_AddNumberToObject(one_rr_object, "minimum", dns_rr->rdata.soa.minimum);
|
||||
break;
|
||||
|
||||
case DNS_RR_TYPE_WKS:
|
||||
cJSON_AddStringToObject(one_rr_object, "addr", ip_str);
|
||||
cJSON_AddNumberToObject(one_rr_object, "protocol", dns_rr->rdata.wks.protocol);
|
||||
cJSON_AddNumberToObject(one_rr_object, "size", dns_rr->rdata.wks.size);
|
||||
|
||||
dns_resource_record_str2hex_append(one_rr_object, dns_rr->rdata.wks.bitmap, dns_rr->rdata.wks.size, "bitmap");
|
||||
break;
|
||||
case DNS_RR_TYPE_OPT:
|
||||
break;
|
||||
case DNS_RR_TYPE_DS:
|
||||
*dns_sec = 2;
|
||||
cJSON_AddNumberToObject(one_rr_object, "key_tag", dns_rr->rdata.ds.key_tag);
|
||||
cJSON_AddNumberToObject(one_rr_object, "algo", dns_rr->rdata.ds.algo);
|
||||
cJSON_AddNumberToObject(one_rr_object, "digest_type", dns_rr->rdata.ds.digest_type);
|
||||
cJSON_AddNumberToObject(one_rr_object, "digest_len", dns_rr->rdata.ds.digest_len);
|
||||
|
||||
dns_resource_record_str2hex_append(one_rr_object, dns_rr->rdata.ds.digest, dns_rr->rdata.ds.digest_len, "digest");
|
||||
break;
|
||||
case DNS_RR_TYPE_RRSIG:
|
||||
*dns_sec = 2;
|
||||
cJSON_AddNumberToObject(one_rr_object, "type_covered", dns_rr->rdata.rrsig.type_covered);
|
||||
cJSON_AddNumberToObject(one_rr_object, "algo", dns_rr->rdata.rrsig.algo);
|
||||
cJSON_AddNumberToObject(one_rr_object, "labels", dns_rr->rdata.rrsig.labels);
|
||||
cJSON_AddNumberToObject(one_rr_object, "original_ttl", dns_rr->rdata.rrsig.original_ttl);
|
||||
cJSON_AddNumberToObject(one_rr_object, "sig_expiration", dns_rr->rdata.rrsig.sig_expiration);
|
||||
cJSON_AddNumberToObject(one_rr_object, "sig_inception", dns_rr->rdata.rrsig.sig_inception);
|
||||
cJSON_AddNumberToObject(one_rr_object, "key_tag", dns_rr->rdata.rrsig.key_tag);
|
||||
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.rrsig.signer_name), "signer_name");
|
||||
|
||||
cJSON_AddNumberToObject(one_rr_object, "signature_len", dns_rr->rdata.rrsig.signature_len);
|
||||
dns_resource_record_str2hex_append(one_rr_object, dns_rr->rdata.rrsig.signature, dns_rr->rdata.rrsig.signature_len, "signature");
|
||||
break;
|
||||
case DNS_RR_TYPE_NSEC:
|
||||
*dns_sec = 2;
|
||||
dns_resource_record_dstring_append(one_rr_object, &(dns_rr->rdata.nsec.next_domain), "next_domain");
|
||||
cJSON_AddNumberToObject(one_rr_object, "maps_len", dns_rr->rdata.nsec.type_bit_maps.value_sz);
|
||||
|
||||
dns_resource_record_str2hex_append(one_rr_object, dns_rr->rdata.nsec.type_bit_maps.value, dns_rr->rdata.nsec.type_bit_maps.value_sz, "type_bit_maps");
|
||||
break;
|
||||
case DNS_RR_TYPE_DNSKEY:
|
||||
*dns_sec = 2;
|
||||
cJSON_AddNumberToObject(one_rr_object, "flags", dns_rr->rdata.dnskey.flags);
|
||||
cJSON_AddNumberToObject(one_rr_object, "protocol", dns_rr->rdata.dnskey.protocol);
|
||||
cJSON_AddNumberToObject(one_rr_object, "algo", dns_rr->rdata.dnskey.algo);
|
||||
cJSON_AddNumberToObject(one_rr_object, "public_key_len", dns_rr->rdata.dnskey.public_key_len);
|
||||
|
||||
dns_resource_record_str2hex_append(one_rr_object, dns_rr->rdata.dnskey.public_key, dns_rr->rdata.dnskey.public_key_len, "public_key");
|
||||
break;
|
||||
case DNS_RR_TYPE_NSEC3:
|
||||
*dns_sec = 2;
|
||||
cJSON_AddNumberToObject(one_rr_object, "hash_algo", dns_rr->rdata.nsec3.hash_algo);
|
||||
cJSON_AddNumberToObject(one_rr_object, "flags", dns_rr->rdata.nsec3.flags);
|
||||
cJSON_AddNumberToObject(one_rr_object, "iteration", dns_rr->rdata.nsec3.iteration);
|
||||
|
||||
cJSON_AddNumberToObject(one_rr_object, "salt_len", dns_rr->rdata.nsec3.salt_len);
|
||||
dns_resource_record_str2hex_append(one_rr_object, dns_rr->rdata.nsec3.salt_value, dns_rr->rdata.nsec3.salt_len, "salt_value");
|
||||
|
||||
cJSON_AddNumberToObject(one_rr_object, "hash_len", dns_rr->rdata.nsec3.hash_len);
|
||||
dns_resource_record_str2hex_append(one_rr_object, dns_rr->rdata.nsec3.next_hash_owner, dns_rr->rdata.nsec3.hash_len, "next_hash_owner");
|
||||
|
||||
cJSON_AddNumberToObject(one_rr_object, "maps_len", dns_rr->rdata.nsec3.type_bit_maps.value_sz);
|
||||
dns_resource_record_str2hex_append(one_rr_object, dns_rr->rdata.nsec3.type_bit_maps.value,dns_rr->rdata.nsec3.type_bit_maps.value_sz, "type_bit_maps");
|
||||
break;
|
||||
case DNS_RR_TYPE_NSEC3PARAM:
|
||||
cJSON_AddNumberToObject(one_rr_object, "hash_algo", dns_rr->rdata.nsec3param.hash_algo);
|
||||
cJSON_AddNumberToObject(one_rr_object, "flags", dns_rr->rdata.nsec3param.flags);
|
||||
cJSON_AddNumberToObject(one_rr_object, "iteration", dns_rr->rdata.nsec3param.iteration);
|
||||
cJSON_AddNumberToObject(one_rr_object, "salt_len", dns_rr->rdata.nsec3param.salt_len);
|
||||
|
||||
dns_resource_record_str2hex_append(one_rr_object, dns_rr->rdata.nsec3param.salt_value, dns_rr->rdata.nsec3param.salt_len, "salt_value");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
cJSON_AddItemToArray(dns_rr_array, one_rr_object);
|
||||
}
|
||||
|
||||
cJSON_AddItemToObject(object, rr_type, dns_rr_array);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void dns_decoder_test_message_cb(struct session *ss, int topic_id, const void *msg, void *per_session_ctx, void *plugin_env_str)
|
||||
{
|
||||
struct dns_message *dns_msg=(struct dns_message *)msg;
|
||||
enum dns_message_type type=dns_message_type_get(dns_msg);
|
||||
if(type==DNS_MESSAGE_TRANSACTION_BEGIN || type==DNS_MESSAGE_TRANSACTION_END)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//uint16_t id=dns_message_header_id_get(dns_msg);
|
||||
struct dns_decoder_test_plugin_env *plugin_env=(struct dns_decoder_test_plugin_env *)plugin_env_str;
|
||||
|
||||
cJSON *real_result=cJSON_CreateObject();
|
||||
cJSON_AddStringToObject(real_result, "Tuple4", session_get0_readable_addr(ss));
|
||||
|
||||
uint16_t n_question=0;
|
||||
struct dns_query_question *question=NULL;
|
||||
dns_message_question_get0(dns_msg, &question, &n_question);
|
||||
if(n_question>0 && question!=NULL)
|
||||
{
|
||||
cJSON_AddStringToObject(real_result, "dns_qname", (char *)question->qname);
|
||||
cJSON_AddNumberToObject(real_result, "dns_qtype", question->qtype);
|
||||
cJSON_AddNumberToObject(real_result, "dns_qclass", question->qclass);
|
||||
}
|
||||
|
||||
struct dns_flag *flag=dns_message_header_flag_get0(dns_msg);
|
||||
if(flag!=NULL)
|
||||
{
|
||||
cJSON_AddNumberToObject(real_result, "dns_qr", (double)(flag->qr));
|
||||
cJSON_AddNumberToObject(real_result, "dns_opcode", (double)(flag->opcode));
|
||||
cJSON_AddNumberToObject(real_result, "dns_rd", (double)(flag->rd));
|
||||
}
|
||||
|
||||
cJSON *rr_object=cJSON_CreateObject();
|
||||
uint16_t n_answer_rr=0;
|
||||
struct dns_resource_record *answer_rr=NULL;
|
||||
dns_message_answer_resource_record_get0(dns_msg, &answer_rr, &n_answer_rr);
|
||||
|
||||
uint16_t n_authority_rr=0;
|
||||
struct dns_resource_record *authority_rr=NULL;
|
||||
dns_message_authority_resource_record_get0(dns_msg, &authority_rr, &n_authority_rr);
|
||||
|
||||
uint16_t n_additional_rr=0;
|
||||
struct dns_resource_record *additional_rr=NULL;
|
||||
dns_message_additional_resource_record_get0(dns_msg, &additional_rr, &n_additional_rr);
|
||||
|
||||
int dns_sec=1;
|
||||
dns_resource_record_json_exporter(rr_object, answer_rr, n_answer_rr, "answer", &dns_sec);
|
||||
dns_resource_record_json_exporter(rr_object, authority_rr, n_authority_rr, "authority", &dns_sec);
|
||||
dns_resource_record_json_exporter(rr_object, additional_rr, n_additional_rr, "additional", &dns_sec);
|
||||
|
||||
cJSON_AddItemToObject(real_result, "rr", rr_object);
|
||||
|
||||
char result_name[16]="";
|
||||
sprintf(result_name, "DNS_RESULT_%d", plugin_env->result_index++);
|
||||
|
||||
char *real_result_str=cJSON_Print(real_result);
|
||||
dns_real_result_write_file(real_result_str);
|
||||
free(real_result_str);
|
||||
|
||||
commit_test_result_json(real_result, result_name);
|
||||
}
|
||||
|
||||
void *dns_decoder_test_per_session_context_new(struct session *sess, void *plugin_env)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void dns_decoder_test_per_session_context_free(struct session *sess, void *session_ctx, void *plugin_env)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
extern "C" void *dns_decoder_test_init(struct stellar *st)
|
||||
{
|
||||
struct dns_decoder_test_plugin_env *plugin_env=(struct dns_decoder_test_plugin_env *)calloc(1, sizeof(struct dns_decoder_test_plugin_env));
|
||||
plugin_env->result_index=1;
|
||||
|
||||
plugin_env->plugin_id=stellar_session_plugin_register(st, dns_decoder_test_per_session_context_new, dns_decoder_test_per_session_context_free, plugin_env);
|
||||
if(plugin_env->plugin_id<0)
|
||||
{
|
||||
printf("dns_decoder_test_init: stellar_plugin_register failed !!!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
plugin_env->topic_id=stellar_session_mq_get_topic_id(st, DNS_MESSAGE_TOPIC);
|
||||
if(plugin_env->topic_id<0)
|
||||
{
|
||||
printf("stellar_session_mq_get_topic_id failed, topic: %s \n", DNS_MESSAGE_TOPIC);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
stellar_session_mq_subscribe(st, plugin_env->topic_id, dns_decoder_test_message_cb, plugin_env->plugin_id);
|
||||
|
||||
return (void *)plugin_env;
|
||||
}
|
||||
|
||||
extern "C" void dns_decoder_test_exit(void *plugin_env_str)
|
||||
{
|
||||
if(plugin_env_str!=NULL)
|
||||
{
|
||||
free(plugin_env_str);
|
||||
}
|
||||
}
|
||||
9
test/env/conflist.inf
vendored
Normal file
9
test/env/conflist.inf
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
[platform]
|
||||
./plug/stellar_on_sapp/start_loader.inf
|
||||
|
||||
|
||||
[protocol]
|
||||
|
||||
|
||||
[business]
|
||||
./plug/stellar_on_sapp/defer_loader.inf
|
||||
BIN
test/env/sapp-4.3.57.16ea514-1.el8.x86_64.rpm
vendored
Normal file
BIN
test/env/sapp-4.3.57.16ea514-1.el8.x86_64.rpm
vendored
Normal file
Binary file not shown.
11
test/env/spec.toml
vendored
Normal file
11
test/env/spec.toml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# stellar_plugin.toml
|
||||
#
|
||||
[[plugin]]
|
||||
path = "./stellar_plugin/dns_decoder.so"
|
||||
init = "dns_decoder_init"
|
||||
exit = "dns_decoder_exit"
|
||||
|
||||
[[plugin]]
|
||||
path = "./stellar_plugin/dns_decoder_test_plug.so"
|
||||
init = "dns_decoder_test_init"
|
||||
exit = "dns_decoder_test_exit"
|
||||
17
test/env/start_loader.inf
vendored
Normal file
17
test/env/start_loader.inf
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
[PLUGINFO]
|
||||
PLUGNAME=stellar_start_loader
|
||||
SO_PATH=./plug/stellar_on_sapp/stellar_on_sapp.so
|
||||
INIT_FUNC=STELLAR_START_LOADER_INIT
|
||||
DESTROY_FUNC=STELLAR_START_LOADER_EXIT
|
||||
|
||||
[TCP_ALL]
|
||||
FUNC_FLAG=ALL
|
||||
FUNC_NAME=stellar_on_sapp_tcpall_entry
|
||||
|
||||
[TCP]
|
||||
FUNC_FLAG=ALL
|
||||
FUNC_NAME=stellar_on_sapp_tcp_entry
|
||||
|
||||
[UDP]
|
||||
FUNC_FLAG=ALL
|
||||
FUNC_NAME=stellar_on_sapp_udp_entry
|
||||
BIN
test/env/stellar-on-sapp-2.1.0.0e6d541-1.el8.x86_64.rpm
vendored
Normal file
BIN
test/env/stellar-on-sapp-2.1.0.0e6d541-1.el8.x86_64.rpm
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user